From e090b19cad531dd46c56fc0fd8ed3cbb7f5645f4 Mon Sep 17 00:00:00 2001 From: Fong Lin Date: Tue, 29 Sep 2009 11:50:59 +0800 Subject: [PATCH] update dev300-m58 --- .tag | 2 +- accessibility/source/helper/acc_factory.cxx | 13 +- .../0004-cws-koheidatapilot03-accessibility.diff | 31 + .../0005-cws-koheidatapilot03-offapi.diff | 22 + applied_patches/0006-cws-koheidatapilot03-sc.diff | 10450 +++ applied_patches/0007-cws-koheidatapilot03-vcl.diff | 507 + .../0008-cws-koheidatapilot03-xmloff.diff | 24 + .../0009-cws-koheicsvimport-filter.diff | 26 + .../0010-cws-koheicsvimport-officecfg.diff | 102 + applied_patches/0011-cws-koheicsvimport-sc.diff | 2677 + applied_patches/0012-cws-kohei03-chart2.diff | 99 + applied_patches/0013-cws-kohei03-sc.diff | 3426 + applied_patches/0014-cws-calctabcolor-filter.diff | 470 + applied_patches/0014-sc-dataform-sc.diff | 1389 - .../0015-cws-calctabcolor-officecfg.diff | 33 + applied_patches/0015-sc-dataform-officecfg.diff | 17 - applied_patches/0016-cws-calctabcolor-oox.diff | 75 + applied_patches/0016-sc-dataform-suppor-vba.diff | 12 - applied_patches/0017-cws-calctabcolor-sc.diff | 1881 + applied_patches/0018-cws-calctabcolor-svtools.diff | 214 + ...ed-configmgr.diff => 0019-speed-configmgr.diff} | 0 ...ccel.diff => 0020-ok-cancel-btn-add-accel.diff} | 0 ...idl-build.diff => 0021-makefile-idl-build.diff} | 0 ...07-speed-pagein.diff => 0022-speed-pagein.diff} | 0 ...aults.diff => 0023-testtool-more-defaults.diff} | 0 ...ator.diff => 0024-plus-minus-sw-navigator.diff} | 0 ...or2.diff => 0025-plus-minus-sw-navigator2.diff} | 0 applied_patches/0025-quiet-build.diff | 5110 -- ...f => 0026-dbaccess-default-varchar-lenght.diff} | 0 applied_patches/0026-quiet-build-more.diff | 814 - ...0012-linkoo-type.diff => 0027-linkoo-type.diff} | 0 ....diff => 0028-selection-crash-svx-svdmrkv.diff} | 0 ...al-doublefree.diff => 0029-sal-doublefree.diff} | 0 ...blem.diff => 0030-sw-graphic-save-problem.diff} | 0 ...rn-speed.diff => 0031-sal-strintern-speed.diff} | 0 ...-fix.diff => 0032-sal-strintern-speed-fix.diff} | 0 .../{0021-fix-linkoo.diff => 0033-fix-linkoo.diff} | 0 ...22-fix-gtk-a11y.diff => 0034-fix-gtk-a11y.diff} | 0 ...=> 0035-fix-gtk-a11y-gail-version-warning.diff} | 0 ...-linkoo-dev300.diff => 0036-linkoo-dev300.diff} | 0 ...> 0037-writerfilter-qnametostr-NOOPTFILES.diff} | 0 ... 0038-sc-cellsuno-avoid-early-destruction.diff} | 0 ...stats.diff => 0039-speed-sal-fewer-lstats.diff} | 0 ...-imp.diff => 0040-cjk-character-units-imp.diff} | 0 ...size.diff => 0041-sw-default-cjk-fontsize.diff} | 0 ...ts-ui.diff => 0042-cjk-character-units-ui.diff} | 0 ...ic-add-missing-includes-after-cws-npower10.diff | 19 - ...aracter-units-rulers-sync-with-pggrid-fix.diff} | 0 ...-fix.diff => 0044-cjk-character-units-fix.diff} | 0 .../0044-vba-show-data-form-link-fix.diff | 13 - ...ff => 0045-cjk-character-units-fix-376788.diff} | 0 ...=> 0046-cjk-character-units-in-pggrid-fix.diff} | 0 ...fice.diff => 0047-wpsimport-config_office.diff} | 0 ...port-filter.diff => 0048-wpsimport-filter.diff} | 0 ...psimport-scp2.diff => 0049-wpsimport-scp2.diff} | 0 ...fect.diff => 0050-wpsimport-writerperfect.diff} | 0 .../{0041-libwps.diff => 0051-libwps.diff} | 0 ...42-wps-registry.diff => 0052-wps-registry.diff} | 0 .../{0045-libwpg.diff => 0053-libwpg.diff} | 0 ...0046-wpgimporter.diff => 0054-wpgimporter.diff} | 0 ...k-gij-paths.diff => 0055-jvmfwk-gij-paths.diff} | 0 ...f => 0056-buildfix-qadevOOo-java-encoding.diff} | 0 .../{0049-debug-bits.diff => 0057-debug-bits.diff} | 0 ...-gui-sw-scroll.diff => 0058-gui-sw-scroll.diff} | 0 .../0058-vba-default-enable-calcmacros.diff | 11 - .../0059-vba-ide-choose-macro-to-run.diff | 32 - ...cl-menu-fixes.diff => 0059-vcl-menu-fixes.diff} | 0 .../{0052-uses-vfs.diff => 0060-uses-vfs.diff} | 0 ...061-buildfix-x86-64-visibility-workaround.diff} | 0 ...tensions.diff => 0062-redirect-extensions.diff} | 0 .../{0055-libwpd.diff => 0063-libwpd.diff} | 0 ... 0064-writerperfect-nocondensedparagraphs.diff} | 0 ...t.diff => 0065-offapi-typecheck-whitelist.diff} | 0 ...-build-ant-1.6.diff => 0066-build-ant-1.6.diff} | 0 ...fix-fmtargs.diff => 0067-buildfix-fmtargs.diff} | 0 ...-nsplugin-path.diff => 0068-nsplugin-path.diff} | 0 ...54573.diff => 0069-printing-bugfix-254573.diff} | 0 ...s.diff => 0070-sd-toolbar-advanced-shapes.diff} | 0 ... 0071-svx-shapes-default-word-wrap-enable.diff} | 0 ... 0072-svx-honour-customshape-capabilities.diff} | 0 ....diff => 0073-check-buttons-rendering-fix.diff} | 0 ...ntconfig.diff => 0074-padmin-nofontconfig.diff} | 0 ...izards-source-importwizard-filesmodul-xba.diff} | 0 ...ff => 0076-automation-testtool-oobuildfix.diff} | 0 ...g.diff => 0077-helpcontent2-auxiliary-cfg.diff} | 0 ....diff => 0078-desktop-safer-user-dir-perm.diff} | 0 ...esktop-application-octet-stream-mime-type.diff} | 0 applied_patches/0079-new-SQLLEN.diff | 1884 - ...es.diff => 0080-xmlsecurity-verify-usages.diff} | 0 ...f => 0081-jvmfwk-modified-javavendors-xml.diff} | 0 ...indcerts.diff => 0082-libxmlsec-findcerts.diff} | 0 ...=> 0083-sfx2-check-existing-template-dirs.diff} | 0 ...-kerning-fix.diff => 0084-vcl-kerning-fix.diff} | 0 applied_patches/0085-new-SQLLEN.diff | 1887 + .../{0080-jpegc.c.diff => 0086-jpegc.c.diff} | 0 ...7-save-doc-withembedded-doc-with-vba-crash.diff | 45 - ...iff => 0087-tools-urlobj-smb-scheme-patch.diff} | 0 ...sc-sd.diff => 0088-samba-hyperlinks-sc-sd.diff} | 0 ...est.diff => 0089-tools-qa-urlobj-unittest.diff} | 0 applied_patches/0089-win32-invalid-names.diff | 48 - ...on-fix.diff => 0090-svx-text-rotation-fix.diff} | 0 ...ath.diff => 0091-sfx-check-real-help-path.diff} | 0 ...s.diff => 0092-xmlhelp-work-with-symlinks.diff} | 0 ...ths.diff => 0093-localize-pl-cygwin-paths.diff} | 0 applied_patches/0094-win32-invalid-names.diff | 50 + .../0095-forms-radio-button-group-names.diff | 897 - applied_patches/0095-openldap-i105016.diff | 45 + ...t-pixel.diff => 0096-customunittext-pixel.diff} | 0 .../0096-xl-import-formradiobutton.diff | 136 - ...rcent.diff => 0097-customunittext-percent.diff} | 0 applied_patches/0097-dialog-groupname-persist.diff | 374 - .../{0092-i93000.diff => 0098-i93000.diff} | 0 ...-resize.diff => 0099-padmin-dialog-resize.diff} | 0 ...ogs-resize.diff => 0100-sw-dialogs-resize.diff} | 0 ... 0101-webdav-locking-from-ooo-build-2-4-1.diff} | 0 ...ff => 0102-webdav-locking-local-temp-file.diff} | 0 ...f => 0103-gnome-vfs-locking-config_office.diff} | 0 ...ng-ucb.diff => 0104-gnome-vfs-locking-ucb.diff} | 0 ...ate-init.diff => 0105-gnome-vfs-late-init.diff} | 0 ...lash-rework.diff => 0106-unxsplash-rework.diff} | 0 ...am.diff => 0107-hack-readd-GetStringParam.diff} | 0 ...-pipe.diff => 0108-unxsplash-new-osl-pipe.diff} | 0 ....diff => 0109-unxsplash-new-osl-pipe-slot.diff} | 0 ...p.diff => 0110-unxsplash-finish-on-hangup.diff} | 0 ...splash-rpath.diff => 0111-unxsplash-rpath.diff} | 0 ...lash-3layer.diff => 0112-unxsplash-3layer.diff} | 0 .../0113-csv-import-preserve-options-sc.diff | 647 - ...mp-alias.diff => 0113-unxsplash-bmp-alias.diff} | 0 ...0114-csv-import-preserve-options-officecfg.diff | 86 - ....diff => 0114-sw-html-insert-unknown-tags.diff} | 0 applied_patches/0115-gcc4-visibility-sc.diff | 19 - ...8-field-fix.diff => 0115-sw-ww8-field-fix.diff} | 0 applied_patches/0118-sc-datapilot-autoformat.diff | 755 +- applied_patches/0122-sc-dp-gridlayout.diff | 616 +- applied_patches/0128-sc-natural-sort.diff | 1208 +- ...ayer-units.diff => 0133-sc-drwlayer-units.diff} | 0 .../0133-vba-sc-autoshapes-hyperlinks.diff | 893 - ...diff => 0134-sc-overwrite-char-font-attrs.diff} | 0 .../0135-calc-filter-by-date-strip-time.diff | 498 + applied_patches/0139-sc-paste-on-enter.diff | 503 +- .../0140-calc-multi-range-copy-paste.diff | 2036 - ...ets.diff => 0140-sc-print-selected-sheets.diff} | 0 ...c-print-lines.diff => 0141-sc-print-lines.diff} | 0 applied_patches/0142-sc-biffdump.diff | 127 - .../0142-sc-dbrange-dynamic-resize.diff | 371 + ... => 0143-sc-cellbackground-over-gridlines.diff} | 0 ...le.diff => 0144-sc-cellformat-icon-toggle.diff} | 0 .../0144-sc-dbrange-dynamic-resize.diff | 372 - ...> 0145-sc-fit-to-width-height-skip-breaks.diff} | 0 ...ff => 0146-chart-skip-hidden-cells-sc-fix.diff} | 0 ...diff => 0147-calc-filter-xml-free-context.diff} | 0 ...ar-func.diff => 0148-calc-status-bar-func.diff} | 0 .../0149-calc-dp-default-new-sheet.diff | 121 + .../0149-chart-axis-multi-chart-types-chart2.diff | 617 - ....diff => 0150-calc-menu-manual-page-break.diff} | 0 .../0150-chart-axis-multi-chart-types-xmloff.diff | 83 - applied_patches/0151-sc-sheet-gridline-toggle.diff | 324 + .../0152-calc-formula-variable-separators-sc.diff | 1050 + .../0153-calc-dp-custom-names-offapi.diff | 22 - ...0153-calc-formula-variable-separators-svx.diff} | 0 applied_patches/0154-calc-dp-custom-names-sc.diff | 2848 - ...alc-formula-variable-separators-officecfg.diff} | 0 .../0155-calc-dp-custom-names-sc-win32-fix.diff | 130 - ...rt.diff => 0155-chart-subtitle-xls-export.diff} | 0 .../0156-calc-dp-custom-names-sc-group-fix.diff | 19 - ...> 0156-calc-external-defined-names-enable.diff} | 0 .../0157-calc-dp-default-new-sheet.diff | 121 - ...> 0157-calc-xls-disable-adjust-row-height.diff} | 0 ...f => 0158-calc-grammar-xls-english-offapi.diff} | 0 ....diff => 0159-calc-grammar-xls-english-sc.diff} | 0 applied_patches/0159-fix-biffdumper.diff | 161 - .../0160-calc-find-replace-empty-cells-sc.diff | 371 + .../0161-calc-find-replace-empty-cells-svx.diff | 105 + .../0162-calc-enhanced-merge-cells-sc.diff | 1115 + ... 0163-calc-enhanced-merge-cells-officecfg.diff} | 0 ...on.diff => 0164-calc-filter-dbf-precision.diff} | 0 ...-calc-autoinput-case-insensitive-matching.diff} | 0 ...f => 0166-calc-jump-on-formula-ref-offapi.diff} | 0 ...> 0167-calc-jump-on-formula-ref-officecfg.diff} | 0 .../0168-calc-jump-on-formula-ref-sc.diff | 616 + ...iff => 0169-calc-jump-on-formula-ref-sfx2.diff} | 0 ...diff => 0170-calc-jump-on-formula-ref-vcl.diff} | 0 .../0171-calc-ods-sheet-protection-sc.diff | 1032 + ... => 0172-calc-ods-sheet-protection-xmloff.diff} | 0 ...=> 0173-calc-ods-sheet-protection-svtools.diff} | 0 .../0174-calc-selection-fixed-cursor.diff | 904 + ...-view.diff => 0175-calc-cursor-split-view.diff} | 0 .../0176-calc-autofilter-shrink-selection.diff | 13 + .../0177-calc-xls-import-array-size.diff | 289 + .../0178-calc-html-csv-import-force-text-cell.diff | 381 + .../0179-calc-find-replace-skip-filtered.diff | 383 + ...-calc-getpivotdata-force-interpret-formula.diff | 44 + .../0181-calc-combo-listbox-export-fix.diff | 13 + .../0182-calc-selection-protected-cells.diff | 155 + ...imit.diff => 0183-calc-increase-row-limit.diff} | 0 ... => 0184-calc-odf-export-autostyle-maxrow.diff} | 0 ....diff => 0185-calc-perf-flat-segment-tree.diff} | 0 .../0186-calc-perf-ods-import-properties.diff | 159 + ...rt.diff => 0187-calc-row-limit-bad-ushort.diff} | 0 .../0188-calc-perf-page-and-manual-breaks.diff | 1646 + .../0189-calc-perf-table-hidden-flags.diff | 3846 + ...ff => 0190-calc-ods-export-no-more-ushort.diff} | 0 ...alc-perf-sort.diff => 0191-calc-perf-sort.diff} | 0 .../0192-calc-perf-lazy-overlay-objects.diff | 187 + .../0193-calc-perf-copy-table-flags.diff | 97 + ... 0194-calc-perf-rowheight-no-progress-bar.diff} | 0 ...cept.diff => 0195-speed-local-link-except.diff} | 0 ...iff => 0196-speed-local-link-except-offuh.diff} | 0 ...-local-link.diff => 0197-speed-local-link.diff} | 0 ....diff => 0198-fpicker-kde-gcc4-visibility.diff} | 0 ...-symbol.diff => 0199-gui-sw-insert-symbol.diff} | 0 ...ring.diff => 0200-addrbk-datasrc-ordering.diff} | 0 ...diff => 0201-svtools-default-new-document.diff} | 0 ...omplete.diff => 0202-context-autocomplete.diff} | 0 ...203-svtools-unsort-template-dialogentries.diff} | 0 ...tdout.diff => 0204-desktop-cmdhelp-stdout.diff} | 0 ...f => 0205-always-allow-save-document-sfx2.diff} | 0 ...iff => 0206-always-allow-save-document-sc.diff} | 0 ...oll-accel-sc.diff => 0207-scroll-accel-sc.diff} | 0 ...l-accel-vcl.diff => 0208-scroll-accel-vcl.diff} | 0 ...fx2.diff => 0209-min-password-length-sfx2.diff} | 0 ...iff => 0210-document-password-change-sfx2.diff} | 0 ...0211-sfx2-remove-check-update-on-fileload.diff} | 0 ...0212-desktop-disable-startup-registration.diff} | 0 .../{0178-go-oo-team.diff => 0213-go-oo-team.diff} | 0 ...tionary.diff => 0214-corporate-dictionary.diff} | 0 applied_patches/0214-session-management.diff | 419 - ...ovell-palette.diff => 0215-novell-palette.diff} | 0 ...16-solenv-really-use-unsinged-char-on-ppc.diff} | 0 ...f => 0217-sc-default-delete-backspace-key.diff} | 0 ...ion.diff => 0218-desktop-config-migration.diff} | 0 ...84-help-support.diff => 0219-help-support.diff} | 0 ...g-ooo3.diff => 0220-scp2-user-config-ooo3.diff} | 0 ...t-psstream.diff => 0221-pushfont-psstream.diff} | 0 ...diff => 0222-split-icons-search-usr-share.diff} | 0 ...0223-novell-win32-agfa-monotype-fonts-m59.diff} | 0 ...target.diff => 0224-build-java-target-m59.diff} | 0 ...ff => 0225-solenv-installer-cleaner-paths.diff} | 0 ...0226-solenv-installer-lang-filelist-names.diff} | 0 ...diff => 0227-installer-get-path-correctly.diff} | 0 ...ilt-stax.diff => 0228-build-prebuilt-stax.diff} | 0 ...-ucb-neon-0.24.diff => 0229-ucb-neon-0.24.diff} | 0 ...e.diff => 0230-dmake-space-in-envvar-name.diff} | 0 applied_patches/0231-armeabi-softfp-buildfix.diff | 47 + applied_patches/0231-buildfix-vba-as-extn.diff | 10 - applied_patches/0232-db4.8.diff | 11 + ...ostset-add-ro.diff => 0233-postset-add-ro.diff} | 0 ...overy-report.diff => 0234-recovery-report.diff} | 0 ...rd.diff => 0235-default-no-startup-wizard.diff} | 0 ...alog.diff => 0236-default-no-style-dialog.diff} | 0 ...tion.diff => 0237-default-no-registration.diff} | 0 ...diff => 0238-tango-prefer-over-industrial.diff} | 0 ...diff => 0239-default-no-registration-menu.diff} | 0 ...f => 0240-default-no-registration-menu-sd.diff} | 0 ...aths.diff => 0241-scp2-3layer-nicer-paths.diff} | 0 ...icker.diff => 0242-default-system-fpicker.diff} | 0 ...t-aasize.diff => 0243-default-font-aasize.diff} | 0 ...-font-size.diff => 0244-default-font-size.diff} | 0 ...rt.diff => 0245-default-ms-filter-convert.diff} | 0 ... 0246-writer-default-as-optimal-page-wrap.diff} | 0 ...0210-vfs-kde-too.diff => 0247-vfs-kde-too.diff} | 0 ...algrind-alloc.diff => 0248-valgrind-alloc.diff} | 0 ....diff => 0249-default-openssl-no-idea-alg.diff} | 0 ...rt.diff => 0250-odf-flatxml-import-export.diff} | 0 applied_patches/0251-session-management.diff | 419 + ...ff => 0252-office-cfg-common-template-dir.diff} | 0 ...iff => 0253-sfx2-template-category-labels.diff} | 0 ...irs.diff => 0254-scp2_add_additional_dirs.diff} | 0 ...ication.diff => 0255-build-identification.diff} | 0 ...nal.diff => 0256-installer-strip-optional.diff} | 0 ...257-i18nutil-glibc-braindamage-workaround.diff} | 0 ...ule-name.diff => 0258-sdk-gid-module-name.diff} | 0 ...-orig.diff => 0259-psprint_config-no-orig.diff} | 0 ...arnings.diff => 0260-stlport-gcc-warnings.diff} | 0 ...-hash-style.diff => 0261-speed-hash-style.diff} | 0 ...ink-as-needed.diff => 0262-link-as-needed.diff} | 0 ....diff => 0263-svx-customshapes-NOOPTFILES.diff} | 0 ...diff => 0264-warning-return-values-filter.diff} | 0 ...ff => 0265-warning-return-values-registry.diff} | 0 ...6-warning-uninitialized-variables-tools-2.diff} | 0 ...ileno.diff => 0267-stlport-solaris-fileno.diff} | 0 ....diff => 0268-system-python-ure-bootstrap.diff} | 0 ...33-pyuno-ooodir.diff => 0269-pyuno-ooodir.diff} | 0 applied_patches/0269-vba-attribute.diff | 95 - applied_patches/0270-basic-prj-build_lst.diff | 8 - ...-path.diff => 0270-system-python-uno-path.diff} | 0 ...-crash-startup.diff => 0271-crash-startup.diff} | 0 ...-takeover.diff => 0272-no-splash-takeover.diff} | 0 ...fallback.diff => 0273-vcl-better-fallback.diff} | 0 ...-hebrew-culmus.diff => 0274-hebrew-culmus.diff} | 0 ...iff => 0275-psprint-postscript-page-setup.diff} | 0 ....diff => 0276-vcl-bitmap2-negative-height.diff} | 0 ...ltiple-window-resize-calls-when-maximised.diff} | 0 ...cons.diff => 0278-gui-toolbox-large-icons.diff} | 0 ...-w32.diff => 0279-tango-icons-default-w32.diff} | 0 ....diff => 0280-about-build-ver-readability.diff} | 0 ...n-build.diff => 0281-fpicker-common-build.diff} | 0 ...-service.diff => 0282-fpicker-kde-service.diff} | 0 ...de-dialog.diff => 0283-fpicker-kde-dialog.diff} | 0 ...-kio.diff => 0284-fpicker-kde-partial-kio.diff} | 0 ...name.diff => 0285-fpicker-kde-filter-name.diff} | 0 ...de-resmgr.diff => 0286-fpicker-kde-resmgr.diff} | 0 ...edia.diff => 0287-fpicker-kde-local-media.diff} | 0 ...ia2.diff => 0288-fpicker-kde-local-media2.diff} | 0 ...oo-wide.diff => 0289-fpicker-kde-too-wide.diff} | 0 ...e.diff => 0290-fpicker-kde-dont-overwrite.diff} | 0 applied_patches/0290-sc-hacky-handle-boolean.diff | 53 - ...on-utf8.diff => 0291-fpicker-kde-non-utf8.diff} | 0 applied_patches/0291-sc-vba-build-lst.diff | 11 - ...-kde-modal.diff => 0292-fpicker-kde-modal.diff} | 0 .../0292-svx-source-inc-fmundo-hxx.diff | 16 - ...mon-scp2.diff => 0293-fpicker-common-scp2.diff} | 0 .../0293-svx-source-form-fmscriptingenv-cxx.diff | 19 - ...de-3layer.diff => 0294-fpicker-kde-3layer.diff} | 0 applied_patches/0294-svx-source-form-makefile.diff | 18 - ...ads.diff => 0295-fpicker-kde-less-threads.diff} | 0 .../0295-svx-source-form-fmundo-cxx.diff | 127 - ...e.diff => 0296-default-evolution-database.diff} | 0 applied_patches/0296-vbaevents-services-build.diff | 19 - ...g.diff => 0297-default-evo-column-mapping.diff} | 0 applied_patches/0297-scp_vba_uno_service.diff | 23 - ...s-evo2.diff => 0298-buildfix-evo1-vs-evo2.diff} | 0 .../0298-vba-support-export-palette.diff | 95 - ...ault-evo2-ab.diff => 0299-default-evo2-ab.diff} | 0 .../0299-vba-get-nonfiltered-range-selection.diff | 178 - ...mponent.diff => 0300-lwp-filter-component.diff} | 0 .../0300-vba-allow-ranges-for-cell-functions.diff | 223 - ...cws-ooo11lotusfilter-lwp-filter-component.diff} | 0 applied_patches/0301-vba-error-object.diff | 379 - ...f => 0302-cws-ooo11lotusfilter-lwp-filter.diff} | 0 applied_patches/0302-sc-vba-autofill-support.diff | 38 - ... => 0303-cws-ooo11lotusfilter-lwp-xfilter.diff} | 0 .../0303-sc-source-ui-vba-makefile-mk.diff | 14 - .../0304-sc-export-shape-macro-bindings.diff | 260 - ...> 0304-warning-return-values-lotuswordpro.diff} | 0 ...0305-cli_ure-source-bootstrap-assembly-cs.diff} | 0 .../0305-sc-export-shape-hlink-bindings.diff | 207 - ...ure-source-bootstrap-managed_bootstrap-cs.diff} | 0 .../0306-sc-vbaimport-override-controlname.diff | 190 - applied_patches/0307-api-application-caller.diff | 63 - ...-cli_ure-source-bootstrap-native_glue-cxx.diff} | 0 .../0308-default-autotext-and-form-name.diff | 168 - .../{0274-mono-scp2.diff => 0308-mono-scp2.diff} | 0 ...0309-cli_ure-source-bootstrap-makefile-mk.diff} | 0 applied_patches/0309-oovbaapi-disable-vba.diff | 90 - ...o-bridge.diff => 0310-cli_ure-mono-bridge.diff} | 0 .../0310-vba-fixup-singlerange-sheetref.diff | 62 - .../{0277-mono-build.diff => 0311-mono-build.diff} | 0 .../0311-vba-always-set-defaultprop.diff | 15 - ...ld-mono-link.diff => 0312-build-mono-link.diff} | 0 applied_patches/0312-vba-check-for-macro.diff | 311 - ...d-keyfile.diff => 0313-mono-build-keyfile.diff} | 0 .../0313-vba-support-properties-inmodules.diff | 145 - .../0314-controls-with-images-import.diff | 443 - ...-mono-climaker.diff => 0314-mono-climaker.diff} | 0 .../0315-enhanced-form-userform-controls.diff | 2031 - ...testtools.diff => 0315-mono-testtools-m59.diff} | 0 applied_patches/0316-ObjectModule.diff | 2061 - .../0316-buildfix-testtool-disabled.diff | 35 + ...harp-win.diff => 0317-climaker-csharp-win.diff} | 0 applied_patches/0317-vba-userform.diff | 395 - ...d.diff => 0318-buildfix-climaker-disabled.diff} | 0 applied_patches/0318-vba-compatible-mode-uno.diff | 277 - ... => 0319-mono-bootstrap-config-and-policy.diff} | 0 .../0319-vba-spinbutton-in-userform.diff | 344 - ...-version.diff => 0320-mono-bridge-version.diff} | 0 .../0320-vbaevents-services-sources.diff | 2074 - ...ff => 0321-buildfix-use-climaker-in-unoil.diff} | 0 .../0321-vba-workbook-worksheet-events.diff | 2227 - ...ld-lst.diff => 0322-cli_ure-prj-build-lst.diff} | 0 .../0322-vba-worksheet-calculate-event-fix.diff | 141 - applied_patches/0323-basic-caller-support.diff | 532 - ...-config.diff => 0323-mono-climaker-config.diff} | 0 ...est.diff => 0324-mono-climaker-bridgetest.diff} | 0 applied_patches/0324-vba-empty-comparison-fix.diff | 11 - applied_patches/0325-cws-vbasupportdev300.diff | 91032 +++++++++++++++++++ .../0325-vba-worksheet-enableselection.diff | 116 - applied_patches/0326-vba-keyword-fix.diff | 116 - .../0326-vba-reenable-rowsourcefixes.diff | 13 + .../0327-userform-activex-identify.diff | 209 - applied_patches/0327-vba-basic-not-fix.diff | 17 + applied_patches/0328-cws-vbasupportdev300-wae.diff | 481 + .../0328-userform-possible-groupingtweak.diff | 27 - applied_patches/0329-basic-ide-objectmodule.diff | 41 - applied_patches/0329-vba-control-api-vis-fix.diff | 26 + .../0330-basic-ide-module-object-name-combile.diff | 98 - applied_patches/0330-vba-fix-isempty.diff | 34 + .../0331-vba-fix-ide-friendly-modulename.diff | 41 - .../0331-vba-fix-wsfunction-booleanparam.diff | 22 + .../0332-vba-basic-macrochoose-dialog.diff | 831 - applied_patches/0332-vba-fix-errobj-errnum.diff | 63 + ...sfx2-pre-and-postprocess-during-save-load.diff} | 0 .../0333-vba-fix-basic-macro-organizer.diff | 40 - applied_patches/0334-range-listBox-compare.diff | 35 - ...> 0334-sfx2-pre-and-postprocess-crash-fix.diff} | 0 .../0335-vba-userform-geometry-tweak.diff | 394 - ... 0335-win32-installer-register-moox-types.diff} | 0 .../0336-vba-allow-forms-resetvalue-binding.diff | 15 - ...r.diff => 0336-writerfilter-module-writer.diff} | 0 .../0337-fix-vba-NOT-trigger-update.diff | 87 - ...rfilter-source-dmapper-domainmapper-debug.diff} | 0 .../0338-buildfix-oox-depends-on-unotools.diff | 8 + applied_patches/0338-vba-variant-fix.diff | 13 - ...t.diff => 0339-oox-fix-placeholder-layout.diff} | 0 .../0339-userform-image-import-fix.diff | 48 - ...ply.diff => 0340-oox-fix-list-style-apply.diff} | 0 .../0340-spinbutton-import-valuechange.diff | 13 - ...t.diff => 0341-oox-pptx-import-fix-layout.diff} | 0 applied_patches/0341-vba-noregrex-for-match.diff | 34 - ... 0342-oox-pptx-import-fix-wipe-transition.diff} | 0 applied_patches/0342-vba-null-not-treatment.diff | 87 - ...-oox-pptx-import-fix-subtitle-placeholder.diff} | 0 applied_patches/0343-vba-commandbar-fix.diff | 654 - ...c-postgresql.diff => 0344-sdbc-postgresql.diff} | 0 applied_patches/0344-vba-xls-formula-parser.diff | 48 - ...st.diff => 0345-sdbc-postgresql-build-lst.diff} | 0 .../0345-vba-fix-docmodule-import-crash.diff | 22 - ...f => 0346-connectivity-workben-postgresql.diff} | 0 applied_patches/0346-vba-servicemacros-rework.diff | 251 - ...ostgresql.diff => 0347-gcc-4.3-postgresql.diff} | 0 applied_patches/0347-vba-interior-object-fix.diff | 52 - .../0348-range-defaultmethod-i98476.diff | 13 - ...iff => 0348-sdbc-postgresql-config_office.diff} | 0 ...y.diff => 0349-kde4-buildfix-connectivity.diff} | 0 applied_patches/0349-vba-excel-iserror-fix.diff | 168 - ...ygen-icons.diff => 0350-kde4-oxygen-icons.diff} | 0 .../0350-word-read-custom-toolbar-filter.diff | 2494 - ....diff => 0351-kde4-fpicker-fix-toOUString.diff} | 0 applied_patches/0351-vba-word-support.diff | 30504 ------- applied_patches/0352-kde4-configure2.diff | 74 + applied_patches/0352-vba-templateobject.diff | 579 - applied_patches/0353-kde4_fpicker_fixes.diff | 204 + applied_patches/0353-vba-vpagebreak-object.diff | 445 - ...s-sd.diff => 0354-transogl-transitions-sd.diff} | 0 .../0354-vba-combobox-listindex-fix.diff | 25 - ...ff => 0355-transogl-transitions-officecfg.diff} | 0 applied_patches/0355-vba-fix-copysheet-toend.diff | 51 - ...sh.diff => 0356-ooo67658.sfx2.reloadcrash.diff} | 0 .../0356-vba-improve-toolbarapi-macro-search.diff | 61 - .../0357-fix-doc-exit-basic-error-core.diff | 13 - ...ff => 0357-oooXXXXX.vcl.x86_64.impressatk.diff} | 0 ...sh.diff => 0358-ooo73201.sw.a11yloadcrash.diff} | 0 applied_patches/0358-read-vba-dir-stream-fix.diff | 885 - ....bodge.diff => 0359-ooo86080.unopkg.bodge.diff} | 0 applied_patches/0359-vba-commandbar-enabled.diff | 52 - ...f => 0360-oooXXXX.partial-revert-ooo95118.diff} | 0 .../0360-vba-worksheet-change-event-fix.diff | 148 - ...iff => 0361-ooo83878.unopkg.enablelinking.diff} | 0 .../0361-vba-toolbar-menufilter-core-fix.diff | 22 - ...er-avmedia.diff => 0362-gstreamer-avmedia.diff} | 0 .../0362-word-read-builtinmenubar-filter.diff | 442 - ...streamer-scp2.diff => 0363-gstreamer-scp2.diff} | 0 applied_patches/0363-vba-fix-private-declare.diff | 60 - ...fice.diff => 0364-gstreamer-config-office.diff} | 0 ...4-vba-import-globaltemplate-customizations.diff | 231 - ...lideshow.diff => 0365-gstreamer-slideshow.diff} | 0 applied_patches/0365-vba-basic-if-compare-fix.diff | 11 - ...amer-solenv.diff => 0366-gstreamer-solenv.diff} | 0 applied_patches/0366-vba-basic-parallel-build.diff | 35 - ...f => 0367-gstreamer-svtools-content-types.diff} | 0 .../0367-vba-oovbaapi-parallel-build.diff | 23 - .../0368-basic-allow-objectforerror-symbol.diff | 42 - ...diff => 0368-gstreamer-avmedia-file-types.diff} | 0 ...-gstreamer-vcl.diff => 0369-gstreamer-vcl.diff} | 0 .../0369-vba-fix-named-any-para-pass.diff | 20 - ...> 0370-avmedia-source-gstreamer-ChangeLog.diff} | 0 .../0370-vba-allow-arrays-in-usertypes.diff | 112 - ...0371-avmedia-source-gstreamer-exports.dxp.diff} | 0 ...71-vba-disable-toolbar+customizationimport.diff | 54 - ...72-avmedia-source-gstreamer-gstcommon.hxx.diff} | 0 .../0372-vba-fix-IsEmpty-api-object.diff | 33 - ...edia-source-gstreamer-gstframegrabber.cxx.diff} | 0 .../0373-vba-fix-control-shape-geom-fix.diff | 233 - ...edia-source-gstreamer-gstframegrabber.hxx.diff} | 0 applied_patches/0374-basic-public-dim-fix.diff | 115 - ...5-avmedia-source-gstreamer-gstmanager.cxx.diff} | 0 .../0375-vba-fix-optionalparam-assigment.diff | 13 - ...6-avmedia-source-gstreamer-gstmanager.hxx.diff} | 0 .../0376-vba-reset-screenupdateing.diff | 69 - ...77-avmedia-source-gstreamer-gstplayer.cxx.diff} | 0 applied_patches/0377-vba-redim-array-fix.diff | 92 - ...78-avmedia-source-gstreamer-gstplayer.hxx.diff} | 0 applied_patches/0378-vba-fix-userform-init.diff | 13 - ... 0379-avmedia-source-gstreamer-gstuno.cxx.diff} | 0 .../0379-vba-fix-Range-Insert-CopyOrigin.diff | 33 - ...80-avmedia-source-gstreamer-gstwindow.cxx.diff} | 0 .../0380-calc-vba-volatile-user-func.diff | 904 - ...81-avmedia-source-gstreamer-gstwindow.hxx.diff} | 0 applied_patches/0381-vba-documentcontext.diff | 101 - ...0382-avmedia-source-gstreamer-makefile.mk.diff} | 0 .../0382-fix-read-disabled-toolbarimport.diff | 62 - ...id.diff => 0383-letter-wizard-resource-id.diff} | 0 applied_patches/0383-vba-word-support-part2.diff | 23674 ----- ...diff => 0384-gstreamer-avmedia-loopingetc.diff} | 0 .../0384-vba-only-import-std-menutoolbar.diff | 14 - ...sal-textenc.diff => 0385-size-sal-textenc.diff} | 0 .../0385-vba-fix-workbook-resize-core.diff | 234 - ...04-jvmfwk-gij32.diff => 0386-jvmfwk-gij32.diff} | 0 .../0386-vba-fix-macromode-api-docopen.diff | 27 - ...ort-filter.diff => 0387-svg-import-filter.diff} | 0 applied_patches/0387-vba-fixup-macrosearch.diff | 1581 - ....diff => 0388-svg-import-filter-gfxfilter.diff} | 0 .../0388-vba-currentcomponent-rework.diff | 1553 - ...x-fix.diff => 0389-svg-import-viewbox-fix.diff} | 0 .../0389-vba-testclient-fix-project.diff | 23 - ...-fix.diff => 0390-svg-import-painturi-fix.diff} | 0 .../0390-vba-fix-checkbox-ole-access.diff | 13 - ...import.diff => 0391-svg-import-textimport.diff} | 0 applied_patches/0391-vba-fix-path-fullname.diff | 32 - .../0392-fix-sheet-control-valueset.diff | 72 - ...ix.diff => 0392-svg-import-convlength-fix.diff} | 0 applied_patches/0393-svg-import-opacity-fix.diff | 153 + .../0393-vba-fix-range-delete-shift.diff | 42 - ...0511-speed-store.diff => 0394-speed-store.diff} | 0 ...-vba-fix-worksheet-add-before-param-object.diff | 31 - .../0395-vba-fix-worksheet-add-activate.diff | 15 - ...tern-brush.diff => 0395-wmf-pattern-brush.diff} | 0 ...iff => 0396-toolkit-layout-gcc-4.3.2-hack.diff} | 0 applied_patches/0396-vba-application-quit.diff | 183 - ...97-layout-accessibility-dispose-only-once.diff} | 0 applied_patches/0397-vba-commandbar-rework.diff | 2079 - ...f => 0398-buildfix-toolkit-workben-layout.diff} | 0 applied_patches/0398-vba-menubar-objects.diff | 1732 - ...-build.diff => 0399-layout-parallel-build.diff} | 0 applied_patches/0399-vba-fix-missing-codename.diff | 424 - ...0-autocorrect-accidental-caps-lock-offapi.diff} | 0 applied_patches/0400-vba-zoom-per-sheet.diff | 273 - ...utocorrect-accidental-caps-lock-officecfg.diff} | 0 .../0401-vba-fallback-to-calling-doc-context.diff | 735 - ... 0402-autocorrect-accidental-caps-lock-sc.diff} | 0 .../0402-vba-cursor-pos-for-selected-maxrange.diff | 24 - ... 0403-autocorrect-accidental-caps-lock-sw.diff} | 0 .../0403-vba-combobox-rowsource-fix.diff | 13 - .../0404-autocorrect-accidental-caps-lock-svx.diff | 536 + .../0404-vba-workbook-auto-open-event.diff | 67 - ...0405-autocorrect-accidental-caps-lock-vcl.diff} | 0 applied_patches/0405-vba-buildin-toolbar-fix.diff | 81 - applied_patches/0406-cws-cbosdo01.diff | 385 + .../0406-vba-workbook-precisionasdisplayed.diff | 60 - ...> 0407-statusbar-fancy-modified-status-sc.diff} | 0 .../0407-uno-xmenu-getpopupMenu-fix.diff | 48 - ...> 0408-statusbar-fancy-modified-status-sd.diff} | 0 .../0408-vba-commandbarcontrol-enabled.diff | 309 - ...0409-statusbar-fancy-modified-status-sfx2.diff} | 0 .../0409-vba-commandbar-document-scope.diff | 252 - ...-statusbar-fancy-modified-status-starmath.diff} | 0 applied_patches/0410-vba-dim-as-contants-fix.diff | 193 - ... 0411-statusbar-fancy-modified-status-svx.diff} | 0 .../0411-vba-commandbar-toolbar-fix.diff | 67 - ...> 0412-statusbar-fancy-modified-status-sw.diff} | 0 applied_patches/0412-vba-automation-set-fix.diff | 85 - .../0413-tool-menu-bar-improvements.diff | 1014 - ...-basebmp.diff => 0413-unittesting-basebmp.diff} | 0 ...-basegfx.diff => 0414-unittesting-basegfx.diff} | 0 applied_patches/0414-vba-styles-add-fix.diff | 34 - ...ting-basic.diff => 0415-unittesting-basic.diff} | 0 applied_patches/0415-vba-financial-functions.diff | 813 - ...esting-bean.diff => 0416-unittesting-bean.diff} | 0 applied_patches/0416-vba-typename-fix.diff | 94 - ...-bridges.diff => 0417-unittesting-bridges.diff} | 0 ...ng-canvas.diff => 0418-unittesting-canvas.diff} | 0 ...-cli_ure.diff => 0419-unittesting-cli_ure.diff} | 0 ...emaker.diff => 0420-unittesting-codemaker.diff} | 0 ...figmgr.diff => 0421-unittesting-configmgr.diff} | 0 .../0422-buildfix-oox-depends-on-unotools.diff | 8 - ...ity.diff => 0422-unittesting-connectivity.diff} | 0 ...esting-cppu.diff => 0423-unittesting-cppu.diff} | 0 ...elper.diff => 0424-unittesting-cppuhelper.diff} | 0 ...baccess.diff => 0425-unittesting-dbaccess.diff} | 0 ...-desktop.diff => 0426-unittesting-desktop.diff} | 0 ...ng-dtrans.diff => 0427-unittesting-dtrans.diff} | 0 .../0428-calc-formula-asian-phonetic.diff | 2715 - ...dobj.diff => 0428-unittesting-embeddedobj.diff} | 0 applied_patches/0429-sc-sheet-gridline-toggle.diff | 309 - ...sions.diff => 0429-unittesting-extensions.diff} | 0 .../0430-calc-formula-variable-separators-sc.diff | 1048 - ...ng-filter.diff => 0430-unittesting-filter.diff} | 0 ...ting-forms.diff => 0431-unittesting-forms.diff} | 0 ...-fpicker.diff => 0432-unittesting-fpicker.diff} | 0 ...mework.diff => 0433-unittesting-framework.diff} | 0 ...ng-chart2.diff => 0434-unittesting-chart2.diff} | 0 ...esting-idlc.diff => 0435-unittesting-idlc.diff} | 0 ...nittesting-io.diff => 0436-unittesting-io.diff} | 0 ...er.diff => 0437-unittesting-javaunohelper.diff} | 0 .../0438-calc-sheet-tab-color-officecfg.diff | 24 - ...esting-jurt.diff => 0438-unittesting-jurt.diff} | 0 .../0439-calc-find-replace-empty-cells-sc.diff | 388 - ...access.diff => 0439-unittesting-jvmaccess.diff} | 0 .../0440-calc-find-replace-empty-cells-svx.diff | 105 - ...istic.diff => 0440-unittesting-linguistic.diff} | 0 .../0441-calc-enhanced-merge-cells-sc.diff | 1078 - ...ng-offapi.diff => 0441-unittesting-offapi.diff} | 0 ...esting-o3tl.diff => 0442-unittesting-o3tl.diff} | 0 ...-package.diff => 0443-unittesting-package.diff} | 0 ...adevOOo.diff => 0444-unittesting-qadevOOo.diff} | 0 .../0445-calc-html-import-custom-lang-filter.diff | 26 - ...egistry.diff => 0445-unittesting-registry.diff} | 0 .../0446-calc-html-import-custom-lang-sc.diff | 1319 - ...-ridljar.diff => 0446-unittesting-ridljar.diff} | 0 .../0447-calc-csv-import-custom-lang-sc.diff | 1071 - ...ttesting-sal.diff => 0447-unittesting-sal.diff} | 0 ...0448-calc-csv-import-custom-lang-officecfg.diff | 27 - ...helper.diff => 0448-unittesting-salhelper.diff} | 0 applied_patches/0449-calc-dp-hide-list-menu.diff | 2457 - ...-sandbox.diff => 0449-unittesting-sandbox.diff} | 0 ...ttesting-sax.diff => 0450-unittesting-sax.diff} | 0 ...nittesting-sc.diff => 0451-unittesting-sc.diff} | 0 .../0452-calc-jump-on-formula-ref-sc.diff | 617 - ...ipting.diff => 0452-unittesting-scripting.diff} | 0 ...nittesting-sd.diff => 0453-unittesting-sd.diff} | 0 ...esting-sfx2.diff => 0454-unittesting-sfx2.diff} | 0 applied_patches/0455-calc-dp-custom-sort.diff | 1439 - ...ting-shell.diff => 0455-unittesting-shell.diff} | 0 .../0456-calc-ods-sheet-protection-sc.diff | 1032 - ...deshow.diff => 0456-unittesting-slideshow.diff} | 0 ...ttesting-sot.diff => 0457-unittesting-sot.diff} | 0 ...tarmath.diff => 0458-unittesting-starmath.diff} | 0 .../0459-calc-dp-custom-names-ods-sc.diff | 818 - ...esting-stoc.diff => 0459-unittesting-stoc.diff} | 0 .../0460-calc-dp-custom-names-ods-xmloff.diff | 24 - ...ting-store.diff => 0460-unittesting-store.diff} | 0 .../0461-calc-selection-fixed-cursor.diff | 877 - ...-svtools.diff => 0461-unittesting-svtools.diff} | 0 ...ttesting-svx.diff => 0462-unittesting-svx.diff} | 0 .../0463-calc-autofilter-shrink-selection.diff | 156 - ...nittesting-sw.diff => 0463-unittesting-sw.diff} | 0 ...estshl2.diff => 0464-unittesting-testshl2.diff} | 0 ...ttools.diff => 0465-unittesting-testtools.diff} | 0 ...-toolkit.diff => 0466-unittesting-toolkit.diff} | 0 ...ting-tools.diff => 0467-unittesting-tools.diff} | 0 ...helper.diff => 0468-unittesting-ucbhelper.diff} | 0 ...ttesting-ucb.diff => 0469-unittesting-ucb.diff} | 0 ...ng-udkapi.diff => 0470-unittesting-udkapi.diff} | 0 ...ttesting-vcl.diff => 0471-unittesting-vcl.diff} | 0 ...ter.diff => 0472-unittesting-writerfilter.diff} | 0 ...ng-xmerge.diff => 0473-unittesting-xmerge.diff} | 0 ...-xmlhelp.diff => 0474-unittesting-xmlhelp.diff} | 0 ...ng-xmloff.diff => 0475-unittesting-xmloff.diff} | 0 ...script.diff => 0476-unittesting-xmlscript.diff} | 0 ...rity.diff => 0477-unittesting-xmlsecurity.diff} | 0 ...win32-odma.diff => 0478-novell-win32-odma.diff} | 0 ... 0479-svx-sdrobjeditview-update-edit-area.diff} | 0 ...unix.diff => 0480-goodies-eps-filter-unix.diff} | 0 ...erer.diff => 0481-emf+-cppcanvas-renderer.diff} | 0 ...fplus.diff => 0482-emf+-cppcanvas-emfplus.diff} | 0 ...enderer.diff => 0483-emf+-offapi-renderer.diff} | 0 ...+-vcl-bitmap.diff => 0484-emf+-vcl-bitmap.diff} | 0 ...l-renderer.diff => 0485-emf+-vcl-renderer.diff} | 0 ...02-emf+-svtools.diff => 0486-emf+-svtools.diff} | 0 ...-renderer.diff => 0487-emf+-scp2-renderer.diff} | 0 ...mf+-crash-fix.diff => 0488-emf+-crash-fix.diff} | 0 ...ff => 0489-vcl-grey-alpha-unix-sal-bitmap.diff} | 0 ...jects.diff => 0490-emf+-multipart-objects.diff} | 0 ...iff => 0491-emf+-use-canvas-only-for-emf+.diff} | 0 ...image.diff => 0492-emf+-embedded-mf-image.diff} | 0 ...r.diff => 0493-vcl-pluggable-mtf-renderer.diff} | 0 ...f => 0494-emf+-cppcanvas-input-validation.diff} | 0 ...in-apps.diff => 0495-linkwarn-dlg-in-apps.diff} | 0 ...0496-linkwarn-sfx2-disable-cb-persistency.diff} | 0 ...ff => 0497-linkwarn-svtools-miscopts-bits.diff} | 0 ...=> 0498-linkwarn-officecfg-disable-msgbox.diff} | 0 ...dlg.diff => 0499-linkwarn-svx-warning-dlg.diff} | 0 ...nks.diff => 0500-linkwarn-sd-no-dnd-links.diff} | 0 ...=> 0501-fix-ppt-linespacing-import-export.diff} | 0 ...rt-fix.diff => 0502-sw-section-import-fix.diff} | 0 ...ng.diff => 0503-sw-allow-negative-spacing.diff} | 0 applied_patches/0504-field-patch.diff | 2696 + ...rols.diff => 0505-sw-import-html-controls.diff} | 0 ... 0506-svx-hacky-htmlselect-control-import.diff} | 0 ...lideshow-slideshowview-transformation-fix.diff} | 0 ...ew-zoom-fix.diff => 0508-sd-view-zoom-fix.diff} | 0 ...-show-fix.diff => 0509-sd-custom-show-fix.diff} | 0 ...ist-to-size.diff => 0510-fit-list-to-size.diff} | 0 ...-size-ui.diff => 0511-fit-list-to-size-ui.diff} | 0 ...f => 0512-fit-list-to-size-style-defaults.diff} | 0 applied_patches/0513-fit-list-to-size-popup.diff | 288 + .../0514-fit-list-to-size-build-fix.diff | 17 + ...-nested-positionned-tables-ww8-import-fix.diff} | 0 ....diff => 0516-xmloff_dis26300_conformance.diff} | 0 ....diff => 0517-lockfile-dont-do-dns-lookup.diff} | 0 ...ymbols.diff => 0518-lockfile-less-symbols.diff} | 0 ... 0519-internal-mesa-headers-config_office.diff} | 0 ...f => 0520-internal-mesa-headers-slideshow.diff} | 0 .../0521-autocorrect-accidental-caps-lock-svx.diff | 536 - ...a.diff => 0521-internal-mesa-headers-mesa.diff} | 0 applied_patches/0522-ui-desktop-integration.diff | 224 + ...-mk.diff => 0523-cairo-pixman-makefile-mk.diff} | 0 ...e-mk.diff => 0524-cairo-cairo-makefile-mk.diff} | 0 ...ure.diff => 0525-internal-cairo-configure.diff} | 0 ...ixman-scp2-source-ooo-file_library_ooo_scp.diff | 24 + ...s.diff => 0527-cppcanvas-fix-roundcorners.diff} | 0 ...diff => 0528-officecfg-bighandles-default.diff} | 0 ...-cutblack.diff => 0529-slideshow-cutblack.diff} | 0 ...ce-fix.diff => 0530-canvas-colorspace-fix.diff} | 0 ...ound.diff => 0531-unoxml-boost-workaround.diff} | 0 ...rce-filter-xml-xmltbli-uninitializedvalue.diff} | 0 ...pdate-ole.diff => 0533-svtools-update-ole.diff} | 0 ...-deliver.diff => 0534-jurt-jnilib-deliver.diff} | 0 ...sing.diff => 0535-timely-canvas-disposing.diff} | 0 ...cks.diff => 0536-instset-prefer-langpacks.diff} | 0 ...diff => 0537-solenv-installer-unopkg-call.diff} | 0 ...eams.diff => 0538-svx-debug-sdrolestreams.diff} | 0 ...acks.diff => 0539-instset-macos-langpacks.diff} | 0 ...ktrace.diff => 0540-sal-disable-backtrace.diff} | 0 ...ing.diff => 0541-sw-invert-border-spacing.diff} | 0 ...542-sw-collapse-empty-table-par-like-html.diff} | 0 ...iff => 0543-canvas-directx-lostdevice-fix.diff} | 0 ...267.diff => 0544-sw-table-join-fix-i99267.diff} | 0 ...f => 0545-svtools-svrtf-token-ignore-case.diff} | 0 ...lerators.diff => 0546-fix-sd-accelerators.diff} | 0 ...f => 0547-sw-outline-numbering-broken-fix.diff} | 0 ...sw-insert-pagebreak-in-numbered-paragraph.diff} | 0 ...in32-tooltips.diff => 0549-win32-tooltips.diff} | 0 applied_patches/0550-win32-cygwin-1.7.diff | 61 + applied_patches/0551-win32-sdk7.diff | 13 + applied_patches/0552-win32-dxsdk-200908.diff | 18 + applied_patches/0553-win32-interix.diff | 22 + ....diff => 0554-sfx2-privateprotectedpublic.diff} | 0 ...ce-ole.diff => 0555-optional-outplace-ole.diff} | 0 ... 0556-slideshow-configurable-paintoverlay.diff} | 0 ....diff => 0557-vcl-permit-global-shortcuts.diff} | 0 ...diff => 0558-sd-customanimation-defbutton.diff} | 0 ...68-sd-ruler-fix.diff => 0559-sd-ruler-fix.diff} | 0 ...vel.diff => 0560-sd-odf-relaxed-listlevel.diff} | 0 ...n-ui-fix.diff => 0561-sd-animation-ui-fix.diff} | 0 ...e-sound.diff => 0562-slideshow-mute-sound.diff} | 0 .../{0672-base64.diff => 0563-base64.diff} | 0 ...hack.diff => 0564-sfx2-qstart-nocrashhack.diff} | 0 ...wind.diff => 0565-slideshow-effect-rewind.diff} | 0 ....diff => 0566-svx-ppt-tablerow-height-fix.diff} | 0 ...ubject.diff => 0567-mail-document-subject.diff} | 0 ...a-separate-lib-sd-build-lst-with-transogl.diff} | 0 ...yout-fix.diff => 0569-pptx-gfx-layout-fix.diff} | 0 ...sx-export-notes-avoid-dereferencing-0-svx.diff} | 0 ...=> 0571-odf-converter-ignore-writerfilter.diff} | 0 applied_patches/0572-external-apm-header.diff | 246 + ...0692-wmf-mm-text.diff => 0573-wmf-mm-text.diff} | 0 ...-wmf-mm-text-1.diff => 0574-wmf-mm-text-1.diff} | 0 ...x.diff => 0575-sd-create-table-height-fix.diff} | 0 ...toplay-fix.diff => 0576-pptx-autoplay-fix.diff} | 0 ...ff => 0577-configmgr-validate-removedtree.diff} | 0 ...h.diff => 0578-svx-fix-fit-to-frame-crash.diff} | 0 ...h-fix.diff => 0579-svx-fontwork-crash-fix.diff} | 0 ...ge.diff => 0580-svx-autoshape-cache-purge.diff} | 0 ...diff => 0581-normalize-template-paths-fix.diff} | 0 ...iff => 0582-edit-links-decode-unicode-uri.diff} | 0 ...=> 0583-fontconfig-cache-pre-substitution.diff} | 0 ...-uno-cppu.diff => 0584-link-with-uno-cppu.diff} | 0 ...ox-pptx-import-fix-placeholder-text-style.diff} | 0 applied_patches/0586-build-fix-linux.diff | 19 + applied_patches/0587-emf+-driver-string.diff | 208 + applied_patches/0588-sd-print-fix-pageoffset.diff | 27 + .../0589-svx-ppt-import-fix-bullet-size.diff | 12 + ...-binfilter-stl.diff => 0590-binfilter-stl.diff} | 0 ...-needed-bf.diff => 0591-link-as-needed-bf.diff} | 0 ... => 0592-binfilter-dont-extern-sRTF-sHTML.diff} | 0 ...r.diff => 0593-fit-list-to-size-binfilter.diff} | 0 ...se.diff => 0594-reportdesigner-no-license.diff} | 0 ...e.diff => 0595-presenterscreen-no-license.diff} | 0 ...=> 0596-presentation-minimizer-no-license.diff} | 0 ...97-apache-commons-build-fix-invalid-chars.diff} | 0 ...se.diff => 0598-wiki-publisher-no-license.diff} | 0 ...license.diff => 0599-pdfimport-no-license.diff} | 0 ...diff => 0600-build-java-target-extensions.diff} | 0 ...s.diff => 0601-pdfimport-lax-restrictions.diff} | 0 ...iff => 0602-slideshow-effect-rewind-sdext.diff} | 0 applied_patches/0628-fit-list-to-size-popup.diff | 288 - applied_patches/0636-ui-desktop-integration.diff | 223 - ...681-calc-external-ref-modify-link-modified.diff | 12 - .../0682-calc-xls-hyperlink-single-quote-fix.diff | 38 - .../0683-calc-external-ref-decode-unicode-uri.diff | 25 - .../0687-calc-perf-ods-import-properties.diff | 158 - applied_patches/0698-basegfx-color-tools.diff | 614 - applied_patches/0705-link-with-comphelper.diff | 10 - .../0706-import-export-dialogmodel.diff | 20 - applied_patches/0707-dtrans-aqua-dragrect-fix.diff | 12 - applied_patches/0709-build-fix.diff | 140 - basctl/source/basicide/baside2.cxx | 2 +- basctl/source/basicide/basides2.cxx | 8 +- basctl/source/basicide/bastype2.cxx | 82 +- basctl/source/basicide/bastypes.cxx | 2 +- basctl/source/basicide/moduldlg.cxx | 8 +- basctl/source/basicide/scriptdocument.cxx | 2 +- basegfx/inc/basegfx/color/bcolortools.hxx | 2 +- basegfx/source/color/bcolortools.cxx | 2 +- basegfx/source/color/makefile.mk | 2 +- basegfx/test/makefile.mk | 2 +- basic/inc/basic/sbobjmod.hxx | 1 + basic/inc/basic/sbstar.hxx | 2 +- basic/source/basmgr/basmgr.cxx | 16 +- basic/source/classes/eventatt.cxx | 10 +- basic/source/classes/sb.cxx | 2 +- basic/source/classes/sb.src | 2 +- basic/source/classes/sbunoobj.cxx | 209 +- basic/source/classes/sbxmod.cxx | 108 +- basic/source/comp/dim.cxx | 5 +- basic/source/comp/exprtree.cxx | 12 +- basic/source/runtime/methods.cxx | 16 +- basic/source/runtime/methods1.cxx | 2 +- basic/source/runtime/runtime.cxx | 7 +- basic/source/runtime/step0.cxx | 28 +- basic/source/runtime/step1.cxx | 4 + basic/source/runtime/step2.cxx | 10 +- basic/source/sbx/sbxvalue.cxx | 8 +- basic/source/uno/scriptcont.cxx | 4 +- bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx | 18 +- canvas/source/directx/dx_winstuff.hxx | 7 +- chart2/source/model/template/AreaChartType.cxx | 114 - chart2/source/model/template/AreaChartType.hxx | 10 - .../model/template/AreaChartTypeTemplate.cxx | 3 - .../source/model/template/BarChartTypeTemplate.cxx | 1 - chart2/source/model/template/ChartTypeTemplate.cxx | 43 - chart2/source/model/template/ChartTypeTemplate.hxx | 5 - chart2/source/model/template/ColumnChartType.cxx | 20 +- .../model/template/ColumnLineChartTypeTemplate.cxx | 1 - chart2/source/model/template/LineChartType.cxx | 20 +- .../model/template/LineChartTypeTemplate.cxx | 1 - .../source/model/template/NetChartTypeTemplate.cxx | 1 - .../source/model/template/PieChartTypeTemplate.cxx | 1 - .../model/template/ScatterChartTypeTemplate.cxx | 1 - .../model/template/StockChartTypeTemplate.cxx | 1 - chart2/source/view/axes/ScaleAutomatism.cxx | 16 - chart2/source/view/charttypes/AreaChart.cxx | 38 +- chart2/source/view/charttypes/BarChart.cxx | 13 - chart2/source/view/charttypes/PieChart.cxx | 29 +- chart2/source/view/charttypes/PieChart.hxx | 4 +- chart2/source/view/charttypes/VSeriesPlotter.cxx | 34 - chart2/source/view/main/ChartView.cxx | 10 +- cli_ure/version/version.txt | 24 +- comphelper/inc/comphelper/docpasswordhelper.hxx | 212 + comphelper/inc/comphelper/docpasswordrequest.hxx | 91 + comphelper/inc/comphelper/mediadescriptor.hxx | 76 +- comphelper/inc/comphelper/servicedecl.hxx | 4 +- comphelper/source/misc/docpasswordhelper.cxx | 152 + comphelper/source/misc/docpasswordrequest.cxx | 153 + comphelper/source/misc/makefile.mk | 2 + comphelper/source/misc/mediadescriptor.cxx | 14 +- comphelper/source/misc/uieventslogger.cxx | 14 +- config.guess | 2 +- configure.in | 38 +- connectivity/inc/connectivity/TTableHelper.hxx | 45 +- connectivity/inc/connectivity/sdbcx/VKey.hxx | 1 + connectivity/inc/connectivity/sdbcx/VView.hxx | 17 +- connectivity/inc/connectivity/sqlnode.hxx | 3 +- .../source/commontools/ConnectionWrapper.cxx | 2 +- connectivity/source/commontools/DateConversion.cxx | 56 +- .../commontools/FDatabaseMetaDataResultSet.cxx | 2 +- connectivity/source/commontools/TColumnsHelper.cxx | 73 +- .../source/commontools/TDatabaseMetaDataBase.cxx | 4 +- connectivity/source/commontools/TIndexColumns.cxx | 2 +- connectivity/source/commontools/TIndexes.cxx | 4 +- connectivity/source/commontools/TKey.cxx | 55 +- .../source/commontools/TPrivilegesResultSet.cxx | 4 +- connectivity/source/commontools/TTableHelper.cxx | 213 +- connectivity/source/commontools/dbconversion.cxx | 4 +- connectivity/source/commontools/dbmetadata.cxx | 3 +- connectivity/source/commontools/dbtools.cxx | 5 +- connectivity/source/commontools/dbtools2.cxx | 49 +- connectivity/source/commontools/parameters.cxx | 2 +- connectivity/source/commontools/sqlerror.cxx | 2 +- connectivity/source/cpool/ZConnectionPool.cxx | 6 +- connectivity/source/cpool/ZPoolCollection.cxx | 4 +- connectivity/source/cpool/ZPooledConnection.cxx | 4 +- connectivity/source/drivers/adabas/BConnection.cxx | 5 +- connectivity/source/drivers/adabas/BDriver.cxx | 2 +- .../source/drivers/adabas/BPreparedStatement.cxx | 4 +- connectivity/source/drivers/adabas/BTables.cxx | 2 +- connectivity/source/drivers/adabas/BViews.cxx | 2 +- .../drivers/ado/ADatabaseMetaDataResultSet.cxx | 2 +- connectivity/source/drivers/ado/ADriver.cxx | 11 +- .../source/drivers/ado/APreparedStatement.cxx | 4 +- connectivity/source/drivers/ado/AResultSet.cxx | 4 +- connectivity/source/drivers/ado/Aservices.cxx | 4 +- connectivity/source/drivers/dbase/DTable.cxx | 2 +- connectivity/source/drivers/evoab2/NDriver.cxx | 2 +- connectivity/source/drivers/evoab2/NResultSet.cxx | 2 +- connectivity/source/drivers/evoab2/NStatement.cxx | 4 +- connectivity/source/drivers/evoab2/NTables.cxx | 2 +- connectivity/source/drivers/file/FCatalog.cxx | 2 +- connectivity/source/drivers/file/FConnection.cxx | 4 +- .../source/drivers/file/FPreparedStatement.cxx | 4 +- connectivity/source/drivers/file/FResultSet.cxx | 10 +- connectivity/source/drivers/file/FTables.cxx | 2 +- connectivity/source/drivers/file/fcomp.cxx | 2 +- connectivity/source/drivers/hsqldb/HStorageMap.cxx | 8 +- connectivity/source/drivers/hsqldb/HTables.cxx | 2 +- connectivity/source/drivers/hsqldb/HViews.cxx | 2 +- connectivity/source/drivers/jdbc/JDriver.cxx | 2 +- connectivity/source/drivers/jdbc/ResultSet.cxx | 2 +- connectivity/source/drivers/kab/KResultSet.cxx | 4 +- connectivity/source/drivers/kab/KTables.cxx | 2 +- .../source/drivers/macab/MacabResultSet.cxx | 4 +- connectivity/source/drivers/macab/MacabTables.cxx | 2 +- .../source/drivers/mozab/MPreparedStatement.cxx | 2 +- connectivity/source/drivers/mozab/MResultSet.cxx | 6 +- .../source/drivers/mozab/MResultSetMetaData.cxx | 2 +- connectivity/source/drivers/mozab/MTables.cxx | 2 +- connectivity/source/drivers/mysql/YTables.cxx | 2 +- connectivity/source/drivers/mysql/YViews.cxx | 2 +- .../source/drivers/odbcbase/OConnection.cxx | 24 +- .../source/drivers/odbcbase/ODatabaseMetaData.cxx | 176 +- .../odbcbase/ODatabaseMetaDataResultSet.cxx | 13 +- .../source/drivers/odbcbase/OPreparedStatement.cxx | 22 +- .../source/drivers/odbcbase/OResultSet.cxx | 6 +- .../source/drivers/odbcbase/OResultSetMetaData.cxx | 34 +- .../source/drivers/odbcbase/OStatement.cxx | 12 +- connectivity/source/drivers/odbcbase/OTools.cxx | 14 +- connectivity/source/inc/OSubComponent.hxx | 2 +- .../source/inc/adabas/BPreparedStatement.hxx | 2 +- connectivity/source/inc/calc/CConnection.hxx | 2 +- connectivity/source/inc/odbc/OConnection.hxx | 6 +- .../source/inc/odbc/ODatabaseMetaDataResultSet.hxx | 1 + .../source/inc/odbc/OPreparedStatement.hxx | 6 +- .../source/inc/odbc/OResultSetMetaData.hxx | 1 + connectivity/source/parse/sqlbison.y | 36 +- connectivity/source/parse/sqliterator.cxx | 15 +- connectivity/source/parse/sqlnode.cxx | 18 +- connectivity/source/sdbcx/VCatalog.cxx | 2 +- connectivity/source/sdbcx/VTable.cxx | 9 +- connectivity/source/sdbcx/VView.cxx | 13 +- cppcanvas/source/mtfrenderer/emfplus.cxx | 148 +- dbaccess/qa/complex/dbaccess/makefile.mk | 6 +- .../source/core/api/SingleSelectQueryComposer.cxx | 8 +- dbaccess/source/core/api/resultcolumn.cxx | 64 +- dbaccess/source/core/api/resultcolumn.hxx | 15 + dbaccess/source/core/inc/PropertyForward.hxx | 1 + dbaccess/source/core/misc/ContainerMediator.cxx | 6 +- dbaccess/source/ui/inc/RelationController.hxx | 8 +- dbaccess/source/ui/misc/DExport.cxx | 21 +- .../ui/relationdesign/RelationController.cxx | 355 +- .../source/ui/relationdesign/RelationTableView.cxx | 6 +- dbaccess/source/ui/tabledesign/TableController.cxx | 71 +- .../res/commandimagelist/lc_navigateback.png | Bin 0 -> 1042 bytes .../res/commandimagelist/lc_navigateforward.png | Bin 0 -> 1039 bytes .../res/commandimagelist/lch_navigateback.png | Bin 0 -> 336 bytes .../res/commandimagelist/lch_navigateforward.png | Bin 0 -> 323 bytes .../res/commandimagelist/sc_navigateback.png | Bin 0 -> 526 bytes .../res/commandimagelist/sc_navigateforward.png | Bin 0 -> 537 bytes .../res/commandimagelist/sch_navigateback.png | Bin 0 -> 310 bytes .../res/commandimagelist/sch_navigateforward.png | Bin 0 -> 320 bytes default_images/sc/res/popup_select_current.png | Bin 0 -> 373 bytes default_images/sc/res/popup_unselect_current.png | Bin 0 -> 324 bytes desktop/source/app/app.cxx | 5 +- desktop/source/app/checkinstall.cxx | 86 +- dmake/make.c | 5 +- dmake/tests/misc-13 | 2 +- dmake/tests/misc-15 | 2 +- dmake/tests/targets-28 | 4 +- .../source/processor2d/vclmetafileprocessor2d.cxx | 4 +- drawinglayer/source/processor2d/vclprocessor2d.cxx | 8 +- extensions/source/config/ldap/ldapaccess.cxx | 92 +- extensions/source/config/ldap/ldapaccess.hxx | 35 +- extensions/source/config/ldap/ldapuserprof.cxx | 6 +- .../source/config/ldap/ldapuserprofilebe.cxx | 29 +- extensions/source/config/ldap/makefile.mk | 1 - extensions/source/config/ldap/wrapldapinclude.hxx | 6 + extensions/source/ole/oleobjw.cxx | 63 +- extensions/source/ole/oleobjw.hxx | 11 +- extensions/source/plugin/aqua/macmgr.cxx | 39 +- .../fragments/types/writer_MS_Word_2007_XML.xcu | 2 +- .../types/writer_MS_Word_2007_XML_Template.xcu | 2 +- filter/source/pdf/impdialog.src | 4 +- filter/source/pdf/pdfdialog.cxx | 35 +- filter/source/pdf/pdfdialog.hxx | 21 +- filter/source/svg/gfxtypes.hxx | 2 + filter/source/svg/svgreader.cxx | 38 +- .../source/xslt/export/spreadsheetml/formular.xsl | 6 +- .../export/spreadsheetml/ooo2spreadsheetml.xsl | 180 +- .../import/spreadsheetml/spreadsheetml2ooo.xsl | 215 + forms/qa/makefile.mk | 9 +- forms/source/component/GroupManager.cxx | 4 +- forms/source/component/RadioButton.cxx | 74 +- forms/source/misc/InterfaceContainer.cxx | 8 +- forms/source/xforms/xpathlib/xpathlib.cxx | 2 +- formula/inc/formula/compiler.hrc | 3 +- formula/inc/formula/opcode.hxx | 1 - formula/source/core/api/FormulaCompiler.cxx | 42 +- formula/source/core/resource/core_resource.src | 6 - fpicker/source/unx/kde4/KDE4FPEntry.cxx | 6 +- fpicker/source/unx/kde4/KDE4FilePicker.cxx | 90 +- .../filepicker/VistaFilePickerEventHandler.cxx | 4 +- .../filepicker/VistaFilePickerEventHandler.hxx | 4 + .../win32/filepicker/VistaFilePickerImpl.cxx | 6 +- .../win32/filepicker/VistaFilePickerImpl.hxx | 4 + .../win32/folderpicker/workbench/Test_fops.cxx | 6 +- .../win32/folderpicker/workbench/makefile.mk | 2 +- fpicker/source/win32/misc/makefile.mk | 3 +- framework/collector/cmduicollector.cxx | 40 +- framework/collector/uicmdstohtml.cxx | 4 +- framework/inc/classes/addonmenu.hxx | 7 +- framework/inc/classes/bmkmenu.hxx | 4 +- framework/inc/classes/eventsconfiguration.hxx | 39 - framework/inc/classes/eventsdocumenthandler.hxx | 198 - framework/inc/classes/fwlresid.hxx | 49 + framework/inc/classes/imagesconfiguration.hxx | 115 - framework/inc/classes/imagesdocumenthandler.hxx | 215 - framework/inc/classes/imagewrapper.hxx | 18 +- framework/inc/classes/menuconfiguration.hxx | 126 - framework/inc/classes/menumanager.hxx | 38 +- framework/inc/classes/statusbarconfiguration.hxx | 48 - framework/inc/classes/statusbardocumenthandler.hxx | 190 - framework/inc/classes/toolboxconfiguration.hxx | 96 - .../inc/classes/toolboxconfigurationdefines.hxx | 80 - framework/inc/classes/toolboxdocumenthandler.hxx | 217 - .../inc/classes/toolboxlayoutdocumenthandler.hxx | 198 - .../inc/helper/dockingareadefaultacceptor.hxx | 15 +- framework/inc/helper/mischelper.hxx | 15 +- framework/inc/helper/ocomponentaccess.hxx | 15 +- framework/inc/helper/ocomponentenumeration.hxx | 16 +- framework/inc/helper/oframes.hxx | 15 +- framework/inc/helper/opluginframedispatcher.hxx | 15 +- framework/inc/helper/popupmenucontrollerbase.hxx | 8 +- .../inc/helper/uiconfigelementwrapperbase.hxx | 10 +- .../interaction/preventduplicateinteraction.hxx | 4 +- framework/inc/jobs/helponstartup.hxx | 14 +- framework/inc/jobs/shelljob.hxx | 13 +- framework/inc/macros/debug/memorymeasure.hxx | 2 +- framework/inc/macros/xserviceinfo.hxx | 27 +- framework/inc/mediadescriptor.h | 160 +- framework/inc/services.h | 18 +- framework/inc/services/dispatchhelper.hxx | 12 +- framework/inc/services/frameloaderfactory.hxx | 12 +- .../inc/services/mediatypedetectionhelper.hxx | 10 +- framework/inc/services/menudocumenthandler.hxx | 317 - .../inc/services/popupmenucontrollerfactory.hxx | 97 - framework/inc/services/saxnamespacefilter.hxx | 119 - framework/inc/services/substitutepathvars.hxx | 11 +- framework/inc/services/uriabbreviation.hxx | 10 +- framework/inc/services/urltransformer.hxx | 10 +- framework/inc/tabwin/tabwinfactory.hxx | 11 +- framework/inc/uiconfiguration/imagemanager.hxx | 62 +- .../inc/uiconfiguration/moduleimagemanager.hxx | 115 +- .../moduleuiconfigurationmanager.hxx | 92 +- .../inc/uiconfiguration/uicategorydescription.hxx | 50 +- .../inc/uiconfiguration/uiconfigurationmanager.hxx | 81 +- .../uiconfiguration/windowstateconfiguration.hxx | 9 +- .../inc/uielement/comboboxtoolbarcontroller.hxx | 4 +- .../inc/uielement/complextoolbarcontroller.hxx | 1 + framework/inc/uielement/controlmenucontroller.hxx | 7 +- .../inc/uielement/dropdownboxtoolbarcontroller.hxx | 4 +- framework/inc/uielement/edittoolbarcontroller.hxx | 4 +- framework/inc/uielement/fontmenucontroller.hxx | 11 +- framework/inc/uielement/fontsizemenucontroller.hxx | 12 +- framework/inc/uielement/footermenucontroller.hxx | 159 +- .../inc/uielement/generictoolbarcontroller.hxx | 27 +- framework/inc/uielement/headermenucontroller.hxx | 14 +- .../inc/uielement/imagebuttontoolbarcontroller.hxx | 3 - framework/inc/uielement/itemcontainer.hxx | 10 +- .../inc/uielement/langselectionmenucontroller.hxx | 9 +- .../uielement/langselectionstatusbarcontroller.hxx | 3 +- framework/inc/uielement/macrosmenucontroller.hxx | 13 +- framework/inc/uielement/menubarmanager.hxx | 21 +- framework/inc/uielement/menubarwrapper.hxx | 7 +- framework/inc/uielement/newmenucontroller.hxx | 11 +- framework/inc/uielement/objectmenucontroller.hxx | 13 +- .../inc/uielement/recentfilesmenucontroller.hxx | 8 +- .../inc/uielement/spinfieldtoolbarcontroller.hxx | 4 +- framework/inc/uielement/statusbarmanager.hxx | 4 +- framework/inc/uielement/statusbarwrapper.hxx | 3 - .../uielement/statusindicatorinterfacewrapper.hxx | 12 +- .../uielement/togglebuttontoolbarcontroller.hxx | 2 +- framework/inc/uielement/toolbarmanager.hxx | 9 + framework/inc/uielement/toolbarsmenucontroller.hxx | 4 - framework/inc/uielement/toolbarwrapper.hxx | 9 +- framework/inc/uielement/uicommanddescription.hxx | 22 +- framework/inc/uifactory/addonstoolboxfactory.hxx | 12 +- framework/inc/uifactory/factoryconfiguration.hxx | 127 + framework/inc/uifactory/menubarfactory.hxx | 24 +- .../inc/uifactory/popupmenucontrollerfactory.hxx | 38 +- .../inc/uifactory/statusbarcontrollerfactory.hxx | 40 +- framework/inc/uifactory/statusbarfactory.hxx | 26 +- .../inc/uifactory/toolbarcontrollerfactory.hxx | 21 +- framework/inc/uifactory/toolboxfactory.hxx | 25 +- .../inc/uifactory/uielementfactorymanager.hxx | 75 +- .../inc/uifactory/windowcontentfactorymanager.hxx | 21 +- framework/inc/xml/eventsdocumenthandler.hxx | 20 +- framework/inc/xml/imagesdocumenthandler.hxx | 15 +- framework/inc/xml/menuconfiguration.hxx | 1 + framework/inc/xml/menudocumenthandler.hxx | 17 +- framework/inc/xml/saxnamespacefilter.hxx | 15 +- framework/inc/xml/statusbardocumenthandler.hxx | 15 +- framework/inc/xml/toolboxdocumenthandler.hxx | 15 +- framework/prj/d.lst | 11 +- framework/source/accelerators/acceleratorcache.cxx | 4 +- .../accelerators/acceleratorconfiguration.cxx | 142 +- .../source/accelerators/acceleratorexecute.cxx | 10 +- .../moduleacceleratorconfiguration.cxx | 3 + framework/source/classes/addonmenu.cxx | 15 +- framework/source/classes/addonsoptions.cxx | 2 +- framework/source/classes/bmkmenu.cxx | 23 +- framework/source/classes/framelistanalyzer.cxx | 6 +- framework/source/classes/fwktabwindow.cxx | 19 +- framework/source/classes/fwlresid.cxx | 68 + framework/source/classes/imagewrapper.cxx | 86 - framework/source/classes/makefile.mk | 1 + framework/source/classes/menumanager.cxx | 553 +- framework/source/classes/propertysethelper.cxx | 3 +- framework/source/classes/protocolhandlercache.cxx | 15 +- framework/source/classes/taskcreator.cxx | 3 +- framework/source/dispatch/closedispatcher.cxx | 5 +- framework/source/dispatch/interceptionhelper.cxx | 4 +- framework/source/dispatch/menudispatcher.cxx | 6 +- framework/source/dispatch/popupmenudispatcher.cxx | 8 +- .../source/dispatch/windowcommanddispatch.cxx | 1 + framework/source/helper/actiontriggerhelper.cxx | 4 +- .../source/helper/dockingareadefaultacceptor.cxx | 13 - framework/source/helper/mischelper.cxx | 90 +- framework/source/helper/ocomponentaccess.cxx | 15 - framework/source/helper/ocomponentenumeration.cxx | 17 - framework/source/helper/oframes.cxx | 19 - framework/source/helper/persistentwindowstate.cxx | 5 +- .../source/helper/popupmenucontrollerbase.cxx | 79 +- framework/source/helper/titlebarupdate.cxx | 3 +- framework/source/helper/titlehelper.cxx | 44 +- .../source/helper/uiconfigelementwrapperbase.cxx | 61 +- framework/source/helper/uielementwrapperbase.cxx | 1 + .../inc/accelerators/acceleratorconfiguration.hxx | 6 +- framework/source/inc/dispatch/uieventloghelper.hxx | 3 +- framework/source/inc/pattern/frame.hxx | 1 + framework/source/jobs/helponstartup.cxx | 13 - framework/source/jobs/job.cxx | 3 + framework/source/jobs/jobdata.cxx | 9 +- framework/source/jobs/jobresult.cxx | 2 +- framework/source/jobs/shelljob.cxx | 11 - framework/source/layoutmanager/layoutmanager.cxx | 582 +- framework/source/loadenv/loadenv.cxx | 4 +- framework/source/recording/dispatchrecorder.cxx | 2 +- framework/source/register/registerservices.cxx | 134 +- framework/source/register/registertemp.cxx | 71 +- framework/source/services/autorecovery.cxx | 8 +- framework/source/services/backingwindow.cxx | 13 +- framework/source/services/desktop.cxx | 1 + framework/source/services/dispatchhelper.cxx | 14 - framework/source/services/frame.cxx | 10 +- framework/source/services/license.cxx | 7 +- .../source/services/mediatypedetectionhelper.cxx | 18 +- framework/source/services/modulemanager.cxx | 7 +- framework/source/services/pathsettings.cxx | 10 +- framework/source/services/substitutepathvars.cxx | 53 +- framework/source/services/uriabbreviation.cxx | 13 - framework/source/services/urltransformer.cxx | 178 +- framework/source/tabwin/tabwindow.cxx | 2 +- framework/source/tabwin/tabwinfactory.cxx | 13 - framework/source/threadhelp/transactionmanager.cxx | 2 +- .../source/uiconfiguration/graphicnameaccess.cxx | 2 +- framework/source/uiconfiguration/imagemanager.cxx | 1390 +- .../source/uiconfiguration/imagemanagerimpl.cxx | 1466 + .../source/uiconfiguration/imagemanagerimpl.hxx | 225 + framework/source/uiconfiguration/makefile.mk | 2 + .../source/uiconfiguration/moduleimagemanager.cxx | 1762 +- .../source/uiconfiguration/moduleuicfgsupplier.cxx | 76 +- .../moduleuiconfigurationmanager.cxx | 1902 +- .../uiconfiguration/uicategorydescription.cxx | 219 +- .../uiconfiguration/uiconfigurationmanager.cxx | 1607 +- .../uiconfiguration/uiconfigurationmanagerimpl.cxx | 1713 + .../uiconfiguration/uiconfigurationmanagerimpl.hxx | 221 + .../uiconfiguration/windowstateconfiguration.cxx | 19 +- .../source/uielement/addonstoolbarmanager.cxx | 30 +- .../source/uielement/addonstoolbarwrapper.cxx | 1 + .../source/uielement/buttontoolbarcontroller.cxx | 2 +- .../source/uielement/comboboxtoolbarcontroller.cxx | 55 +- .../source/uielement/complextoolbarcontroller.cxx | 19 +- framework/source/uielement/constitemcontainer.cxx | 12 +- .../source/uielement/controlmenucontroller.cxx | 146 +- .../uielement/dropdownboxtoolbarcontroller.cxx | 55 +- .../source/uielement/edittoolbarcontroller.cxx | 55 +- framework/source/uielement/fontmenucontroller.cxx | 111 +- .../source/uielement/fontsizemenucontroller.cxx | 107 +- .../source/uielement/footermenucontroller.cxx | 446 +- .../source/uielement/generictoolbarcontroller.cxx | 66 + .../source/uielement/headermenucontroller.cxx | 124 +- .../uielement/imagebuttontoolbarcontroller.cxx | 8 - framework/source/uielement/itemcontainer.cxx | 37 +- .../uielement/langselectionmenucontroller.cxx | 210 +- .../uielement/langselectionstatusbarcontroller.cxx | 20 +- .../uielement/logoimagestatusbarcontroller.cxx | 4 +- .../uielement/logotextstatusbarcontroller.cxx | 4 +- .../source/uielement/macrosmenucontroller.cxx | 169 +- framework/source/uielement/menubarmanager.cxx | 724 +- framework/source/uielement/menubarmerger.cxx | 8 +- framework/source/uielement/menubarwrapper.cxx | 91 +- framework/source/uielement/newmenucontroller.cxx | 126 +- .../source/uielement/objectmenucontroller.cxx | 89 +- .../source/uielement/recentfilesmenucontroller.cxx | 83 +- framework/source/uielement/rootitemcontainer.cxx | 9 +- .../uielement/spinfieldtoolbarcontroller.cxx | 63 +- framework/source/uielement/statusbarmanager.cxx | 175 +- framework/source/uielement/statusbarwrapper.cxx | 50 +- .../uielement/statusindicatorinterfacewrapper.cxx | 16 +- .../uielement/togglebuttontoolbarcontroller.cxx | 58 +- framework/source/uielement/toolbar.cxx | 1 + framework/source/uielement/toolbarmanager.cxx | 282 +- .../source/uielement/toolbarsmenucontroller.cxx | 74 +- framework/source/uielement/toolbarwrapper.cxx | 74 +- .../source/uielement/uicommanddescription.cxx | 236 +- .../source/uifactory/addonstoolboxfactory.cxx | 17 +- .../source/uifactory/factoryconfiguration.cxx | 344 + framework/source/uifactory/makefile.mk | 1 + framework/source/uifactory/menubarfactory.cxx | 115 +- .../uifactory/popupmenucontrollerfactory.cxx | 629 +- .../uifactory/statusbarcontrollerfactory.cxx | 716 +- framework/source/uifactory/statusbarfactory.cxx | 112 +- .../source/uifactory/toolbarcontrollerfactory.cxx | 820 +- framework/source/uifactory/toolboxfactory.cxx | 116 +- .../source/uifactory/uielementfactorymanager.cxx | 230 +- .../uifactory/windowcontentfactorymanager.cxx | 292 +- framework/source/xml/eventsconfiguration.cxx | 9 +- framework/source/xml/eventsdocumenthandler.cxx | 13 - framework/source/xml/imagesconfiguration.cxx | 9 +- framework/source/xml/imagesdocumenthandler.cxx | 13 - framework/source/xml/menuconfiguration.cxx | 7 +- framework/source/xml/menudocumenthandler.cxx | 27 +- framework/source/xml/saxnamespacefilter.cxx | 16 +- framework/source/xml/statusbarconfiguration.cxx | 5 +- framework/source/xml/statusbardocumenthandler.cxx | 23 +- framework/source/xml/toolboxconfiguration.cxx | 5 +- framework/source/xml/toolboxdocumenthandler.cxx | 26 +- framework/util/makefile.mk | 66 +- hsqldb/makefile.mk | 3 +- hsqldb/patches/accumulated_patches.patch | 11 + i18npool/inc/defaultnumberingprovider.hxx | 1 + .../defaultnumberingprovider.cxx | 11 +- idlc/source/idlcmain.cxx | 5 + jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx | 2 +- jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 18 +- moz/download/mozilla-source.txt | 7 +- moz/extractfiles.mk | 2 +- moz/makefile.mk | 98 +- moz/zipped/makefile.mk | 22 +- offapi/com/sun/star/document/MediaDescriptor.idl | 12 +- offapi/com/sun/star/document/PDFDialog.idl | 67 + .../com/sun/star/document/XVbaMethodParameter.idl | 68 + offapi/com/sun/star/document/makefile.mk | 4 +- offapi/com/sun/star/text/XFormField.idl | 15 +- offapi/com/sun/star/ui/ItemStyle.idl | 1 + .../data/org/openoffice/Office/UI/CalcCommands.xcu | 12 +- officecfg/registry/data/org/openoffice/VCL.xcu | 34 +- officecfg/registry/data/org/openoffice/VCL.xcu.bak | 34 +- oovbaapi/ooo/vba/Globals.idl | 0 oovbaapi/ooo/vba/XGlobals.idl | 0 oovbaapi/ooo/vba/msforms/XLabel.idl | 1 + oovbaapi/ooo/vba/msforms/XListBox.idl | 2 +- oox/inc/oox/core/binarycodec.hxx | 33 +- oox/inc/oox/core/binaryfilterbase.hxx | 5 +- oox/inc/oox/core/filterbase.hxx | 30 +- oox/inc/oox/core/filterdetect.hxx | 168 + oox/inc/oox/core/xmlfilterbase.hxx | 9 +- oox/inc/oox/dump/dumperbase.hxx | 50 +- oox/inc/oox/xls/biffcodec.hxx | 111 +- oox/inc/oox/xls/biffhelper.hxx | 3 + oox/inc/oox/xls/viewsettings.hxx | 3 + oox/inc/oox/xls/workbooksettings.hxx | 19 + oox/prj/build.lst | 2 +- oox/prj/d.lst | 23 +- oox/source/core/binarycodec.cxx | 25 +- oox/source/core/binaryfilterbase.cxx | 17 +- oox/source/core/filterbase.cxx | 174 +- oox/source/core/filterdetect.cxx | 535 +- oox/source/core/makefile.mk | 4 + oox/source/core/xmlfilterbase.cxx | 53 +- .../drawingml/fillpropertiesgroupcontext.cxx | 13 +- oox/source/dump/biffdumper.cxx | 84 +- oox/source/dump/biffdumper.ini | 5 + oox/source/dump/dumperbase.cxx | 55 +- oox/source/dump/pptxdumper.cxx | 4 +- oox/source/dump/xlsbdumper.cxx | 10 +- oox/source/token/properties.txt | 1 + oox/source/vml/vmlshape.cxx | 2 +- oox/source/xls/biffcodec.cxx | 289 +- oox/source/xls/viewsettings.cxx | 9 + oox/source/xls/workbookfragment.cxx | 64 +- oox/source/xls/workbooksettings.cxx | 45 + oox/source/xls/worksheetfragment.cxx | 4 +- oox/source/xls/worksheetsettings.cxx | 15 +- oox/util/makefile.mk | 14 + package/inc/ZipFile.hxx | 14 +- package/inc/ZipPackage.hxx | 17 +- package/inc/ZipPackageBuffer.hxx | 2 +- package/inc/zipfileaccess.hxx | 6 +- package/source/zipapi/XUnbufferedStream.cxx | 13 +- package/source/zipapi/XUnbufferedStream.hxx | 13 +- package/source/zipapi/ZipFile.cxx | 25 +- package/source/zippackage/ZipPackage.cxx | 321 +- package/source/zippackage/ZipPackageStream.cxx | 32 +- package/source/zippackage/ZipPackageStream.hxx | 2 - package/source/zippackage/zipfileaccess.cxx | 33 +- packimages/pack/makefile.mk | 2 +- qadevOOo/runner/base/java_fat.java | 29 +- qadevOOo/runner/graphical/IniFile.java | 2 +- qadevOOo/runner/graphical/JPEGComparator.java | 30 +- qadevOOo/runner/graphical/JPEGCreator.java | 107 +- qadevOOo/runner/graphical/PixelCounter.java | 58 +- qadevOOo/runner/helper/APIDescGetter.java | 60 +- qadevOOo/runner/helper/OfficeProvider.java | 20 + qadevOOo/runner/lib/MultiPropertyTest.java | 331 +- qadevOOo/runner/lib/TestParameters.java | 4 +- qadevOOo/runner/org/openoffice/Runner.java | 2 +- qadevOOo/runner/util/DesktopTools.java | 8 +- reportdesign/source/core/sdr/RptObject.cxx | 2 +- reportdesign/source/ui/misc/UITools.cxx | 4 +- .../source/ui/misc/statusbarcontroller.cxx | 2 + sal/osl/all/makefile.mk | 6 +- sal/osl/all/readline.c | 311 - sal/osl/unx/file.cxx | 5091 +- sal/osl/unx/file_impl.hxx | 43 +- sal/osl/unx/file_misc.cxx | 1084 + sal/osl/unx/file_stat.cxx | 281 +- sal/osl/unx/file_url.cxx | 177 +- sal/osl/unx/file_url.h | 60 +- sal/osl/unx/file_volume.cxx | 1570 + sal/osl/unx/makefile.mk | 12 +- sal/osl/w32/MAKEFILE.MK | 8 + sal/osl/w32/file.cxx | 4900 +- sal/osl/w32/file_dirvol.cxx | 1774 + sal/osl/w32/file_error.c | 154 + sal/osl/w32/file_error.h | 54 + sal/osl/w32/file_url.cxx | 1019 + sal/osl/w32/file_url.h | 96 + sal/osl/w32/procimpl.cxx | 8 +- sal/osl/w32/tempfile.cxx | 279 + sal/workben/makefile.mk | 23 +- sal/workben/t_layer.c | 314 - sal/workben/t_readline.c | 58 + sal/workben/t_tls.c | 257 - sal/workben/t_zip.c | 183 - sax/source/expatwrap/sax_expat.cxx | 18 +- sax/source/expatwrap/saxwriter.cxx | 21 + sc/inc/AccessibleFilterMenu.hxx | 191 + sc/inc/AccessibleFilterMenuItem.hxx | 124 + sc/inc/AccessibleFilterTopWindow.hxx | 104 + sc/inc/AccessibleGlobal.hxx | 72 + sc/inc/ViewSettingsSequenceDefines.hxx | 5 +- sc/inc/attrib.hxx | 1 + sc/inc/cell.hxx | 177 +- sc/inc/cellsuno.hxx | 10 +- sc/inc/chart2uno.hxx | 8 + sc/inc/chartlis.hxx | 2 +- sc/inc/clipparam.hxx | 1 + sc/inc/collect.hxx | 3 +- sc/inc/column.hxx | 17 +- sc/inc/datauno.hxx | 2 + sc/inc/dbcolect.hxx | 3 +- sc/inc/detfunc.hxx | 1 + sc/inc/dociter.hxx | 100 +- sc/inc/document.hxx | 132 +- sc/inc/docuno.hxx | 3 + sc/inc/dpcachetable.hxx | 1 + sc/inc/dpobject.hxx | 30 +- sc/inc/dpoutput.hxx | 6 +- sc/inc/dpoutputgeometry.hxx | 9 +- sc/inc/dpshttab.hxx | 1 + sc/inc/global.hxx | 80 +- sc/inc/globstr.hrc | 35 +- sc/inc/indexmap.hxx | 59 - sc/inc/miscuno.hxx | 17 + sc/inc/olinetab.hxx | 5 +- sc/inc/optutil.hxx | 6 +- sc/inc/phonetic.hxx | 107 - sc/inc/pivot.hxx | 29 +- sc/inc/queryparam.hxx | 144 + sc/inc/rangenam.hxx | 2 - sc/inc/reftokenhelper.hxx | 8 +- sc/inc/sc.hrc | 42 +- sc/inc/sc.hrc.patched | 1660 + sc/inc/scabstdlg.hxx | 18 +- sc/inc/scextopt.hxx | 2 + sc/inc/scfuncs.hrc | 1 - sc/inc/sheetdata.hxx | 183 + sc/inc/sortparam.hxx | 2 +- sc/inc/stringutil.hxx | 35 + sc/inc/tabbgcolor.hxx | 46 + sc/inc/table.hxx | 124 +- sc/inc/textuno.hxx | 11 + sc/inc/unonames.hxx | 2 + sc/sdi/docsh.sdi | 1 + sc/sdi/scalc.sdi | 54 +- sc/sdi/tabvwsh.sdi | 1 + sc/source/core/data/attarray.cxx | 12 + sc/source/core/data/autonamecache.cxx | 3 +- sc/source/core/data/bcaslot.cxx | 2 +- sc/source/core/data/cell.cxx | 106 +- sc/source/core/data/cell2.cxx | 27 +- sc/source/core/data/clipparam.cxx | 15 +- sc/source/core/data/column.cxx | 18 - sc/source/core/data/column2.cxx | 11 +- sc/source/core/data/column3.cxx | 56 +- sc/source/core/data/conditio.cxx | 10 +- sc/source/core/data/dociter.cxx | 427 +- sc/source/core/data/docpool.cxx | 4 +- sc/source/core/data/documen2.cxx | 26 +- sc/source/core/data/documen3.cxx | 88 +- sc/source/core/data/documen7.cxx | 7 + sc/source/core/data/documen8.cxx | 54 +- sc/source/core/data/documen9.cxx | 4 +- sc/source/core/data/document.cxx | 470 +- sc/source/core/data/dpcachetable.cxx | 31 + sc/source/core/data/dpgroup.cxx | 2 +- sc/source/core/data/dpobject.cxx | 183 +- sc/source/core/data/dpoutput.cxx | 31 +- sc/source/core/data/dpoutputgeometry.cxx | 43 +- sc/source/core/data/dpsave.cxx | 120 +- sc/source/core/data/dptabdat.cxx | 4 +- sc/source/core/data/dptabsrc.cxx | 4 +- sc/source/core/data/drwlayer.cxx | 10 +- sc/source/core/data/fillinfo.cxx | 41 +- sc/source/core/data/global.cxx | 82 +- sc/source/core/data/global2.cxx | 293 +- sc/source/core/data/makefile.mk | 2 +- sc/source/core/data/olinetab.cxx | 8 +- sc/source/core/data/phonetic.cxx | 72 - sc/source/core/data/pivot2.cxx | 24 +- sc/source/core/data/poolhelp.cxx | 61 +- sc/source/core/data/sortparam.cxx | 9 +- sc/source/core/data/stlpool.cxx | 11 +- sc/source/core/data/stlsheet.cxx | 15 +- sc/source/core/data/table1.cxx | 63 +- sc/source/core/data/table2.cxx | 411 +- sc/source/core/data/table3.cxx | 328 +- sc/source/core/data/table5.cxx | 779 +- sc/source/core/data/table6.cxx | 217 +- sc/source/core/inc/doubleref.hxx | 194 + sc/source/core/inc/interpre.hxx | 8 +- sc/source/core/inc/poolhelp.hxx | 17 +- sc/source/core/tool/autoform.cxx | 6 +- sc/source/core/tool/callform.cxx | 4 +- sc/source/core/tool/chartarr.cxx | 76 +- sc/source/core/tool/collect.cxx | 19 +- sc/source/core/tool/compiler.cxx | 11 +- sc/source/core/tool/dbcolect.cxx | 11 +- sc/source/core/tool/detfunc.cxx | 16 + sc/source/core/tool/docoptio.cxx | 2 +- sc/source/core/tool/doubleref.cxx | 568 + sc/source/core/tool/indexmap.cxx | 80 - sc/source/core/tool/interpr1.cxx | 259 +- sc/source/core/tool/interpr2.cxx | 70 - sc/source/core/tool/interpr4.cxx | 356 +- sc/source/core/tool/interpr5.cxx | 2 +- sc/source/core/tool/makefile.mk | 5 +- sc/source/core/tool/optutil.cxx | 4 +- sc/source/core/tool/queryparam.cxx | 371 + sc/source/core/tool/rangelst.cxx | 4 +- sc/source/core/tool/rangenam.cxx | 28 +- sc/source/core/tool/stringutil.cxx | 9 + sc/source/core/tool/userlist.cxx | 4 +- sc/source/filter/excel/biffdump.cxx | 9929 -- sc/source/filter/excel/colrowst.cxx | 3 +- sc/source/filter/excel/excel.cxx | 36 +- sc/source/filter/excel/excform.cxx | 7 +- sc/source/filter/excel/excform8.cxx | 18 +- sc/source/filter/excel/excimp8.cxx | 10 +- sc/source/filter/excel/frmbase.cxx | 6 + sc/source/filter/excel/impop.cxx | 25 +- sc/source/filter/excel/makefile.mk | 2 +- sc/source/filter/excel/read.cxx | 10 +- sc/source/filter/excel/xeescher.cxx | 2 + sc/source/filter/excel/xehelper.cxx | 20 +- sc/source/filter/excel/xelink.cxx | 2 +- sc/source/filter/excel/xepage.cxx | 31 +- sc/source/filter/excel/xestream.cxx | 2 +- sc/source/filter/excel/xestring.cxx | 89 +- sc/source/filter/excel/xestyle.cxx | 1 + sc/source/filter/excel/xetable.cxx | 5 +- sc/source/filter/excel/xeview.cxx | 43 + sc/source/filter/excel/xichart.cxx | 63 +- sc/source/filter/excel/xicontent.cxx | 67 +- sc/source/filter/excel/xiescher.cxx | 6 +- sc/source/filter/excel/xiformula.cxx | 4 +- sc/source/filter/excel/xihelper.cxx | 16 +- sc/source/filter/excel/xiname.cxx | 8 +- sc/source/filter/excel/xipage.cxx | 4 +- sc/source/filter/excel/xipivot.cxx | 63 +- sc/source/filter/excel/xiroot.cxx | 12 - sc/source/filter/excel/xistream.cxx | 176 +- sc/source/filter/excel/xistring.cxx | 28 +- sc/source/filter/excel/xiview.cxx | 22 + sc/source/filter/excel/xlescher.cxx | 15 +- sc/source/filter/excel/xlformula.cxx | 4 +- sc/source/filter/excel/xlroot.cxx | 8 + sc/source/filter/excel/xlstream.cxx | 52 - sc/source/filter/excel/xltoolbar.cxx | 82 +- sc/source/filter/excel/xltoolbar.hxx | 12 +- sc/source/filter/excel/xlview.cxx | 1 + sc/source/filter/ftools/fapihelper.cxx | 53 +- sc/source/filter/html/htmlexp.cxx | 14 +- sc/source/filter/inc/excform.hxx | 6 +- sc/source/filter/inc/excimp8.hxx | 1 + sc/source/filter/inc/fapihelper.hxx | 6 +- sc/source/filter/inc/fdumper.hxx | 1520 - sc/source/filter/inc/fdumperole.hxx | 186 - sc/source/filter/inc/formel.hxx | 11 +- sc/source/filter/inc/imp_op.hxx | 2 + sc/source/filter/inc/xestream.hxx | 7 +- sc/source/filter/inc/xestring.hxx | 18 - sc/source/filter/inc/xestyle.hxx | 3 +- sc/source/filter/inc/xeview.hxx | 15 + sc/source/filter/inc/xichart.hxx | 9 +- sc/source/filter/inc/xiroot.hxx | 6 - sc/source/filter/inc/xistream.hxx | 65 +- sc/source/filter/inc/xistring.hxx | 11 - sc/source/filter/inc/xiview.hxx | 3 +- sc/source/filter/inc/xlcontent.hxx | 6 +- sc/source/filter/inc/xldumper.hxx | 683 - sc/source/filter/inc/xlroot.hxx | 10 +- sc/source/filter/inc/xlstream.hxx | 15 +- sc/source/filter/inc/xlstring.hxx | 63 +- sc/source/filter/inc/xlview.hxx | 8 + sc/source/filter/lotus/lotimpop.cxx | 3 +- sc/source/filter/lotus/op.cxx | 4 +- sc/source/filter/rtf/eeimpars.cxx | 13 +- sc/source/filter/rtf/expbase.cxx | 13 +- sc/source/filter/starcalc/scflt.cxx | 32 +- sc/source/filter/xcl97/XclImpChangeTrack.cxx | 4 +- sc/source/filter/xml/XMLExportDataPilot.cxx | 3 +- sc/source/filter/xml/XMLExportDataPilot.hxx | 1 + sc/source/filter/xml/XMLExportIterator.cxx | 73 +- sc/source/filter/xml/XMLExportIterator.hxx | 10 +- sc/source/filter/xml/XMLStylesExportHelper.cxx | 4 +- sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 39 +- sc/source/filter/xml/XMLTableShapeImportHelper.hxx | 2 + sc/source/filter/xml/XMLTextPContext.cxx | 109 +- sc/source/filter/xml/XMLTextPContext.hxx | 13 - sc/source/filter/xml/makefile.mk | 53 +- sc/source/filter/xml/sheetdata.cxx | 275 + sc/source/filter/xml/xmlannoi.cxx | 10 +- sc/source/filter/xml/xmlannoi.hxx | 23 +- sc/source/filter/xml/xmlbodyi.cxx | 40 +- sc/source/filter/xml/xmlbodyi.hxx | 1 + sc/source/filter/xml/xmlcelli.cxx | 125 +- sc/source/filter/xml/xmlcelli.hxx | 8 - sc/source/filter/xml/xmlcoli.cxx | 12 +- sc/source/filter/xml/xmldpimp.cxx | 31 +- sc/source/filter/xml/xmldpimp.hxx | 3 +- sc/source/filter/xml/xmlexprt.cxx | 868 +- sc/source/filter/xml/xmlexprt.hxx | 31 +- sc/source/filter/xml/xmlimprt.cxx | 105 +- sc/source/filter/xml/xmlimprt.hxx | 28 +- sc/source/filter/xml/xmlrowi.cxx | 11 + sc/source/filter/xml/xmlrubyi.cxx | 207 - sc/source/filter/xml/xmlrubyi.hxx | 191 - sc/source/filter/xml/xmlstyle.cxx | 1 - sc/source/filter/xml/xmlstyli.cxx | 162 +- sc/source/filter/xml/xmlstyli.hxx | 83 +- sc/source/filter/xml/xmlsubti.cxx | 16 +- sc/source/filter/xml/xmltabi.cxx | 17 + sc/source/filter/xml/xmltabi.hxx | 1 + sc/source/filter/xml/xmlwrap.cxx | 63 +- sc/source/ui/Accessibility/AccessibleCellBase.cxx | 10 +- .../ui/Accessibility/AccessibleContextBase.cxx | 5 + .../ui/Accessibility/AccessibleFilterMenu.cxx | 402 + .../ui/Accessibility/AccessibleFilterMenuItem.cxx | 209 + .../ui/Accessibility/AccessibleFilterTopWindow.cxx | 137 + sc/source/ui/Accessibility/AccessibleGlobal.cxx | 98 + sc/source/ui/Accessibility/makefile.mk | 8 + sc/source/ui/app/inputhdl.cxx | 2 +- sc/source/ui/app/inputwin.cxx | 2 +- sc/source/ui/app/transobj.cxx | 15 +- sc/source/ui/attrdlg/scdlgfact.cxx | 53 +- sc/source/ui/attrdlg/scdlgfact.hxx | 23 +- sc/source/ui/cctrl/dpcontrol.cxx | 872 +- sc/source/ui/cctrl/dpcontrol.src | 35 +- sc/source/ui/dbgui/asciiopt.src | 12 +- sc/source/ui/dbgui/fieldwnd.cxx | 60 +- sc/source/ui/dbgui/filtdlg.cxx | 12 +- sc/source/ui/dbgui/foptmgr.cxx | 1 + sc/source/ui/dbgui/langchooser.cxx | 120 - sc/source/ui/dbgui/langchooser.src | 112 - sc/source/ui/dbgui/makefile.mk | 6 +- sc/source/ui/dbgui/pfiltdlg.cxx | 3 +- sc/source/ui/dbgui/pvfundlg.cxx | 44 +- sc/source/ui/dbgui/pvlaydlg.cxx | 56 +- sc/source/ui/dbgui/scuiasciiopt.cxx | 2 +- sc/source/ui/dbgui/textimportoptions.cxx | 120 + sc/source/ui/dbgui/textimportoptions.src | 112 + sc/source/ui/docshell/arealink.cxx | 6 +- sc/source/ui/docshell/dbdocfun.cxx | 64 +- sc/source/ui/docshell/docfunc.cxx | 165 +- sc/source/ui/docshell/docsh.cxx | 43 +- sc/source/ui/docshell/docsh4.cxx | 7 + sc/source/ui/docshell/docsh5.cxx | 6 +- sc/source/ui/docshell/docsh8.cxx | 201 +- sc/source/ui/docshell/externalrefmgr.cxx | 4 +- sc/source/ui/docshell/impex.cxx | 25 +- sc/source/ui/docshell/olinefun.cxx | 8 +- sc/source/ui/docshell/tablink.cxx | 2 +- sc/source/ui/drawfunc/futext3.cxx | 8 + sc/source/ui/inc/AccessibleContextBase.hxx | 2 + sc/source/ui/inc/cellsh.hxx | 3 +- sc/source/ui/inc/dbfunc.hxx | 6 +- sc/source/ui/inc/docfunc.hxx | 5 + sc/source/ui/inc/docsh.hxx | 6 + sc/source/ui/inc/dpcontrol.hrc | 9 +- sc/source/ui/inc/dpcontrol.hxx | 183 +- sc/source/ui/inc/fieldwnd.hxx | 11 +- sc/source/ui/inc/filtdlg.hxx | 1 + sc/source/ui/inc/gridwin.hxx | 36 +- sc/source/ui/inc/hdrcont.hxx | 2 +- sc/source/ui/inc/langchooser.hxx | 76 - sc/source/ui/inc/miscdlgs.hrc | 6 + sc/source/ui/inc/pfiltdlg.hxx | 2 +- sc/source/ui/inc/tabbgcolordlg.hxx | 80 + .../inc/{langchooser.hrc => textimportoptions.hrc} | 0 sc/source/ui/inc/textimportoptions.hxx | 76 + sc/source/ui/inc/uiitems.hxx | 1 + sc/source/ui/inc/undodat.hxx | 1 + sc/source/ui/inc/undotab.hxx | 32 + sc/source/ui/inc/viewdata.hxx | 17 +- sc/source/ui/inc/viewfunc.hxx | 5 + sc/source/ui/inc/viewutil.hxx | 4 +- sc/source/ui/miscdlgs/acredlin.cxx | 2 +- sc/source/ui/miscdlgs/makefile.mk | 3 +- sc/source/ui/miscdlgs/solveroptions.cxx | 2 +- sc/source/ui/miscdlgs/tabbgcolordlg.cxx | 197 + sc/source/ui/navipi/content.cxx | 6 +- sc/source/ui/src/globstr.src | 8 + sc/source/ui/src/miscdlgs.src | 90 + sc/source/ui/src/popup.src | 165 +- sc/source/ui/src/scfuncs.src | 27 - sc/source/ui/src/scstring.src | 8 + sc/source/ui/undo/undobase.cxx | 1 + sc/source/ui/undo/undoblk.cxx | 14 +- sc/source/ui/undo/undoblk3.cxx | 7 +- sc/source/ui/undo/undocell.cxx | 2 + sc/source/ui/undo/undodat.cxx | 7 +- sc/source/ui/undo/undotab.cxx | 111 + sc/source/ui/unoobj/cellsuno.cxx | 128 +- sc/source/ui/unoobj/chart2uno.cxx | 38 +- sc/source/ui/unoobj/dapiuno.cxx | 17 +- sc/source/ui/unoobj/docuno.cxx | 95 +- sc/source/ui/unoobj/filtuno.cxx | 4 +- sc/source/ui/unoobj/funcuno.cxx | 6 +- sc/source/ui/unoobj/miscuno.cxx | 37 + sc/source/ui/unoobj/textuno.cxx | 41 + sc/source/ui/unoobj/viewuno.cxx | 2 +- sc/source/ui/vba/helperdecl.hxx | 2 +- sc/source/ui/vba/makefile.mk | 2 +- sc/source/ui/vba/testvba/Logs/AutoFilter.log | 20 + sc/source/ui/vba/testvba/Logs/CalcFont.log | 17 + .../ui/vba/testvba/Logs/MiscOperatorTests.log | 30 + sc/source/ui/vba/testvba/Logs/MiscRangeTests.log | 45 + sc/source/ui/vba/testvba/Logs/PageBreaks.log | 10 + sc/source/ui/vba/testvba/Logs/Ranges-2.log | 68 + sc/source/ui/vba/testvba/Logs/Ranges-3.log | 8 + sc/source/ui/vba/testvba/Logs/Ranges.log | 280 + sc/source/ui/vba/testvba/Logs/Shapes.log | 77 + sc/source/ui/vba/testvba/Logs/StrConv-test.log | 9 + sc/source/ui/vba/testvba/Logs/Template.log | 14 + sc/source/ui/vba/testvba/Logs/TestAddress.log | 67 + .../ui/vba/testvba/Logs/TestCalc_Rangetest.log | 60 + .../ui/vba/testvba/Logs/TestCalc_Rangetest2.log | 65 + sc/source/ui/vba/testvba/Logs/TestIntersection.log | 26 + sc/source/ui/vba/testvba/Logs/TestUnion.log | 17 + sc/source/ui/vba/testvba/Logs/VariantTest.log | 47 + sc/source/ui/vba/testvba/Logs/Window.log | 46 + sc/source/ui/vba/testvba/Logs/bytearraystring.log | 8 + sc/source/ui/vba/testvba/Logs/dateserial.log | 9 + sc/source/ui/vba/testvba/Logs/datevalue.log | 8 + sc/source/ui/vba/testvba/Logs/format.log | 36 + sc/source/ui/vba/testvba/Logs/pagesetup.log | 77 + sc/source/ui/vba/testvba/Logs/partition.log | 11 + sc/source/ui/vba/testvba/Logs/range-4.log | 16 + sc/source/ui/vba/testvba/Logs/replace.log | 14 + sc/source/ui/vba/testvba/Logs/stringplusdouble.log | 62 + sc/source/ui/vba/testvba/Logs/window2.log | 41 + .../testvba/TestDocuments/logs/unix/CalcFont.log | 17 + .../TestDocuments/logs/unix/MiscOperatorTests.log | 30 + .../vba/testvba/TestDocuments/logs/unix/Ranges.log | 20 +- .../TestDocuments/logs/unix/TestAddress.log | 11 +- .../TestDocuments/logs/unix/TestIntersection.log | 26 + .../testvba/TestDocuments/logs/unix/TestUnion.log | 17 + .../TestDocuments/logs/unix/VariantTest.log | 47 + .../vba/testvba/TestDocuments/logs/unix/format.log | 4 +- .../testvba/TestDocuments/logs/unix/replace.log | 4 +- .../testvba/TestDocuments/logs/unix/window2.log | 24 +- sc/source/ui/vba/testvba/list1 | 28 + sc/source/ui/vba/testvba/list2 | 28 + sc/source/ui/vba/testvba/list3 | 28 + sc/source/ui/vba/testvba/runTests.pl | 2 +- sc/source/ui/vba/testvba/testrun.log | 417 + sc/source/ui/vba/vbaapplication.cxx | 52 +- sc/source/ui/vba/vbabutton.cxx | 0 sc/source/ui/vba/vbabutton.hxx | 0 sc/source/ui/vba/vbacheckbox.cxx | 0 sc/source/ui/vba/vbacheckbox.hxx | 0 sc/source/ui/vba/vbacollectionimpl.cxx | 0 sc/source/ui/vba/vbacollectionimpl.hxx | 0 sc/source/ui/vba/vbacolorformat.cxx | 0 sc/source/ui/vba/vbacolorformat.hxx | 0 sc/source/ui/vba/vbacombobox.cxx | 0 sc/source/ui/vba/vbacombobox.hxx | 0 sc/source/ui/vba/vbacommandbar.cxx | 0 sc/source/ui/vba/vbacommandbar.hxx | 0 sc/source/ui/vba/vbacommandbarcontrol.cxx | 0 sc/source/ui/vba/vbacommandbarcontrol.hxx | 0 sc/source/ui/vba/vbacommandbarcontrols.cxx | 0 sc/source/ui/vba/vbacommandbarcontrols.hxx | 0 sc/source/ui/vba/vbacommandbars.cxx | 0 sc/source/ui/vba/vbacommandbars.hxx | 0 sc/source/ui/vba/vbacomment.cxx | 9 +- sc/source/ui/vba/vbacontrol.hxx | 0 sc/source/ui/vba/vbacontrols.cxx | 0 sc/source/ui/vba/vbacontrols.hxx | 0 sc/source/ui/vba/vbadialog.cxx | 80 +- sc/source/ui/vba/vbadialog.hxx | 5 +- sc/source/ui/vba/vbadialogs.cxx | 8 + sc/source/ui/vba/vbadialogs.hxx | 1 + sc/source/ui/vba/vbafillformat.cxx | 0 sc/source/ui/vba/vbafillformat.hxx | 0 sc/source/ui/vba/vbafont.cxx | 5 +- sc/source/ui/vba/vbaframe.cxx | 0 sc/source/ui/vba/vbaframe.hxx | 0 sc/source/ui/vba/vbaglobals.cxx | 12 +- sc/source/ui/vba/vbaglobals.hxx | 2 +- sc/source/ui/vba/vbahelper.hxx | 0 sc/source/ui/vba/vbahelperinterface.hxx | 0 sc/source/ui/vba/vbaimage.cxx | 0 sc/source/ui/vba/vbaimage.hxx | 0 sc/source/ui/vba/vbainterior.cxx | 12 +- sc/source/ui/vba/vbalabel.cxx | 0 sc/source/ui/vba/vbalabel.hxx | 0 sc/source/ui/vba/vbalineformat.cxx | 0 sc/source/ui/vba/vbalineformat.hxx | 0 sc/source/ui/vba/vbalistbox.cxx | 0 sc/source/ui/vba/vbalistbox.hxx | 0 sc/source/ui/vba/vbalistcontrolhelper.cxx | 0 sc/source/ui/vba/vbalistcontrolhelper.hxx | 0 sc/source/ui/vba/vbamultipage.cxx | 0 sc/source/ui/vba/vbamultipage.hxx | 0 sc/source/ui/vba/vbapagebreaks.cxx | 23 +- sc/source/ui/vba/vbapages.cxx | 0 sc/source/ui/vba/vbapages.hxx | 0 sc/source/ui/vba/vbapagesetup.cxx | 12 +- sc/source/ui/vba/vbapictureformat.cxx | 0 sc/source/ui/vba/vbapictureformat.hxx | 0 sc/source/ui/vba/vbaprogressbar.cxx | 0 sc/source/ui/vba/vbaprogressbar.hxx | 0 sc/source/ui/vba/vbaradiobutton.cxx | 0 sc/source/ui/vba/vbaradiobutton.hxx | 0 sc/source/ui/vba/vbarange.cxx | 47 +- sc/source/ui/vba/vbarange.cxx.pathched | 5441 ++ sc/source/ui/vba/vbascrollbar.cxx | 0 sc/source/ui/vba/vbascrollbar.hxx | 0 sc/source/ui/vba/vbashape.cxx | 0 sc/source/ui/vba/vbashape.hxx | 0 sc/source/ui/vba/vbashaperange.cxx | 0 sc/source/ui/vba/vbashaperange.hxx | 0 sc/source/ui/vba/vbashapes.cxx | 0 sc/source/ui/vba/vbashapes.hxx | 0 sc/source/ui/vba/vbaspinbutton.cxx | 0 sc/source/ui/vba/vbaspinbutton.hxx | 0 sc/source/ui/vba/vbatextbox.cxx | 0 sc/source/ui/vba/vbatextbox.hxx | 0 sc/source/ui/vba/vbatogglebutton.cxx | 0 sc/source/ui/vba/vbatogglebutton.hxx | 0 sc/source/ui/vba/vbauserform.cxx | 0 sc/source/ui/vba/vbauserform.hxx | 0 sc/source/ui/vba/vbawindow.cxx | 2 +- sc/source/ui/vba/vbaworkbook.cxx | 4 +- sc/source/ui/vba/vbaworkbooks.cxx | 10 +- sc/source/ui/vba/vbaworksheet.cxx | 36 +- sc/source/ui/vba/vbaworksheets.cxx | 8 +- sc/source/ui/vba/vbawsfunction.cxx | 14 +- sc/source/ui/view/cellsh.cxx | 8 +- sc/source/ui/view/cellsh1.cxx | 13 +- sc/source/ui/view/cellsh2.cxx | 15 +- sc/source/ui/view/cellsh4.cxx | 24 +- sc/source/ui/view/colrowba.cxx | 6 +- sc/source/ui/view/dbfunc.cxx | 5 +- sc/source/ui/view/dbfunc3.cxx | 48 +- sc/source/ui/view/drawutil.cxx | 19 +- sc/source/ui/view/formatsh.cxx | 5 + sc/source/ui/view/gridwin.cxx | 322 +- sc/source/ui/view/gridwin2.cxx | 162 +- sc/source/ui/view/gridwin4.cxx | 42 +- sc/source/ui/view/hdrcont.cxx | 41 +- sc/source/ui/view/olinewin.cxx | 9 +- sc/source/ui/view/output.cxx | 52 +- sc/source/ui/view/output2.cxx | 37 +- sc/source/ui/view/pivotsh.cxx | 89 +- sc/source/ui/view/prevloc.cxx | 92 +- sc/source/ui/view/printfun.cxx | 142 +- sc/source/ui/view/scextopt.cxx | 3 +- sc/source/ui/view/select.cxx | 9 +- sc/source/ui/view/tabcont.cxx | 25 +- sc/source/ui/view/tabview.cxx | 34 +- sc/source/ui/view/tabview2.cxx | 25 +- sc/source/ui/view/tabview3.cxx | 23 +- sc/source/ui/view/tabvwsh4.cxx | 4 +- sc/source/ui/view/tabvwsha.cxx | 48 +- sc/source/ui/view/tabvwshb.cxx | 5 +- sc/source/ui/view/tabvwshf.cxx | 135 + sc/source/ui/view/viewdata.cxx | 83 +- sc/source/ui/view/viewfun2.cxx | 23 + sc/source/ui/view/viewfun3.cxx | 90 +- sc/source/ui/view/viewfun5.cxx | 9 +- sc/source/ui/view/viewfunc.cxx | 34 +- sc/source/ui/view/viewutil.cxx | 27 +- sc/uiconfig/scalc/menubar/menubar.xml | 2 + sc/util/hidother.src | 1 - sc/util/makefile.mk | 4 +- scp2/source/ooo/file_library_ooo.scp | 19 +- scripting/source/dlgprov/dlgprov.hxx | 2 +- scripting/source/vbaevents/eventhelper.cxx | 269 +- sd/source/ui/inc/EventMultiplexer.hxx | 9 +- sd/source/ui/inc/taskpane/TitleBar.hxx | 1 + sd/source/ui/inc/taskpane/TitledControl.hxx | 2 + sd/source/ui/toolpanel/LayoutMenu.cxx | 84 +- sd/source/ui/toolpanel/LayoutMenu.hxx | 12 + sd/source/ui/toolpanel/TitleBar.cxx | 24 +- sd/source/ui/toolpanel/TitledControl.cxx | 26 +- .../controls/CurrentMasterPagesSelector.cxx | 6 +- sd/source/ui/tools/EventMultiplexer.cxx | 12 +- sd/source/ui/unoidl/unopback.cxx | 4 +- sd/source/ui/view/GraphicObjectBar.cxx | 6 +- sd/source/ui/view/PrintManager.cxx | 17 +- sd/source/ui/view/drviews7.cxx | 3 + sfx2/inc/sfx2/filedlghelper.hxx | 3 +- sfx2/source/appl/appcfg.cxx | 13 +- sfx2/source/appl/appopen.cxx | 112 +- sfx2/source/dialog/filedlghelper.cxx | 106 +- sfx2/source/doc/SfxDocumentMetaData.cxx | 153 +- sfx2/source/doc/guisaveas.cxx | 6 +- sfx2/source/doc/objcont.cxx | 52 +- sfx2/source/doc/objxtor.cxx | 59 +- sfx2/source/doc/sfxbasemodel.cxx | 48 + sfx2/source/notify/eventsupplier.cxx | 2 +- solenv/bin/build.pl | 37 +- solenv/bin/build_client.pl | 50 +- solenv/bin/checkdll.sh | 2 +- solenv/bin/deliver.pl | 15 +- solenv/bin/installoffice.pl | 2 +- solenv/bin/mhids.pl | 4 - solenv/bin/modules/installer/control.pm | 7 +- solenv/bin/modules/installer/converter.pm | 10 - solenv/bin/modules/installer/download.pm | 12 +- solenv/bin/modules/installer/followme.pm | 7 - solenv/bin/modules/installer/globals.pm | 28 +- solenv/bin/modules/installer/parameter.pm | 2 +- solenv/bin/modules/installer/servicesfile.pm | 18 +- solenv/bin/modules/installer/systemactions.pm | 55 +- solenv/bin/modules/installer/windows/msiglobal.pm | 10 +- solenv/bin/modules/installer/windows/sign.pm | 12 +- solenv/bin/modules/packager/globals.pm | 15 +- solenv/bin/modules/par2script/globals.pm | 18 +- solenv/bin/modules/par2script/parameter.pm | 2 +- solenv/bin/modules/pre2par/globals.pm | 18 +- solenv/bin/modules/pre2par/parameter.pm | 2 +- solenv/config/sdev300.ini | 56 +- solenv/inc/_tg_app.mk | 1160 +- solenv/inc/_tg_def.mk | 500 +- solenv/inc/_tg_lib.mk | 500 +- solenv/inc/_tg_rslb.mk | 360 +- solenv/inc/_tg_scp.mk | 120 +- solenv/inc/_tg_sdi.mk | 240 +- solenv/inc/_tg_shl.mk | 2280 +- solenv/inc/_tg_srs.mk | 1310 +- solenv/inc/_tg_zip.mk | 600 +- solenv/inc/ant.mk | 12 +- solenv/inc/antsettings.mk | 16 +- solenv/inc/cppunit.mk | 2 +- solenv/inc/extension_post.mk | 86 +- solenv/inc/extension_pre.mk | 14 +- solenv/inc/javaunittest.mk | 24 +- solenv/inc/libs.mk | 14 +- solenv/inc/minor.mk | 6 +- solenv/inc/os2.mk | 6 +- solenv/inc/os2gcci.mk | 4 +- solenv/inc/pkg_config.mk | 6 +- solenv/inc/pstrules.mk | 64 +- solenv/inc/rules.mk | 537 +- solenv/inc/set_wntx64.mk | 100 +- solenv/inc/settings.mk | 305 +- solenv/inc/startup/wnt/macros.mk | 36 - solenv/inc/target.mk | 539 +- solenv/inc/tg_app.mk | 116 +- solenv/inc/tg_compv.mk | 14 +- solenv/inc/tg_config.mk | 78 +- solenv/inc/tg_def.mk | 50 +- solenv/inc/tg_dep.mk | 55 +- solenv/inc/tg_ext.mk | 225 +- solenv/inc/tg_jar.mk | 10 +- solenv/inc/tg_java.mk | 20 +- solenv/inc/tg_javav.mk | 10 +- solenv/inc/tg_lib.mk | 50 +- solenv/inc/tg_merge.mk | 14 +- solenv/inc/tg_moz.mk | 26 +- solenv/inc/tg_obj.mk | 20 +- solenv/inc/tg_res.mk | 4 +- solenv/inc/tg_rslb.mk | 36 +- solenv/inc/tg_scp.mk | 12 +- solenv/inc/tg_sdi.mk | 24 +- solenv/inc/tg_shl.mk | 228 +- solenv/inc/tg_slo.mk | 20 +- solenv/inc/tg_srs.mk | 65 +- solenv/inc/tg_wntx64.mk | 154 +- solenv/inc/tg_yxx.mk | 40 +- solenv/inc/tg_zip.mk | 60 +- solenv/inc/unitools.mk | 87 +- solenv/inc/unx.mk | 4 +- solenv/inc/unxbsdi.mk | 2 +- solenv/inc/unxbsdi2.mk | 2 +- solenv/inc/unxbsds.mk | 2 +- solenv/inc/unxfbsd.mk | 6 +- solenv/inc/unxlnga.mk | 6 +- solenv/inc/unxlngi4.mk | 4 +- solenv/inc/unxlngi6.mk | 10 +- solenv/inc/unxlngm68k.mk | 6 +- solenv/inc/unxlngmips.mk | 6 +- solenv/inc/unxlngp.mk | 2 +- solenv/inc/unxlngppc.mk | 2 +- solenv/inc/unxlngppc4.mk | 4 +- solenv/inc/unxlngr.mk | 6 +- solenv/inc/unxlngs.mk | 4 +- solenv/inc/unxlngs3904.mk | 6 +- solenv/inc/unxlngx6.mk | 6 +- solenv/inc/unxlnxi.mk | 2 +- solenv/inc/unxmacx.mk | 16 +- solenv/inc/unxsogi.mk | 2 +- solenv/inc/unxsogs.mk | 2 +- solenv/inc/unxsoli4.mk | 4 +- solenv/inc/unxsols4.mk | 4 +- solenv/inc/unxsolu4.mk | 4 +- solenv/inc/wnt.mk | 4 - solenv/inc/wntgcci6.mk | 40 +- solenv/inc/wntmsci10.mk | 16 +- solenv/inc/wntmsci11.mk | 31 +- soltools/checkdll/checkdll.c | 14 +- store/source/lockbyte.cxx | 2 +- store/workben/makefile.mk | 11 +- svtools/inc/docmspasswdrequest.hxx | 72 - svtools/inc/docpasswdrequest.hxx | 71 - svtools/inc/svtools/filter.hxx | 7 +- svtools/inc/svtools/wmf.hxx | 25 +- svtools/inc/tabbar.hxx | 5 + svtools/source/config/fltrcfg.cxx | 5 +- svtools/source/control/tabbar.cxx | 110 +- svtools/source/dialogs/addresstemplate.cxx | 25 +- svtools/source/filter.vcl/filter/filter.cxx | 10 +- svtools/source/filter.vcl/wmf/winmtf.hxx | 5 +- svtools/source/filter.vcl/wmf/winwmf.cxx | 24 +- svtools/source/filter.vcl/wmf/wmf.cxx | 4 +- svtools/source/filter.vcl/wmf/wmfwr.cxx | 11 +- svtools/source/misc1/docmspasswdrequest.cxx | 143 - svtools/source/misc1/docpasswdrequest.cxx | 142 - svtools/source/misc1/makefile.mk | 4 +- svtools/source/syslocale/syslocale.cxx | 22 +- svx/inc/svx/SmartTagMgr.hxx | 4 +- svx/inc/svx/dbcharsethelper.hxx | 69 + svx/inc/svx/dbtoolsclient.hxx | 238 + svx/inc/svx/msocximex.hxx | 2 +- svx/inc/svx/mstoolbar.hxx | 11 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.hxx | 6 +- svx/inc/svx/svdetc.hxx | 10 +- svx/inc/svx/svxacorr.hxx | 4 + svx/inc/svx/swafopt.hxx | 1 + svx/inc/svx/tstpitem.hxx | 12 +- svx/inc/svxmsbas.hxx | 8 +- svx/prj/d.lst | 2 + svx/source/cui/autocdlg.cxx | 15 + svx/source/cui/autocdlg.hrc | 1 + svx/source/cui/autocdlg.hxx | 2 + svx/source/cui/autocdlg.src | 6 +- svx/source/cui/cfg.cxx | 4 +- svx/source/cui/optgdlg.cxx | 4 +- svx/source/cui/webconninfo.cxx | 13 +- svx/source/customshapes/EnhancedCustomShape2d.cxx | 245 +- svx/source/customshapes/EnhancedCustomShape2d.hxx | 5 +- .../customshapes/EnhancedCustomShapeFontWork.cxx | 4 +- svx/source/dialog/txencbox.cxx | 2 +- svx/source/editeng/acorrcfg.cxx | 21 +- svx/source/editeng/svxacorr.cxx | 50 + svx/source/fmcomp/gridctrl.cxx | 21 +- svx/source/form/datanavi.cxx | 28 +- svx/source/form/datanavi.src | 5 +- svx/source/form/dbcharsethelper.cxx | 2 +- svx/source/form/dbtoolsclient.cxx | 2 +- svx/source/form/fmdocumentclassification.cxx | 2 +- svx/source/form/fmpgeimp.cxx | 2 +- svx/source/form/fmscriptingenv.cxx | 2 +- svx/source/form/fmtools.cxx | 2 +- svx/source/form/fmundo.cxx | 6 +- svx/source/form/formcontrolfactory.cxx | 2 +- svx/source/form/tabwin.cxx | 2 +- svx/source/inc/dbcharsethelper.hxx | 69 - svx/source/inc/dbtoolsclient.hxx | 238 - svx/source/inc/fmshimp.hxx | 2 +- svx/source/inc/sqlparserclient.hxx | 2 +- svx/source/inc/tabwin.hxx | 2 +- svx/source/inc/typeconversionclient.hxx | 2 +- svx/source/items/algitem.cxx | 100 +- svx/source/items/numitem.cxx | 22 +- svx/source/items/paraitem.cxx | 13 +- svx/source/msfilter/msdffimp.cxx | 19 +- svx/source/msfilter/msocximex.cxx | 112 +- svx/source/msfilter/mstoolbar.cxx | 105 +- svx/source/msfilter/svxmsbas.cxx | 16 +- .../sdr/contact/viewcontactofsdrobjcustomshape.cxx | 14 +- svx/source/sdr/contact/viewcontactofunocontrol.cxx | 4 +- .../sdr/contact/viewobjectcontactofunocontrol.cxx | 64 +- .../sdr/primitive2d/sdrcustomshapeprimitive2d.cxx | 16 +- svx/source/smarttags/SmartTagMgr.cxx | 18 +- svx/source/svdraw/svdedtv.cxx | 5 + svx/source/svdraw/svdetc.cxx | 28 +- svx/source/svdraw/svdfppt.cxx | 35 +- svx/source/svdraw/svdmrkv.cxx | 6 + svx/source/svdraw/svdotextdecomposition.cxx | 73 +- svx/source/svrtf/rtfgrf.cxx | 11 +- svx/source/table/cell.cxx | 13 - svx/source/table/cellcursor.cxx | 17 +- svx/source/table/tablecontroller.cxx | 41 +- svx/source/table/tablelayouter.cxx | 1 - svx/source/table/tablemodel.cxx | 14 +- sw/inc/IDocumentMarkAccess.hxx | 7 + sw/inc/IMark.hxx | 23 +- sw/inc/bookmrk.hxx | 4 +- sw/inc/breakit.hxx | 19 +- sw/inc/calc.hxx | 2 +- sw/inc/comcore.hrc | 3 +- sw/inc/crsrsh.hxx | 5 +- sw/inc/dbgoutsw.hxx | 4 +- sw/inc/doc.hxx | 29 +- sw/inc/ecmaflds.hxx | 68 + sw/inc/editsh.hxx | 10 +- sw/inc/hintids.hxx | 6 +- sw/inc/pam.hxx | 1 + sw/inc/printdata.hxx | 2 +- sw/inc/swcalwrp.hxx | 5 +- sw/inc/swtypes.hxx | 1 - sw/inc/unoobj.hxx | 9 + sw/source/core/access/accpara.cxx | 14 +- sw/source/core/access/accportions.cxx | 6 +- sw/source/core/bastyp/breakit.cxx | 37 +- sw/source/core/bastyp/calc.cxx | 12 +- sw/source/core/bastyp/init.cxx | 28 +- sw/source/core/crsr/bookmrk.cxx | 126 +- sw/source/core/crsr/callnk.cxx | 6 +- sw/source/core/crsr/crossrefbookmark.cxx | 2 +- sw/source/core/crsr/crstrvl.cxx | 11 + sw/source/core/crsr/findtxt.cxx | 2 +- sw/source/core/crsr/pam.cxx | 38 +- sw/source/core/crsr/swcrsr.cxx | 44 +- sw/source/core/doc/docbm.cxx | 60 +- sw/source/core/doc/docdde.cxx | 187 +- sw/source/core/doc/docdesc.cxx | 4 +- sw/source/core/doc/docedt.cxx | 4 +- sw/source/core/doc/docfmt.cxx | 8 +- sw/source/core/doc/docnum.cxx | 62 +- sw/source/core/doc/docruby.cxx | 6 +- sw/source/core/doc/doctxm.cxx | 2 +- sw/source/core/doc/poolfmt.cxx | 16 +- sw/source/core/docnode/ndcopy.cxx | 292 +- sw/source/core/docnode/node.cxx | 8 +- sw/source/core/edit/autofmt.cxx | 9 +- sw/source/core/edit/edattr.cxx | 16 +- sw/source/core/edit/edglbldc.cxx | 3 +- sw/source/core/edit/ednumber.cxx | 8 +- sw/source/core/edit/edtox.cxx | 22 + sw/source/core/fields/docufld.cxx | 10 +- sw/source/core/fields/fldbas.cxx | 2 +- sw/source/core/inc/GetMetricVal.hxx | 2 +- sw/source/core/inc/MarkManager.hxx | 10 + sw/source/core/inc/bookmrk.hxx | 43 +- sw/source/core/inc/crossrefbookmark.hxx | 6 +- sw/source/core/inc/frmtool.hxx | 17 +- sw/source/core/layout/flowfrm.cxx | 51 +- sw/source/core/layout/frmtool.cxx | 31 +- sw/source/core/text/guess.cxx | 6 +- sw/source/core/text/inftxt.cxx | 57 +- sw/source/core/text/itratr.cxx | 8 +- sw/source/core/text/itrcrsr.cxx | 24 +- sw/source/core/text/porfld.cxx | 14 +- sw/source/core/text/porlay.cxx | 26 +- sw/source/core/text/pormulti.cxx | 2 +- sw/source/core/text/portxt.cxx | 126 +- sw/source/core/text/redlnitr.cxx | 2 +- sw/source/core/text/txtdrop.cxx | 4 +- sw/source/core/text/txthyph.cxx | 4 +- sw/source/core/txtnode/fntcache.cxx | 8 +- sw/source/core/txtnode/fntcap.cxx | 10 +- sw/source/core/txtnode/ndtxt.cxx | 10 +- sw/source/core/txtnode/txatritr.cxx | 22 +- sw/source/core/txtnode/txtedt.cxx | 24 +- sw/source/core/undo/undo.src | 2 +- sw/source/core/unocore/unobkm.cxx | 104 +- sw/source/core/unocore/unoport.cxx | 5 +- sw/source/core/view/vprint.cxx | 3 +- sw/source/filter/html/htmlatr.cxx | 4 +- sw/source/filter/html/htmlfldw.cxx | 8 +- sw/source/filter/html/swhtml.cxx | 16 +- sw/source/filter/rtf/rtfatr.cxx | 12 +- sw/source/filter/rtf/rtffld.cxx | 4 +- sw/source/filter/ww8/writerwordglue.cxx | 10 +- sw/source/filter/ww8/wrtw8esh.cxx | 4 +- sw/source/filter/ww8/wrtw8nds.cxx | 115 +- sw/source/filter/ww8/wrtww8.cxx | 59 +- sw/source/filter/ww8/wrtww8.hxx | 2 + sw/source/filter/ww8/ww8atr.cxx | 12 +- sw/source/filter/ww8/ww8par.cxx | 54 +- sw/source/filter/ww8/ww8par.hxx | 42 +- sw/source/filter/ww8/ww8par3.cxx | 179 +- sw/source/filter/ww8/ww8par5.cxx | 111 +- sw/source/filter/ww8/ww8toolbar.cxx | 126 +- sw/source/filter/ww8/ww8toolbar.hxx | 20 +- sw/source/ui/app/docstyle.cxx | 3 +- sw/source/ui/config/usrpref.cxx | 4 +- sw/source/ui/config/viewopt.cxx | 3 +- sw/source/ui/dialog/uiregionsw.cxx | 1 + sw/source/ui/docvw/edtwin.cxx | 39 +- sw/source/ui/fldui/fldmgr.cxx | 2 +- sw/source/ui/inc/view.hxx | 4 +- sw/source/ui/inc/wrtsh.hxx | 4 + sw/source/ui/misc/pgfnote.cxx | 3 +- sw/source/ui/shells/textsh.cxx | 11 +- sw/source/ui/shells/textsh1.cxx | 34 +- sw/source/ui/uiview/view.cxx | 64 +- sw/source/ui/uiview/viewling.cxx | 136 + sw/source/ui/uno/unomod.cxx | 42 +- sw/source/ui/uno/unotxdoc.cxx | 20 +- sw/source/ui/utlui/initui.cxx | 3 +- sw/source/ui/utlui/numfmtlb.cxx | 2 +- sw/source/ui/utlui/uitool.cxx | 3 +- sw/source/ui/utlui/utlui.src | 4 + sw/source/ui/vba/vbaautotextentry.cxx | 2 +- sw/source/ui/vba/vbaborders.cxx | 2 +- sw/source/ui/vba/vbadialog.cxx | 2 +- sw/source/ui/vba/vbadocument.cxx | 3 +- sw/source/ui/vba/vbadocuments.cxx | 6 +- sw/source/ui/vba/vbafind.cxx | 6 +- sw/source/ui/vba/vbaheaderfooter.cxx | 4 +- sw/source/ui/vba/vbaoptions.cxx | 26 +- sw/source/ui/vba/vbapagesetup.cxx | 2 +- sw/source/ui/vba/vbaparagraphformat.cxx | 8 +- sw/source/ui/vba/vbarange.cxx | 2 +- sw/source/ui/vba/vbasection.cxx | 2 +- sw/source/ui/vba/vbaselection.cxx | 2 +- sw/source/ui/vba/vbastyles.cxx | 2 +- sw/source/ui/vba/vbatable.cxx | 2 +- sw/source/ui/vba/vbatables.cxx | 2 +- sw/source/ui/vba/vbatemplate.cxx | 3 +- sw/source/ui/wrtsh/wrtsh1.cxx | 100 +- sw/source/ui/wrtsh/wrtsh2.cxx | 7 + .../dbaccess/optional/includes/ctrl_Clipboard.inc | 12 - .../optional/includes/wiz_DatabaseWizard.inc | 24 +- testautomation/dbaccess/tools/dbcreatetools.inc | 2 +- .../framework/optional/f_options_ooo.bas | 1 + .../optional/includes/options_ooo_colors.inc | 212 +- .../optional/includes/options_ooo_view.inc | 16 +- .../optional/input/options/ooo_view_changed.ref | 2 +- .../optional/input/options/ooo_view_defaults.ref | 2 +- testautomation/framework/required/f_first.bas | 4 + .../required/includes/standard_toolbar_3.inc | 215 +- .../framework/required/input/mailmerge_data.odb | Bin 3527 -> 3524 bytes .../framework/tools/includes/options_tools.inc | 54 +- .../tools/includes/optional/t_basic_ide_tools.inc | 6 +- .../global/tools/includes/optional/t_docfuncs.inc | 177 +- .../global/tools/includes/required/t_doc1.inc | 29 +- .../global/tools/includes/required/t_filters.inc | 2 +- .../global/tools/includes/required/t_tools1.inc | 34 +- testautomation/global/win/edia_d_h.win | 1 + testautomation/global/win/etab_e_g.win | 2 +- .../graphics/optional/g_autocorrection.bas | 1 - testautomation/graphics/optional/g_insert.bas | 3 +- testautomation/graphics/optional/g_tables.bas | 2 +- .../optional/includes/global/export_graphic_2.inc | 101 +- .../graphics/optional/includes/global/g_insert.inc | 3 +- .../optional/includes/impress/i_pengine.inc | 1 - .../optional/includes/impress/i_pengine2.inc | 1 - .../optional/includes/impress/i_us_present.inc | 3 +- .../required/includes/impress/i_opt_1_.inc | 2 +- .../graphics/required/includes/impress/im_002_.inc | 8 +- .../graphics/required/includes/impress/im_003_.inc | 246 +- .../graphics/required/includes/impress/im_004_.inc | 16 +- .../graphics/required/includes/impress/im_005_.inc | 29 +- .../graphics/required/includes/impress/im_007_.inc | 730 +- .../graphics/required/includes/impress/im_011_.inc | 357 +- .../required/includes/c_upd_insertmenu.inc | 2 + .../writer/optional/includes/fields/w_fields1.inc | 28 +- .../writer/optional/includes/fields/w_fields2.inc | 48 +- .../writer/optional/includes/fields/w_fields3.inc | 68 +- .../writer/optional/includes/fields/w_fields4.inc | 50 +- .../writer/optional/includes/fields/w_fields5.inc | 52 +- .../writer/optional/includes/fields/w_fields6.inc | 54 +- .../writer/optional/includes/fields/w_fields7.inc | 12 +- .../includes/insertgraphic/w_insertgraphic5.inc | 2 - .../optional/includes/loadsave/w_loadsave.inc | 44 +- .../writer/optional/includes/option/wh_o_1.inc | 2 + .../writer/optional/includes/option/wh_o_2.inc | 1 + .../optional/includes/redlining/w_redlining1.inc | 3 - .../writer/optional/includes/stylist/w_stylist.inc | 2041 +- .../optional/includes/textframes/w_textframes2.inc | 37 +- .../optional/includes/textframes/w_textframes3.inc | 61 +- testautomation/writer/optional/w_fields.bas | 2 +- testautomation/writer/optional/w_textframes.bas | 2 - testautomation/writer/required/includes/w_001_.inc | 6 +- .../writer/required/includes/w_005b_.inc | 9 +- testautomation/writer/tools/includes/w_tool6.inc | 1 - testautomation/writer/tools/includes/w_tools.inc | 46 +- testtools/source/bridgetest/idl/makefile.mk | 6 + .../cliversioning/version_libs/version_3_1_1.dll | Bin 0 -> 11776 bytes testtools/util/makefile.pmk | 2 +- toolkit/inc/toolkit/awt/vclxwindows.hxx | 6 + toolkit/inc/toolkit/controls/dialogcontrol.hxx | 2 +- toolkit/inc/toolkit/controls/unocontrols.hxx | 2 +- toolkit/source/awt/vclxmenu.cxx | 4 +- toolkit/source/awt/vclxwindows.cxx | 40 +- toolkit/source/controls/dialogcontrol.cxx | 28 +- .../com/sun/star/script/XAutomationInvocation.idl | 51 + udkapi/com/sun/star/script/makefile.mk | 1 + unoil/climaker/version.txt | 6 +- vbahelper/source/msforms/makefile.mk | 2 + vbahelper/source/msforms/vbacontrol.cxx | 24 +- vbahelper/source/msforms/vbaframe.cxx | 11 + vbahelper/source/msforms/vbaframe.hxx | 4 + vbahelper/source/msforms/vbalabel.cxx | 15 + vbahelper/source/msforms/vbalabel.hxx | 4 + vbahelper/source/msforms/vbalistbox.cxx | 12 +- vbahelper/source/msforms/vbalistbox.hxx | 4 +- vbahelper/source/msforms/vbatextbox.cxx | 3 +- vbahelper/source/msforms/vbatogglebutton.cxx | 21 +- vbahelper/source/vbahelper/vbafontbase.cxx | 2 +- vbahelper/source/vbahelper/vbahelper.cxx | 3 +- vbahelper/source/vbahelper/vbapictureformat.cxx | 9 +- vbahelper/source/vbahelper/vbashapes.cxx | 2 +- vcl/aqua/inc/salframe.h | 86 +- vcl/aqua/source/app/salinst.cxx | 14 +- vcl/aqua/source/gdi/salbmp.cxx | 24 +- vcl/aqua/source/window/salframe.cxx | 23 + vcl/inc/vcl/bitmapex.hxx | 1 + vcl/inc/vcl/dialog.hxx | 4 + vcl/inc/vcl/menu.hxx | 2 + vcl/inc/vcl/popupmenuwindow.hxx | 50 + vcl/inc/vcl/settings.hxx | 5 + vcl/inc/vcl/toolbox.hxx | 3 + vcl/inc/vcl/vclevent.hxx | 18 + vcl/inc/vcl/window.h | 3 +- vcl/inc/vcl/window.hxx | 9 +- vcl/os2/source/window/salframe.cxx | 1 + vcl/prj/build.lst | 2 +- vcl/prj/d.lst | 1 + vcl/source/app/settings.cxx | 3 + vcl/source/app/vclevent.cxx | 14 + vcl/source/control/combobox.cxx | 15 +- vcl/source/gdi/bitmapex.cxx | 56 + vcl/source/gdi/outdev3.cxx | 91 +- vcl/source/gdi/pdfwriter_impl.cxx | 11 +- vcl/source/window/dialog.cxx | 7 + vcl/source/window/makefile.mk | 7 +- vcl/source/window/menu.cxx | 14 +- vcl/source/window/popupmenuwindow.cxx | 82 + vcl/source/window/toolbox.cxx | 101 +- vcl/source/window/toolbox2.cxx | 2 + vcl/source/window/window.cxx | 29 +- vcl/unx/gtk/a11y/atkutil.cxx | 11 +- vcl/unx/gtk/a11y/atkwindow.cxx | 41 +- vcl/unx/gtk/a11y/atkwrapper.cxx | 54 + vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 32 +- vcl/unx/kde/salnativewidgets-kde.cxx | 1 + vcl/unx/kde4/KDEData.cxx | 2 + vcl/unx/kde4/KDESalFrame.cxx | 1 + vcl/unx/kde4/KDESalGraphics.cxx | 129 +- vcl/unx/source/app/sm.cxx | 47 +- vcl/unx/source/gdi/cdeint.cxx | 1 + vcl/unx/source/gdi/makefile.mk | 4 +- vcl/unx/source/gdi/salgdi.cxx | 83 +- vcl/unx/source/plugadapt/salplug.cxx | 4 +- vcl/win/source/window/salframe.cxx | 1 + writerfilter/source/filter/ImportFilter.cxx | 42 +- writerfilter/util/makefile.mk | 5 +- xmloff/inc/xmloff/ecmaflds.hxx | 68 + xmloff/inc/xmloff/nmspmap.hxx | 5 + xmloff/inc/xmloff/xmlaustp.hxx | 4 + xmloff/source/chart/SchXMLChartContext.cxx | 51 - xmloff/source/draw/shapeexport2.cxx | 2 +- xmloff/source/style/impastp3.cxx | 40 + xmloff/source/style/impastp4.cxx | 41 + xmloff/source/style/impastpl.hxx | 8 + xmloff/source/style/xmlaustp.cxx | 7 + xmloff/source/text/XMLTextMarkImportContext.cxx | 47 +- xmloff/source/text/txtimp.cxx | 54 +- xmloff/source/text/txtparae.cxx | 29 +- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 14 +- xmlscript/util/makefile.mk | 2 +- xmlscript/util/makefile.mk.patched | 81 + .../xmlsec/nss/securityenvironment_nssimpl.cxx | 11 +- 2283 files changed, 192131 insertions(+), 187102 deletions(-) create mode 100644 applied_patches/0004-cws-koheidatapilot03-accessibility.diff create mode 100644 applied_patches/0005-cws-koheidatapilot03-offapi.diff create mode 100644 applied_patches/0006-cws-koheidatapilot03-sc.diff create mode 100644 applied_patches/0007-cws-koheidatapilot03-vcl.diff create mode 100644 applied_patches/0008-cws-koheidatapilot03-xmloff.diff create mode 100644 applied_patches/0009-cws-koheicsvimport-filter.diff create mode 100644 applied_patches/0010-cws-koheicsvimport-officecfg.diff create mode 100644 applied_patches/0011-cws-koheicsvimport-sc.diff create mode 100644 applied_patches/0012-cws-kohei03-chart2.diff create mode 100644 applied_patches/0013-cws-kohei03-sc.diff create mode 100644 applied_patches/0014-cws-calctabcolor-filter.diff delete mode 100644 applied_patches/0014-sc-dataform-sc.diff create mode 100644 applied_patches/0015-cws-calctabcolor-officecfg.diff delete mode 100644 applied_patches/0015-sc-dataform-officecfg.diff create mode 100644 applied_patches/0016-cws-calctabcolor-oox.diff delete mode 100644 applied_patches/0016-sc-dataform-suppor-vba.diff create mode 100644 applied_patches/0017-cws-calctabcolor-sc.diff create mode 100644 applied_patches/0018-cws-calctabcolor-svtools.diff rename applied_patches/{0004-speed-configmgr.diff => 0019-speed-configmgr.diff} (100%) rename applied_patches/{0005-ok-cancel-btn-add-accel.diff => 0020-ok-cancel-btn-add-accel.diff} (100%) rename applied_patches/{0006-makefile-idl-build.diff => 0021-makefile-idl-build.diff} (100%) rename applied_patches/{0007-speed-pagein.diff => 0022-speed-pagein.diff} (100%) rename applied_patches/{0008-testtool-more-defaults.diff => 0023-testtool-more-defaults.diff} (100%) rename applied_patches/{0009-plus-minus-sw-navigator.diff => 0024-plus-minus-sw-navigator.diff} (100%) rename applied_patches/{0010-plus-minus-sw-navigator2.diff => 0025-plus-minus-sw-navigator2.diff} (100%) delete mode 100644 applied_patches/0025-quiet-build.diff rename applied_patches/{0011-dbaccess-default-varchar-lenght.diff => 0026-dbaccess-default-varchar-lenght.diff} (100%) delete mode 100644 applied_patches/0026-quiet-build-more.diff rename applied_patches/{0012-linkoo-type.diff => 0027-linkoo-type.diff} (100%) rename applied_patches/{0013-selection-crash-svx-svdmrkv.diff => 0028-selection-crash-svx-svdmrkv.diff} (100%) rename applied_patches/{0017-sal-doublefree.diff => 0029-sal-doublefree.diff} (100%) rename applied_patches/{0018-sw-graphic-save-problem.diff => 0030-sw-graphic-save-problem.diff} (100%) rename applied_patches/{0019-sal-strintern-speed.diff => 0031-sal-strintern-speed.diff} (100%) rename applied_patches/{0020-sal-strintern-speed-fix.diff => 0032-sal-strintern-speed-fix.diff} (100%) rename applied_patches/{0021-fix-linkoo.diff => 0033-fix-linkoo.diff} (100%) rename applied_patches/{0022-fix-gtk-a11y.diff => 0034-fix-gtk-a11y.diff} (100%) rename applied_patches/{0023-fix-gtk-a11y-gail-version-warning.diff => 0035-fix-gtk-a11y-gail-version-warning.diff} (100%) rename applied_patches/{0024-linkoo-dev300.diff => 0036-linkoo-dev300.diff} (100%) rename applied_patches/{0027-writerfilter-qnametostr-NOOPTFILES.diff => 0037-writerfilter-qnametostr-NOOPTFILES.diff} (100%) rename applied_patches/{0028-sc-cellsuno-avoid-early-destruction.diff => 0038-sc-cellsuno-avoid-early-destruction.diff} (100%) rename applied_patches/{0029-speed-sal-fewer-lstats.diff => 0039-speed-sal-fewer-lstats.diff} (100%) rename applied_patches/{0030-cjk-character-units-imp.diff => 0040-cjk-character-units-imp.diff} (100%) rename applied_patches/{0031-sw-default-cjk-fontsize.diff => 0041-sw-default-cjk-fontsize.diff} (100%) rename applied_patches/{0032-cjk-character-units-ui.diff => 0042-cjk-character-units-ui.diff} (100%) delete mode 100644 applied_patches/0043-basic-add-missing-includes-after-cws-npower10.diff rename applied_patches/{0033-cjk-character-units-rulers-sync-with-pggrid-fix.diff => 0043-cjk-character-units-rulers-sync-with-pggrid-fix.diff} (100%) rename applied_patches/{0034-cjk-character-units-fix.diff => 0044-cjk-character-units-fix.diff} (100%) delete mode 100644 applied_patches/0044-vba-show-data-form-link-fix.diff rename applied_patches/{0035-cjk-character-units-fix-376788.diff => 0045-cjk-character-units-fix-376788.diff} (100%) rename applied_patches/{0036-cjk-character-units-in-pggrid-fix.diff => 0046-cjk-character-units-in-pggrid-fix.diff} (100%) rename applied_patches/{0037-wpsimport-config_office.diff => 0047-wpsimport-config_office.diff} (100%) rename applied_patches/{0038-wpsimport-filter.diff => 0048-wpsimport-filter.diff} (100%) rename applied_patches/{0039-wpsimport-scp2.diff => 0049-wpsimport-scp2.diff} (100%) rename applied_patches/{0040-wpsimport-writerperfect.diff => 0050-wpsimport-writerperfect.diff} (100%) rename applied_patches/{0041-libwps.diff => 0051-libwps.diff} (100%) rename applied_patches/{0042-wps-registry.diff => 0052-wps-registry.diff} (100%) rename applied_patches/{0045-libwpg.diff => 0053-libwpg.diff} (100%) rename applied_patches/{0046-wpgimporter.diff => 0054-wpgimporter.diff} (100%) rename applied_patches/{0047-jvmfwk-gij-paths.diff => 0055-jvmfwk-gij-paths.diff} (100%) rename applied_patches/{0048-buildfix-qadevOOo-java-encoding.diff => 0056-buildfix-qadevOOo-java-encoding.diff} (100%) rename applied_patches/{0049-debug-bits.diff => 0057-debug-bits.diff} (100%) rename applied_patches/{0050-gui-sw-scroll.diff => 0058-gui-sw-scroll.diff} (100%) delete mode 100644 applied_patches/0058-vba-default-enable-calcmacros.diff delete mode 100644 applied_patches/0059-vba-ide-choose-macro-to-run.diff rename applied_patches/{0051-vcl-menu-fixes.diff => 0059-vcl-menu-fixes.diff} (100%) rename applied_patches/{0052-uses-vfs.diff => 0060-uses-vfs.diff} (100%) rename applied_patches/{0053-buildfix-x86-64-visibility-workaround.diff => 0061-buildfix-x86-64-visibility-workaround.diff} (100%) rename applied_patches/{0054-redirect-extensions.diff => 0062-redirect-extensions.diff} (100%) rename applied_patches/{0055-libwpd.diff => 0063-libwpd.diff} (100%) rename applied_patches/{0056-writerperfect-nocondensedparagraphs.diff => 0064-writerperfect-nocondensedparagraphs.diff} (100%) rename applied_patches/{0057-offapi-typecheck-whitelist.diff => 0065-offapi-typecheck-whitelist.diff} (100%) rename applied_patches/{0060-build-ant-1.6.diff => 0066-build-ant-1.6.diff} (100%) rename applied_patches/{0061-buildfix-fmtargs.diff => 0067-buildfix-fmtargs.diff} (100%) rename applied_patches/{0062-nsplugin-path.diff => 0068-nsplugin-path.diff} (100%) rename applied_patches/{0063-printing-bugfix-254573.diff => 0069-printing-bugfix-254573.diff} (100%) rename applied_patches/{0064-sd-toolbar-advanced-shapes.diff => 0070-sd-toolbar-advanced-shapes.diff} (100%) rename applied_patches/{0065-svx-shapes-default-word-wrap-enable.diff => 0071-svx-shapes-default-word-wrap-enable.diff} (100%) rename applied_patches/{0066-svx-honour-customshape-capabilities.diff => 0072-svx-honour-customshape-capabilities.diff} (100%) rename applied_patches/{0067-check-buttons-rendering-fix.diff => 0073-check-buttons-rendering-fix.diff} (100%) rename applied_patches/{0068-padmin-nofontconfig.diff => 0074-padmin-nofontconfig.diff} (100%) rename applied_patches/{0069-wizards-source-importwizard-filesmodul-xba.diff => 0075-wizards-source-importwizard-filesmodul-xba.diff} (100%) rename applied_patches/{0070-automation-testtool-oobuildfix.diff => 0076-automation-testtool-oobuildfix.diff} (100%) rename applied_patches/{0071-helpcontent2-auxiliary-cfg.diff => 0077-helpcontent2-auxiliary-cfg.diff} (100%) rename applied_patches/{0072-desktop-safer-user-dir-perm.diff => 0078-desktop-safer-user-dir-perm.diff} (100%) rename applied_patches/{0073-desktop-application-octet-stream-mime-type.diff => 0079-desktop-application-octet-stream-mime-type.diff} (100%) delete mode 100644 applied_patches/0079-new-SQLLEN.diff rename applied_patches/{0074-xmlsecurity-verify-usages.diff => 0080-xmlsecurity-verify-usages.diff} (100%) rename applied_patches/{0075-jvmfwk-modified-javavendors-xml.diff => 0081-jvmfwk-modified-javavendors-xml.diff} (100%) rename applied_patches/{0076-libxmlsec-findcerts.diff => 0082-libxmlsec-findcerts.diff} (100%) rename applied_patches/{0077-sfx2-check-existing-template-dirs.diff => 0083-sfx2-check-existing-template-dirs.diff} (100%) rename applied_patches/{0078-vcl-kerning-fix.diff => 0084-vcl-kerning-fix.diff} (100%) create mode 100644 applied_patches/0085-new-SQLLEN.diff rename applied_patches/{0080-jpegc.c.diff => 0086-jpegc.c.diff} (100%) delete mode 100644 applied_patches/0087-save-doc-withembedded-doc-with-vba-crash.diff rename applied_patches/{0081-tools-urlobj-smb-scheme-patch.diff => 0087-tools-urlobj-smb-scheme-patch.diff} (100%) rename applied_patches/{0082-samba-hyperlinks-sc-sd.diff => 0088-samba-hyperlinks-sc-sd.diff} (100%) rename applied_patches/{0083-tools-qa-urlobj-unittest.diff => 0089-tools-qa-urlobj-unittest.diff} (100%) delete mode 100644 applied_patches/0089-win32-invalid-names.diff rename applied_patches/{0084-svx-text-rotation-fix.diff => 0090-svx-text-rotation-fix.diff} (100%) rename applied_patches/{0085-sfx-check-real-help-path.diff => 0091-sfx-check-real-help-path.diff} (100%) rename applied_patches/{0086-xmlhelp-work-with-symlinks.diff => 0092-xmlhelp-work-with-symlinks.diff} (100%) rename applied_patches/{0088-localize-pl-cygwin-paths.diff => 0093-localize-pl-cygwin-paths.diff} (100%) create mode 100644 applied_patches/0094-win32-invalid-names.diff delete mode 100644 applied_patches/0095-forms-radio-button-group-names.diff create mode 100644 applied_patches/0095-openldap-i105016.diff rename applied_patches/{0090-customunittext-pixel.diff => 0096-customunittext-pixel.diff} (100%) delete mode 100644 applied_patches/0096-xl-import-formradiobutton.diff rename applied_patches/{0091-customunittext-percent.diff => 0097-customunittext-percent.diff} (100%) delete mode 100644 applied_patches/0097-dialog-groupname-persist.diff rename applied_patches/{0092-i93000.diff => 0098-i93000.diff} (100%) rename applied_patches/{0093-padmin-dialog-resize.diff => 0099-padmin-dialog-resize.diff} (100%) rename applied_patches/{0094-sw-dialogs-resize.diff => 0100-sw-dialogs-resize.diff} (100%) rename applied_patches/{0098-webdav-locking-from-ooo-build-2-4-1.diff => 0101-webdav-locking-from-ooo-build-2-4-1.diff} (100%) rename applied_patches/{0099-webdav-locking-local-temp-file.diff => 0102-webdav-locking-local-temp-file.diff} (100%) rename applied_patches/{0100-gnome-vfs-locking-config_office.diff => 0103-gnome-vfs-locking-config_office.diff} (100%) rename applied_patches/{0101-gnome-vfs-locking-ucb.diff => 0104-gnome-vfs-locking-ucb.diff} (100%) rename applied_patches/{0102-gnome-vfs-late-init.diff => 0105-gnome-vfs-late-init.diff} (100%) rename applied_patches/{0103-unxsplash-rework.diff => 0106-unxsplash-rework.diff} (100%) rename applied_patches/{0104-hack-readd-GetStringParam.diff => 0107-hack-readd-GetStringParam.diff} (100%) rename applied_patches/{0105-unxsplash-new-osl-pipe.diff => 0108-unxsplash-new-osl-pipe.diff} (100%) rename applied_patches/{0106-unxsplash-new-osl-pipe-slot.diff => 0109-unxsplash-new-osl-pipe-slot.diff} (100%) rename applied_patches/{0107-unxsplash-finish-on-hangup.diff => 0110-unxsplash-finish-on-hangup.diff} (100%) rename applied_patches/{0108-unxsplash-rpath.diff => 0111-unxsplash-rpath.diff} (100%) rename applied_patches/{0109-unxsplash-3layer.diff => 0112-unxsplash-3layer.diff} (100%) delete mode 100644 applied_patches/0113-csv-import-preserve-options-sc.diff rename applied_patches/{0110-unxsplash-bmp-alias.diff => 0113-unxsplash-bmp-alias.diff} (100%) delete mode 100644 applied_patches/0114-csv-import-preserve-options-officecfg.diff rename applied_patches/{0111-sw-html-insert-unknown-tags.diff => 0114-sw-html-insert-unknown-tags.diff} (100%) delete mode 100644 applied_patches/0115-gcc4-visibility-sc.diff rename applied_patches/{0112-sw-ww8-field-fix.diff => 0115-sw-ww8-field-fix.diff} (100%) rewrite applied_patches/0118-sc-datapilot-autoformat.diff (79%) rewrite applied_patches/0122-sc-dp-gridlayout.diff (88%) rewrite applied_patches/0128-sc-natural-sort.diff (61%) rename applied_patches/{0134-sc-drwlayer-units.diff => 0133-sc-drwlayer-units.diff} (100%) delete mode 100644 applied_patches/0133-vba-sc-autoshapes-hyperlinks.diff rename applied_patches/{0135-sc-overwrite-char-font-attrs.diff => 0134-sc-overwrite-char-font-attrs.diff} (100%) create mode 100644 applied_patches/0135-calc-filter-by-date-strip-time.diff rewrite applied_patches/0139-sc-paste-on-enter.diff (80%) delete mode 100644 applied_patches/0140-calc-multi-range-copy-paste.diff rename applied_patches/{0141-sc-print-selected-sheets.diff => 0140-sc-print-selected-sheets.diff} (100%) rename applied_patches/{0143-sc-print-lines.diff => 0141-sc-print-lines.diff} (100%) delete mode 100644 applied_patches/0142-sc-biffdump.diff create mode 100644 applied_patches/0142-sc-dbrange-dynamic-resize.diff rename applied_patches/{0145-sc-cellbackground-over-gridlines.diff => 0143-sc-cellbackground-over-gridlines.diff} (100%) rename applied_patches/{0146-sc-cellformat-icon-toggle.diff => 0144-sc-cellformat-icon-toggle.diff} (100%) delete mode 100644 applied_patches/0144-sc-dbrange-dynamic-resize.diff rename applied_patches/{0147-sc-fit-to-width-height-skip-breaks.diff => 0145-sc-fit-to-width-height-skip-breaks.diff} (100%) rename applied_patches/{0148-chart-skip-hidden-cells-sc-fix.diff => 0146-chart-skip-hidden-cells-sc-fix.diff} (100%) rename applied_patches/{0151-calc-filter-xml-free-context.diff => 0147-calc-filter-xml-free-context.diff} (100%) rename applied_patches/{0152-calc-status-bar-func.diff => 0148-calc-status-bar-func.diff} (100%) create mode 100644 applied_patches/0149-calc-dp-default-new-sheet.diff delete mode 100644 applied_patches/0149-chart-axis-multi-chart-types-chart2.diff rename applied_patches/{0158-calc-menu-manual-page-break.diff => 0150-calc-menu-manual-page-break.diff} (100%) delete mode 100644 applied_patches/0150-chart-axis-multi-chart-types-xmloff.diff create mode 100644 applied_patches/0151-sc-sheet-gridline-toggle.diff create mode 100644 applied_patches/0152-calc-formula-variable-separators-sc.diff delete mode 100644 applied_patches/0153-calc-dp-custom-names-offapi.diff rename applied_patches/{0431-calc-formula-variable-separators-svx.diff => 0153-calc-formula-variable-separators-svx.diff} (100%) delete mode 100644 applied_patches/0154-calc-dp-custom-names-sc.diff rename applied_patches/{0432-calc-formula-variable-separators-officecfg.diff => 0154-calc-formula-variable-separators-officecfg.diff} (100%) delete mode 100644 applied_patches/0155-calc-dp-custom-names-sc-win32-fix.diff rename applied_patches/{0433-chart-subtitle-xls-export.diff => 0155-chart-subtitle-xls-export.diff} (100%) delete mode 100644 applied_patches/0156-calc-dp-custom-names-sc-group-fix.diff rename applied_patches/{0434-calc-external-defined-names-enable.diff => 0156-calc-external-defined-names-enable.diff} (100%) delete mode 100644 applied_patches/0157-calc-dp-default-new-sheet.diff rename applied_patches/{0435-calc-xls-disable-adjust-row-height.diff => 0157-calc-xls-disable-adjust-row-height.diff} (100%) rename applied_patches/{0436-calc-grammar-xls-english-offapi.diff => 0158-calc-grammar-xls-english-offapi.diff} (100%) rename applied_patches/{0437-calc-grammar-xls-english-sc.diff => 0159-calc-grammar-xls-english-sc.diff} (100%) delete mode 100644 applied_patches/0159-fix-biffdumper.diff create mode 100644 applied_patches/0160-calc-find-replace-empty-cells-sc.diff create mode 100644 applied_patches/0161-calc-find-replace-empty-cells-svx.diff create mode 100644 applied_patches/0162-calc-enhanced-merge-cells-sc.diff rename applied_patches/{0442-calc-enhanced-merge-cells-officecfg.diff => 0163-calc-enhanced-merge-cells-officecfg.diff} (100%) rename applied_patches/{0443-calc-filter-dbf-precision.diff => 0164-calc-filter-dbf-precision.diff} (100%) rename applied_patches/{0444-calc-autoinput-case-insensitive-matching.diff => 0165-calc-autoinput-case-insensitive-matching.diff} (100%) rename applied_patches/{0450-calc-jump-on-formula-ref-offapi.diff => 0166-calc-jump-on-formula-ref-offapi.diff} (100%) rename applied_patches/{0451-calc-jump-on-formula-ref-officecfg.diff => 0167-calc-jump-on-formula-ref-officecfg.diff} (100%) create mode 100644 applied_patches/0168-calc-jump-on-formula-ref-sc.diff rename applied_patches/{0453-calc-jump-on-formula-ref-sfx2.diff => 0169-calc-jump-on-formula-ref-sfx2.diff} (100%) rename applied_patches/{0454-calc-jump-on-formula-ref-vcl.diff => 0170-calc-jump-on-formula-ref-vcl.diff} (100%) create mode 100644 applied_patches/0171-calc-ods-sheet-protection-sc.diff rename applied_patches/{0457-calc-ods-sheet-protection-xmloff.diff => 0172-calc-ods-sheet-protection-xmloff.diff} (100%) rename applied_patches/{0458-calc-ods-sheet-protection-svtools.diff => 0173-calc-ods-sheet-protection-svtools.diff} (100%) create mode 100644 applied_patches/0174-calc-selection-fixed-cursor.diff rename applied_patches/{0462-calc-cursor-split-view.diff => 0175-calc-cursor-split-view.diff} (100%) create mode 100644 applied_patches/0176-calc-autofilter-shrink-selection.diff create mode 100644 applied_patches/0177-calc-xls-import-array-size.diff create mode 100644 applied_patches/0178-calc-html-csv-import-force-text-cell.diff create mode 100644 applied_patches/0179-calc-find-replace-skip-filtered.diff create mode 100644 applied_patches/0180-calc-getpivotdata-force-interpret-formula.diff create mode 100644 applied_patches/0181-calc-combo-listbox-export-fix.diff create mode 100644 applied_patches/0182-calc-selection-protected-cells.diff rename applied_patches/{0684-calc-increase-row-limit.diff => 0183-calc-increase-row-limit.diff} (100%) rename applied_patches/{0685-calc-odf-export-autostyle-maxrow.diff => 0184-calc-odf-export-autostyle-maxrow.diff} (100%) rename applied_patches/{0686-calc-perf-flat-segment-tree.diff => 0185-calc-perf-flat-segment-tree.diff} (100%) create mode 100644 applied_patches/0186-calc-perf-ods-import-properties.diff rename applied_patches/{0688-calc-row-limit-bad-ushort.diff => 0187-calc-row-limit-bad-ushort.diff} (100%) create mode 100644 applied_patches/0188-calc-perf-page-and-manual-breaks.diff create mode 100644 applied_patches/0189-calc-perf-table-hidden-flags.diff rename applied_patches/{0689-calc-ods-export-no-more-ushort.diff => 0190-calc-ods-export-no-more-ushort.diff} (100%) rename applied_patches/{0690-calc-perf-sort.diff => 0191-calc-perf-sort.diff} (100%) create mode 100644 applied_patches/0192-calc-perf-lazy-overlay-objects.diff create mode 100644 applied_patches/0193-calc-perf-copy-table-flags.diff rename applied_patches/{0691-calc-perf-rowheight-no-progress-bar.diff => 0194-calc-perf-rowheight-no-progress-bar.diff} (100%) rename applied_patches/{0160-speed-local-link-except.diff => 0195-speed-local-link-except.diff} (100%) rename applied_patches/{0161-speed-local-link-except-offuh.diff => 0196-speed-local-link-except-offuh.diff} (100%) rename applied_patches/{0162-speed-local-link.diff => 0197-speed-local-link.diff} (100%) rename applied_patches/{0163-fpicker-kde-gcc4-visibility.diff => 0198-fpicker-kde-gcc4-visibility.diff} (100%) rename applied_patches/{0164-gui-sw-insert-symbol.diff => 0199-gui-sw-insert-symbol.diff} (100%) rename applied_patches/{0165-addrbk-datasrc-ordering.diff => 0200-addrbk-datasrc-ordering.diff} (100%) rename applied_patches/{0166-svtools-default-new-document.diff => 0201-svtools-default-new-document.diff} (100%) rename applied_patches/{0167-context-autocomplete.diff => 0202-context-autocomplete.diff} (100%) rename applied_patches/{0168-svtools-unsort-template-dialogentries.diff => 0203-svtools-unsort-template-dialogentries.diff} (100%) rename applied_patches/{0169-desktop-cmdhelp-stdout.diff => 0204-desktop-cmdhelp-stdout.diff} (100%) rename applied_patches/{0170-always-allow-save-document-sfx2.diff => 0205-always-allow-save-document-sfx2.diff} (100%) rename applied_patches/{0171-always-allow-save-document-sc.diff => 0206-always-allow-save-document-sc.diff} (100%) rename applied_patches/{0172-scroll-accel-sc.diff => 0207-scroll-accel-sc.diff} (100%) rename applied_patches/{0173-scroll-accel-vcl.diff => 0208-scroll-accel-vcl.diff} (100%) rename applied_patches/{0174-min-password-length-sfx2.diff => 0209-min-password-length-sfx2.diff} (100%) rename applied_patches/{0175-document-password-change-sfx2.diff => 0210-document-password-change-sfx2.diff} (100%) rename applied_patches/{0176-sfx2-remove-check-update-on-fileload.diff => 0211-sfx2-remove-check-update-on-fileload.diff} (100%) rename applied_patches/{0177-desktop-disable-startup-registration.diff => 0212-desktop-disable-startup-registration.diff} (100%) rename applied_patches/{0178-go-oo-team.diff => 0213-go-oo-team.diff} (100%) rename applied_patches/{0179-corporate-dictionary.diff => 0214-corporate-dictionary.diff} (100%) delete mode 100644 applied_patches/0214-session-management.diff rename applied_patches/{0180-novell-palette.diff => 0215-novell-palette.diff} (100%) rename applied_patches/{0181-solenv-really-use-unsinged-char-on-ppc.diff => 0216-solenv-really-use-unsinged-char-on-ppc.diff} (100%) rename applied_patches/{0182-sc-default-delete-backspace-key.diff => 0217-sc-default-delete-backspace-key.diff} (100%) rename applied_patches/{0183-desktop-config-migration.diff => 0218-desktop-config-migration.diff} (100%) rename applied_patches/{0184-help-support.diff => 0219-help-support.diff} (100%) rename applied_patches/{0185-scp2-user-config-ooo3.diff => 0220-scp2-user-config-ooo3.diff} (100%) rename applied_patches/{0186-pushfont-psstream.diff => 0221-pushfont-psstream.diff} (100%) rename applied_patches/{0187-split-icons-search-usr-share.diff => 0222-split-icons-search-usr-share.diff} (100%) rename applied_patches/{0188-novell-win32-agfa-monotype-fonts.diff => 0223-novell-win32-agfa-monotype-fonts-m59.diff} (100%) rename applied_patches/{0189-build-java-target.diff => 0224-build-java-target-m59.diff} (100%) rename applied_patches/{0190-solenv-installer-cleaner-paths.diff => 0225-solenv-installer-cleaner-paths.diff} (100%) rename applied_patches/{0191-solenv-installer-lang-filelist-names.diff => 0226-solenv-installer-lang-filelist-names.diff} (100%) rename applied_patches/{0192-installer-get-path-correctly.diff => 0227-installer-get-path-correctly.diff} (100%) rename applied_patches/{0193-build-prebuilt-stax.diff => 0228-build-prebuilt-stax.diff} (100%) rename applied_patches/{0194-ucb-neon-0.24.diff => 0229-ucb-neon-0.24.diff} (100%) rename applied_patches/{0196-dmake-space-in-envvar-name.diff => 0230-dmake-space-in-envvar-name.diff} (100%) create mode 100644 applied_patches/0231-armeabi-softfp-buildfix.diff delete mode 100644 applied_patches/0231-buildfix-vba-as-extn.diff create mode 100644 applied_patches/0232-db4.8.diff rename applied_patches/{0195-postset-add-ro.diff => 0233-postset-add-ro.diff} (100%) rename applied_patches/{0197-recovery-report.diff => 0234-recovery-report.diff} (100%) rename applied_patches/{0198-default-no-startup-wizard.diff => 0235-default-no-startup-wizard.diff} (100%) rename applied_patches/{0199-default-no-style-dialog.diff => 0236-default-no-style-dialog.diff} (100%) rename applied_patches/{0200-default-no-registration.diff => 0237-default-no-registration.diff} (100%) rename applied_patches/{0201-tango-prefer-over-industrial.diff => 0238-tango-prefer-over-industrial.diff} (100%) rename applied_patches/{0202-default-no-registration-menu.diff => 0239-default-no-registration-menu.diff} (100%) rename applied_patches/{0203-default-no-registration-menu-sd.diff => 0240-default-no-registration-menu-sd.diff} (100%) rename applied_patches/{0204-scp2-3layer-nicer-paths.diff => 0241-scp2-3layer-nicer-paths.diff} (100%) rename applied_patches/{0205-default-system-fpicker.diff => 0242-default-system-fpicker.diff} (100%) rename applied_patches/{0206-default-font-aasize.diff => 0243-default-font-aasize.diff} (100%) rename applied_patches/{0207-default-font-size.diff => 0244-default-font-size.diff} (100%) rename applied_patches/{0208-default-ms-filter-convert.diff => 0245-default-ms-filter-convert.diff} (100%) rename applied_patches/{0209-writer-default-as-optimal-page-wrap.diff => 0246-writer-default-as-optimal-page-wrap.diff} (100%) rename applied_patches/{0210-vfs-kde-too.diff => 0247-vfs-kde-too.diff} (100%) rename applied_patches/{0211-valgrind-alloc.diff => 0248-valgrind-alloc.diff} (100%) rename applied_patches/{0212-default-openssl-no-idea-alg.diff => 0249-default-openssl-no-idea-alg.diff} (100%) rename applied_patches/{0213-odf-flatxml-import-export.diff => 0250-odf-flatxml-import-export.diff} (100%) create mode 100644 applied_patches/0251-session-management.diff rename applied_patches/{0215-office-cfg-common-template-dir.diff => 0252-office-cfg-common-template-dir.diff} (100%) rename applied_patches/{0216-sfx2-template-category-labels.diff => 0253-sfx2-template-category-labels.diff} (100%) rename applied_patches/{0217-scp2_add_additional_dirs.diff => 0254-scp2_add_additional_dirs.diff} (100%) rename applied_patches/{0218-build-identification.diff => 0255-build-identification.diff} (100%) rename applied_patches/{0219-installer-strip-optional.diff => 0256-installer-strip-optional.diff} (100%) rename applied_patches/{0220-i18nutil-glibc-braindamage-workaround.diff => 0257-i18nutil-glibc-braindamage-workaround.diff} (100%) rename applied_patches/{0221-sdk-gid-module-name.diff => 0258-sdk-gid-module-name.diff} (100%) rename applied_patches/{0222-psprint_config-no-orig.diff => 0259-psprint_config-no-orig.diff} (100%) rename applied_patches/{0223-stlport-gcc-warnings.diff => 0260-stlport-gcc-warnings.diff} (100%) rename applied_patches/{0224-speed-hash-style.diff => 0261-speed-hash-style.diff} (100%) rename applied_patches/{0225-link-as-needed.diff => 0262-link-as-needed.diff} (100%) rename applied_patches/{0226-svx-customshapes-NOOPTFILES.diff => 0263-svx-customshapes-NOOPTFILES.diff} (100%) rename applied_patches/{0227-warning-return-values-filter.diff => 0264-warning-return-values-filter.diff} (100%) rename applied_patches/{0228-warning-return-values-registry.diff => 0265-warning-return-values-registry.diff} (100%) rename applied_patches/{0229-warning-uninitialized-variables-tools-2.diff => 0266-warning-uninitialized-variables-tools-2.diff} (100%) rename applied_patches/{0230-stlport-solaris-fileno.diff => 0267-stlport-solaris-fileno.diff} (100%) rename applied_patches/{0232-system-python-ure-bootstrap.diff => 0268-system-python-ure-bootstrap.diff} (100%) rename applied_patches/{0233-pyuno-ooodir.diff => 0269-pyuno-ooodir.diff} (100%) delete mode 100644 applied_patches/0269-vba-attribute.diff delete mode 100644 applied_patches/0270-basic-prj-build_lst.diff rename applied_patches/{0234-system-python-uno-path.diff => 0270-system-python-uno-path.diff} (100%) rename applied_patches/{0235-crash-startup.diff => 0271-crash-startup.diff} (100%) rename applied_patches/{0236-no-splash-takeover.diff => 0272-no-splash-takeover.diff} (100%) rename applied_patches/{0237-vcl-better-fallback.diff => 0273-vcl-better-fallback.diff} (100%) rename applied_patches/{0238-hebrew-culmus.diff => 0274-hebrew-culmus.diff} (100%) rename applied_patches/{0239-psprint-postscript-page-setup.diff => 0275-psprint-postscript-page-setup.diff} (100%) rename applied_patches/{0240-vcl-bitmap2-negative-height.diff => 0276-vcl-bitmap2-negative-height.diff} (100%) rename applied_patches/{0241-prevent-multiple-window-resize-calls-when-maximised.diff => 0277-prevent-multiple-window-resize-calls-when-maximised.diff} (100%) rename applied_patches/{0242-gui-toolbox-large-icons.diff => 0278-gui-toolbox-large-icons.diff} (100%) rename applied_patches/{0243-tango-icons-default-w32.diff => 0279-tango-icons-default-w32.diff} (100%) rename applied_patches/{0244-about-build-ver-readability.diff => 0280-about-build-ver-readability.diff} (100%) rename applied_patches/{0245-fpicker-common-build.diff => 0281-fpicker-common-build.diff} (100%) rename applied_patches/{0246-fpicker-kde-service.diff => 0282-fpicker-kde-service.diff} (100%) rename applied_patches/{0247-fpicker-kde-dialog.diff => 0283-fpicker-kde-dialog.diff} (100%) rename applied_patches/{0248-fpicker-kde-partial-kio.diff => 0284-fpicker-kde-partial-kio.diff} (100%) rename applied_patches/{0249-fpicker-kde-filter-name.diff => 0285-fpicker-kde-filter-name.diff} (100%) rename applied_patches/{0250-fpicker-kde-resmgr.diff => 0286-fpicker-kde-resmgr.diff} (100%) rename applied_patches/{0251-fpicker-kde-local-media.diff => 0287-fpicker-kde-local-media.diff} (100%) rename applied_patches/{0252-fpicker-kde-local-media2.diff => 0288-fpicker-kde-local-media2.diff} (100%) rename applied_patches/{0253-fpicker-kde-too-wide.diff => 0289-fpicker-kde-too-wide.diff} (100%) rename applied_patches/{0254-fpicker-kde-dont-overwrite.diff => 0290-fpicker-kde-dont-overwrite.diff} (100%) delete mode 100644 applied_patches/0290-sc-hacky-handle-boolean.diff rename applied_patches/{0255-fpicker-kde-non-utf8.diff => 0291-fpicker-kde-non-utf8.diff} (100%) delete mode 100644 applied_patches/0291-sc-vba-build-lst.diff rename applied_patches/{0256-fpicker-kde-modal.diff => 0292-fpicker-kde-modal.diff} (100%) delete mode 100644 applied_patches/0292-svx-source-inc-fmundo-hxx.diff rename applied_patches/{0257-fpicker-common-scp2.diff => 0293-fpicker-common-scp2.diff} (100%) delete mode 100644 applied_patches/0293-svx-source-form-fmscriptingenv-cxx.diff rename applied_patches/{0258-fpicker-kde-3layer.diff => 0294-fpicker-kde-3layer.diff} (100%) delete mode 100644 applied_patches/0294-svx-source-form-makefile.diff rename applied_patches/{0259-fpicker-kde-less-threads.diff => 0295-fpicker-kde-less-threads.diff} (100%) delete mode 100644 applied_patches/0295-svx-source-form-fmundo-cxx.diff rename applied_patches/{0260-default-evolution-database.diff => 0296-default-evolution-database.diff} (100%) delete mode 100644 applied_patches/0296-vbaevents-services-build.diff rename applied_patches/{0261-default-evo-column-mapping.diff => 0297-default-evo-column-mapping.diff} (100%) delete mode 100644 applied_patches/0297-scp_vba_uno_service.diff rename applied_patches/{0262-buildfix-evo1-vs-evo2.diff => 0298-buildfix-evo1-vs-evo2.diff} (100%) delete mode 100644 applied_patches/0298-vba-support-export-palette.diff rename applied_patches/{0263-default-evo2-ab.diff => 0299-default-evo2-ab.diff} (100%) delete mode 100644 applied_patches/0299-vba-get-nonfiltered-range-selection.diff rename applied_patches/{0264-lwp-filter-component.diff => 0300-lwp-filter-component.diff} (100%) delete mode 100644 applied_patches/0300-vba-allow-ranges-for-cell-functions.diff rename applied_patches/{0265-cws-ooo11lotusfilter-lwp-filter-component.diff => 0301-cws-ooo11lotusfilter-lwp-filter-component.diff} (100%) delete mode 100644 applied_patches/0301-vba-error-object.diff rename applied_patches/{0266-cws-ooo11lotusfilter-lwp-filter.diff => 0302-cws-ooo11lotusfilter-lwp-filter.diff} (100%) delete mode 100644 applied_patches/0302-sc-vba-autofill-support.diff rename applied_patches/{0267-cws-ooo11lotusfilter-lwp-xfilter.diff => 0303-cws-ooo11lotusfilter-lwp-xfilter.diff} (100%) delete mode 100644 applied_patches/0303-sc-source-ui-vba-makefile-mk.diff delete mode 100644 applied_patches/0304-sc-export-shape-macro-bindings.diff rename applied_patches/{0268-warning-return-values-lotuswordpro.diff => 0304-warning-return-values-lotuswordpro.diff} (100%) rename applied_patches/{0271-cli_ure-source-bootstrap-assembly-cs.diff => 0305-cli_ure-source-bootstrap-assembly-cs.diff} (100%) delete mode 100644 applied_patches/0305-sc-export-shape-hlink-bindings.diff rename applied_patches/{0272-cli_ure-source-bootstrap-managed_bootstrap-cs.diff => 0306-cli_ure-source-bootstrap-managed_bootstrap-cs.diff} (100%) delete mode 100644 applied_patches/0306-sc-vbaimport-override-controlname.diff delete mode 100644 applied_patches/0307-api-application-caller.diff rename applied_patches/{0273-cli_ure-source-bootstrap-native_glue-cxx.diff => 0307-cli_ure-source-bootstrap-native_glue-cxx.diff} (100%) delete mode 100644 applied_patches/0308-default-autotext-and-form-name.diff rename applied_patches/{0274-mono-scp2.diff => 0308-mono-scp2.diff} (100%) rename applied_patches/{0275-cli_ure-source-bootstrap-makefile-mk.diff => 0309-cli_ure-source-bootstrap-makefile-mk.diff} (100%) delete mode 100644 applied_patches/0309-oovbaapi-disable-vba.diff rename applied_patches/{0276-cli_ure-mono-bridge.diff => 0310-cli_ure-mono-bridge.diff} (100%) delete mode 100644 applied_patches/0310-vba-fixup-singlerange-sheetref.diff rename applied_patches/{0277-mono-build.diff => 0311-mono-build.diff} (100%) delete mode 100644 applied_patches/0311-vba-always-set-defaultprop.diff rename applied_patches/{0278-build-mono-link.diff => 0312-build-mono-link.diff} (100%) delete mode 100644 applied_patches/0312-vba-check-for-macro.diff rename applied_patches/{0279-mono-build-keyfile.diff => 0313-mono-build-keyfile.diff} (100%) delete mode 100644 applied_patches/0313-vba-support-properties-inmodules.diff delete mode 100644 applied_patches/0314-controls-with-images-import.diff rename applied_patches/{0280-mono-climaker.diff => 0314-mono-climaker.diff} (100%) delete mode 100644 applied_patches/0315-enhanced-form-userform-controls.diff rename applied_patches/{0281-mono-testtools.diff => 0315-mono-testtools-m59.diff} (100%) delete mode 100644 applied_patches/0316-ObjectModule.diff create mode 100644 applied_patches/0316-buildfix-testtool-disabled.diff rename applied_patches/{0282-climaker-csharp-win.diff => 0317-climaker-csharp-win.diff} (100%) delete mode 100644 applied_patches/0317-vba-userform.diff rename applied_patches/{0283-buildfix-climaker-disabled.diff => 0318-buildfix-climaker-disabled.diff} (100%) delete mode 100644 applied_patches/0318-vba-compatible-mode-uno.diff rename applied_patches/{0284-mono-bootstrap-config-and-policy.diff => 0319-mono-bootstrap-config-and-policy.diff} (100%) delete mode 100644 applied_patches/0319-vba-spinbutton-in-userform.diff rename applied_patches/{0285-mono-bridge-version.diff => 0320-mono-bridge-version.diff} (100%) delete mode 100644 applied_patches/0320-vbaevents-services-sources.diff rename applied_patches/{0286-buildfix-use-climaker-in-unoil.diff => 0321-buildfix-use-climaker-in-unoil.diff} (100%) delete mode 100644 applied_patches/0321-vba-workbook-worksheet-events.diff rename applied_patches/{0287-cli_ure-prj-build-lst.diff => 0322-cli_ure-prj-build-lst.diff} (100%) delete mode 100644 applied_patches/0322-vba-worksheet-calculate-event-fix.diff delete mode 100644 applied_patches/0323-basic-caller-support.diff rename applied_patches/{0288-mono-climaker-config.diff => 0323-mono-climaker-config.diff} (100%) rename applied_patches/{0289-mono-climaker-bridgetest.diff => 0324-mono-climaker-bridgetest.diff} (100%) delete mode 100644 applied_patches/0324-vba-empty-comparison-fix.diff create mode 100644 applied_patches/0325-cws-vbasupportdev300.diff delete mode 100644 applied_patches/0325-vba-worksheet-enableselection.diff delete mode 100644 applied_patches/0326-vba-keyword-fix.diff create mode 100644 applied_patches/0326-vba-reenable-rowsourcefixes.diff delete mode 100644 applied_patches/0327-userform-activex-identify.diff create mode 100644 applied_patches/0327-vba-basic-not-fix.diff create mode 100644 applied_patches/0328-cws-vbasupportdev300-wae.diff delete mode 100644 applied_patches/0328-userform-possible-groupingtweak.diff delete mode 100644 applied_patches/0329-basic-ide-objectmodule.diff create mode 100644 applied_patches/0329-vba-control-api-vis-fix.diff delete mode 100644 applied_patches/0330-basic-ide-module-object-name-combile.diff create mode 100644 applied_patches/0330-vba-fix-isempty.diff delete mode 100644 applied_patches/0331-vba-fix-ide-friendly-modulename.diff create mode 100644 applied_patches/0331-vba-fix-wsfunction-booleanparam.diff delete mode 100644 applied_patches/0332-vba-basic-macrochoose-dialog.diff create mode 100644 applied_patches/0332-vba-fix-errobj-errnum.diff rename applied_patches/{0417-sfx2-pre-and-postprocess-during-save-load.diff => 0333-sfx2-pre-and-postprocess-during-save-load.diff} (100%) delete mode 100644 applied_patches/0333-vba-fix-basic-macro-organizer.diff delete mode 100644 applied_patches/0334-range-listBox-compare.diff rename applied_patches/{0418-sfx2-pre-and-postprocess-crash-fix.diff => 0334-sfx2-pre-and-postprocess-crash-fix.diff} (100%) delete mode 100644 applied_patches/0335-vba-userform-geometry-tweak.diff rename applied_patches/{0419-win32-installer-register-moox-types.diff => 0335-win32-installer-register-moox-types.diff} (100%) delete mode 100644 applied_patches/0336-vba-allow-forms-resetvalue-binding.diff rename applied_patches/{0420-writerfilter-module-writer.diff => 0336-writerfilter-module-writer.diff} (100%) delete mode 100644 applied_patches/0337-fix-vba-NOT-trigger-update.diff rename applied_patches/{0421-writerfilter-source-dmapper-domainmapper-debug.diff => 0337-writerfilter-source-dmapper-domainmapper-debug.diff} (100%) create mode 100644 applied_patches/0338-buildfix-oox-depends-on-unotools.diff delete mode 100644 applied_patches/0338-vba-variant-fix.diff rename applied_patches/{0423-oox-fix-placeholder-layout.diff => 0339-oox-fix-placeholder-layout.diff} (100%) delete mode 100644 applied_patches/0339-userform-image-import-fix.diff rename applied_patches/{0424-oox-fix-list-style-apply.diff => 0340-oox-fix-list-style-apply.diff} (100%) delete mode 100644 applied_patches/0340-spinbutton-import-valuechange.diff rename applied_patches/{0425-oox-pptx-import-fix-layout.diff => 0341-oox-pptx-import-fix-layout.diff} (100%) delete mode 100644 applied_patches/0341-vba-noregrex-for-match.diff rename applied_patches/{0426-oox-pptx-import-fix-wipe-transition.diff => 0342-oox-pptx-import-fix-wipe-transition.diff} (100%) delete mode 100644 applied_patches/0342-vba-null-not-treatment.diff rename applied_patches/{0427-oox-pptx-import-fix-subtitle-placeholder.diff => 0343-oox-pptx-import-fix-subtitle-placeholder.diff} (100%) delete mode 100644 applied_patches/0343-vba-commandbar-fix.diff rename applied_patches/{0464-sdbc-postgresql.diff => 0344-sdbc-postgresql.diff} (100%) delete mode 100644 applied_patches/0344-vba-xls-formula-parser.diff rename applied_patches/{0465-sdbc-postgresql-build-lst.diff => 0345-sdbc-postgresql-build-lst.diff} (100%) delete mode 100644 applied_patches/0345-vba-fix-docmodule-import-crash.diff rename applied_patches/{0466-connectivity-workben-postgresql.diff => 0346-connectivity-workben-postgresql.diff} (100%) delete mode 100644 applied_patches/0346-vba-servicemacros-rework.diff rename applied_patches/{0467-gcc-4.3-postgresql.diff => 0347-gcc-4.3-postgresql.diff} (100%) delete mode 100644 applied_patches/0347-vba-interior-object-fix.diff delete mode 100644 applied_patches/0348-range-defaultmethod-i98476.diff rename applied_patches/{0468-sdbc-postgresql-config_office.diff => 0348-sdbc-postgresql-config_office.diff} (100%) rename applied_patches/{0469-kde4-buildfix-connectivity.diff => 0349-kde4-buildfix-connectivity.diff} (100%) delete mode 100644 applied_patches/0349-vba-excel-iserror-fix.diff rename applied_patches/{0470-kde4-oxygen-icons.diff => 0350-kde4-oxygen-icons.diff} (100%) delete mode 100644 applied_patches/0350-word-read-custom-toolbar-filter.diff rename applied_patches/{0471-kde4-fpicker-fix-toOUString.diff => 0351-kde4-fpicker-fix-toOUString.diff} (100%) delete mode 100644 applied_patches/0351-vba-word-support.diff create mode 100644 applied_patches/0352-kde4-configure2.diff delete mode 100644 applied_patches/0352-vba-templateobject.diff create mode 100644 applied_patches/0353-kde4_fpicker_fixes.diff delete mode 100644 applied_patches/0353-vba-vpagebreak-object.diff rename applied_patches/{0472-transogl-transitions-sd.diff => 0354-transogl-transitions-sd.diff} (100%) delete mode 100644 applied_patches/0354-vba-combobox-listindex-fix.diff rename applied_patches/{0473-transogl-transitions-officecfg.diff => 0355-transogl-transitions-officecfg.diff} (100%) delete mode 100644 applied_patches/0355-vba-fix-copysheet-toend.diff rename applied_patches/{0474-ooo67658.sfx2.reloadcrash.diff => 0356-ooo67658.sfx2.reloadcrash.diff} (100%) delete mode 100644 applied_patches/0356-vba-improve-toolbarapi-macro-search.diff delete mode 100644 applied_patches/0357-fix-doc-exit-basic-error-core.diff rename applied_patches/{0475-oooXXXXX.vcl.x86_64.impressatk.diff => 0357-oooXXXXX.vcl.x86_64.impressatk.diff} (100%) rename applied_patches/{0476-ooo73201.sw.a11yloadcrash.diff => 0358-ooo73201.sw.a11yloadcrash.diff} (100%) delete mode 100644 applied_patches/0358-read-vba-dir-stream-fix.diff rename applied_patches/{0477-ooo86080.unopkg.bodge.diff => 0359-ooo86080.unopkg.bodge.diff} (100%) delete mode 100644 applied_patches/0359-vba-commandbar-enabled.diff rename applied_patches/{0478-oooXXXX.partial-revert-ooo95118.diff => 0360-oooXXXX.partial-revert-ooo95118.diff} (100%) delete mode 100644 applied_patches/0360-vba-worksheet-change-event-fix.diff rename applied_patches/{0479-ooo83878.unopkg.enablelinking.diff => 0361-ooo83878.unopkg.enablelinking.diff} (100%) delete mode 100644 applied_patches/0361-vba-toolbar-menufilter-core-fix.diff rename applied_patches/{0480-gstreamer-avmedia.diff => 0362-gstreamer-avmedia.diff} (100%) delete mode 100644 applied_patches/0362-word-read-builtinmenubar-filter.diff rename applied_patches/{0481-gstreamer-scp2.diff => 0363-gstreamer-scp2.diff} (100%) delete mode 100644 applied_patches/0363-vba-fix-private-declare.diff rename applied_patches/{0482-gstreamer-config-office.diff => 0364-gstreamer-config-office.diff} (100%) delete mode 100644 applied_patches/0364-vba-import-globaltemplate-customizations.diff rename applied_patches/{0483-gstreamer-slideshow.diff => 0365-gstreamer-slideshow.diff} (100%) delete mode 100644 applied_patches/0365-vba-basic-if-compare-fix.diff rename applied_patches/{0484-gstreamer-solenv.diff => 0366-gstreamer-solenv.diff} (100%) delete mode 100644 applied_patches/0366-vba-basic-parallel-build.diff rename applied_patches/{0485-gstreamer-svtools-content-types.diff => 0367-gstreamer-svtools-content-types.diff} (100%) delete mode 100644 applied_patches/0367-vba-oovbaapi-parallel-build.diff delete mode 100644 applied_patches/0368-basic-allow-objectforerror-symbol.diff rename applied_patches/{0486-gstreamer-avmedia-file-types.diff => 0368-gstreamer-avmedia-file-types.diff} (100%) rename applied_patches/{0487-gstreamer-vcl.diff => 0369-gstreamer-vcl.diff} (100%) delete mode 100644 applied_patches/0369-vba-fix-named-any-para-pass.diff rename applied_patches/{0488-avmedia-source-gstreamer-ChangeLog.diff => 0370-avmedia-source-gstreamer-ChangeLog.diff} (100%) delete mode 100644 applied_patches/0370-vba-allow-arrays-in-usertypes.diff rename applied_patches/{0489-avmedia-source-gstreamer-exports.dxp.diff => 0371-avmedia-source-gstreamer-exports.dxp.diff} (100%) delete mode 100644 applied_patches/0371-vba-disable-toolbar+customizationimport.diff rename applied_patches/{0490-avmedia-source-gstreamer-gstcommon.hxx.diff => 0372-avmedia-source-gstreamer-gstcommon.hxx.diff} (100%) delete mode 100644 applied_patches/0372-vba-fix-IsEmpty-api-object.diff rename applied_patches/{0491-avmedia-source-gstreamer-gstframegrabber.cxx.diff => 0373-avmedia-source-gstreamer-gstframegrabber.cxx.diff} (100%) delete mode 100644 applied_patches/0373-vba-fix-control-shape-geom-fix.diff rename applied_patches/{0492-avmedia-source-gstreamer-gstframegrabber.hxx.diff => 0374-avmedia-source-gstreamer-gstframegrabber.hxx.diff} (100%) delete mode 100644 applied_patches/0374-basic-public-dim-fix.diff rename applied_patches/{0493-avmedia-source-gstreamer-gstmanager.cxx.diff => 0375-avmedia-source-gstreamer-gstmanager.cxx.diff} (100%) delete mode 100644 applied_patches/0375-vba-fix-optionalparam-assigment.diff rename applied_patches/{0494-avmedia-source-gstreamer-gstmanager.hxx.diff => 0376-avmedia-source-gstreamer-gstmanager.hxx.diff} (100%) delete mode 100644 applied_patches/0376-vba-reset-screenupdateing.diff rename applied_patches/{0495-avmedia-source-gstreamer-gstplayer.cxx.diff => 0377-avmedia-source-gstreamer-gstplayer.cxx.diff} (100%) delete mode 100644 applied_patches/0377-vba-redim-array-fix.diff rename applied_patches/{0496-avmedia-source-gstreamer-gstplayer.hxx.diff => 0378-avmedia-source-gstreamer-gstplayer.hxx.diff} (100%) delete mode 100644 applied_patches/0378-vba-fix-userform-init.diff rename applied_patches/{0497-avmedia-source-gstreamer-gstuno.cxx.diff => 0379-avmedia-source-gstreamer-gstuno.cxx.diff} (100%) delete mode 100644 applied_patches/0379-vba-fix-Range-Insert-CopyOrigin.diff rename applied_patches/{0498-avmedia-source-gstreamer-gstwindow.cxx.diff => 0380-avmedia-source-gstreamer-gstwindow.cxx.diff} (100%) delete mode 100644 applied_patches/0380-calc-vba-volatile-user-func.diff rename applied_patches/{0499-avmedia-source-gstreamer-gstwindow.hxx.diff => 0381-avmedia-source-gstreamer-gstwindow.hxx.diff} (100%) delete mode 100644 applied_patches/0381-vba-documentcontext.diff rename applied_patches/{0500-avmedia-source-gstreamer-makefile.mk.diff => 0382-avmedia-source-gstreamer-makefile.mk.diff} (100%) delete mode 100644 applied_patches/0382-fix-read-disabled-toolbarimport.diff rename applied_patches/{0501-letter-wizard-resource-id.diff => 0383-letter-wizard-resource-id.diff} (100%) delete mode 100644 applied_patches/0383-vba-word-support-part2.diff rename applied_patches/{0502-gstreamer-avmedia-loopingetc.diff => 0384-gstreamer-avmedia-loopingetc.diff} (100%) delete mode 100644 applied_patches/0384-vba-only-import-std-menutoolbar.diff rename applied_patches/{0503-size-sal-textenc.diff => 0385-size-sal-textenc.diff} (100%) delete mode 100644 applied_patches/0385-vba-fix-workbook-resize-core.diff rename applied_patches/{0504-jvmfwk-gij32.diff => 0386-jvmfwk-gij32.diff} (100%) delete mode 100644 applied_patches/0386-vba-fix-macromode-api-docopen.diff rename applied_patches/{0505-svg-import-filter.diff => 0387-svg-import-filter.diff} (100%) delete mode 100644 applied_patches/0387-vba-fixup-macrosearch.diff rename applied_patches/{0506-svg-import-filter-gfxfilter.diff => 0388-svg-import-filter-gfxfilter.diff} (100%) delete mode 100644 applied_patches/0388-vba-currentcomponent-rework.diff rename applied_patches/{0507-svg-import-viewbox-fix.diff => 0389-svg-import-viewbox-fix.diff} (100%) delete mode 100644 applied_patches/0389-vba-testclient-fix-project.diff rename applied_patches/{0508-svg-import-painturi-fix.diff => 0390-svg-import-painturi-fix.diff} (100%) delete mode 100644 applied_patches/0390-vba-fix-checkbox-ole-access.diff rename applied_patches/{0509-svg-import-textimport.diff => 0391-svg-import-textimport.diff} (100%) delete mode 100644 applied_patches/0391-vba-fix-path-fullname.diff delete mode 100644 applied_patches/0392-fix-sheet-control-valueset.diff rename applied_patches/{0510-svg-import-convlength-fix.diff => 0392-svg-import-convlength-fix.diff} (100%) create mode 100644 applied_patches/0393-svg-import-opacity-fix.diff delete mode 100644 applied_patches/0393-vba-fix-range-delete-shift.diff rename applied_patches/{0511-speed-store.diff => 0394-speed-store.diff} (100%) delete mode 100644 applied_patches/0394-vba-fix-worksheet-add-before-param-object.diff delete mode 100644 applied_patches/0395-vba-fix-worksheet-add-activate.diff rename applied_patches/{0512-wmf-pattern-brush.diff => 0395-wmf-pattern-brush.diff} (100%) rename applied_patches/{0513-toolkit-layout-gcc-4.3.2-hack.diff => 0396-toolkit-layout-gcc-4.3.2-hack.diff} (100%) delete mode 100644 applied_patches/0396-vba-application-quit.diff rename applied_patches/{0514-layout-accessibility-dispose-only-once.diff => 0397-layout-accessibility-dispose-only-once.diff} (100%) delete mode 100644 applied_patches/0397-vba-commandbar-rework.diff rename applied_patches/{0515-buildfix-toolkit-workben-layout.diff => 0398-buildfix-toolkit-workben-layout.diff} (100%) delete mode 100644 applied_patches/0398-vba-menubar-objects.diff rename applied_patches/{0516-layout-parallel-build.diff => 0399-layout-parallel-build.diff} (100%) delete mode 100644 applied_patches/0399-vba-fix-missing-codename.diff rename applied_patches/{0517-autocorrect-accidental-caps-lock-offapi.diff => 0400-autocorrect-accidental-caps-lock-offapi.diff} (100%) delete mode 100644 applied_patches/0400-vba-zoom-per-sheet.diff rename applied_patches/{0518-autocorrect-accidental-caps-lock-officecfg.diff => 0401-autocorrect-accidental-caps-lock-officecfg.diff} (100%) delete mode 100644 applied_patches/0401-vba-fallback-to-calling-doc-context.diff rename applied_patches/{0519-autocorrect-accidental-caps-lock-sc.diff => 0402-autocorrect-accidental-caps-lock-sc.diff} (100%) delete mode 100644 applied_patches/0402-vba-cursor-pos-for-selected-maxrange.diff rename applied_patches/{0520-autocorrect-accidental-caps-lock-sw.diff => 0403-autocorrect-accidental-caps-lock-sw.diff} (100%) delete mode 100644 applied_patches/0403-vba-combobox-rowsource-fix.diff create mode 100644 applied_patches/0404-autocorrect-accidental-caps-lock-svx.diff delete mode 100644 applied_patches/0404-vba-workbook-auto-open-event.diff rename applied_patches/{0522-autocorrect-accidental-caps-lock-vcl.diff => 0405-autocorrect-accidental-caps-lock-vcl.diff} (100%) delete mode 100644 applied_patches/0405-vba-buildin-toolbar-fix.diff create mode 100644 applied_patches/0406-cws-cbosdo01.diff delete mode 100644 applied_patches/0406-vba-workbook-precisionasdisplayed.diff rename applied_patches/{0523-statusbar-fancy-modified-status-sc.diff => 0407-statusbar-fancy-modified-status-sc.diff} (100%) delete mode 100644 applied_patches/0407-uno-xmenu-getpopupMenu-fix.diff rename applied_patches/{0524-statusbar-fancy-modified-status-sd.diff => 0408-statusbar-fancy-modified-status-sd.diff} (100%) delete mode 100644 applied_patches/0408-vba-commandbarcontrol-enabled.diff rename applied_patches/{0525-statusbar-fancy-modified-status-sfx2.diff => 0409-statusbar-fancy-modified-status-sfx2.diff} (100%) delete mode 100644 applied_patches/0409-vba-commandbar-document-scope.diff rename applied_patches/{0526-statusbar-fancy-modified-status-starmath.diff => 0410-statusbar-fancy-modified-status-starmath.diff} (100%) delete mode 100644 applied_patches/0410-vba-dim-as-contants-fix.diff rename applied_patches/{0527-statusbar-fancy-modified-status-svx.diff => 0411-statusbar-fancy-modified-status-svx.diff} (100%) delete mode 100644 applied_patches/0411-vba-commandbar-toolbar-fix.diff rename applied_patches/{0528-statusbar-fancy-modified-status-sw.diff => 0412-statusbar-fancy-modified-status-sw.diff} (100%) delete mode 100644 applied_patches/0412-vba-automation-set-fix.diff delete mode 100644 applied_patches/0413-tool-menu-bar-improvements.diff rename applied_patches/{0529-unittesting-basebmp.diff => 0413-unittesting-basebmp.diff} (100%) rename applied_patches/{0530-unittesting-basegfx.diff => 0414-unittesting-basegfx.diff} (100%) delete mode 100644 applied_patches/0414-vba-styles-add-fix.diff rename applied_patches/{0531-unittesting-basic.diff => 0415-unittesting-basic.diff} (100%) delete mode 100644 applied_patches/0415-vba-financial-functions.diff rename applied_patches/{0532-unittesting-bean.diff => 0416-unittesting-bean.diff} (100%) delete mode 100644 applied_patches/0416-vba-typename-fix.diff rename applied_patches/{0533-unittesting-bridges.diff => 0417-unittesting-bridges.diff} (100%) rename applied_patches/{0534-unittesting-canvas.diff => 0418-unittesting-canvas.diff} (100%) rename applied_patches/{0535-unittesting-cli_ure.diff => 0419-unittesting-cli_ure.diff} (100%) rename applied_patches/{0536-unittesting-codemaker.diff => 0420-unittesting-codemaker.diff} (100%) rename applied_patches/{0537-unittesting-configmgr.diff => 0421-unittesting-configmgr.diff} (100%) delete mode 100644 applied_patches/0422-buildfix-oox-depends-on-unotools.diff rename applied_patches/{0538-unittesting-connectivity.diff => 0422-unittesting-connectivity.diff} (100%) rename applied_patches/{0539-unittesting-cppu.diff => 0423-unittesting-cppu.diff} (100%) rename applied_patches/{0540-unittesting-cppuhelper.diff => 0424-unittesting-cppuhelper.diff} (100%) rename applied_patches/{0541-unittesting-dbaccess.diff => 0425-unittesting-dbaccess.diff} (100%) rename applied_patches/{0542-unittesting-desktop.diff => 0426-unittesting-desktop.diff} (100%) rename applied_patches/{0543-unittesting-dtrans.diff => 0427-unittesting-dtrans.diff} (100%) delete mode 100644 applied_patches/0428-calc-formula-asian-phonetic.diff rename applied_patches/{0544-unittesting-embeddedobj.diff => 0428-unittesting-embeddedobj.diff} (100%) delete mode 100644 applied_patches/0429-sc-sheet-gridline-toggle.diff rename applied_patches/{0545-unittesting-extensions.diff => 0429-unittesting-extensions.diff} (100%) delete mode 100644 applied_patches/0430-calc-formula-variable-separators-sc.diff rename applied_patches/{0546-unittesting-filter.diff => 0430-unittesting-filter.diff} (100%) rename applied_patches/{0547-unittesting-forms.diff => 0431-unittesting-forms.diff} (100%) rename applied_patches/{0548-unittesting-fpicker.diff => 0432-unittesting-fpicker.diff} (100%) rename applied_patches/{0549-unittesting-framework.diff => 0433-unittesting-framework.diff} (100%) rename applied_patches/{0550-unittesting-chart2.diff => 0434-unittesting-chart2.diff} (100%) rename applied_patches/{0551-unittesting-idlc.diff => 0435-unittesting-idlc.diff} (100%) rename applied_patches/{0552-unittesting-io.diff => 0436-unittesting-io.diff} (100%) rename applied_patches/{0553-unittesting-javaunohelper.diff => 0437-unittesting-javaunohelper.diff} (100%) delete mode 100644 applied_patches/0438-calc-sheet-tab-color-officecfg.diff rename applied_patches/{0554-unittesting-jurt.diff => 0438-unittesting-jurt.diff} (100%) delete mode 100644 applied_patches/0439-calc-find-replace-empty-cells-sc.diff rename applied_patches/{0555-unittesting-jvmaccess.diff => 0439-unittesting-jvmaccess.diff} (100%) delete mode 100644 applied_patches/0440-calc-find-replace-empty-cells-svx.diff rename applied_patches/{0556-unittesting-linguistic.diff => 0440-unittesting-linguistic.diff} (100%) delete mode 100644 applied_patches/0441-calc-enhanced-merge-cells-sc.diff rename applied_patches/{0557-unittesting-offapi.diff => 0441-unittesting-offapi.diff} (100%) rename applied_patches/{0558-unittesting-o3tl.diff => 0442-unittesting-o3tl.diff} (100%) rename applied_patches/{0559-unittesting-package.diff => 0443-unittesting-package.diff} (100%) rename applied_patches/{0560-unittesting-qadevOOo.diff => 0444-unittesting-qadevOOo.diff} (100%) delete mode 100644 applied_patches/0445-calc-html-import-custom-lang-filter.diff rename applied_patches/{0561-unittesting-registry.diff => 0445-unittesting-registry.diff} (100%) delete mode 100644 applied_patches/0446-calc-html-import-custom-lang-sc.diff rename applied_patches/{0562-unittesting-ridljar.diff => 0446-unittesting-ridljar.diff} (100%) delete mode 100644 applied_patches/0447-calc-csv-import-custom-lang-sc.diff rename applied_patches/{0563-unittesting-sal.diff => 0447-unittesting-sal.diff} (100%) delete mode 100644 applied_patches/0448-calc-csv-import-custom-lang-officecfg.diff rename applied_patches/{0564-unittesting-salhelper.diff => 0448-unittesting-salhelper.diff} (100%) delete mode 100644 applied_patches/0449-calc-dp-hide-list-menu.diff rename applied_patches/{0565-unittesting-sandbox.diff => 0449-unittesting-sandbox.diff} (100%) rename applied_patches/{0566-unittesting-sax.diff => 0450-unittesting-sax.diff} (100%) rename applied_patches/{0567-unittesting-sc.diff => 0451-unittesting-sc.diff} (100%) delete mode 100644 applied_patches/0452-calc-jump-on-formula-ref-sc.diff rename applied_patches/{0568-unittesting-scripting.diff => 0452-unittesting-scripting.diff} (100%) rename applied_patches/{0569-unittesting-sd.diff => 0453-unittesting-sd.diff} (100%) rename applied_patches/{0570-unittesting-sfx2.diff => 0454-unittesting-sfx2.diff} (100%) delete mode 100644 applied_patches/0455-calc-dp-custom-sort.diff rename applied_patches/{0571-unittesting-shell.diff => 0455-unittesting-shell.diff} (100%) delete mode 100644 applied_patches/0456-calc-ods-sheet-protection-sc.diff rename applied_patches/{0572-unittesting-slideshow.diff => 0456-unittesting-slideshow.diff} (100%) rename applied_patches/{0573-unittesting-sot.diff => 0457-unittesting-sot.diff} (100%) rename applied_patches/{0574-unittesting-starmath.diff => 0458-unittesting-starmath.diff} (100%) delete mode 100644 applied_patches/0459-calc-dp-custom-names-ods-sc.diff rename applied_patches/{0575-unittesting-stoc.diff => 0459-unittesting-stoc.diff} (100%) delete mode 100644 applied_patches/0460-calc-dp-custom-names-ods-xmloff.diff rename applied_patches/{0576-unittesting-store.diff => 0460-unittesting-store.diff} (100%) delete mode 100644 applied_patches/0461-calc-selection-fixed-cursor.diff rename applied_patches/{0577-unittesting-svtools.diff => 0461-unittesting-svtools.diff} (100%) rename applied_patches/{0578-unittesting-svx.diff => 0462-unittesting-svx.diff} (100%) delete mode 100644 applied_patches/0463-calc-autofilter-shrink-selection.diff rename applied_patches/{0579-unittesting-sw.diff => 0463-unittesting-sw.diff} (100%) rename applied_patches/{0580-unittesting-testshl2.diff => 0464-unittesting-testshl2.diff} (100%) rename applied_patches/{0581-unittesting-testtools.diff => 0465-unittesting-testtools.diff} (100%) rename applied_patches/{0582-unittesting-toolkit.diff => 0466-unittesting-toolkit.diff} (100%) rename applied_patches/{0583-unittesting-tools.diff => 0467-unittesting-tools.diff} (100%) rename applied_patches/{0584-unittesting-ucbhelper.diff => 0468-unittesting-ucbhelper.diff} (100%) rename applied_patches/{0585-unittesting-ucb.diff => 0469-unittesting-ucb.diff} (100%) rename applied_patches/{0586-unittesting-udkapi.diff => 0470-unittesting-udkapi.diff} (100%) rename applied_patches/{0587-unittesting-vcl.diff => 0471-unittesting-vcl.diff} (100%) rename applied_patches/{0588-unittesting-writerfilter.diff => 0472-unittesting-writerfilter.diff} (100%) rename applied_patches/{0589-unittesting-xmerge.diff => 0473-unittesting-xmerge.diff} (100%) rename applied_patches/{0590-unittesting-xmlhelp.diff => 0474-unittesting-xmlhelp.diff} (100%) rename applied_patches/{0591-unittesting-xmloff.diff => 0475-unittesting-xmloff.diff} (100%) rename applied_patches/{0592-unittesting-xmlscript.diff => 0476-unittesting-xmlscript.diff} (100%) rename applied_patches/{0593-unittesting-xmlsecurity.diff => 0477-unittesting-xmlsecurity.diff} (100%) rename applied_patches/{0594-novell-win32-odma.diff => 0478-novell-win32-odma.diff} (100%) rename applied_patches/{0595-svx-sdrobjeditview-update-edit-area.diff => 0479-svx-sdrobjeditview-update-edit-area.diff} (100%) rename applied_patches/{0596-goodies-eps-filter-unix.diff => 0480-goodies-eps-filter-unix.diff} (100%) rename applied_patches/{0597-emf+-cppcanvas-renderer.diff => 0481-emf+-cppcanvas-renderer.diff} (100%) rename applied_patches/{0598-emf+-cppcanvas-emfplus.diff => 0482-emf+-cppcanvas-emfplus.diff} (100%) rename applied_patches/{0599-emf+-offapi-renderer.diff => 0483-emf+-offapi-renderer.diff} (100%) rename applied_patches/{0600-emf+-vcl-bitmap.diff => 0484-emf+-vcl-bitmap.diff} (100%) rename applied_patches/{0601-emf+-vcl-renderer.diff => 0485-emf+-vcl-renderer.diff} (100%) rename applied_patches/{0602-emf+-svtools.diff => 0486-emf+-svtools.diff} (100%) rename applied_patches/{0603-emf+-scp2-renderer.diff => 0487-emf+-scp2-renderer.diff} (100%) rename applied_patches/{0604-emf+-crash-fix.diff => 0488-emf+-crash-fix.diff} (100%) rename applied_patches/{0605-vcl-grey-alpha-unix-sal-bitmap.diff => 0489-vcl-grey-alpha-unix-sal-bitmap.diff} (100%) rename applied_patches/{0606-emf+-multipart-objects.diff => 0490-emf+-multipart-objects.diff} (100%) rename applied_patches/{0607-emf+-use-canvas-only-for-emf+.diff => 0491-emf+-use-canvas-only-for-emf+.diff} (100%) rename applied_patches/{0608-emf+-embedded-mf-image.diff => 0492-emf+-embedded-mf-image.diff} (100%) rename applied_patches/{0609-vcl-pluggable-mtf-renderer.diff => 0493-vcl-pluggable-mtf-renderer.diff} (100%) rename applied_patches/{0610-emf+-cppcanvas-input-validation.diff => 0494-emf+-cppcanvas-input-validation.diff} (100%) rename applied_patches/{0611-linkwarn-dlg-in-apps.diff => 0495-linkwarn-dlg-in-apps.diff} (100%) rename applied_patches/{0612-linkwarn-sfx2-disable-cb-persistency.diff => 0496-linkwarn-sfx2-disable-cb-persistency.diff} (100%) rename applied_patches/{0613-linkwarn-svtools-miscopts-bits.diff => 0497-linkwarn-svtools-miscopts-bits.diff} (100%) rename applied_patches/{0614-linkwarn-officecfg-disable-msgbox.diff => 0498-linkwarn-officecfg-disable-msgbox.diff} (100%) rename applied_patches/{0615-linkwarn-svx-warning-dlg.diff => 0499-linkwarn-svx-warning-dlg.diff} (100%) rename applied_patches/{0616-linkwarn-sd-no-dnd-links.diff => 0500-linkwarn-sd-no-dnd-links.diff} (100%) rename applied_patches/{0617-fix-ppt-linespacing-import-export.diff => 0501-fix-ppt-linespacing-import-export.diff} (100%) rename applied_patches/{0618-sw-section-import-fix.diff => 0502-sw-section-import-fix.diff} (100%) rename applied_patches/{0619-sw-allow-negative-spacing.diff => 0503-sw-allow-negative-spacing.diff} (100%) create mode 100644 applied_patches/0504-field-patch.diff rename applied_patches/{0620-sw-import-html-controls.diff => 0505-sw-import-html-controls.diff} (100%) rename applied_patches/{0621-svx-hacky-htmlselect-control-import.diff => 0506-svx-hacky-htmlselect-control-import.diff} (100%) rename applied_patches/{0622-sd-slideshow-slideshowview-transformation-fix.diff => 0507-sd-slideshow-slideshowview-transformation-fix.diff} (100%) rename applied_patches/{0623-sd-view-zoom-fix.diff => 0508-sd-view-zoom-fix.diff} (100%) rename applied_patches/{0624-sd-custom-show-fix.diff => 0509-sd-custom-show-fix.diff} (100%) rename applied_patches/{0625-fit-list-to-size.diff => 0510-fit-list-to-size.diff} (100%) rename applied_patches/{0626-fit-list-to-size-ui.diff => 0511-fit-list-to-size-ui.diff} (100%) rename applied_patches/{0627-fit-list-to-size-style-defaults.diff => 0512-fit-list-to-size-style-defaults.diff} (100%) create mode 100644 applied_patches/0513-fit-list-to-size-popup.diff create mode 100644 applied_patches/0514-fit-list-to-size-build-fix.diff rename applied_patches/{0629-sw-nested-positionned-tables-ww8-import-fix.diff => 0515-sw-nested-positionned-tables-ww8-import-fix.diff} (100%) rename applied_patches/{0630-xmloff_dis26300_conformance.diff => 0516-xmloff_dis26300_conformance.diff} (100%) rename applied_patches/{0631-lockfile-dont-do-dns-lookup.diff => 0517-lockfile-dont-do-dns-lookup.diff} (100%) rename applied_patches/{0632-lockfile-less-symbols.diff => 0518-lockfile-less-symbols.diff} (100%) rename applied_patches/{0633-internal-mesa-headers-config_office.diff => 0519-internal-mesa-headers-config_office.diff} (100%) rename applied_patches/{0634-internal-mesa-headers-slideshow.diff => 0520-internal-mesa-headers-slideshow.diff} (100%) delete mode 100644 applied_patches/0521-autocorrect-accidental-caps-lock-svx.diff rename applied_patches/{0635-internal-mesa-headers-mesa.diff => 0521-internal-mesa-headers-mesa.diff} (100%) create mode 100644 applied_patches/0522-ui-desktop-integration.diff rename applied_patches/{0637-cairo-pixman-makefile-mk.diff => 0523-cairo-pixman-makefile-mk.diff} (100%) rename applied_patches/{0638-cairo-cairo-makefile-mk.diff => 0524-cairo-cairo-makefile-mk.diff} (100%) rename applied_patches/{0639-internal-cairo-configure.diff => 0525-internal-cairo-configure.diff} (100%) create mode 100644 applied_patches/0526-package-pixman-scp2-source-ooo-file_library_ooo_scp.diff rename applied_patches/{0640-cppcanvas-fix-roundcorners.diff => 0527-cppcanvas-fix-roundcorners.diff} (100%) rename applied_patches/{0641-officecfg-bighandles-default.diff => 0528-officecfg-bighandles-default.diff} (100%) rename applied_patches/{0642-slideshow-cutblack.diff => 0529-slideshow-cutblack.diff} (100%) rename applied_patches/{0643-canvas-colorspace-fix.diff => 0530-canvas-colorspace-fix.diff} (100%) rename applied_patches/{0644-unoxml-boost-workaround.diff => 0531-unoxml-boost-workaround.diff} (100%) rename applied_patches/{0645-sw-source-filter-xml-xmltbli-uninitializedvalue.diff => 0532-sw-source-filter-xml-xmltbli-uninitializedvalue.diff} (100%) rename applied_patches/{0646-svtools-update-ole.diff => 0533-svtools-update-ole.diff} (100%) rename applied_patches/{0647-jurt-jnilib-deliver.diff => 0534-jurt-jnilib-deliver.diff} (100%) rename applied_patches/{0648-timely-canvas-disposing.diff => 0535-timely-canvas-disposing.diff} (100%) rename applied_patches/{0649-instset-prefer-langpacks.diff => 0536-instset-prefer-langpacks.diff} (100%) rename applied_patches/{0650-solenv-installer-unopkg-call.diff => 0537-solenv-installer-unopkg-call.diff} (100%) rename applied_patches/{0651-svx-debug-sdrolestreams.diff => 0538-svx-debug-sdrolestreams.diff} (100%) rename applied_patches/{0652-instset-macos-langpacks.diff => 0539-instset-macos-langpacks.diff} (100%) rename applied_patches/{0653-sal-disable-backtrace.diff => 0540-sal-disable-backtrace.diff} (100%) rename applied_patches/{0654-sw-invert-border-spacing.diff => 0541-sw-invert-border-spacing.diff} (100%) rename applied_patches/{0655-sw-collapse-empty-table-par-like-html.diff => 0542-sw-collapse-empty-table-par-like-html.diff} (100%) rename applied_patches/{0656-canvas-directx-lostdevice-fix.diff => 0543-canvas-directx-lostdevice-fix.diff} (100%) rename applied_patches/{0657-sw-table-join-fix-i99267.diff => 0544-sw-table-join-fix-i99267.diff} (100%) rename applied_patches/{0658-svtools-svrtf-token-ignore-case.diff => 0545-svtools-svrtf-token-ignore-case.diff} (100%) rename applied_patches/{0659-fix-sd-accelerators.diff => 0546-fix-sd-accelerators.diff} (100%) rename applied_patches/{0660-sw-outline-numbering-broken-fix.diff => 0547-sw-outline-numbering-broken-fix.diff} (100%) rename applied_patches/{0661-sw-insert-pagebreak-in-numbered-paragraph.diff => 0548-sw-insert-pagebreak-in-numbered-paragraph.diff} (100%) rename applied_patches/{0662-win32-tooltips.diff => 0549-win32-tooltips.diff} (100%) create mode 100644 applied_patches/0550-win32-cygwin-1.7.diff create mode 100644 applied_patches/0551-win32-sdk7.diff create mode 100644 applied_patches/0552-win32-dxsdk-200908.diff create mode 100644 applied_patches/0553-win32-interix.diff rename applied_patches/{0663-sfx2-privateprotectedpublic.diff => 0554-sfx2-privateprotectedpublic.diff} (100%) rename applied_patches/{0664-optional-outplace-ole.diff => 0555-optional-outplace-ole.diff} (100%) rename applied_patches/{0665-slideshow-configurable-paintoverlay.diff => 0556-slideshow-configurable-paintoverlay.diff} (100%) rename applied_patches/{0666-vcl-permit-global-shortcuts.diff => 0557-vcl-permit-global-shortcuts.diff} (100%) rename applied_patches/{0667-sd-customanimation-defbutton.diff => 0558-sd-customanimation-defbutton.diff} (100%) rename applied_patches/{0668-sd-ruler-fix.diff => 0559-sd-ruler-fix.diff} (100%) rename applied_patches/{0669-sd-odf-relaxed-listlevel.diff => 0560-sd-odf-relaxed-listlevel.diff} (100%) rename applied_patches/{0670-sd-animation-ui-fix.diff => 0561-sd-animation-ui-fix.diff} (100%) rename applied_patches/{0671-slideshow-mute-sound.diff => 0562-slideshow-mute-sound.diff} (100%) rename applied_patches/{0672-base64.diff => 0563-base64.diff} (100%) rename applied_patches/{0673-sfx2-qstart-nocrashhack.diff => 0564-sfx2-qstart-nocrashhack.diff} (100%) rename applied_patches/{0674-slideshow-effect-rewind.diff => 0565-slideshow-effect-rewind.diff} (100%) rename applied_patches/{0675-svx-ppt-tablerow-height-fix.diff => 0566-svx-ppt-tablerow-height-fix.diff} (100%) rename applied_patches/{0676-mail-document-subject.diff => 0567-mail-document-subject.diff} (100%) rename applied_patches/{0677-pptx-filter-as-a-separate-lib-sd-build-lst-with-transogl.diff => 0568-pptx-filter-as-a-separate-lib-sd-build-lst-with-transogl.diff} (100%) rename applied_patches/{0678-pptx-gfx-layout-fix.diff => 0569-pptx-gfx-layout-fix.diff} (100%) rename applied_patches/{0679-xlsx-export-notes-avoid-dereferencing-0-svx.diff => 0570-xlsx-export-notes-avoid-dereferencing-0-svx.diff} (100%) rename applied_patches/{0680-odf-converter-ignore-writerfilter.diff => 0571-odf-converter-ignore-writerfilter.diff} (100%) create mode 100644 applied_patches/0572-external-apm-header.diff rename applied_patches/{0692-wmf-mm-text.diff => 0573-wmf-mm-text.diff} (100%) rename applied_patches/{0693-wmf-mm-text-1.diff => 0574-wmf-mm-text-1.diff} (100%) rename applied_patches/{0694-sd-create-table-height-fix.diff => 0575-sd-create-table-height-fix.diff} (100%) rename applied_patches/{0695-pptx-autoplay-fix.diff => 0576-pptx-autoplay-fix.diff} (100%) rename applied_patches/{0696-configmgr-validate-removedtree.diff => 0577-configmgr-validate-removedtree.diff} (100%) rename applied_patches/{0697-svx-fix-fit-to-frame-crash.diff => 0578-svx-fix-fit-to-frame-crash.diff} (100%) rename applied_patches/{0699-svx-fontwork-crash-fix.diff => 0579-svx-fontwork-crash-fix.diff} (100%) rename applied_patches/{0700-svx-autoshape-cache-purge.diff => 0580-svx-autoshape-cache-purge.diff} (100%) rename applied_patches/{0701-normalize-template-paths-fix.diff => 0581-normalize-template-paths-fix.diff} (100%) rename applied_patches/{0702-edit-links-decode-unicode-uri.diff => 0582-edit-links-decode-unicode-uri.diff} (100%) rename applied_patches/{0703-fontconfig-cache-pre-substitution.diff => 0583-fontconfig-cache-pre-substitution.diff} (100%) rename applied_patches/{0704-link-with-uno-cppu.diff => 0584-link-with-uno-cppu.diff} (100%) rename applied_patches/{0708-oox-pptx-import-fix-placeholder-text-style.diff => 0585-oox-pptx-import-fix-placeholder-text-style.diff} (100%) create mode 100644 applied_patches/0586-build-fix-linux.diff create mode 100644 applied_patches/0587-emf+-driver-string.diff create mode 100644 applied_patches/0588-sd-print-fix-pageoffset.diff create mode 100644 applied_patches/0589-svx-ppt-import-fix-bullet-size.diff rename applied_patches/{0710-binfilter-stl.diff => 0590-binfilter-stl.diff} (100%) rename applied_patches/{0711-link-as-needed-bf.diff => 0591-link-as-needed-bf.diff} (100%) rename applied_patches/{0712-binfilter-dont-extern-sRTF-sHTML.diff => 0592-binfilter-dont-extern-sRTF-sHTML.diff} (100%) rename applied_patches/{0713-fit-list-to-size-binfilter.diff => 0593-fit-list-to-size-binfilter.diff} (100%) rename applied_patches/{0714-reportdesigner-no-license.diff => 0594-reportdesigner-no-license.diff} (100%) rename applied_patches/{0715-presenterscreen-no-license.diff => 0595-presenterscreen-no-license.diff} (100%) rename applied_patches/{0716-presentation-minimizer-no-license.diff => 0596-presentation-minimizer-no-license.diff} (100%) rename applied_patches/{0717-apache-commons-build-fix-invalid-chars.diff => 0597-apache-commons-build-fix-invalid-chars.diff} (100%) rename applied_patches/{0718-wiki-publisher-no-license.diff => 0598-wiki-publisher-no-license.diff} (100%) rename applied_patches/{0719-pdfimport-no-license.diff => 0599-pdfimport-no-license.diff} (100%) rename applied_patches/{0720-build-java-target-extensions.diff => 0600-build-java-target-extensions.diff} (100%) rename applied_patches/{0721-pdfimport-lax-restrictions.diff => 0601-pdfimport-lax-restrictions.diff} (100%) rename applied_patches/{0722-slideshow-effect-rewind-sdext.diff => 0602-slideshow-effect-rewind-sdext.diff} (100%) delete mode 100644 applied_patches/0628-fit-list-to-size-popup.diff delete mode 100644 applied_patches/0636-ui-desktop-integration.diff delete mode 100644 applied_patches/0681-calc-external-ref-modify-link-modified.diff delete mode 100644 applied_patches/0682-calc-xls-hyperlink-single-quote-fix.diff delete mode 100644 applied_patches/0683-calc-external-ref-decode-unicode-uri.diff delete mode 100644 applied_patches/0687-calc-perf-ods-import-properties.diff delete mode 100644 applied_patches/0698-basegfx-color-tools.diff delete mode 100644 applied_patches/0705-link-with-comphelper.diff delete mode 100644 applied_patches/0706-import-export-dialogmodel.diff delete mode 100644 applied_patches/0707-dtrans-aqua-dragrect-fix.diff delete mode 100644 applied_patches/0709-build-fix.diff create mode 100644 comphelper/inc/comphelper/docpasswordhelper.hxx create mode 100644 comphelper/inc/comphelper/docpasswordrequest.hxx create mode 100644 comphelper/source/misc/docpasswordhelper.cxx create mode 100644 comphelper/source/misc/docpasswordrequest.cxx create mode 100644 default_images/res/commandimagelist/lc_navigateback.png create mode 100644 default_images/res/commandimagelist/lc_navigateforward.png create mode 100644 default_images/res/commandimagelist/lch_navigateback.png create mode 100644 default_images/res/commandimagelist/lch_navigateforward.png create mode 100644 default_images/res/commandimagelist/sc_navigateback.png create mode 100644 default_images/res/commandimagelist/sc_navigateforward.png create mode 100644 default_images/res/commandimagelist/sch_navigateback.png create mode 100644 default_images/res/commandimagelist/sch_navigateforward.png create mode 100644 default_images/sc/res/popup_select_current.png create mode 100644 default_images/sc/res/popup_unselect_current.png delete mode 100644 framework/inc/classes/eventsconfiguration.hxx delete mode 100644 framework/inc/classes/eventsdocumenthandler.hxx create mode 100755 framework/inc/classes/fwlresid.hxx delete mode 100644 framework/inc/classes/imagesconfiguration.hxx delete mode 100644 framework/inc/classes/imagesdocumenthandler.hxx delete mode 100644 framework/inc/classes/menuconfiguration.hxx delete mode 100644 framework/inc/classes/statusbarconfiguration.hxx delete mode 100644 framework/inc/classes/statusbardocumenthandler.hxx delete mode 100755 framework/inc/classes/toolboxconfiguration.hxx delete mode 100644 framework/inc/classes/toolboxconfigurationdefines.hxx delete mode 100755 framework/inc/classes/toolboxdocumenthandler.hxx delete mode 100644 framework/inc/classes/toolboxlayoutdocumenthandler.hxx rewrite framework/inc/mediadescriptor.h (76%) delete mode 100644 framework/inc/services/menudocumenthandler.hxx delete mode 100644 framework/inc/services/popupmenucontrollerfactory.hxx delete mode 100644 framework/inc/services/saxnamespacefilter.hxx rewrite framework/inc/uielement/footermenucontroller.hxx (61%) create mode 100755 framework/inc/uifactory/factoryconfiguration.hxx create mode 100755 framework/source/classes/fwlresid.cxx rewrite framework/source/uiconfiguration/imagemanager.cxx (81%) create mode 100755 framework/source/uiconfiguration/imagemanagerimpl.cxx create mode 100755 framework/source/uiconfiguration/imagemanagerimpl.hxx rewrite framework/source/uiconfiguration/moduleimagemanager.cxx (87%) rewrite framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx (84%) rewrite framework/source/uiconfiguration/uiconfigurationmanager.cxx (81%) create mode 100755 framework/source/uiconfiguration/uiconfigurationmanagerimpl.cxx create mode 100755 framework/source/uiconfiguration/uiconfigurationmanagerimpl.hxx rewrite framework/source/uielement/footermenucontroller.cxx (71%) create mode 100755 framework/source/uifactory/factoryconfiguration.cxx rewrite framework/source/uifactory/popupmenucontrollerfactory.cxx (81%) rewrite framework/source/uifactory/statusbarcontrollerfactory.cxx (83%) rewrite framework/source/uifactory/toolbarcontrollerfactory.cxx (62%) create mode 100644 offapi/com/sun/star/document/PDFDialog.idl create mode 100644 offapi/com/sun/star/document/XVbaMethodParameter.idl create mode 100644 oovbaapi/ooo/vba/Globals.idl create mode 100644 oovbaapi/ooo/vba/XGlobals.idl create mode 100644 oox/inc/oox/core/filterdetect.hxx delete mode 100644 sal/osl/all/readline.c rewrite sal/osl/unx/file.cxx (87%) create mode 100644 sal/osl/unx/file_misc.cxx create mode 100644 sal/osl/unx/file_volume.cxx rewrite sal/osl/w32/file.cxx (91%) create mode 100644 sal/osl/w32/file_dirvol.cxx create mode 100644 sal/osl/w32/file_error.c create mode 100644 sal/osl/w32/file_error.h create mode 100644 sal/osl/w32/file_url.cxx create mode 100644 sal/osl/w32/file_url.h create mode 100644 sal/osl/w32/tempfile.cxx delete mode 100644 sal/workben/t_layer.c create mode 100644 sal/workben/t_readline.c delete mode 100644 sal/workben/t_tls.c delete mode 100644 sal/workben/t_zip.c create mode 100644 sc/inc/AccessibleFilterMenu.hxx create mode 100644 sc/inc/AccessibleFilterMenuItem.hxx create mode 100644 sc/inc/AccessibleFilterTopWindow.hxx create mode 100644 sc/inc/AccessibleGlobal.hxx delete mode 100644 sc/inc/indexmap.hxx delete mode 100644 sc/inc/phonetic.hxx create mode 100644 sc/inc/queryparam.hxx create mode 100644 sc/inc/sc.hrc.patched create mode 100644 sc/inc/sheetdata.hxx create mode 100644 sc/inc/tabbgcolor.hxx delete mode 100644 sc/source/core/data/phonetic.cxx create mode 100644 sc/source/core/inc/doubleref.hxx create mode 100644 sc/source/core/tool/doubleref.cxx delete mode 100644 sc/source/core/tool/indexmap.cxx create mode 100644 sc/source/core/tool/queryparam.cxx delete mode 100644 sc/source/filter/excel/biffdump.cxx delete mode 100644 sc/source/filter/excel/xlstream.cxx delete mode 100644 sc/source/filter/inc/fdumper.hxx delete mode 100644 sc/source/filter/inc/fdumperole.hxx delete mode 100644 sc/source/filter/inc/xldumper.hxx create mode 100644 sc/source/filter/xml/sheetdata.cxx delete mode 100644 sc/source/filter/xml/xmlrubyi.cxx delete mode 100644 sc/source/filter/xml/xmlrubyi.hxx create mode 100644 sc/source/ui/Accessibility/AccessibleFilterMenu.cxx create mode 100644 sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx create mode 100644 sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx create mode 100644 sc/source/ui/Accessibility/AccessibleGlobal.cxx delete mode 100644 sc/source/ui/dbgui/langchooser.cxx delete mode 100644 sc/source/ui/dbgui/langchooser.src create mode 100644 sc/source/ui/dbgui/textimportoptions.cxx create mode 100644 sc/source/ui/dbgui/textimportoptions.src delete mode 100644 sc/source/ui/inc/langchooser.hxx create mode 100644 sc/source/ui/inc/tabbgcolordlg.hxx rename sc/source/ui/inc/{langchooser.hrc => textimportoptions.hrc} (100%) create mode 100644 sc/source/ui/inc/textimportoptions.hxx create mode 100644 sc/source/ui/miscdlgs/tabbgcolordlg.cxx create mode 100644 sc/source/ui/vba/testvba/Logs/AutoFilter.log create mode 100644 sc/source/ui/vba/testvba/Logs/CalcFont.log create mode 100644 sc/source/ui/vba/testvba/Logs/MiscOperatorTests.log create mode 100644 sc/source/ui/vba/testvba/Logs/MiscRangeTests.log create mode 100644 sc/source/ui/vba/testvba/Logs/PageBreaks.log create mode 100644 sc/source/ui/vba/testvba/Logs/Ranges-2.log create mode 100644 sc/source/ui/vba/testvba/Logs/Ranges-3.log create mode 100644 sc/source/ui/vba/testvba/Logs/Ranges.log create mode 100644 sc/source/ui/vba/testvba/Logs/Shapes.log create mode 100644 sc/source/ui/vba/testvba/Logs/StrConv-test.log create mode 100644 sc/source/ui/vba/testvba/Logs/Template.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestAddress.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestCalc_Rangetest2.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestIntersection.log create mode 100644 sc/source/ui/vba/testvba/Logs/TestUnion.log create mode 100644 sc/source/ui/vba/testvba/Logs/VariantTest.log create mode 100644 sc/source/ui/vba/testvba/Logs/Window.log create mode 100644 sc/source/ui/vba/testvba/Logs/bytearraystring.log create mode 100644 sc/source/ui/vba/testvba/Logs/dateserial.log create mode 100644 sc/source/ui/vba/testvba/Logs/datevalue.log create mode 100644 sc/source/ui/vba/testvba/Logs/format.log create mode 100644 sc/source/ui/vba/testvba/Logs/pagesetup.log create mode 100644 sc/source/ui/vba/testvba/Logs/partition.log create mode 100644 sc/source/ui/vba/testvba/Logs/range-4.log create mode 100644 sc/source/ui/vba/testvba/Logs/replace.log create mode 100644 sc/source/ui/vba/testvba/Logs/stringplusdouble.log create mode 100644 sc/source/ui/vba/testvba/Logs/window2.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/CalcFont.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/MiscOperatorTests.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestIntersection.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/TestUnion.log create mode 100644 sc/source/ui/vba/testvba/TestDocuments/logs/unix/VariantTest.log create mode 100644 sc/source/ui/vba/testvba/list1 create mode 100644 sc/source/ui/vba/testvba/list2 create mode 100644 sc/source/ui/vba/testvba/list3 create mode 100644 sc/source/ui/vba/testvba/testrun.log create mode 100644 sc/source/ui/vba/vbabutton.cxx create mode 100644 sc/source/ui/vba/vbabutton.hxx create mode 100644 sc/source/ui/vba/vbacheckbox.cxx create mode 100644 sc/source/ui/vba/vbacheckbox.hxx create mode 100644 sc/source/ui/vba/vbacollectionimpl.cxx create mode 100644 sc/source/ui/vba/vbacollectionimpl.hxx create mode 100644 sc/source/ui/vba/vbacolorformat.cxx create mode 100644 sc/source/ui/vba/vbacolorformat.hxx create mode 100644 sc/source/ui/vba/vbacombobox.cxx create mode 100644 sc/source/ui/vba/vbacombobox.hxx create mode 100644 sc/source/ui/vba/vbacommandbar.cxx create mode 100644 sc/source/ui/vba/vbacommandbar.hxx create mode 100644 sc/source/ui/vba/vbacommandbarcontrol.cxx create mode 100644 sc/source/ui/vba/vbacommandbarcontrol.hxx create mode 100644 sc/source/ui/vba/vbacommandbarcontrols.cxx create mode 100644 sc/source/ui/vba/vbacommandbarcontrols.hxx create mode 100644 sc/source/ui/vba/vbacommandbars.cxx create mode 100644 sc/source/ui/vba/vbacommandbars.hxx create mode 100644 sc/source/ui/vba/vbacontrol.hxx create mode 100644 sc/source/ui/vba/vbacontrols.cxx create mode 100644 sc/source/ui/vba/vbacontrols.hxx create mode 100644 sc/source/ui/vba/vbafillformat.cxx create mode 100644 sc/source/ui/vba/vbafillformat.hxx create mode 100644 sc/source/ui/vba/vbaframe.cxx create mode 100644 sc/source/ui/vba/vbaframe.hxx create mode 100644 sc/source/ui/vba/vbahelper.hxx create mode 100644 sc/source/ui/vba/vbahelperinterface.hxx create mode 100644 sc/source/ui/vba/vbaimage.cxx create mode 100644 sc/source/ui/vba/vbaimage.hxx create mode 100644 sc/source/ui/vba/vbalabel.cxx create mode 100644 sc/source/ui/vba/vbalabel.hxx create mode 100644 sc/source/ui/vba/vbalineformat.cxx create mode 100644 sc/source/ui/vba/vbalineformat.hxx create mode 100644 sc/source/ui/vba/vbalistbox.cxx create mode 100644 sc/source/ui/vba/vbalistbox.hxx create mode 100644 sc/source/ui/vba/vbalistcontrolhelper.cxx create mode 100644 sc/source/ui/vba/vbalistcontrolhelper.hxx create mode 100644 sc/source/ui/vba/vbamultipage.cxx create mode 100644 sc/source/ui/vba/vbamultipage.hxx create mode 100644 sc/source/ui/vba/vbapages.cxx create mode 100644 sc/source/ui/vba/vbapages.hxx create mode 100644 sc/source/ui/vba/vbapictureformat.cxx create mode 100644 sc/source/ui/vba/vbapictureformat.hxx create mode 100644 sc/source/ui/vba/vbaprogressbar.cxx create mode 100644 sc/source/ui/vba/vbaprogressbar.hxx create mode 100644 sc/source/ui/vba/vbaradiobutton.cxx create mode 100644 sc/source/ui/vba/vbaradiobutton.hxx create mode 100644 sc/source/ui/vba/vbarange.cxx.pathched create mode 100644 sc/source/ui/vba/vbascrollbar.cxx create mode 100644 sc/source/ui/vba/vbascrollbar.hxx create mode 100644 sc/source/ui/vba/vbashape.cxx create mode 100644 sc/source/ui/vba/vbashape.hxx create mode 100644 sc/source/ui/vba/vbashaperange.cxx create mode 100644 sc/source/ui/vba/vbashaperange.hxx create mode 100644 sc/source/ui/vba/vbashapes.cxx create mode 100644 sc/source/ui/vba/vbashapes.hxx create mode 100644 sc/source/ui/vba/vbaspinbutton.cxx create mode 100644 sc/source/ui/vba/vbaspinbutton.hxx create mode 100644 sc/source/ui/vba/vbatextbox.cxx create mode 100644 sc/source/ui/vba/vbatextbox.hxx create mode 100644 sc/source/ui/vba/vbatogglebutton.cxx create mode 100644 sc/source/ui/vba/vbatogglebutton.hxx create mode 100644 sc/source/ui/vba/vbauserform.cxx create mode 100644 sc/source/ui/vba/vbauserform.hxx rewrite solenv/inc/_tg_srs.mk (70%) delete mode 100644 svtools/inc/docmspasswdrequest.hxx delete mode 100644 svtools/inc/docpasswdrequest.hxx delete mode 100644 svtools/source/misc1/docmspasswdrequest.cxx delete mode 100644 svtools/source/misc1/docpasswdrequest.cxx create mode 100755 svx/inc/svx/dbcharsethelper.hxx create mode 100755 svx/inc/svx/dbtoolsclient.hxx delete mode 100644 svx/source/inc/dbcharsethelper.hxx delete mode 100644 svx/source/inc/dbtoolsclient.hxx create mode 100644 sw/inc/ecmaflds.hxx rewrite testautomation/framework/required/input/mailmerge_data.odb (71%) rewrite testautomation/graphics/required/includes/impress/im_011_.inc (78%) create mode 100644 testtools/source/cliversioning/version_libs/version_3_1_1.dll create mode 100644 udkapi/com/sun/star/script/XAutomationInvocation.idl create mode 100644 vcl/inc/vcl/popupmenuwindow.hxx create mode 100644 vcl/source/window/popupmenuwindow.cxx create mode 100644 xmloff/inc/xmloff/ecmaflds.hxx create mode 100644 xmlscript/util/makefile.mk.patched diff --git a/.tag b/.tag index 858e5d365..d5e574e72 100644 --- a/.tag +++ b/.tag @@ -1 +1 @@ -dev300-m57 +dev300-m58 diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index aea02be9c..84c702a70 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -72,6 +72,7 @@ #include #include #include +#include "vcl/popupmenuwindow.hxx" #include @@ -376,7 +377,17 @@ inline bool hasFloatingChild(Window *pWindow) } else if ( nType == WINDOW_BORDERWINDOW && hasFloatingChild( pWindow ) ) { - xContext = new FloatingWindowAccessible( _pXWindow ); + PopupMenuFloatingWindow* pChild = dynamic_cast( + pWindow->GetAccessibleChildWindow(0)); + if ( pChild && pChild->IsPopupMenu() ) + { + // Get the accessible context from the child window. + Reference xAccessible = pChild->CreateAccessible(); + if (xAccessible.is()) + xContext = xAccessible->getAccessibleContext(); + } + else + xContext = new FloatingWindowAccessible( _pXWindow ); } else if ( nType == WINDOW_HELPTEXTWINDOW ) { diff --git a/applied_patches/0004-cws-koheidatapilot03-accessibility.diff b/applied_patches/0004-cws-koheidatapilot03-accessibility.diff new file mode 100644 index 000000000..5b41a8dc6 --- /dev/null +++ b/applied_patches/0004-cws-koheidatapilot03-accessibility.diff @@ -0,0 +1,31 @@ +diff --git accessibility/source/helper/acc_factory.cxx accessibility/source/helper/acc_factory.cxx +index aea02be..84c702a 100644 +--- accessibility/source/helper/acc_factory.cxx ++++ accessibility/source/helper/acc_factory.cxx +@@ -72,6 +72,7 @@ + #include + #include + #include ++#include "vcl/popupmenuwindow.hxx" + + #include + +@@ -376,7 +377,17 @@ inline bool hasFloatingChild(Window *pWindow) + } + else if ( nType == WINDOW_BORDERWINDOW && hasFloatingChild( pWindow ) ) + { +- xContext = new FloatingWindowAccessible( _pXWindow ); ++ PopupMenuFloatingWindow* pChild = dynamic_cast( ++ pWindow->GetAccessibleChildWindow(0)); ++ if ( pChild && pChild->IsPopupMenu() ) ++ { ++ // Get the accessible context from the child window. ++ Reference xAccessible = pChild->CreateAccessible(); ++ if (xAccessible.is()) ++ xContext = xAccessible->getAccessibleContext(); ++ } ++ else ++ xContext = new FloatingWindowAccessible( _pXWindow ); + } + else if ( nType == WINDOW_HELPTEXTWINDOW ) + { diff --git a/applied_patches/0005-cws-koheidatapilot03-offapi.diff b/applied_patches/0005-cws-koheidatapilot03-offapi.diff new file mode 100644 index 000000000..3f06e0d72 --- /dev/null +++ b/applied_patches/0005-cws-koheidatapilot03-offapi.diff @@ -0,0 +1,22 @@ +diff --git offapi/com/sun/star/sheet/MemberResultFlags.idl offapi/com/sun/star/sheet/MemberResultFlags.idl +index 6660b38..23ba7b0 100644 +--- offapi/com/sun/star/sheet/MemberResultFlags.idl ++++ offapi/com/sun/star/sheet/MemberResultFlags.idl +@@ -59,6 +59,17 @@ published constants MemberResultFlags + */ + const long CONTINUE = 4; + ++ //------------------------------------------------------------------------- ++ ++ /** The element contains a grand total. ++ */ ++ const long GRANDTOTAL = 8; ++ ++ //------------------------------------------------------------------------- ++ ++ /** The element is a numeric value. ++ */ ++ const long NUMERIC = 16; + }; + + //============================================================================= diff --git a/applied_patches/0006-cws-koheidatapilot03-sc.diff b/applied_patches/0006-cws-koheidatapilot03-sc.diff new file mode 100644 index 000000000..2427c76b9 --- /dev/null +++ b/applied_patches/0006-cws-koheidatapilot03-sc.diff @@ -0,0 +1,10450 @@ +diff --git sc/inc/AccessibleFilterMenu.hxx sc/inc/AccessibleFilterMenu.hxx +new file mode 100644 +index 0000000..2495b4c +--- /dev/null ++++ sc/inc/AccessibleFilterMenu.hxx +@@ -0,0 +1,191 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_ACCESSIBLEFILTERMENU_HXX ++#define SC_ACCESSIBLEFILTERMENU_HXX ++ ++#include "AccessibleContextBase.hxx" ++#include "cppuhelper/implbase1.hxx" ++ ++#include ++#include ++#include ++#include ++ ++#include ++ ++namespace com { namespace sun { namespace star { ++ namespace accessibility { ++ struct AccessibleEventObject; ++ } ++}}} ++ ++class ScDocument; ++class ScMenuFloatingWindow; ++ ++typedef ::cppu::ImplHelper1< ++ ::com::sun::star::accessibility::XAccessibleSelection > ScAccessibleFilterMenu_BASE; ++ ++class ScAccessibleFilterMenu : ++ public ScAccessibleContextBase, ++ public ScAccessibleFilterMenu_BASE ++{ ++public: ++ explicit ScAccessibleFilterMenu( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessible>& rxParent, ++ ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos, ScDocument* pDoc); ++ virtual ~ScAccessibleFilterMenu(); ++ ++ // XAccessibleComponent ++ ++ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual sal_Bool SAL_CALL isVisible() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual void SAL_CALL grabFocus() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual sal_Int32 SAL_CALL getForeground() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual sal_Int32 SAL_CALL getBackground() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ // XAccessibleContext ++ ++ virtual ::rtl::OUString SAL_CALL getAccessibleName() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual sal_Int32 SAL_CALL getAccessibleChildCount() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL ++ getAccessibleChild(sal_Int32 nIndex) ++ throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); ++ ++ virtual ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL ++ getAccessibleStateSet() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::rtl::OUString SAL_CALL getImplementationName() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ // XAccessibleEventBroadcaster ++ ++ virtual void SAL_CALL ++ addEventListener( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) ++ throw (com::sun::star::uno::RuntimeException); ++ ++ // Remove an existing event listener. ++ virtual void SAL_CALL ++ removeEventListener( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) ++ throw (com::sun::star::uno::RuntimeException); ++ ++ // XAccessibleSelection ++ ++ virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) ++ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); ++ ++ virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) ++ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); ++ ++ virtual void SAL_CALL clearAccessibleSelection() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual void SAL_CALL selectAllAccessibleChildren() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::sal_Int32 SAL_CALL getSelectedAccessibleChildCount() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL ++ getSelectedAccessibleChild(sal_Int32 nChildIndex) ++ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); ++ ++ virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) ++ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); ++ ++ // XInterface ++ ++ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ++ ::com::sun::star::uno::Type const & rType ) ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual void SAL_CALL acquire() throw (); ++ virtual void SAL_CALL release() throw (); ++ ++ // XTypeProvider ++ ++ virtual ::com::sun::star::uno::Sequence SAL_CALL getImplementationId() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ // non-UNO methods ++ ++ void appendMenuItem(const ::rtl::OUString& rName, bool bEnabled, size_t nMenuPos); ++ void setMenuPos(size_t nMenuPos); ++ void setEnabled(bool bEnabled); ++ ++protected: ++ ++ sal_Int32 getMenuItemCount() const; ++ ++ virtual Rectangle GetBoundingBoxOnScreen() const ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual Rectangle GetBoundingBox() const ++ throw (::com::sun::star::uno::RuntimeException); ++ ++private: ++ bool isSelected() const; ++ bool isFocused() const; ++ ++ void updateStates(); ++ ++private: ++ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > maMenuItems; ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet; ++ ++ size_t mnMenuPos; ++ ScMenuFloatingWindow* mpWindow; ++ ScDocument* mpDoc; ++ ++ bool mbEnabled:1; ++}; ++ ++#endif +diff --git sc/inc/AccessibleFilterMenuItem.hxx sc/inc/AccessibleFilterMenuItem.hxx +new file mode 100644 +index 0000000..b9a3485 +--- /dev/null ++++ sc/inc/AccessibleFilterMenuItem.hxx +@@ -0,0 +1,124 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_ACCESSIBLEFILTERMENUITEM_HXX ++#define SC_ACCESSIBLEFILTERMENUITEM_HXX ++ ++#include "AccessibleContextBase.hxx" ++#include "cppuhelper/implbase1.hxx" ++ ++#include ++ ++class ScMenuFloatingWindow; ++ ++typedef ::cppu::ImplHelper1< ++ ::com::sun::star::accessibility::XAccessibleAction > ScAccessibleFilterMenuItem_BASE; ++ ++class ScAccessibleFilterMenuItem : ++ public ScAccessibleContextBase, ++ public ScAccessibleFilterMenuItem_BASE ++{ ++public: ++ explicit ScAccessibleFilterMenuItem( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessible>& rxParent, ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos); ++ ++ virtual ~ScAccessibleFilterMenuItem(); ++ ++ // XAccessibleContext ++ ++ virtual sal_Int32 SAL_CALL getAccessibleChildCount() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessible > SAL_CALL ++ getAccessibleChild(sal_Int32 nIndex) ++ throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); ++ ++ virtual ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL ++ getAccessibleStateSet() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::rtl::OUString SAL_CALL getImplementationName() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ // XAccessibleAction ++ ++ virtual ::sal_Int32 SAL_CALL getAccessibleActionCount() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) ++ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); ++ ++ virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) ++ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); ++ ++ virtual ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL ++ getAccessibleActionKeyBinding(sal_Int32 nIndex) ++ throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); ++ ++ // XInterface ++ ++ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ++ ::com::sun::star::uno::Type const & rType ) ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual void SAL_CALL acquire() throw (); ++ virtual void SAL_CALL release() throw (); ++ ++ // Non-UNO Methods ++ ++ void setEnabled(bool bEnabled); ++ ++protected: ++ ++ virtual Rectangle GetBoundingBoxOnScreen() const ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual Rectangle GetBoundingBox() const ++ throw (::com::sun::star::uno::RuntimeException); ++ ++private: ++ bool isSelected() const; ++ bool isFocused() const; ++ void updateStateSet(); ++ ++private: ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet; ++ ++ ScMenuFloatingWindow* mpWindow; ++ ::rtl::OUString maName; ++ size_t mnMenuPos; ++ bool mbEnabled; ++}; ++ ++#endif +diff --git sc/inc/AccessibleFilterTopWindow.hxx sc/inc/AccessibleFilterTopWindow.hxx +new file mode 100644 +index 0000000..c13c494 +--- /dev/null ++++ sc/inc/AccessibleFilterTopWindow.hxx +@@ -0,0 +1,104 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_ACCESSIBLEFILTERTOPWINDOW_HXX ++#define SC_ACCESSIBLEFILTERTOPWINDOW_HXX ++ ++//#include "AccessibleContextBase.hxx" ++#include "AccessibleFilterMenu.hxx" ++#include "cppuhelper/implbase1.hxx" ++ ++class ScDPFieldPopupWindow; ++class ScDocument; ++ ++class ScAccessibleFilterTopWindow : public ScAccessibleFilterMenu ++{ ++public: ++ ScAccessibleFilterTopWindow( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessible>& rxParent, ++ ScDPFieldPopupWindow* pWin, const ::rtl::OUString& rName, ScDocument* pDoc); ++ virtual ~ScAccessibleFilterTopWindow(); ++ ++ // XAccessibleContext ++ ++ virtual sal_Int32 SAL_CALL getAccessibleChildCount() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL ++ getAccessibleChild(sal_Int32 nIndex) ++ throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); ++ ++ virtual ::rtl::OUString SAL_CALL getImplementationName() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ // Non-UNO Methods ++ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ getAccessibleChildMenu(); ++ ++ enum ChildControlType { ++ LISTBOX, TOGGLE_ALL, SINGLE_ON_BTN, SINGLE_OFF_BTN, OK_BTN, CANCEL_BTN ++ }; ++ void setAccessibleChild( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessible >& rAccessible, ++ ChildControlType eType); ++ ++private: ++ /** The top menu part */ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ mxAccMenu; ++ ++ /** check list box for field member visibility */ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ mxAccListBox; ++ ++ /** check box for toggling all field member's visibility. */ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ mxAccToggleAll; ++ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ mxAccSingleOnBtn; ++ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ mxAccSingleOffBtn; ++ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ mxAccOkBtn; ++ ++ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ++ mxAccCancelBtn; ++ ++ ScDPFieldPopupWindow* mpWindow; ++ ScDocument* mpDoc; ++}; ++ ++#endif +diff --git sc/inc/AccessibleGlobal.hxx sc/inc/AccessibleGlobal.hxx +new file mode 100644 +index 0000000..5e75bf4 +--- /dev/null ++++ sc/inc/AccessibleGlobal.hxx +@@ -0,0 +1,72 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_ACCESSIBLEGLOBAL_HXX ++#define SC_ACCESSIBLEGLOBAL_HXX ++ ++#include ++#include "cppuhelper/implbase1.hxx" ++ ++#include ++ ++/** ++ * Generic XAccessibleStateSet implementation. ++ */ ++class ScAccessibleStateSet : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleStateSet > ++{ ++public: ++ ScAccessibleStateSet(); ++ virtual ~ScAccessibleStateSet(); ++ ++ // XAccessibleStateSet ++ ++ virtual ::sal_Bool SAL_CALL isEmpty() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::sal_Bool SAL_CALL containsAll( ++ const ::com::sun::star::uno::Sequence& aStateSet) ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() ++ throw (::com::sun::star::uno::RuntimeException); ++ ++ // Non-UNO Methods ++ ++ void insert(sal_Int16 nState); ++ void clear(); ++ ++private: ++ ::std::set maStates; ++}; ++ ++#endif +diff --git sc/inc/attrib.hxx sc/inc/attrib.hxx +index 72a4769..25caeb1 100644 +--- sc/inc/attrib.hxx ++++ sc/inc/attrib.hxx +@@ -42,13 +42,16 @@ + + // Flags fuer durch Merge verdeckte Zellen + // und Control fuer Auto-Filter +-#define SC_MF_HOR 1 +-#define SC_MF_VER 2 +-#define SC_MF_AUTO 4 +-#define SC_MF_BUTTON 8 +-#define SC_MF_SCENARIO 16 ++#define SC_MF_HOR 0x0001 ++#define SC_MF_VER 0x0002 ++#define SC_MF_AUTO 0x0004 /// autofilter arrow ++#define SC_MF_BUTTON 0x0008 /// field button for datapilot ++#define SC_MF_SCENARIO 0x0010 ++#define SC_MF_BUTTON_POPUP 0x0020 /// dp button with popup arrow ++#define SC_MF_HIDDEN_MEMBER 0x0040 /// dp field button with presence of hidden member ++#define SC_MF_DP_TABLE 0x0080 /// dp table output + +-#define SC_MF_ALL 31 ++#define SC_MF_ALL 0x00FF + + + class EditTextObject; +@@ -103,6 +106,7 @@ public: + + BOOL HasAutoFilter() const { return ( GetValue() & SC_MF_AUTO ) != 0; } + BOOL HasButton() const { return ( GetValue() & SC_MF_BUTTON ) != 0; } ++ bool HasDPTable() const { return ( GetValue() & SC_MF_DP_TABLE ) != 0; } + + BOOL IsScenario() const { return ( GetValue() & SC_MF_SCENARIO ) != 0; } + }; +diff --git sc/inc/column.hxx sc/inc/column.hxx +index fd2473b..ec87323 100644 +--- sc/inc/column.hxx ++++ sc/inc/column.hxx +@@ -162,7 +162,7 @@ public: + SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; + BOOL HasDataAt(SCROW nRow) const; + BOOL HasVisibleDataAt(SCROW nRow) const; +-//UNUSED2009-05 SCROW GetFirstDataPos() const; ++ SCROW GetFirstDataPos() const; + SCROW GetLastDataPos() const; + SCROW GetLastVisDataPos(BOOL bNotes) const; // ohne Broadcaster + SCROW GetFirstVisDataPos(BOOL bNotes) const; +diff --git sc/inc/document.hxx sc/inc/document.hxx +index f0f9189..14d606e 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -859,6 +859,8 @@ public: + + USHORT GetErrCode( const ScAddress& ) const; + ++ bool ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const; ++ + void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ); + SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; +diff --git sc/inc/dpgroup.hxx sc/inc/dpgroup.hxx +index f81ff66..07be632 100644 +--- sc/inc/dpgroup.hxx ++++ sc/inc/dpgroup.hxx +@@ -33,6 +33,7 @@ + + #include + #include ++#include + + #include "dptabdat.hxx" + #include "scdllapi.h" +@@ -182,7 +183,7 @@ class ScDPGroupTableData : public ScDPTableData + { + typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > StringHashSet; + +- ScDPTableData* pSourceData; ++ ::boost::shared_ptr pSourceData; + long nSourceCount; + ScDPGroupDimensionVec aGroups; + ScDPNumGroupDimension* pNumGroups; // array[nSourceCount] +@@ -200,7 +201,7 @@ class ScDPGroupTableData : public ScDPTableData + + public: + // takes ownership of pSource +- ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ); ++ ScDPGroupTableData( const ::boost::shared_ptr& pSource, ScDocument* pDocument ); + virtual ~ScDPGroupTableData(); + + void AddGroupDimension( const ScDPGroupDimension& rGroup ); +diff --git sc/inc/dpobject.hxx sc/inc/dpobject.hxx +index e968007..d7fbbfe 100644 +--- sc/inc/dpobject.hxx ++++ sc/inc/dpobject.hxx +@@ -36,8 +36,11 @@ + #include "address.hxx" + #include "collect.hxx" + #include "dpoutput.hxx" ++#include "pivot.hxx" + #include + ++#include ++ + //------------------------------------------------------------------ + + namespace com { namespace sun { namespace star { namespace sheet { +@@ -64,6 +67,7 @@ class ScStrCollection; + class TypedScStrCollection; + struct PivotField; + class ScDPCacheTable; ++class ScDPTableData; + + struct ScDPServiceDesc + { +@@ -99,15 +103,19 @@ private: + ScSheetSourceDesc* pSheetDesc; // for sheet data + ScImportSourceDesc* pImpDesc; // for database data + ScDPServiceDesc* pServDesc; // for external service ++ ::boost::shared_ptr mpTableData; + // cached data + com::sun::star::uno::Reference xSource; + ScDPOutput* pOutput; + BOOL bSettingsChanged; + BOOL bAlive; // FALSE if only used to hold settings ++ sal_uInt16 mnAutoFormatIndex; + BOOL bAllowMove; + long nHeaderRows; // page fields plus filter button ++ bool mbHeaderLayout; // TRUE : grid, FALSE : standard + + ++ SC_DLLPRIVATE ScDPTableData* GetTableData(); + SC_DLLPRIVATE void CreateObjects(); + SC_DLLPRIVATE void CreateOutput(); + +@@ -135,6 +143,12 @@ public: + void SetOutRange(const ScRange& rRange); + const ScRange& GetOutRange() const { return aOutRange; } + ++ void SetAutoFormatIndex (const sal_uInt16 nIndex); ++ sal_uInt16 GetAutoFormatIndex() const; ++ ++ void SetHeaderLayout(bool bUseGrid); ++ bool GetHeaderLayout() const; ++ + void SetSheetDesc(const ScSheetSourceDesc& rDesc); + void SetImportDesc(const ScImportSourceDesc& rDesc); + void SetServiceData(const ScDPServiceDesc& rDesc); +@@ -157,7 +171,14 @@ public: + void SetTag(const String& rNew); + const String& GetTag() const { return aTableTag; } + +- BOOL IsDimNameInUse( const String& rName ) const; ++ /** ++ * Data description cell displays the description of a data dimension if ++ * and only if there is only one data dimension. It's usually located at ++ * the upper-left corner of the table output. ++ */ ++ bool IsDataDescriptionCell(const ScAddress& rPos); ++ ++ bool IsDimNameInUse(const ::rtl::OUString& rName) const; + String GetDimName( long nDim, BOOL& rIsDataLayout ); + BOOL IsDuplicated( long nDim ); + long GetDimCount(); +@@ -190,16 +211,10 @@ public: + sal_Int32 GetUsedHierarchy( sal_Int32 nDim ); + + BOOL GetMembersNA( sal_Int32 nDim, com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xMembers ); +- BOOL GetMembers( sal_Int32 nDim, +- com::sun::star::uno::Sequence< rtl::OUString >& rMembers, +- com::sun::star::uno::Sequence< sal_Bool >* pVisible = 0, +- com::sun::star::uno::Sequence< sal_Bool >* pShowDet = 0 ); +- + BOOL GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xMembers ); +- BOOL GetMembers( sal_Int32 nDim, sal_Int32 nHier, +- com::sun::star::uno::Sequence< rtl::OUString >& rMembers, +- com::sun::star::uno::Sequence< sal_Bool >* pVisible = 0, +- com::sun::star::uno::Sequence< sal_Bool >* pShowDet = 0 ); ++ ++ bool GetMemberNames( sal_Int32 nDim, ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames ); ++ bool GetMembers( sal_Int32 nDim, sal_Int32 nHier, ::std::vector& rMembers ); + + void UpdateReference( UpdateRefMode eUpdateRefMode, + const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); +@@ -221,6 +236,8 @@ public: + // (button attribute must be present) + void RefreshAfterLoad(); + ++ void BuildAllDimensionMembers(); ++ + static BOOL HasRegisteredSources(); + static com::sun::star::uno::Sequence GetRegisteredSources(); + static com::sun::star::uno::Reference +@@ -291,6 +308,11 @@ public: + + ScSimpleSharedString& GetSharedString(); + ++ void FreeTable(ScDPObject* pDPObj); ++ SC_DLLPUBLIC bool InsertNewTable(ScDPObject* pDPObj); ++ ++ bool HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const; ++ + ScDPCacheCell* getCacheCellFromPool(const ScDPCacheCell& rCell); + void clearCacheCellPool(); + }; +diff --git sc/inc/dpoutput.hxx sc/inc/dpoutput.hxx +index 4a071de..c28f901 100644 +--- sc/inc/dpoutput.hxx ++++ sc/inc/dpoutput.hxx +@@ -94,6 +94,7 @@ private: + com::sun::star::uno::Sequence< + com::sun::star::sheet::DataResult> > aData; + BOOL bResultsError; ++ bool mbHasDataLayout; + String aDataDescription; + + // Number format related parameters +@@ -109,6 +110,7 @@ private: + long nColCount; + long nRowCount; + long nHeaderSize; ++ bool mbHeaderLayout; // TRUE : grid, FALSE : standard + SCCOL nTabStartCol; + SCROW nTabStartRow; + SCCOL nMemberStartCol; +@@ -123,8 +125,8 @@ private: + void HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, + const com::sun::star::sheet::MemberResult& rData, + BOOL bColHeader, long nLevel ); +- void FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, +- BOOL bFrame = TRUE ); ++ void FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, ++ bool bInTable, bool bPopup, bool bHasHiddenMember ); + void CalcSizes(); + + /** Query which sub-area of the table the cell is in. See +@@ -162,6 +164,9 @@ public: + + void GetMemberResultNames( ScStrCollection& rNames, long nDimension ); + ++ void SetHeaderLayout(bool bUseGrid); ++ bool GetHeaderLayout() const; ++ + static void GetDataDimensionNames( String& rSourceName, String& rGivenName, + const com::sun::star::uno::Reference< + com::sun::star::uno::XInterface>& xDim ); +diff --git sc/inc/dpoutputgeometry.hxx sc/inc/dpoutputgeometry.hxx +new file mode 100644 +index 0000000..d423d18 +--- /dev/null ++++ sc/inc/dpoutputgeometry.hxx +@@ -0,0 +1,80 @@ ++/************************************************************************* ++ * ++ * 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: xmldpimp.cxx,v $ ++ * $Revision: 1.27.134.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_DPOUTPUTGEOMETRY_HXX ++#define SC_DPOUTPUTGEOMETRY_HXX ++ ++#include "address.hxx" ++#include ++ ++class ScAddress; ++ ++class SC_DLLPUBLIC ScDPOutputGeometry ++{ ++public: ++ enum FieldType { Column, Row, Page, Data, None }; ++ enum ImportType { ODF, XLS }; ++ ++ ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter, ImportType eImportType); ++ ~ScDPOutputGeometry(); ++ ++ /** ++ * @param nCount number of row fields, excluding the data layout ++ * field if exists. ++ */ ++ void setRowFieldCount(sal_uInt32 nCount); ++ void setColumnFieldCount(sal_uInt32 nCount); ++ void setPageFieldCount(sal_uInt32 nCount); ++ void setDataFieldCount(sal_uInt32 nCount); ++ ++ void getColumnFieldPositions(::std::vector& rAddrs) const; ++ void getRowFieldPositions(::std::vector& rAddrs) const; ++ void getPageFieldPositions(::std::vector& rAddrs) const; ++ ++ SCROW getRowFieldHeaderRow() const; ++ ++ FieldType getFieldButtonType(const ScAddress& rPos) const; ++ ++private: ++ ScDPOutputGeometry(); // disabled ++ ++private: ++ ScRange maOutRange; ++ sal_uInt32 mnRowFields; /// number of row fields (data layout field NOT included!) ++ sal_uInt32 mnColumnFields; ++ sal_uInt32 mnPageFields; ++ sal_uInt32 mnDataFields; ++ ++ ImportType meImportType; ++ ++ bool mbShowFilter; ++}; ++ ++#endif +diff --git sc/inc/dpsave.hxx sc/inc/dpsave.hxx +index 11ed5d7..0f9c6fe 100644 +--- sc/inc/dpsave.hxx ++++ sc/inc/dpsave.hxx +@@ -34,9 +34,11 @@ + #include + #include + #include ++#include + #include "scdllapi.h" + #include + #include ++#include + + namespace com { namespace sun { namespace star { namespace sheet { + struct DataPilotFieldReference; +@@ -46,6 +48,7 @@ namespace com { namespace sun { namespace star { namespace sheet { + } } } } + + class ScDPDimensionSaveData; ++class ScDPTableData; + + // -------------------------------------------------------------------- + // +@@ -57,6 +60,7 @@ class ScDPSaveMember + { + private: + String aName; ++ ::std::auto_ptr mpLayoutName; // custom name to be displayed in the table. + USHORT nVisibleMode; + USHORT nShowDetailsMode; + +@@ -77,18 +81,23 @@ public: + + void SetName( const String& rNew ); // used if the source member was renamed (groups) + ++ SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName ); ++ SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; ++ void RemoveLayoutName(); ++ + void WriteToSource( const com::sun::star::uno::Reference< + com::sun::star::uno::XInterface>& xMember, + sal_Int32 nPosition ); + }; + + +-class ScDPSaveDimension ++class SC_DLLPUBLIC ScDPSaveDimension + { + private: + String aName; +- String* pLayoutName; // alternative name for layout, not used (yet) + String* pSelectedPage; ++ ::std::auto_ptr mpLayoutName; ++ ::std::auto_ptr mpSubtotalName; + BOOL bIsDataLayout; + BOOL bDupFlag; + USHORT nOrientation; +@@ -127,43 +136,52 @@ public: + + void SetName( const String& rNew ); // used if the source dim was renamed (groups) + +- SC_DLLPUBLIC void SetOrientation(USHORT nNew); +- SC_DLLPUBLIC void SetSubTotals(long nCount, const USHORT* pFuncs); ++ void SetOrientation(USHORT nNew); ++ void SetSubTotals(long nCount, const USHORT* pFuncs); + long GetSubTotalsCount() const { return nSubTotalCount; } + USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; } +- SC_DLLPUBLIC void SetShowEmpty(BOOL bSet); ++ void SetShowEmpty(BOOL bSet); + BOOL GetShowEmpty() const { return BOOL(nShowEmptyMode); } +- SC_DLLPUBLIC void SetFunction(USHORT nNew); // enum GeneralFunction ++ void SetFunction(USHORT nNew); // enum GeneralFunction + USHORT GetFunction() const { return nFunction; } + void SetUsedHierarchy(long nNew); + long GetUsedHierarchy() const { return nUsedHierarchy; } +- SC_DLLPUBLIC void SetLayoutName(const String* pName); +- SC_DLLPUBLIC const String& GetLayoutName() const; +- SC_DLLPUBLIC BOOL HasLayoutName() const; ++ ++ void SetLayoutName(const ::rtl::OUString& rName); ++ const ::rtl::OUString* GetLayoutName() const; ++ void RemoveLayoutName(); ++ void SetSubtotalName(const ::rtl::OUString& rName); ++ const ::rtl::OUString* GetSubtotalName() const; ++ ++ bool IsMemberNameInUse(const ::rtl::OUString& rName) const; + + const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const { return pReferenceValue; } +- SC_DLLPUBLIC void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); ++ void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); + + const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const { return pSortInfo; } +- SC_DLLPUBLIC void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); ++ void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); + const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const { return pAutoShowInfo; } +- SC_DLLPUBLIC void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); ++ void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); + const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const { return pLayoutInfo; } +- SC_DLLPUBLIC void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); ++ void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); + +- SC_DLLPUBLIC void SetCurrentPage( const String* pPage ); // NULL = no selection (all) +- SC_DLLPUBLIC BOOL HasCurrentPage() const; +- SC_DLLPUBLIC const String& GetCurrentPage() const; ++ void SetCurrentPage( const String* pPage ); // NULL = no selection (all) ++ BOOL HasCurrentPage() const; ++ const String& GetCurrentPage() const; + + USHORT GetOrientation() const { return nOrientation; } + + ScDPSaveMember* GetExistingMemberByName(const String& rName); +- SC_DLLPUBLIC ScDPSaveMember* GetMemberByName(const String& rName); ++ ScDPSaveMember* GetMemberByName(const String& rName); + + void SetMemberPosition( const String& rName, sal_Int32 nNewPos ); + + void WriteToSource( const com::sun::star::uno::Reference< + com::sun::star::uno::XInterface>& xDim ); ++ ++ void UpdateMemberVisibility(const ::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData); ++ ++ bool HasInvisibleMember() const; + }; + + +@@ -179,6 +197,12 @@ private: + BOOL bFilterButton; // not passed to DataPilotSource + BOOL bDrillDown; // not passed to DataPilotSource + ++ /** if true, all dimensions already have all of their member instances ++ * created. */ ++ bool mbDimensionMembersBuilt; ++ ++ ::std::auto_ptr mpGrandTotalName; ++ + public: + SC_DLLPUBLIC ScDPSaveData(); + ScDPSaveData(const ScDPSaveData& r); +@@ -188,21 +212,26 @@ public: + + BOOL operator== ( const ScDPSaveData& r ) const; + ++ SC_DLLPUBLIC void SetGrandTotalName(const ::rtl::OUString& rName); ++ SC_DLLPUBLIC const ::rtl::OUString* GetGrandTotalName() const; ++ + const List& GetDimensions() const { return aDimList; } + void AddDimension(ScDPSaveDimension* pDim) { aDimList.Insert(pDim, LIST_APPEND); } + + ScDPSaveDimension* GetDimensionByName(const String& rName); + SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension(); ++ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const; + + ScDPSaveDimension* DuplicateDimension(const String& rName); + SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim); + +- SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName); ++ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName) const; + SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const String& rName); + + void RemoveDimensionByName(const String& rName); + + ScDPSaveDimension* GetInnermostDimension(USHORT nOrientation); ++ ScDPSaveDimension* GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation); + long GetDataDimensionCount() const; + + +@@ -229,6 +258,14 @@ public: + const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; } + SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there + void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied ++ void BuildAllDimensionMembers(ScDPTableData* pData); ++ ++ /** ++ * Check whether a dimension has one or more invisible members. ++ * ++ * @param rDimName dimension name ++ */ ++ SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const; + }; + + +diff --git sc/inc/dptabres.hxx sc/inc/dptabres.hxx +index 0712cc9..4e05c19 100644 +--- sc/inc/dptabres.hxx ++++ sc/inc/dptabres.hxx +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + namespace com { namespace sun { namespace star { namespace sheet { + struct DataPilotFieldReference; +@@ -262,7 +263,7 @@ public: + + long GetMeasureCount() const { return nMeasCount; } + ScSubTotalFunc GetMeasureFunction(long nMeasure) const; +- String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc) const; ++ String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const; + String GetMeasureDimensionName(long nMeasure) const; + const ::com::sun::star::sheet::DataPilotFieldReference& GetMeasureRefVal(long nMeasure) const; + USHORT GetMeasureRefOrient(long nMeasure) const; +@@ -284,6 +285,8 @@ public: + const ScDPItemData& rBaseData, long nBaseIndex ) const; + BOOL HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, + const ScDPItemData& rSecondData, long nSecondIndex ) const; ++ ++ const ScDPSource* GetSource() const; + }; + + +diff --git sc/inc/dptabsrc.hxx sc/inc/dptabsrc.hxx +index 670f314..deb0498 100644 +--- sc/inc/dptabsrc.hxx ++++ sc/inc/dptabsrc.hxx +@@ -33,6 +33,7 @@ + + #include + #include ++#include + #include + #include + #include "global.hxx" // enum ScSubTotalFunc +@@ -108,7 +109,7 @@ class ScDPSource : public cppu::WeakImplHelper6< + com::sun::star::lang::XServiceInfo > + { + private: +- ScDPTableData* pData; // data source ++ ScDPTableData* pData; // data source (ScDPObject manages its life time) + ScDPDimensions* pDimensions; // api objects + // settings: + long nColDims[SC_DAPI_MAXFIELDS]; +@@ -136,6 +137,8 @@ private: + List aRowLevelList; + BOOL bResultOverflow; + ++ ::std::auto_ptr mpGrandTotalName; ++ + void CreateRes_Impl(); + void FillMemberResults(); + void FillLevelList( USHORT nOrientation, List& rList ); +@@ -162,11 +165,15 @@ public: + ScDPTableData* GetData() { return pData; } + const ScDPTableData* GetData() const { return pData; } + ++ void SetGrandTotalName(const ::rtl::OUString& rName); ++ const ::rtl::OUString* GetGrandTotalName() const; ++ + USHORT GetOrientation(long nColumn); + void SetOrientation(long nColumn, USHORT nNew); + long GetPosition(long nColumn); + + long GetDataDimensionCount(); ++ ScDPDimension* GetDataDimension(long nIndex); + String GetDataDimName(long nIndex); + BOOL IsDataLayoutDimension(long nDim); + USHORT GetDataLayoutOrientation(); +@@ -333,12 +340,15 @@ private: + long nUsedHier; + USHORT nFunction; // enum GeneralFunction + String aName; // if empty, take from source ++ ::std::auto_ptr mpLayoutName; ++ ::std::auto_ptr mpSubtotalName; + long nSourceDim; // >=0 if dup'ed + ::com::sun::star::sheet::DataPilotFieldReference + aReferenceValue; // settings for "show data as" / "displayed value" + BOOL bHasSelectedPage; + String aSelectedPage; + ScDPItemData* pSelectedData; // internal, temporary, created from aSelectedPage ++ sal_Bool mbHasHiddenMember; + + public: + ScDPDimension( ScDPSource* pSrc, long nD ); +@@ -350,6 +360,9 @@ public: + ScDPDimension* CreateCloneObject(); + ScDPHierarchies* GetHierarchiesObject(); + ++ SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; ++ const ::rtl::OUString* GetSubtotalName() const; ++ + // XNamed + virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName( const ::rtl::OUString& aName ) +@@ -736,7 +749,7 @@ private: + long nLev; + + ScDPItemData maData; +-// String aCaption; // visible name (changeable by user) ++ ::std::auto_ptr mpLayoutName; + + sal_Int32 nPosition; // manual sorting + BOOL bVisible; +@@ -750,6 +763,7 @@ public: + BOOL IsNamedItem( const ScDPItemData& r ) const; + String GetNameStr() const; + void FillItemData( ScDPItemData& rData ) const; ++ SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; + + sal_Int32 Compare( const ScDPMember& rOther ) const; // visible order + +diff --git sc/inc/fillinfo.hxx sc/inc/fillinfo.hxx +index a75f3c1..4d97133 100644 +--- sc/inc/fillinfo.hxx ++++ sc/inc/fillinfo.hxx +@@ -99,6 +99,8 @@ struct CellInfo + BOOL bVOverlapped : 1; + BOOL bAutoFilter : 1; + BOOL bPushButton : 1; ++ bool bPopupButton: 1; ++ bool bFilterActive:1; + + BOOL bPrinted : 1; // bei Bedarf (Pagebreak-Modus) + +diff --git sc/inc/global.hxx sc/inc/global.hxx +index 3e31be4..e207691 100644 +--- sc/inc/global.hxx ++++ sc/inc/global.hxx +@@ -87,8 +87,6 @@ extern "C" { + #endif + + //------------------------------------------------------------------------ +-struct LabelData; +-//------------------------------------------------------------------------ + + // die 1000 Namen des Calc... + // Clipboard-Namen sind jetzt in so3/soapp.hxx +diff --git sc/inc/miscuno.hxx sc/inc/miscuno.hxx +index 3402f5a..7ce4c90 100644 +--- sc/inc/miscuno.hxx ++++ sc/inc/miscuno.hxx +@@ -285,12 +285,29 @@ public: + static sal_Int32 GetEnumProperty( const com::sun::star::uno::Reference< + com::sun::star::beans::XPropertySet>& xProp, + const ::rtl::OUString& rName, long nDefault ); ++ static ::rtl::OUString GetStringProperty( ++ const com::sun::star::uno::Reference& xProp, ++ const ::rtl::OUString& rName, const ::rtl::OUString& rDefault ); + + static sal_Bool GetBoolFromAny( const com::sun::star::uno::Any& aAny ); + static sal_Int16 GetInt16FromAny( const com::sun::star::uno::Any& aAny ); + static sal_Int32 GetInt32FromAny( const com::sun::star::uno::Any& aAny ); + static sal_Int32 GetEnumFromAny( const com::sun::star::uno::Any& aAny ); + static void SetBoolInAny( com::sun::star::uno::Any& rAny, sal_Bool bValue ); ++ ++ static void SetOptionalPropertyValue( ++ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, ++ const sal_Char* pPropName, const ::com::sun::star::uno::Any& rVal ); ++ ++ template ++ static void SetOptionalPropertyValue( ++ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, ++ const sal_Char* pPropName, const ValueType& rVal ) ++ { ++ ::com::sun::star::uno::Any any; ++ any <<= rVal; ++ SetOptionalPropertyValue(rPropSet, pPropName, any); ++ } + }; + + +diff --git sc/inc/pivot.hxx sc/inc/pivot.hxx +index d1b0fb9..680da7d 100644 +--- sc/inc/pivot.hxx ++++ sc/inc/pivot.hxx +@@ -53,6 +53,7 @@ + #include "address.hxx" + + #include ++#include + + class SubTotal; + #include "collect.hxx" +@@ -69,7 +70,9 @@ class SvStream; + class ScDocument; + class ScUserListData; + class ScProgress; +-struct LabelData; ++struct ScDPLabelData; ++ ++typedef ::boost::shared_ptr ScDPLabelDataRef; + + // ----------------------------------------------------------------------- + +@@ -93,8 +96,7 @@ struct ScPivotParam + SCCOL nCol; // Cursor Position / + SCROW nRow; // bzw. Anfang des Zielbereiches + SCTAB nTab; +- LabelData** ppLabelArr; +- SCSIZE nLabels; ++ ::std::vector maLabelArray; + PivotField aPageArr[PIVOT_MAXPAGEFIELD]; + PivotField aColArr[PIVOT_MAXFIELD]; + PivotField aRowArr[PIVOT_MAXFIELD]; +@@ -115,10 +117,8 @@ struct ScPivotParam + ScPivotParam& operator= ( const ScPivotParam& r ); + BOOL operator== ( const ScPivotParam& r ) const; + //UNUSED2009-05 void Clear (); +- void ClearLabelData (); + void ClearPivotArrays(); +- void SetLabelData ( LabelData** ppLabArr, +- SCSIZE nLab ); ++ void SetLabelData (const ::std::vector& r); + void SetPivotArrays ( const PivotField* pPageArr, + const PivotField* pColArr, + const PivotField* pRowArr, +@@ -136,24 +136,45 @@ typedef PivotField PivotPageFieldArr[PIVOT_MAXPAGEFIELD]; + + //------------------------------------------------------------------------ + +-struct LabelData ++struct ScDPLabelData + { +- String maName; /// Visible name of the dimension. ++ ::rtl::OUString maName; /// Original name of the dimension. ++ ::rtl::OUString maLayoutName; /// Layout name (display name) + SCsCOL mnCol; + USHORT mnFuncMask; /// Page/Column/Row subtotal function. + sal_Int32 mnUsedHier; /// Used hierarchy. + bool mbShowAll; /// true = Show all (also empty) results. + bool mbIsValue; /// true = Sum or count in data field. + ++ struct Member ++ { ++ ::rtl::OUString maName; ++ ::rtl::OUString maLayoutName; ++ bool mbVisible; ++ bool mbShowDetails; ++ ++ Member(); ++ ++ /** ++ * return the name that should be displayed in the dp dialogs i.e. ++ * when the layout name is present, use it, or else use the original ++ * name. ++ */ ++ ::rtl::OUString SC_DLLPUBLIC getDisplayName() const; ++ }; ++ ::std::vector maMembers; + ::com::sun::star::uno::Sequence< ::rtl::OUString > maHiers; /// Hierarchies. +- ::com::sun::star::uno::Sequence< ::rtl::OUString > maMembers; /// Members. +- ::com::sun::star::uno::Sequence< sal_Bool > maVisible; /// Visibility of members. +- ::com::sun::star::uno::Sequence< sal_Bool > maShowDet; /// Show details of members. + ::com::sun::star::sheet::DataPilotFieldSortInfo maSortInfo; /// Sorting info. + ::com::sun::star::sheet::DataPilotFieldLayoutInfo maLayoutInfo; /// Layout info. + ::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo; /// AutoShow info. + +- explicit LabelData( const String& rName, short nCol, bool bIsValue ); ++ explicit ScDPLabelData( const String& rName, short nCol, bool bIsValue ); ++ ++ /** ++ * return the name that should be displayed in the dp dialogs i.e. when ++ * the layout name is present, use it, or else use the original name. ++ */ ++ ::rtl::OUString SC_DLLPUBLIC getDisplayName() const; + }; + + // ============================================================================ +@@ -171,7 +192,6 @@ struct ScDPFuncData + + // ============================================================================ + +-typedef LabelData ScDPLabelData; + typedef std::vector< ScDPLabelData > ScDPLabelDataVec; + typedef std::vector< String > ScDPNameVec; + +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index e823b40..3e0a1f8 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -1444,6 +1444,8 @@ + #define RID_IMG_H_DROP_URL (BMP_START + 5) + #define RID_IMG_H_DROP_LINK (BMP_START + 6) + #define RID_IMG_H_DROP_COPY (BMP_START + 7) ++#define RID_IMG_SELECT_CURRENT (BMP_START + 8) ++#define RID_IMG_UNSELECT_CURRENT (BMP_START + 9) + + #define RID_SCPTR_PIVOTCOL (BMP_START + 81) + #define RID_SCPTR_PIVOTROW (BMP_START + 82) +@@ -1635,8 +1637,9 @@ + #define RID_SCDLG_DOCPROTECTION (SC_DIALOGS_START + 149) + #define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150) + #define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) ++#define RID_POPUP_FILTER (SC_DIALOGS_START + 152) + +-#define SC_DIALOGS_END (SC_DIALOGS_START + 152) ++#define SC_DIALOGS_END (SC_DIALOGS_START + 153) + + #ifndef STD_MASKCOLOR + #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } +diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx +index 2e1a33d..de99888 100644 +--- sc/inc/scabstdlg.hxx ++++ sc/inc/scabstdlg.hxx +@@ -243,7 +243,7 @@ class AbstractScDPSubtotalDlg : public VclAbstractDialog //add for ScDPSubtotal + { + public: + virtual USHORT GetFuncMask() const = 0; +- virtual void FillLabelData( LabelData& rLabelData ) const = 0; ++ virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0; + }; + + class AbstractScDPNumGroupDlg : public VclAbstractDialog +diff --git sc/inc/table.hxx sc/inc/table.hxx +index a33ebb9..715e119 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -291,6 +291,7 @@ public: + } + ScBaseCell* GetCell( SCCOL nCol, SCROW nRow ) const; + ++ void GetFirstDataPos(SCCOL& rCol, SCROW& rRow) const; + void GetLastDataPos(SCCOL& rCol, SCROW& rRow) const; + + /** Returns the pointer to a cell note object at the passed cell address. */ +diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx +index c7ce536..faa463f 100644 +--- sc/inc/unonames.hxx ++++ sc/inc/unonames.hxx +@@ -561,6 +561,10 @@ + #define SC_UNO_ROWFIELDCOUNT "RowFieldCount" + #define SC_UNO_COLUMNFIELDCOUNT "ColumnFieldCount" + #define SC_UNO_DATAFIELDCOUNT "DataFieldCount" ++#define SC_UNO_LAYOUTNAME "LayoutName" ++#define SC_UNO_FIELD_SUBTOTALNAME "FieldSubtotalName" ++#define SC_UNO_GRANDTOTAL_NAME "GrandTotalName" ++#define SC_UNO_HAS_HIDDEN_MEMBER "HasHiddenMember" + + // (preliminary:) + #define SC_UNO_REFVALUE "ReferenceValue" +diff --git sc/source/core/data/column2.cxx sc/source/core/data/column2.cxx +index 067f074..9fc2ea5 100644 +--- sc/source/core/data/column2.cxx ++++ sc/source/core/data/column2.cxx +@@ -1376,13 +1376,13 @@ SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirecti + return nLines; + } + +-//UNUSED2009-05 SCROW ScColumn::GetFirstDataPos() const +-//UNUSED2009-05 { +-//UNUSED2009-05 if (nCount) +-//UNUSED2009-05 return pItems[0].nRow; +-//UNUSED2009-05 else +-//UNUSED2009-05 return 0; +-//UNUSED2009-05 } ++SCROW ScColumn::GetFirstDataPos() const ++{ ++ if (nCount) ++ return pItems[0].nRow; ++ else ++ return 0; ++} + + SCROW ScColumn::GetLastDataPos() const + { +diff --git sc/source/core/data/documen8.cxx sc/source/core/data/documen8.cxx +index 19d6d94..448c339 100644 +--- sc/source/core/data/documen8.cxx ++++ sc/source/core/data/documen8.cxx +@@ -96,6 +96,7 @@ + #include "globstr.hrc" + #include "sc.hrc" + #include "charthelper.hxx" ++#include "dpobject.hxx" + + #define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() + +@@ -713,8 +714,13 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe + // skip everything left of rSpellPos: + while ( pCell && nRow == rSpellPos.Row() && nCol < rSpellPos.Col() ) + pCell = aIter.GetNext( nCol, nRow ); +- while ( pCell ) ++ ++ for (; pCell; pCell = aIter.GetNext(nCol, nRow)) + { ++ if (pDPCollection && pDPCollection->HasDPTable(nCol, nRow, nTab)) ++ // Don't spell check within datapilot table. ++ continue; ++ + CellType eType = pCell->GetCellType(); + if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT ) + { +@@ -799,8 +805,6 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe + + if ( ++nCellCount >= SPELL_MAXCELLS ) // seen enough cells? + break; +- +- pCell = aIter.GetNext( nCol, nRow ); + } + + if ( pCell ) +diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx +index 39ff75e..efb9693 100644 +--- sc/source/core/data/document.cxx ++++ sc/source/core/data/document.cxx +@@ -608,6 +608,32 @@ BOOL ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) cons + return FALSE; + } + ++bool ScDocument::ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const ++{ ++ if (!ValidTab(nTab) || !pTab[nTab]) ++ return false; ++ ++ SCCOL nCol1, nCol2; ++ SCROW nRow1, nRow2; ++ pTab[nTab]->GetFirstDataPos(nCol1, nRow1); ++ pTab[nTab]->GetLastDataPos(nCol2, nRow2); ++ ++ if (nCol1 > nCol2 || nRow1 > nRow2) ++ // invalid range. ++ return false; ++ ++ // Make sure the area only shrinks, and doesn't grow. ++ if (rStartCol < nCol1) ++ rStartCol = nCol1; ++ if (nCol2 < rEndCol) ++ rEndCol = nCol2; ++ if (rStartRow < nRow1) ++ rStartRow = nRow1; ++ if (nRow2 < rEndRow) ++ rEndRow = nRow2; ++ ++ return true; // success! ++} + + // zusammenhaengender Bereich + +diff --git sc/source/core/data/dpgroup.cxx sc/source/core/data/dpgroup.cxx +index b4e3568..96ed464 100644 +--- sc/source/core/data/dpgroup.cxx ++++ sc/source/core/data/dpgroup.cxx +@@ -70,6 +70,7 @@ using ::rtl::OUStringHash; + using ::std::vector; + using ::std::hash_set; + using ::std::hash_map; ++using ::boost::shared_ptr; + + #define D_TIMEFACTOR 86400.0 + +@@ -977,7 +978,7 @@ String lcl_GetNumGroupForValue( double fValue, const ScDPNumGroupInfo& rInfo, bo + return lcl_GetNumGroupName( fGroupStart, rInfo, bHasNonInteger, cDecSeparator, pFormatter ); + } + +-ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ) : ++ScDPGroupTableData::ScDPGroupTableData( const shared_ptr& pSource, ScDocument* pDocument ) : + ScDPTableData(pDocument), + pSourceData( pSource ), + pDoc( pDocument ) +@@ -992,7 +993,6 @@ ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDoc + ScDPGroupTableData::~ScDPGroupTableData() + { + delete[] pNumGroups; +- delete pSourceData; + } + + void ScDPGroupTableData::AddGroupDimension( const ScDPGroupDimension& rGroup ) +diff --git sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx +index ff15b82..ede7316 100644 +--- sc/source/core/data/dpobject.cxx ++++ sc/source/core/data/dpobject.cxx +@@ -75,9 +75,11 @@ + #include // IsNumberFormat + + #include ++#include + + using namespace com::sun::star; + using ::std::vector; ++using ::boost::shared_ptr; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::UNO_QUERY; +@@ -162,11 +164,14 @@ ScDPObject::ScDPObject( ScDocument* pD ) : + pSheetDesc( NULL ), + pImpDesc( NULL ), + pServDesc( NULL ), ++ mpTableData(static_cast(NULL)), + pOutput( NULL ), + bSettingsChanged( FALSE ), + bAlive( FALSE ), ++ mnAutoFormatIndex( 65535 ), + bAllowMove( FALSE ), +- nHeaderRows( 0 ) ++ nHeaderRows( 0 ), ++ mbHeaderLayout(false) + { + } + +@@ -180,11 +185,14 @@ ScDPObject::ScDPObject(const ScDPObject& r) : + pSheetDesc( NULL ), + pImpDesc( NULL ), + pServDesc( NULL ), ++ mpTableData(static_cast(NULL)), + pOutput( NULL ), + bSettingsChanged( FALSE ), + bAlive( FALSE ), ++ mnAutoFormatIndex( r.mnAutoFormatIndex ), + bAllowMove( FALSE ), +- nHeaderRows( r.nHeaderRows ) ++ nHeaderRows( r.nHeaderRows ), ++ mbHeaderLayout( r.mbHeaderLayout ) + { + if (r.pSaveData) + pSaveData = new ScDPSaveData(*r.pSaveData); +@@ -232,6 +240,26 @@ void ScDPObject::SetSaveData(const ScDPSaveData& rData) + InvalidateData(); // re-init source from SaveData + } + ++void ScDPObject::SetAutoFormatIndex(const sal_uInt16 nIndex) ++{ ++ mnAutoFormatIndex = nIndex; ++} ++ ++sal_uInt16 ScDPObject::GetAutoFormatIndex() const ++{ ++ return mnAutoFormatIndex; ++} ++ ++void ScDPObject::SetHeaderLayout (bool bUseGrid) ++{ ++ mbHeaderLayout = bUseGrid; ++} ++ ++bool ScDPObject::GetHeaderLayout() const ++{ ++ return mbHeaderLayout; ++} ++ + void ScDPObject::SetOutRange(const ScRange& rRange) + { + aOutRange = rRange; +@@ -325,6 +353,22 @@ void ScDPObject::SetTag(const String& rNew) + aTableTag = rNew; + } + ++bool ScDPObject::IsDataDescriptionCell(const ScAddress& rPos) ++{ ++ if (!pSaveData) ++ return false; ++ ++ long nDataDimCount = pSaveData->GetDataDimensionCount(); ++ if (nDataDimCount != 1) ++ // There has to be exactly one data dimension for the description to ++ // appear at top-left corner. ++ return false; ++ ++ CreateOutput(); ++ ScRange aTabRange = pOutput->GetOutputRange(sheet::DataPilotOutputRangeType::TABLE); ++ return (rPos == aTabRange.aStart); ++} ++ + uno::Reference ScDPObject::GetSource() + { + CreateObjects(); +@@ -338,6 +382,7 @@ void ScDPObject::CreateOutput() + { + BOOL bFilterButton = IsSheetData() && pSaveData && pSaveData->GetFilterButton(); + pOutput = new ScDPOutput( pDoc, xSource, aOutRange.aStart, bFilterButton ); ++ pOutput->SetHeaderLayout ( mbHeaderLayout ); + + long nOldRows = nHeaderRows; + nHeaderRows = pOutput->GetHeaderRows(); +@@ -365,11 +410,43 @@ void ScDPObject::CreateOutput() + } + } + ++ScDPTableData* ScDPObject::GetTableData() ++{ ++ if (!mpTableData) ++ { ++ if ( pImpDesc ) ++ { ++ // database data ++ mpTableData.reset(new ScDatabaseDPData(pDoc, *pImpDesc)); ++ } ++ else ++ { ++ // cell data ++ if (!pSheetDesc) ++ { ++ DBG_ERROR("no source descriptor"); ++ pSheetDesc = new ScSheetSourceDesc; // dummy defaults ++ } ++ mpTableData.reset(new ScSheetDPData(pDoc, *pSheetDesc)); ++ } ++ ++ // grouping (for cell or database data) ++ if ( pSaveData && pSaveData->GetExistingDimensionData() ) ++ { ++ shared_ptr pGroupData(new ScDPGroupTableData(mpTableData, pDoc)); ++ pSaveData->GetExistingDimensionData()->WriteToData(*pGroupData); ++ mpTableData = pGroupData; ++ } ++ } ++ ++ return mpTableData.get(); ++} ++ + void ScDPObject::CreateObjects() + { + // if groups are involved, create a new source with the ScDPGroupTableData + if ( bSettingsChanged && pSaveData && pSaveData->GetExistingDimensionData() ) +- xSource = NULL; ++ InvalidateSource(); + + if (!xSource.is()) + { +@@ -387,33 +464,9 @@ void ScDPObject::CreateObjects() + if ( !xSource.is() ) // database or sheet data, or error in CreateSource + { + DBG_ASSERT( !pServDesc, "DPSource could not be created" ); +- +- ScDPTableData* pData = NULL; +- if ( pImpDesc ) +- { +- // database data +- pData = new ScDatabaseDPData( pDoc, *pImpDesc ); +- } +- else +- { +- // cell data +- if (!pSheetDesc) +- { +- DBG_ERROR("no source descriptor"); +- pSheetDesc = new ScSheetSourceDesc; // dummy defaults +- } +- pData = new ScSheetDPData( pDoc, *pSheetDesc ); +- } +- +- // grouping (for cell or database data) +- if ( pSaveData && pSaveData->GetExistingDimensionData() ) +- { +- ScDPGroupTableData* pGroupData = new ScDPGroupTableData( pData, pDoc ); +- pSaveData->GetExistingDimensionData()->WriteToData( *pGroupData ); +- pData = pGroupData; +- } +- +- xSource = new ScDPSource( pData ); ++ ScDPTableData* pData = GetTableData(); ++ ScDPSource* pSource = new ScDPSource( pData ); ++ xSource = pSource; + } + + if (pSaveData) +@@ -450,6 +503,7 @@ void ScDPObject::InvalidateData() + void ScDPObject::InvalidateSource() + { + xSource = NULL; ++ mpTableData.reset(); + } + + ScRange ScDPObject::GetNewOutputRange( BOOL& rOverflow ) +@@ -484,6 +538,9 @@ void ScDPObject::Output( const ScAddress& rPos ) + + // aOutRange is always the range that was last output to the document + aOutRange = pOutput->GetOutputRange(); ++ const ScAddress& s = aOutRange.aStart; ++ const ScAddress& e = aOutRange.aEnd; ++ pDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE); + } + + const ScRange ScDPObject::GetOutputRangeByType( sal_Int32 nType ) +@@ -533,6 +590,63 @@ void ScDPObject::RefreshAfterLoad() + nHeaderRows = 0; // nothing found, no drop-down lists + } + ++void ScDPObject::BuildAllDimensionMembers() ++{ ++ if (!pSaveData) ++ return; ++ ++ pSaveData->BuildAllDimensionMembers(GetTableData()); ++} ++ ++bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence& rNames ) ++{ ++ vector aMembers; ++ if (!GetMembers(nDim, GetUsedHierarchy(nDim), aMembers)) ++ return false; ++ ++ size_t n = aMembers.size(); ++ rNames.realloc(n); ++ for (size_t i = 0; i < n; ++i) ++ rNames[i] = aMembers[i].maName; ++ ++ return true; ++} ++ ++bool ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, vector& rMembers ) ++{ ++ Reference< container::XNameAccess > xMembersNA; ++ if (!GetMembersNA( nDim, nHier, xMembersNA )) ++ return false; ++ ++ Reference xMembersIA( new ScNameToIndexAccess(xMembersNA) ); ++ sal_Int32 nCount = xMembersIA->getCount(); ++ vector aMembers; ++ aMembers.reserve(nCount); ++ ++ for (sal_Int32 i = 0; i < nCount; ++i) ++ { ++ Reference xMember(xMembersIA->getByIndex(i), UNO_QUERY); ++ ScDPLabelData::Member aMem; ++ ++ if (xMember.is()) ++ aMem.maName = xMember->getName(); ++ ++ Reference xMemProp(xMember, UNO_QUERY); ++ if (xMemProp.is()) ++ { ++ aMem.mbVisible = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString::createFromAscii(SC_UNO_ISVISIBL)); ++ aMem.mbShowDetails = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString::createFromAscii(SC_UNO_SHOWDETA)); ++ ++ aMem.maLayoutName = ScUnoHelpFunctions::GetStringProperty( ++ xMemProp, OUString::createFromAscii(SC_UNO_LAYOUTNAME), OUString()); ++ } ++ ++ aMembers.push_back(aMem); ++ } ++ rMembers.swap(aMembers); ++ return true; ++} ++ + void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode, + const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) + { +@@ -655,23 +769,33 @@ void ScDPObject::GetDrillDownData(const ScAddress& rPos, Sequence< Sequence + rTableData = xDrillDownData->getDrillDownData(filters); + } + +-BOOL ScDPObject::IsDimNameInUse( const String& rName ) const ++bool ScDPObject::IsDimNameInUse(const OUString& rName) const + { +- if ( xSource.is() ) ++ if (!xSource.is()) ++ return false; ++ ++ Reference xDims = xSource->getDimensions(); ++ Sequence aDimNames = xDims->getElementNames(); ++ sal_Int32 n = aDimNames.getLength(); ++ for (sal_Int32 i = 0; i < n; ++i) + { +- uno::Reference xDimsName = xSource->getDimensions(); +- if ( xDimsName.is() ) ++ const OUString& rDimName = aDimNames[i]; ++ if (rDimName.equalsIgnoreAsciiCase(rName)) ++ return true; ++ ++ Reference xPropSet(xDims->getByName(rDimName), UNO_QUERY); ++ if (!xPropSet.is()) ++ continue; ++ ++ Any any = xPropSet->getPropertyValue(OUString::createFromAscii(SC_UNO_LAYOUTNAME)); ++ OUString aLayoutName; ++ if (any >>= aLayoutName) + { +- rtl::OUString aCompare( rName ); +- uno::Sequence aNames = xDimsName->getElementNames(); +- long nCount = aNames.getLength(); +- const rtl::OUString* pArr = aNames.getConstArray(); +- for (long nPos=0; nPos& xDimProp ) ++void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XPropertySet >& xDimProp ) + { + uno::Reference xDimSupp( xDimProp, uno::UNO_QUERY ); + if ( xDimProp.is() && xDimSupp.is() ) +@@ -1778,6 +1902,8 @@ void lcl_FillLabelData( LabelData& rData, const uno::Reference< beans::XProperty + + BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) + { ++ rParam.maLabelArray.clear(); ++ + ((ScDPObject*)this)->CreateObjects(); + + uno::Reference xDimsName = xSource->getDimensions(); +@@ -1788,8 +1914,6 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) + if (!nDimCount) + return FALSE; + +- SCSIZE nOutCount = 0; +- LabelData** aLabelArr = new LabelData*[nDimCount]; + for (long nDim=0; nDim < nDimCount; nDim++) + { + String aFieldName; +@@ -1819,29 +1943,24 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) + { + } + ++ OUString aLayoutName = ScUnoHelpFunctions::GetStringProperty( ++ xDimProp, OUString::createFromAscii(SC_UNO_LAYOUTNAME), OUString()); ++ + if ( aFieldName.Len() && !bData && !bDuplicated ) + { + SCsCOL nCol = static_cast< SCsCOL >( nDim ); //! ??? + bool bIsValue = true; //! check + +- aLabelArr[nOutCount] = new LabelData( aFieldName, nCol, bIsValue ); +- +- LabelData& rLabelData = *aLabelArr[nOutCount]; +- GetHierarchies( nDim, rLabelData.maHiers ); +- GetMembers( nDim, rLabelData.maMembers, &rLabelData.maVisible, &rLabelData.maShowDet ); +- lcl_FillLabelData( rLabelData, xDimProp ); +- +- ++nOutCount; ++ ScDPLabelDataRef pNewLabel(new ScDPLabelData(aFieldName, nCol, bIsValue)); ++ pNewLabel->maLayoutName = aLayoutName; ++ GetHierarchies(nDim, pNewLabel->maHiers); ++ GetMembers(nDim, GetUsedHierarchy(nDim), pNewLabel->maMembers); ++ lcl_FillLabelData(*pNewLabel, xDimProp); ++ rParam.maLabelArray.push_back(pNewLabel); + } + } + } + +- rParam.SetLabelData( aLabelArr, nOutCount ); +- +- for (SCSIZE i=0; i& rMembers, +- uno::Sequence< sal_Bool >* pVisible, +- uno::Sequence< sal_Bool >* pShowDet ) +-{ +- return GetMembers( nDim, GetUsedHierarchy( nDim ), rMembers, pVisible, pShowDet ); +-} +- + BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< container::XNameAccess >& xMembers ) + { + BOOL bRet = FALSE; +@@ -1933,55 +2044,6 @@ BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< + return bRet; + } + +-BOOL ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, +- uno::Sequence< rtl::OUString >& rMembers, +- uno::Sequence< sal_Bool >* pVisible, +- uno::Sequence< sal_Bool >* pShowDet ) +-{ +- BOOL bRet = FALSE; +- uno::Reference< container::XNameAccess > xMembersNA; +- if( GetMembersNA( nDim, nHier, xMembersNA ) ) +- { +- uno::Reference< container::XIndexAccess > xMembersIA( new ScNameToIndexAccess( xMembersNA ) ); +- sal_Int32 nCount = xMembersIA->getCount(); +- rMembers.realloc( nCount ); +- if( pVisible ) +- pVisible->realloc( nCount ); +- if( pShowDet ) +- pShowDet->realloc( nCount ); +- +- rtl::OUString* pAry = rMembers.getArray(); +- for( sal_Int32 nItem = 0; nItem < nCount; ++nItem ) +- { +- uno::Reference< container::XNamed > xMember( xMembersIA->getByIndex( nItem ), uno::UNO_QUERY ); +- if( xMember.is() ) +- pAry[ nItem ] = xMember->getName(); +- if( pVisible || pShowDet ) +- { +- uno::Reference< beans::XPropertySet > xMemProp( xMember, uno::UNO_QUERY ); +- if( pVisible ) +- { +- sal_Bool bVis = sal_True; +- if( xMemProp.is() ) +- bVis = ScUnoHelpFunctions::GetBoolProperty( xMemProp, +- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_ISVISIBL ) ) ); +- (*pVisible)[ nItem ] = bVis; +- } +- if( pShowDet ) +- { +- sal_Bool bShow = sal_True; +- if( xMemProp.is() ) +- bShow = ScUnoHelpFunctions::GetBoolProperty( xMemProp, +- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SHOWDETA ) ) ); +- (*pShowDet)[ nItem ] = bShow; +- } +- } +- } +- bRet = TRUE; +- } +- return bRet; +-} +- + //------------------------------------------------------------------------ + // convert old pivot tables into new datapilot tables + +@@ -2376,7 +2438,7 @@ void ScDPCollection::WriteRefsTo( ScDPCollection& r ) const + + ScDPObject* pDestObj = new ScDPObject( *pSourceObj ); + pDestObj->SetAlive(TRUE); +- if ( !r.Insert(pDestObj) ) ++ if ( !r.InsertNewTable(pDestObj) ) + { + DBG_ERROR("cannot insert DPObject"); + DELETEZ( pDestObj ); +@@ -2411,6 +2473,39 @@ ScSimpleSharedString& ScDPCollection::GetSharedString() + return maSharedString; + } + ++void ScDPCollection::FreeTable(ScDPObject* pDPObj) ++{ ++ const ScRange& rOutRange = pDPObj->GetOutRange(); ++ const ScAddress& s = rOutRange.aStart; ++ const ScAddress& e = rOutRange.aEnd; ++ pDoc->RemoveFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE); ++ Free(pDPObj); ++} ++ ++bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj) ++{ ++ bool bSuccess = Insert(pDPObj); ++ if (bSuccess) ++ { ++ const ScRange& rOutRange = pDPObj->GetOutRange(); ++ const ScAddress& s = rOutRange.aStart; ++ const ScAddress& e = rOutRange.aEnd; ++ pDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE); ++ } ++ return bSuccess; ++} ++ ++bool ScDPCollection::HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const ++{ ++ const ScMergeFlagAttr* pMergeAttr = static_cast( ++ pDoc->GetAttr(nCol, nRow, nTab, ATTR_MERGE_FLAG)); ++ ++ if (!pMergeAttr) ++ return false; ++ ++ return pMergeAttr->HasDPTable(); ++} ++ + ScDPCacheCell* ScDPCollection::getCacheCellFromPool(const ScDPCacheCell& rCell) + { + ScDPCacheCell aCell(rCell); +diff --git sc/source/core/data/dpoutput.cxx sc/source/core/data/dpoutput.cxx +index 0699892..e472dbf 100644 +--- sc/source/core/data/dpoutput.cxx ++++ sc/source/core/data/dpoutput.cxx +@@ -81,6 +81,7 @@ + + using namespace com::sun::star; + using ::std::vector; ++using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::Reference; +@@ -98,7 +99,6 @@ using ::rtl::OUString; + #define DP_PROP_ORIENTATION "Orientation" + #define DP_PROP_POSITION "Position" + #define DP_PROP_USEDHIERARCHY "UsedHierarchy" +-#define DP_PROP_DATADESCR "DataDescription" + #define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension" + #define DP_PROP_NUMBERFORMAT "NumberFormat" + #define DP_PROP_FILTER "Filter" +@@ -119,9 +119,15 @@ struct ScDPOutLevelData + long nLevel; + long nDimPos; + uno::Sequence aResult; +- String aCaption; +- +- ScDPOutLevelData() { nDim = nHier = nLevel = nDimPos = -1; } ++ String maName; /// Name is the internal field name. ++ String aCaption; /// Caption is the name visible in the output table. ++ bool mbHasHiddenMember; ++ ++ ScDPOutLevelData() ++ { ++ nDim = nHier = nLevel = nDimPos = -1; ++ mbHasHiddenMember = false; ++ } + + BOOL operator<(const ScDPOutLevelData& r) const + { return nDimPosgetName()); //! Caption... ++ String aName = xLevNam->getName(); ++ OUString aCaption = aName; // Caption equals the field name by default. ++ Reference xPropSet(xLevel, UNO_QUERY); ++ if (xPropSet.is()) ++ { ++ Any any = xPropSet->getPropertyValue( ++ OUString::createFromAscii(SC_UNO_LAYOUTNAME)); ++ any >>= aCaption; ++ } ++ ++ bool bRowFieldHasMember = false; + switch ( eDimOrient ) + { + case sheet::DataPilotFieldOrientation_COLUMN: +@@ -452,7 +472,9 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); ++ pColFields[nColFieldCount].maName = aName; + pColFields[nColFieldCount].aCaption= aCaption; ++ pColFields[nColFieldCount].mbHasHiddenMember = bHasHiddenMember; + if (!lcl_MemberEmpty(pColFields[nColFieldCount].aResult)) + ++nColFieldCount; + break; +@@ -462,9 +484,14 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); ++ pRowFields[nRowFieldCount].maName = aName; + pRowFields[nRowFieldCount].aCaption= aCaption; ++ pRowFields[nRowFieldCount].mbHasHiddenMember = bHasHiddenMember; + if (!lcl_MemberEmpty(pRowFields[nRowFieldCount].aResult)) ++ { + ++nRowFieldCount; ++ bRowFieldHasMember = true; ++ } + break; + case sheet::DataPilotFieldOrientation_PAGE: + pPageFields[nPageFieldCount].nDim = nDim; +@@ -472,7 +499,9 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetPropertyValue( +- rtl::OUString::createFromAscii(DP_PROP_DATADESCR) ); ++ rtl::OUString::createFromAscii(SC_UNO_DATADESC) ); + rtl::OUString aUStr; + aAny >>= aUStr; + aDataDescription = String( aUStr ); +@@ -605,9 +637,16 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, + const sheet::MemberResult& rData, BOOL bColHeader, long nLevel ) + { + long nFlags = rData.Flags; ++ ++ rtl::OUStringBuffer aCaptionBuf; ++ if (!(nFlags & sheet::MemberResultFlags::NUMERIC)) ++ // This caption is not a number. Make sure it won't get parsed as one. ++ aCaptionBuf.append(sal_Unicode('\'')); ++ aCaptionBuf.append(rData.Caption); ++ + if ( nFlags & sheet::MemberResultFlags::HASMEMBER ) + { +- pDoc->SetString( nCol, nRow, nTab, rData.Caption ); ++ pDoc->SetString( nCol, nRow, nTab, aCaptionBuf.makeStringAndClear() ); + } + else + { +@@ -638,14 +677,20 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, + } + } + +-void ScDPOutput::FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, BOOL bFrame ) ++void ScDPOutput::FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, ++ bool bInTable, bool bPopup, bool bHasHiddenMember ) + { + pDoc->SetString( nCol, nRow, nTab, rCaption ); +- if (bFrame) ++ if (bInTable) + lcl_SetFrame( pDoc,nTab, nCol,nRow, nCol,nRow, 20 ); + + // Button +- pDoc->ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr(SC_MF_BUTTON) ); ++ sal_uInt16 nMergeFlag = SC_MF_BUTTON; ++ if (bPopup) ++ nMergeFlag |= SC_MF_BUTTON_POPUP; ++ if (bHasHiddenMember) ++ nMergeFlag |= SC_MF_HIDDEN_MEMBER; ++ pDoc->ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, nMergeFlag); + + lcl_SetStyleById( pDoc,nTab, nCol,nRow, nCol,nRow, STR_PIVOT_STYLE_FIELDNAME ); + } +@@ -653,7 +698,7 @@ void ScDPOutput::FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rC + void lcl_DoFilterButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) + { + pDoc->SetString( nCol, nRow, nTab, ScGlobal::GetRscString(STR_CELL_FILTER) ); +- pDoc->ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr(SC_MF_BUTTON) ); ++ pDoc->ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, SC_MF_BUTTON); + } + + void ScDPOutput::CalcSizes() +@@ -666,7 +711,11 @@ void ScDPOutput::CalcSizes() + nRowCount = aData.getLength(); + const uno::Sequence* pRowAry = aData.getConstArray(); + nColCount = nRowCount ? ( pRowAry[0].getLength() ) : 0; +- nHeaderSize = 1; // one row for field names ++ ++ nHeaderSize = 1; ++ if (GetHeaderLayout() && nColFieldCount == 0) ++ // Insert an extra header row only when there is no column field. ++ nHeaderSize = 2; + + // calculate output positions and sizes + +@@ -775,7 +824,7 @@ void ScDPOutput::Output() + SCCOL nHdrCol = aStartPos.Col(); + SCROW nHdrRow = aStartPos.Row() + nField + ( bDoFilter ? 1 : 0 ); + // draw without frame for consistency with filter button: +- FieldCell( nHdrCol, nHdrRow, nTab, pPageFields[nField].aCaption, FALSE ); ++ FieldCell( nHdrCol, nHdrRow, nTab, pPageFields[nField].aCaption, false, false, pPageFields[nField].mbHasHiddenMember ); + SCCOL nFldCol = nHdrCol + 1; + + String aPageValue; +@@ -814,7 +863,7 @@ void ScDPOutput::Output() + for (nField=0; nField rSequence = pColFields[nField].aResult; +@@ -849,9 +898,12 @@ void ScDPOutput::Output() + + for (nField=0; nField rSequence = pRowFields[nField].aResult; +@@ -993,6 +1045,16 @@ void ScDPOutput::GetMemberResultNames( ScStrCollection& rNames, long nDimension + } + } + ++void ScDPOutput::SetHeaderLayout(bool bUseGrid) ++{ ++ mbHeaderLayout = bUseGrid; ++ bSizesValid = false; ++} ++ ++bool ScDPOutput::GetHeaderLayout() const ++{ ++ return mbHeaderLayout; ++} + + void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionData& rPosData) + { +@@ -1146,7 +1208,7 @@ bool ScDPOutput::GetDataResultPositionData(vector& + for (SCCOL nColField = 0; nColField < nColFieldCount && bFilterByCol; ++nColField) + { + sheet::DataPilotFieldFilter filter; +- filter.FieldName = pColFields[nColField].aCaption; ++ filter.FieldName = pColFields[nColField].maName; + + const uno::Sequence rSequence = pColFields[nColField].aResult; + const sheet::MemberResult* pArray = rSequence.getConstArray(); +@@ -1163,10 +1225,15 @@ bool ScDPOutput::GetDataResultPositionData(vector& + } + + // row fields ++ bool bDataLayoutExists = (nDataFieldCount > 1); + for (SCROW nRowField = 0; nRowField < nRowFieldCount && bFilterByRow; ++nRowField) + { ++ if (bDataLayoutExists && nRowField == nRowFieldCount - 1) ++ // There is no sense including the data layout field for filtering. ++ continue; ++ + sheet::DataPilotFieldFilter filter; +- filter.FieldName = pRowFields[nRowField].aCaption; ++ filter.FieldName = pRowFields[nRowField].maName; + + const uno::Sequence rSequence = pRowFields[nRowField].aResult; + const sheet::MemberResult* pArray = rSequence.getConstArray(); +@@ -1199,7 +1199,7 @@ bool lcl_IsNamedDataField( const ScDPGetPivotDataField& rTarget, const String& r + bool lcl_IsNamedCategoryField( const ScDPGetPivotDataField& rFilter, const ScDPOutLevelData& rField ) + { + //! name from source instead of caption? +- return ScGlobal::GetpTransliteration()->isEqual( rFilter.maFieldName, rField.aCaption ); ++ return ScGlobal::GetpTransliteration()->isEqual( rFilter.maFieldName, rField.maName ); + } + + bool lcl_IsCondition( const sheet::MemberResult& rResultEntry, const ScDPGetPivotDataField& rFilter ) +diff --git sc/source/core/data/dpoutputgeometry.cxx sc/source/core/data/dpoutputgeometry.cxx +new file mode 100644 +index 0000000..999ab28 +--- /dev/null ++++ sc/source/core/data/dpoutputgeometry.cxx +@@ -0,0 +1,217 @@ ++/************************************************************************* ++ * ++ * 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: xmldpimp.cxx,v $ ++ * $Revision: 1.27.134.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++ ++ ++// INCLUDE --------------------------------------------------------------- ++ ++#include "dpoutputgeometry.hxx" ++#include "address.hxx" ++ ++#include ++ ++using ::std::vector; ++ ++ScDPOutputGeometry::ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter, ImportType eImportType) : ++ maOutRange(rOutRange), ++ mnRowFields(0), ++ mnColumnFields(0), ++ mnPageFields(0), ++ mnDataFields(0), ++ meImportType(eImportType), ++ mbShowFilter(bShowFilter) ++{ ++} ++ ++ScDPOutputGeometry::~ScDPOutputGeometry() ++{ ++} ++ ++void ScDPOutputGeometry::setRowFieldCount(sal_uInt32 nCount) ++{ ++ mnRowFields = nCount; ++} ++ ++void ScDPOutputGeometry::setColumnFieldCount(sal_uInt32 nCount) ++{ ++ mnColumnFields = nCount; ++} ++ ++void ScDPOutputGeometry::setPageFieldCount(sal_uInt32 nCount) ++{ ++ mnPageFields = nCount; ++} ++ ++void ScDPOutputGeometry::setDataFieldCount(sal_uInt32 nCount) ++{ ++ mnDataFields = nCount; ++} ++ ++void ScDPOutputGeometry::getColumnFieldPositions(vector& rAddrs) const ++{ ++ vector aAddrs; ++ if (!mnColumnFields) ++ { ++ rAddrs.swap(aAddrs); ++ return; ++ } ++ ++ bool bDataLayout = mnDataFields > 1; ++ ++ SCROW nCurRow = maOutRange.aStart.Row(); ++ ++ if (mnPageFields) ++ { ++ SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; ++ SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); ++ nCurRow = nRowEnd + 2; ++ } ++ else if (mbShowFilter) ++ nCurRow += 2; ++ ++ SCROW nRow = nCurRow; ++ SCTAB nTab = maOutRange.aStart.Tab(); ++ SCCOL nColStart = maOutRange.aStart.Col() + mnRowFields + bDataLayout; ++ SCCOL nColEnd = nColStart + static_cast(mnColumnFields-1); ++ ++ for (SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) ++ aAddrs.push_back(ScAddress(nCol, nRow, nTab)); ++ rAddrs.swap(aAddrs); ++} ++ ++void ScDPOutputGeometry::getRowFieldPositions(vector& rAddrs) const ++{ ++ vector aAddrs; ++ if (!mnRowFields) ++ { ++ rAddrs.swap(aAddrs); ++ return; ++ } ++ ++ SCROW nRow = getRowFieldHeaderRow(); ++ SCTAB nTab = maOutRange.aStart.Tab(); ++ SCCOL nColStart = maOutRange.aStart.Col(); ++ SCCOL nColEnd = nColStart + static_cast(mnRowFields-1); ++ ++ for (SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) ++ aAddrs.push_back(ScAddress(nCol, nRow, nTab)); ++ rAddrs.swap(aAddrs); ++} ++ ++void ScDPOutputGeometry::getPageFieldPositions(vector& rAddrs) const ++{ ++ vector aAddrs; ++ if (!mnPageFields) ++ { ++ rAddrs.swap(aAddrs); ++ return; ++ } ++ ++ SCTAB nTab = maOutRange.aStart.Tab(); ++ SCCOL nCol = maOutRange.aStart.Col(); ++ ++ SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; ++ SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); ++ ++ for (SCROW nRow = nRowStart; nRow <= nRowEnd; ++nRow) ++ aAddrs.push_back(ScAddress(nCol, nRow, nTab)); ++ rAddrs.swap(aAddrs); ++} ++ ++SCROW ScDPOutputGeometry::getRowFieldHeaderRow() const ++{ ++ SCROW nCurRow = maOutRange.aStart.Row(); ++ ++ if (mnPageFields) ++ { ++ SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; ++ SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); ++ nCurRow = nRowEnd + 2; ++ } ++ else if (mbShowFilter) ++ nCurRow += 2; ++ ++ if (mnColumnFields) ++ nCurRow += static_cast(mnColumnFields); ++ else if (mnRowFields) ++ ++nCurRow; ++ ++ return nCurRow; ++} ++ ++ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAddress& rPos) const ++{ ++ // We will ignore the table position for now. ++ ++ bool bExtraTitleRow = (mnColumnFields == 0 && meImportType == ScDPOutputGeometry::XLS); ++ bool bDataLayout = mnDataFields > 1; ++ ++ SCROW nCurRow = maOutRange.aStart.Row(); ++ ++ if (mnPageFields) ++ { ++ SCCOL nCol = maOutRange.aStart.Col(); ++ SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; ++ SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); ++ if (rPos.Col() == nCol && nRowStart <= rPos.Row() && rPos.Row() <= nRowEnd) ++ return Page; ++ ++ nCurRow = nRowEnd + 2; ++ } ++ else if (mbShowFilter) ++ nCurRow += 2; ++ ++ if (mnColumnFields) ++ { ++ SCROW nRow = nCurRow; ++ SCCOL nColStart = maOutRange.aStart.Col() + mnRowFields + bDataLayout; ++ SCCOL nColEnd = nColStart + static_cast(mnColumnFields-1); ++ if (rPos.Row() == nRow && nColStart <= rPos.Col() && rPos.Col() <= nColEnd) ++ return Column; ++ ++ nCurRow += static_cast(mnColumnFields); ++ } ++ ++ if (bExtraTitleRow) ++ ++nCurRow; ++ ++ if (mnRowFields) ++ { ++ SCCOL nColStart = maOutRange.aStart.Col(); ++ SCCOL nColEnd = nColStart + static_cast(mnRowFields-1); ++ if (rPos.Row() == nCurRow && nColStart <= rPos.Col() && rPos.Col() <= nColEnd) ++ return Row; ++ } ++ ++ return None; ++} +diff --git sc/source/core/data/dpsave.cxx sc/source/core/data/dpsave.cxx +index b7e04fc..3161155 100644 +--- sc/source/core/data/dpsave.cxx ++++ sc/source/core/data/dpsave.cxx +@@ -58,7 +58,15 @@ + #include + #include + ++#include ++ + using namespace com::sun::star; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::uno::Any; ++using ::rtl::OUString; ++using ::rtl::OUStringHash; ++using ::std::hash_map; ++using ::std::auto_ptr; + + // ----------------------------------------------------------------------- + +@@ -99,6 +107,7 @@ void lcl_SetBoolProperty( const uno::Reference& xProp, + + ScDPSaveMember::ScDPSaveMember(const String& rName) : + aName( rName ), ++ mpLayoutName(NULL), + nVisibleMode( SC_DPSAVEMODE_DONTKNOW ), + nShowDetailsMode( SC_DPSAVEMODE_DONTKNOW ) + { +@@ -106,9 +115,12 @@ ScDPSaveMember::ScDPSaveMember(const String& rName) : + + ScDPSaveMember::ScDPSaveMember(const ScDPSaveMember& r) : + aName( r.aName ), ++ mpLayoutName(NULL), + nVisibleMode( r.nVisibleMode ), + nShowDetailsMode( r.nShowDetailsMode ) + { ++ if (r.mpLayoutName.get()) ++ mpLayoutName.reset(new OUString(*r.mpLayoutName)); + } + + ScDPSaveMember::~ScDPSaveMember() +@@ -153,12 +165,23 @@ void ScDPSaveMember::SetName( const String& rNew ) + aName = rNew; + } + +-void ScDPSaveMember::WriteToSource( const uno::Reference& xMember, sal_Int32 nPosition ) ++void ScDPSaveMember::SetLayoutName( const OUString& rName ) + { +- // nothing to do? +- if ( nVisibleMode == SC_DPSAVEMODE_DONTKNOW && nShowDetailsMode == SC_DPSAVEMODE_DONTKNOW && nPosition < 0 ) +- return; ++ mpLayoutName.reset(new OUString(rName)); ++} + ++const OUString* ScDPSaveMember::GetLayoutName() const ++{ ++ return mpLayoutName.get(); ++} ++ ++void ScDPSaveMember::RemoveLayoutName() ++{ ++ mpLayoutName.reset(NULL); ++} ++ ++void ScDPSaveMember::WriteToSource( const uno::Reference& xMember, sal_Int32 nPosition ) ++{ + uno::Reference xMembProp( xMember, uno::UNO_QUERY ); + DBG_ASSERT( xMembProp.is(), "no properties at member" ); + if ( xMembProp.is() ) +@@ -173,17 +196,11 @@ void ScDPSaveMember::WriteToSource( const uno::Reference& xMemb + lcl_SetBoolProperty( xMembProp, + rtl::OUString::createFromAscii(DP_PROP_SHOWDETAILS), (BOOL)nShowDetailsMode ); + ++ if (mpLayoutName.get()) ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xMembProp, SC_UNO_LAYOUTNAME, *mpLayoutName); ++ + if ( nPosition >= 0 ) +- { +- try +- { +- xMembProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_POSITION), uno::Any(nPosition) ); +- } +- catch ( uno::Exception& ) +- { +- // position is optional - exception must be ignored +- } +- } ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xMembProp, DP_PROP_POSITION, nPosition); + } + } + +@@ -191,8 +208,9 @@ void ScDPSaveMember::WriteToSource( const uno::Reference& xMemb + + ScDPSaveDimension::ScDPSaveDimension(const String& rName, BOOL bDataLayout) : + aName( rName ), +- pLayoutName( NULL ), + pSelectedPage( NULL ), ++ mpLayoutName(NULL), ++ mpSubtotalName(NULL), + bIsDataLayout( bDataLayout ), + bDupFlag( FALSE ), + nOrientation( sheet::DataPilotFieldOrientation_HIDDEN ), +@@ -211,6 +229,8 @@ ScDPSaveDimension::ScDPSaveDimension(const String& rName, BOOL bDataLayout) : + + ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) : + aName( r.aName ), ++ mpLayoutName(NULL), ++ mpSubtotalName(NULL), + bIsDataLayout( r.bIsDataLayout ), + bDupFlag( r.bDupFlag ), + nOrientation( r.nOrientation ), +@@ -251,14 +271,14 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) : + pLayoutInfo = new sheet::DataPilotFieldLayoutInfo( *(r.pLayoutInfo) ); + else + pLayoutInfo = NULL; +- if (r.pLayoutName) +- pLayoutName = new String( *(r.pLayoutName) ); +- else +- pLayoutName = NULL; + if (r.pSelectedPage) + pSelectedPage = new String( *(r.pSelectedPage) ); + else + pSelectedPage = NULL; ++ if (r.mpLayoutName.get()) ++ mpLayoutName.reset(new OUString(*r.mpLayoutName)); ++ if (r.mpSubtotalName.get()) ++ mpSubtotalName.reset(new OUString(*r.mpSubtotalName)); + } + + ScDPSaveDimension::~ScDPSaveDimension() +@@ -269,7 +289,6 @@ ScDPSaveDimension::~ScDPSaveDimension() + delete pSortInfo; + delete pAutoShowInfo; + delete pLayoutInfo; +- delete pLayoutName; + delete pSelectedPage; + delete [] pSubTotalFuncs; + } +@@ -370,25 +389,45 @@ void ScDPSaveDimension::SetUsedHierarchy(long nNew) + nUsedHierarchy = nNew; + } + +-BOOL ScDPSaveDimension::HasLayoutName() const ++void ScDPSaveDimension::SetSubtotalName(const OUString& rName) + { +- return ( pLayoutName != NULL ); ++ mpSubtotalName.reset(new OUString(rName)); + } + +-void ScDPSaveDimension::SetLayoutName(const String* pName) ++const OUString* ScDPSaveDimension::GetSubtotalName() const + { +- delete pLayoutName; +- if (pName) +- pLayoutName = new String( *pName ); +- else +- pLayoutName = NULL; ++ return mpSubtotalName.get(); ++} ++ ++bool ScDPSaveDimension::IsMemberNameInUse(const OUString& rName) const ++{ ++ MemberList::const_iterator itr = maMemberList.begin(), itrEnd = maMemberList.end(); ++ for (; itr != itrEnd; ++itr) ++ { ++ const ScDPSaveMember* pMem = *itr; ++ if (rName.equalsIgnoreAsciiCase(pMem->GetName())) ++ return true; ++ ++ const OUString* pLayoutName = pMem->GetLayoutName(); ++ if (pLayoutName && rName.equalsIgnoreAsciiCase(*pLayoutName)) ++ return true; ++ } ++ return false; ++} ++ ++void ScDPSaveDimension::SetLayoutName(const OUString& rName) ++{ ++ mpLayoutName.reset(new OUString(rName)); + } + +-const String& ScDPSaveDimension::GetLayoutName() const ++const OUString* ScDPSaveDimension::GetLayoutName() const + { +- if (pLayoutName) +- return *pLayoutName; +- return aName; ++ return mpLayoutName.get(); ++} ++ ++void ScDPSaveDimension::RemoveLayoutName() ++{ ++ mpLayoutName.reset(NULL); + } + + void ScDPSaveDimension::SetReferenceValue(const sheet::DataPilotFieldReference* pNew) +@@ -520,15 +559,15 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD + aFilter = uno::Sequence( &aField, 1 ); + } + // else keep empty sequence +- try +- { +- aAny <<= aFilter; +- xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_FILTER), aAny ); +- } +- catch ( beans::UnknownPropertyException& ) +- { +- // recent addition - allow source to not handle it (no error) +- } ++ ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, DP_PROP_FILTER, aFilter); ++ if (mpLayoutName.get()) ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_LAYOUTNAME, *mpLayoutName); ++ ++ const OUString* pSubTotalName = GetSubtotalName(); ++ if (pSubTotalName) ++ // Custom subtotal name, with '?' being replaced by the visible field name later. ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_FIELD_SUBTOTALNAME, *pSubTotalName); + } + + // Level loop outside of maMemberList loop +@@ -546,6 +585,8 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD + nHierCount = xHiers->getCount(); + } + ++ sal_Bool bHasHiddenMember = false; ++ + for (long nHier=0; nHier xHierarchy = ScUnoHelpFunctions::AnyToInterface( xHiers->getByIndex(nHier) ); +@@ -585,41 +626,13 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD + rtl::OUString::createFromAscii(DP_PROP_SHOWEMPTY), (BOOL)nShowEmptyMode ); + + if ( pSortInfo ) +- { +- aAny <<= *pSortInfo; +- try +- { +- xLevProp->setPropertyValue( rtl::OUString::createFromAscii(SC_UNO_SORTING), aAny ); +- } +- catch ( beans::UnknownPropertyException& ) +- { +- // recent addition - allow source to not handle it (no error) +- } +- } ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_SORTING, *pSortInfo); ++ + if ( pAutoShowInfo ) +- { +- aAny <<= *pAutoShowInfo; +- try +- { +- xLevProp->setPropertyValue( rtl::OUString::createFromAscii(SC_UNO_AUTOSHOW), aAny ); +- } +- catch ( beans::UnknownPropertyException& ) +- { +- // recent addition - allow source to not handle it (no error) +- } +- } ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_AUTOSHOW, *pAutoShowInfo); ++ + if ( pLayoutInfo ) +- { +- aAny <<= *pLayoutInfo; +- try +- { +- xLevProp->setPropertyValue( rtl::OUString::createFromAscii(SC_UNO_LAYOUT), aAny ); +- } +- catch ( beans::UnknownPropertyException& ) +- { +- // recent addition - allow source to not handle it (no error) +- } +- } ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_LAYOUT, *pLayoutInfo); + + // exceptions are caught at ScDPSaveData::WriteToSource + } +@@ -638,12 +651,15 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD + + for (MemberList::const_iterator i=maMemberList.begin(); i != maMemberList.end() ; i++) + { +- rtl::OUString aMemberName = (*i)->GetName(); ++ ScDPSaveMember* pMember = *i; ++ if (!pMember->GetIsVisible()) ++ bHasHiddenMember = true; ++ rtl::OUString aMemberName = pMember->GetName(); + if ( xMembers->hasByName( aMemberName ) ) + { + uno::Reference xMemberInt = ScUnoHelpFunctions::AnyToInterface( + xMembers->getByName( aMemberName ) ); +- (*i)->WriteToSource( xMemberInt, nPosition ); ++ pMember->WriteToSource( xMemberInt, nPosition ); + + if ( nPosition >= 0 ) + ++nPosition; // increase if initialized +@@ -655,6 +671,35 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD + } + } + } ++ ++ if (xDimProp.is()) ++ ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_HAS_HIDDEN_MEMBER, bHasHiddenMember); ++} ++ ++void ScDPSaveDimension::UpdateMemberVisibility(const hash_map& rData) ++{ ++ typedef hash_map DataMap; ++ MemberList::iterator itrMem = maMemberList.begin(), itrMemEnd = maMemberList.end(); ++ for (; itrMem != itrMemEnd; ++itrMem) ++ { ++ ScDPSaveMember* pMem = *itrMem; ++ const String& rMemName = pMem->GetName(); ++ DataMap::const_iterator itr = rData.find(rMemName); ++ if (itr != rData.end()) ++ pMem->SetIsVisible(itr->second); ++ } ++} ++ ++bool ScDPSaveDimension::HasInvisibleMember() const ++{ ++ MemberList::const_iterator itrMem = maMemberList.begin(), itrMemEnd = maMemberList.end(); ++ for (; itrMem != itrMemEnd; ++itrMem) ++ { ++ const ScDPSaveMember* pMem = *itrMem; ++ if (!pMem->GetIsVisible()) ++ return true; ++ } ++ return false; + } + + // ----------------------------------------------------------------------- +@@ -666,7 +711,9 @@ ScDPSaveData::ScDPSaveData() : + nIgnoreEmptyMode( SC_DPSAVEMODE_DONTKNOW ), + nRepeatEmptyMode( SC_DPSAVEMODE_DONTKNOW ), + bFilterButton( TRUE ), +- bDrillDown( TRUE ) ++ bDrillDown( TRUE ), ++ mbDimensionMembersBuilt(false), ++ mpGrandTotalName(NULL) + { + } + +@@ -676,7 +723,9 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) : + nIgnoreEmptyMode( r.nIgnoreEmptyMode ), + nRepeatEmptyMode( r.nRepeatEmptyMode ), + bFilterButton( r.bFilterButton ), +- bDrillDown( r.bDrillDown ) ++ bDrillDown( r.bDrillDown ), ++ mbDimensionMembersBuilt(r.mbDimensionMembersBuilt), ++ mpGrandTotalName(NULL) + { + if ( r.pDimensionData ) + pDimensionData = new ScDPDimensionSaveData( *r.pDimensionData ); +@@ -689,6 +738,9 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) : + ScDPSaveDimension* pNew = new ScDPSaveDimension( *(ScDPSaveDimension*)r.aDimList.GetObject(i) ); + aDimList.Insert( pNew, LIST_APPEND ); + } ++ ++ if (r.mpGrandTotalName.get()) ++ mpGrandTotalName.reset(new OUString(*r.mpGrandTotalName)); + } + + ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) +@@ -707,6 +759,7 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) + nRepeatEmptyMode = r.nRepeatEmptyMode; + bFilterButton = r.bFilterButton; + bDrillDown = r.bDrillDown; ++ mbDimensionMembersBuilt = r.mbDimensionMembersBuilt; + + // remove old dimensions + +@@ -725,6 +778,9 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) + new ScDPSaveDimension( *(ScDPSaveDimension*)r.aDimList.GetObject(i) ); + aDimList.Insert( pNew, LIST_APPEND ); + } ++ ++ if (r.mpGrandTotalName.get()) ++ mpGrandTotalName.reset(new OUString(*r.mpGrandTotalName)); + } + return *this; + } +@@ -736,7 +792,8 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const + nIgnoreEmptyMode != r.nIgnoreEmptyMode || + nRepeatEmptyMode != r.nRepeatEmptyMode || + bFilterButton != r.bFilterButton || +- bDrillDown != r.bDrillDown ) ++ bDrillDown != r.bDrillDown || ++ mbDimensionMembersBuilt != r.mbDimensionMembersBuilt) + return FALSE; + + if ( pDimensionData || r.pDimensionData ) +@@ -752,6 +809,16 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const + *(ScDPSaveDimension*)r.aDimList.GetObject(i) ) ) + return FALSE; + ++ if (mpGrandTotalName.get()) ++ { ++ if (!r.mpGrandTotalName.get()) ++ return false; ++ if (!mpGrandTotalName->equals(*r.mpGrandTotalName)) ++ return false; ++ } ++ else if (r.mpGrandTotalName.get()) ++ return false; ++ + return TRUE; + } + +@@ -765,6 +832,16 @@ ScDPSaveData::~ScDPSaveData() + delete pDimensionData; + } + ++void ScDPSaveData::SetGrandTotalName(const OUString& rName) ++{ ++ mpGrandTotalName.reset(new OUString(rName)); ++} ++ ++const OUString* ScDPSaveData::GetGrandTotalName() const ++{ ++ return mpGrandTotalName.get(); ++} ++ + ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName) + { + long nCount = aDimList.Count(); +@@ -779,7 +856,7 @@ ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName) + return pNew; + } + +-ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName) ++ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName) const + { + long nCount = aDimList.Count(); + for (long i=0; iIsDataLayout() ) + return pDim; + } +- ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), TRUE ); +- aDimList.Insert( pNew, LIST_APPEND ); +- return pNew; ++ return NULL; + } + + ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName) +@@ -870,6 +956,18 @@ ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(USHORT nOrientation) + return pInner; // the last matching one + } + ++ScDPSaveDimension* ScDPSaveData::GetFirstDimension(sheet::DataPilotFieldOrientation eOrientation) ++{ ++ long nCount = aDimList.Count(); ++ for (long i = 0; i < nCount; ++i) ++ { ++ ScDPSaveDimension* pDim = static_cast(aDimList.GetObject(i)); ++ if (pDim->GetOrientation() == eOrientation && !pDim->IsDataLayout()) ++ return pDim; ++ } ++ return NULL; ++} ++ + long ScDPSaveData::GetDataDimensionCount() const + { + long nDataCount = 0; +@@ -982,6 +1080,10 @@ void ScDPSaveData::WriteToSource( const uno::Reference NameIndexMap; ++ NameIndexMap aMap; ++ long nColCount = pData->GetColumnCount(); ++ for (long i = 0; i < nColCount; ++i) ++ aMap.insert( NameIndexMap::value_type(pData->getDimensionName(i), i)); ++ ++ NameIndexMap::const_iterator itrEnd = aMap.end(); ++ ++ sal_uInt32 n = aDimList.Count(); ++ for (sal_uInt32 i = 0; i < n; ++i) ++ { ++ ScDPSaveDimension* pDim = static_cast(aDimList.GetObject(i)); ++ const String& rDimName = pDim->GetName(); ++ if (!rDimName.Len()) ++ // empty dimension name. It must be data layout. ++ continue; ++ ++ NameIndexMap::const_iterator itr = aMap.find(rDimName); ++ if (itr == itrEnd) ++ // dimension name not in the data. This should never happen! ++ continue; ++ ++ long nDimIndex = itr->second; ++ const TypedScStrCollection& rMembers = pData->GetColumnEntries(nDimIndex); ++ sal_uInt16 nMemberCount = rMembers.GetCount(); ++ for (sal_uInt16 j = 0; j < nMemberCount; ++j) ++ { ++ const String& rMemName = rMembers[j]->GetString(); ++ if (pDim->GetExistingMemberByName(rMemName)) ++ // this member instance already exists. nothing to do. ++ continue; ++ ++ auto_ptr pNewMember(new ScDPSaveMember(rMemName)); ++ pNewMember->SetIsVisible(true); ++ pDim->AddMember(pNewMember.release()); ++ } ++ } ++ ++ mbDimensionMembersBuilt = true; ++} ++ ++bool ScDPSaveData::HasInvisibleMember(const OUString& rDimName) const ++{ ++ ScDPSaveDimension* pDim = GetExistingDimensionByName(rDimName); ++ if (!pDim) ++ return false; ++ ++ return pDim->HasInvisibleMember(); ++} +diff --git sc/source/core/data/dptabres.cxx sc/source/core/data/dptabres.cxx +index 675a0a5..0494bc6 100644 +--- sc/source/core/data/dptabres.cxx ++++ sc/source/core/data/dptabres.cxx +@@ -67,6 +67,7 @@ using ::std::vector; + using ::std::pair; + using ::std::hash_map; + using ::com::sun::star::uno::Sequence; ++using ::rtl::OUString; + + // ----------------------------------------------------------------------- + +@@ -825,11 +826,11 @@ USHORT ScDPResultData::GetMeasureRefOrient(long nMeasure) const + return pMeasRefOrient[nMeasure]; + } + +-String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc) const ++String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const + { + // with bForce==TRUE, return function instead of "result" for single measure + // with eForceFunc != SUBTOTAL_FUNC_NONE, always use eForceFunc +- ++ rbTotalResult = false; + if ( nMeasure < 0 || ( nMeasCount == 1 && !bForce && eForceFunc == SUBTOTAL_FUNC_NONE ) ) + { + // for user-specified subtotal function with all measures, +@@ -837,12 +838,19 @@ String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFu + if ( eForceFunc != SUBTOTAL_FUNC_NONE ) + return ScGlobal::GetRscString(nFuncStrIds[eForceFunc]); + ++ rbTotalResult = true; + return ScGlobal::GetRscString(STR_TABLE_ERGEBNIS); + } + else + { + DBG_ASSERT( pMeasNames && nMeasure < nMeasCount, "bumm" ); +- ++ ScDPDimension* pDataDim = pSource->GetDataDimension(nMeasure); ++ if (pDataDim) ++ { ++ const OUString* pLayoutName = pDataDim->GetLayoutName(); ++ if (pLayoutName) ++ return *pLayoutName; ++ } + String aRet; + ScSubTotalFunc eFunc = ( eForceFunc == SUBTOTAL_FUNC_NONE ) ? + GetMeasureFunction(nMeasure) : eForceFunc; +@@ -896,6 +904,11 @@ BOOL ScDPResultData::HasCommonElement( const ScDPItemData& rFirstData, long nFir + return pSource->GetData()->HasCommonElement( rFirstData, nFirstIndex, rSecondData, nSecondIndex ); + } + ++const ScDPSource* ScDPResultData::GetSource() const ++{ ++ return pSource; ++} ++ + // ----------------------------------------------------------------------- + + +@@ -1172,6 +1185,33 @@ void ScDPResultMember::ProcessData( const vector& aChildMembers, c + } + } + ++/** ++ * Parse subtotal string and replace all occurrences of '?' with the caption ++ * string. Do ensure that escaped characters are not translated. ++ */ ++static String lcl_parseSubtotalName(const String& rSubStr, const String& rCaption) ++{ ++ String aNewStr; ++ xub_StrLen n = rSubStr.Len(); ++ bool bEscaped = false; ++ for (xub_StrLen i = 0; i < n; ++i) ++ { ++ sal_Unicode c = rSubStr.GetChar(i); ++ if (!bEscaped && c == sal_Unicode('\\')) ++ { ++ bEscaped = true; ++ continue; ++ } ++ ++ if (!bEscaped && c == sal_Unicode('?')) ++ aNewStr.Append(rCaption); ++ else ++ aNewStr.Append(c); ++ bEscaped = false; ++ } ++ return aNewStr; ++} ++ + void ScDPResultMember::FillMemberResults( uno::Sequence* pSequences, + long& rPos, long nMeasure, BOOL bRoot, + const String* pMemberName, +@@ -1204,17 +1244,25 @@ void ScDPResultMember::FillMemberResults( uno::Sequence* pS + } + + String aCaption = aName; ++ if (pMemberDesc) ++ { ++ const OUString* pLayoutName = pMemberDesc->GetLayoutName(); ++ if (pLayoutName) ++ { ++ aCaption = *pLayoutName; ++ bIsNumeric = false; // layout name is always non-numeric. ++ } ++ } ++ + if ( pMemberCaption ) // use pMemberCaption if != NULL + aCaption = *pMemberCaption; + if (!aCaption.Len()) + aCaption = ScGlobal::GetRscString(STR_EMPTYDATA); + +- if ( !bIsNumeric ) +- { +- // add a "'" character so a string isn't parsed as value in the output cell +- //! have a separate bit in Flags (MemberResultFlags) instead? +- aCaption.Insert( (sal_Unicode) '\'', 0 ); +- } ++ if (bIsNumeric) ++ pArray[rPos].Flags |= sheet::MemberResultFlags::NUMERIC; ++ else ++ pArray[rPos].Flags &= ~sheet::MemberResultFlags::NUMERIC; + + if ( nSize && !bRoot ) // root is overwritten by first dimension + { +@@ -1277,9 +1325,30 @@ void ScDPResultMember::FillMemberResults( uno::Sequence* pS + if (bHasChild) + eForce = lcl_GetForceFunc( pParentLevel, nUserPos ); + +- String aSubStr = aName; //! caption? ++ bool bTotalResult = false; ++ String aSubStr = aCaption; + aSubStr += ' '; +- aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce); ++ aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce, bTotalResult); ++ ++ if (bTotalResult) ++ { ++ if (pMemberDesc) ++ { ++ // single data field layout. ++ const OUString* pSubtotalName = pParentDim->GetSubtotalName(); ++ if (pSubtotalName) ++ aSubStr = lcl_parseSubtotalName(*pSubtotalName, aCaption); ++ pArray[rPos].Flags &= ~sheet::MemberResultFlags::GRANDTOTAL; ++ } ++ else ++ { ++ // root member - subtotal (grand total?) for multi-data field layout. ++ const rtl::OUString* pGrandTotalName = pResultData->GetSource()->GetGrandTotalName(); ++ if (pGrandTotalName) ++ aSubStr = *pGrandTotalName; ++ pArray[rPos].Flags |= sheet::MemberResultFlags::GRANDTOTAL; ++ } ++ } + + pArray[rPos].Name = rtl::OUString(aName); + pArray[rPos].Caption = rtl::OUString(aSubStr); +@@ -2796,8 +2865,9 @@ void ScDPResultDimension::FillMemberResults( uno::Sequence* + // in data layout dimension, use first member with different measures/names + if ( bIsDataLayout ) + { ++ bool bTotalResult = false; + String aMbrName = pResultData->GetMeasureDimensionName( nSorted ); +- String aMbrCapt = pResultData->GetMeasureString( nSorted, FALSE, SUBTOTAL_FUNC_NONE ); ++ String aMbrCapt = pResultData->GetMeasureString( nSorted, FALSE, SUBTOTAL_FUNC_NONE, bTotalResult ); + maMemberArray[0]->FillMemberResults( pSequences, nPos, nSorted, FALSE, &aMbrName, &aMbrCapt ); + } + else if ( pMember->IsVisible() ) +diff --git sc/source/core/data/dptabsrc.cxx sc/source/core/data/dptabsrc.cxx +index 3b5a6e0..1216202 100644 +--- sc/source/core/data/dptabsrc.cxx ++++ sc/source/core/data/dptabsrc.cxx +@@ -85,6 +85,7 @@ using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Any; + using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; ++using ::rtl::OUString; + + // ----------------------------------------------------------------------- + +@@ -141,15 +142,14 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : + pRowResRoot( NULL ), + pColResults( NULL ), + pRowResults( NULL ), +- bResultOverflow( FALSE ) ++ bResultOverflow( FALSE ), ++ mpGrandTotalName(NULL) + { + pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); + } + + ScDPSource::~ScDPSource() + { +- delete pData; // ScDPTableData is not ref-counted +- + if (pDimensions) + pDimensions->release(); // ref-counted + +@@ -163,6 +163,16 @@ ScDPSource::~ScDPSource() + delete pResData; + } + ++void ScDPSource::SetGrandTotalName(const ::rtl::OUString& rName) ++{ ++ mpGrandTotalName.reset(new ::rtl::OUString(rName)); ++} ++ ++const ::rtl::OUString* ScDPSource::GetGrandTotalName() const ++{ ++ return mpGrandTotalName.get(); ++} ++ + USHORT ScDPSource::GetOrientation(long nColumn) + { + long i; +@@ -186,16 +196,21 @@ long ScDPSource::GetDataDimensionCount() + return nDataDimCount; + } + ++ScDPDimension* ScDPSource::GetDataDimension(long nIndex) ++{ ++ if (nIndex < 0 || nIndex >= nDataDimCount) ++ return NULL; ++ ++ long nDimIndex = nDataDims[nIndex]; ++ return GetDimensionsObject()->getByIndex(nDimIndex); ++} ++ + String ScDPSource::GetDataDimName( long nIndex ) + { + String aRet; +- if ( nIndex >= 0 && nIndex < nDataDimCount ) +- { +- long nDimIndex = nDataDims[nIndex]; +- ScDPDimension* pDim = GetDimensionsObject()->getByIndex(nDimIndex); +- if (pDim) +- aRet = String( pDim->getName() ); +- } ++ ScDPDimension* pDim = GetDataDimension(nIndex); ++ if (pDim) ++ aRet = String(pDim->getName()); + return aRet; + } + +@@ -488,7 +503,10 @@ String ScDPSource::getDataDescription() + + String aRet; + if ( pResData->GetMeasureCount() == 1 ) +- aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE ); ++ { ++ bool bTotalResult = false; ++ aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE, bTotalResult ); ++ } + + // empty for more than one measure + +@@ -1132,6 +1150,7 @@ uno::Reference SAL_CALL ScDPSource::getPropertySetInfo( + throw(uno::RuntimeException) + { + ScUnoGuard aGuard; ++ using beans::PropertyAttribute::READONLY; + + static SfxItemPropertyMapEntry aDPSourceMap_Impl[] = + { +@@ -1140,6 +1159,10 @@ uno::Reference SAL_CALL ScDPSource::getPropertySetInfo( + {MAP_CHAR_LEN(SC_UNO_IGNOREEM), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only + {MAP_CHAR_LEN(SC_UNO_REPEATIF), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only + {MAP_CHAR_LEN(SC_UNO_ROWGRAND), 0, &getBooleanCppuType(), 0, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_ROWFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_COLUMNFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_DATAFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_GRANDTOTAL_NAME), 0, &getCppuType(static_cast(0)), 0, 0 }, + {0,0,0,0,0,0} + }; + static uno::Reference aRef = +@@ -1161,6 +1184,12 @@ void SAL_CALL ScDPSource::setPropertyValue( const rtl::OUString& aPropertyName, + setIgnoreEmptyRows( lcl_GetBoolFromAny( aValue ) ); + else if ( aNameStr.EqualsAscii( SC_UNO_REPEATIF ) ) + setRepeatIfEmpty( lcl_GetBoolFromAny( aValue ) ); ++ else if (aNameStr.EqualsAscii(SC_UNO_GRANDTOTAL_NAME)) ++ { ++ OUString aName; ++ if (aValue >>= aName) ++ mpGrandTotalName.reset(new OUString(aName)); ++ } + else + { + DBG_ERROR("unknown property"); +@@ -1190,6 +1219,11 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const rtl::OUString& aPropertyNa + aRet <<= static_cast(nColDimCount); + else if ( aNameStr.EqualsAscii( SC_UNO_DATAFIELDCOUNT ) ) // read-only + aRet <<= static_cast(nDataDimCount); ++ else if (aNameStr.EqualsAscii(SC_UNO_GRANDTOTAL_NAME)) ++ { ++ if (mpGrandTotalName.get()) ++ aRet <<= *mpGrandTotalName; ++ } + else + { + DBG_ERROR("unknown property"); +@@ -1337,9 +1371,12 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) : + pHierarchies( NULL ), + nUsedHier( 0 ), + nFunction( SUBTOTAL_FUNC_SUM ), // sum is default ++ mpLayoutName(NULL), ++ mpSubtotalName(NULL), + nSourceDim( -1 ), + bHasSelectedPage( FALSE ), +- pSelectedData( NULL ) ++ pSelectedData( NULL ), ++ mbHasHiddenMember(false) + { + //! hold pSource + } +@@ -1364,6 +1401,16 @@ ScDPHierarchies* ScDPDimension::GetHierarchiesObject() + return pHierarchies; + } + ++const rtl::OUString* ScDPDimension::GetLayoutName() const ++{ ++ return mpLayoutName.get(); ++} ++ ++const rtl::OUString* ScDPDimension::GetSubtotalName() const ++{ ++ return mpSubtotalName.get(); ++} ++ + uno::Reference SAL_CALL ScDPDimension::getHierarchies() + throw(uno::RuntimeException) + { +@@ -1523,6 +1570,9 @@ uno::Reference SAL_CALL ScDPDimension::getPropertySetIn + {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_REFVALUE), 0, &getCppuType((sheet::DataPilotFieldReference*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_USEDHIER), 0, &getCppuType((sal_Int32*)0), 0, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_FIELD_SUBTOTALNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_HAS_HIDDEN_MEMBER), 0, &getBooleanCppuType(), 0, 0 }, + {0,0,0,0,0,0} + }; + static uno::Reference aRef = +@@ -1593,6 +1643,20 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam + } + DELETEZ( pSelectedData ); // invalid after changing aSelectedPage + } ++ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) ++ { ++ OUString aTmpName; ++ if (aValue >>= aTmpName) ++ mpLayoutName.reset(new OUString(aTmpName)); ++ } ++ else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME)) ++ { ++ OUString aTmpName; ++ if (aValue >>= aTmpName) ++ mpSubtotalName.reset(new OUString(aTmpName)); ++ } ++ else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER)) ++ aValue >>= mbHasHiddenMember; + else + { + DBG_ERROR("unknown property"); +@@ -1652,6 +1716,12 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert + else + aRet <<= uno::Sequence(0); + } ++ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) ++ aRet <<= mpLayoutName.get() ? *mpLayoutName : OUString::createFromAscii(""); ++ else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME)) ++ aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii(""); ++ else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER)) ++ aRet <<= mbHasHiddenMember; + else + { + DBG_ERROR("unknown property"); +@@ -2155,7 +2225,11 @@ uno::Sequence SAL_CALL ScDPLevel::getResults() throw(uno::R + return aRet; + } + +- return pSource->GetData()->getDimensionName( nSrcDim ); // (original) dimension name ++ ScDPDimension* pDim = pSource->GetDimensionsObject()->getByIndex(nSrcDim); ++ if (!pDim) ++ return rtl::OUString(); ++ ++ return pDim->getName(); + } + + void SAL_CALL ScDPLevel::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException) +@@ -2258,6 +2332,20 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const rtl::OUString& aPropertyNam + aRet <<= aAutoShowInfo; + else if ( aNameStr.EqualsAscii( SC_UNO_LAYOUT ) ) + aRet <<= aLayoutInfo; ++ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) ++ { ++ // read only property ++ long nSrcDim = pSource->GetSourceDim(nDim); ++ ScDPDimension* pDim = pSource->GetDimensionsObject()->getByIndex(nSrcDim); ++ if (!pDim) ++ return aRet; ++ ++ const OUString* pLayoutName = pDim->GetLayoutName(); ++ if (!pLayoutName) ++ return aRet; ++ ++ aRet <<= *pLayoutName; ++ } + else + { + DBG_ERROR("unknown property"); +@@ -2550,6 +2638,7 @@ ScDPMember::ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, + nHier( nH ), + nLev( nL ), + maData( rN, fV, bHV ), ++ mpLayoutName(NULL), + nPosition( -1 ), + bVisible( TRUE ), + bShowDet( TRUE ) +@@ -2610,6 +2699,11 @@ void ScDPMember::FillItemData( ScDPItemData& rData ) const + rData = maData; + } + ++const OUString* ScDPMember::GetLayoutName() const ++{ ++ return mpLayoutName.get(); ++} ++ + String ScDPMember::GetNameStr() const + { + return maData.aString; +@@ -2669,6 +2763,7 @@ uno::Reference SAL_CALL ScDPMember::getPropertySetInfo( + {MAP_CHAR_LEN(SC_UNO_ISVISIBL), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_SHOWDETA), 0, &getBooleanCppuType(), 0, 0 }, ++ {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, + {0,0,0,0,0,0} + }; + static uno::Reference aRef = +@@ -2692,6 +2787,12 @@ void SAL_CALL ScDPMember::setPropertyValue( const rtl::OUString& aPropertyName, + if (aValue >>= nInt) + setPosition( nInt ); + } ++ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) ++ { ++ rtl::OUString aName; ++ if (aValue >>= aName) ++ mpLayoutName.reset(new rtl::OUString(aName)); ++ } + else + { + DBG_ERROR("unknown property"); +@@ -2711,6 +2812,8 @@ uno::Any SAL_CALL ScDPMember::getPropertyValue( const rtl::OUString& aPropertyNa + lcl_SetBoolInAny( aRet, getShowDetails() ); + else if ( aNameStr.EqualsAscii( SC_UNO_POSITION ) ) + aRet <<= (sal_Int32) getPosition(); ++ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) ++ aRet <<= mpLayoutName.get() ? *mpLayoutName : rtl::OUString(); + else + { + DBG_ERROR("unknown property"); +diff --git sc/source/core/data/fillinfo.cxx sc/source/core/data/fillinfo.cxx +index 1de2385..54ffe10 100644 +--- sc/source/core/data/fillinfo.cxx ++++ sc/source/core/data/fillinfo.cxx +@@ -332,6 +332,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX + pInfo->bVOverlapped = FALSE; + pInfo->bAutoFilter = FALSE; + pInfo->bPushButton = FALSE; ++ pInfo->bPopupButton = false; ++ pInfo->bFilterActive = false; + pInfo->nRotateDir = SC_ROTDIR_NONE; + + pInfo->bPrinted = FALSE; // view-intern +@@ -458,6 +460,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX + BOOL bAutoFilter = ((nOverlap & SC_MF_AUTO) != 0); + BOOL bPushButton = ((nOverlap & SC_MF_BUTTON) != 0); + BOOL bScenario = ((nOverlap & SC_MF_SCENARIO) != 0); ++ bool bPopupButton = ((nOverlap & SC_MF_BUTTON_POPUP) != 0); ++ bool bFilterActive = ((nOverlap & SC_MF_HIDDEN_MEMBER) != 0); + if (bMerged||bHOverlapped||bVOverlapped) + bAnyMerged = TRUE; // intern + +@@ -498,6 +502,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX + pInfo->bVOverlapped = bVOverlapped; + pInfo->bAutoFilter = bAutoFilter; + pInfo->bPushButton = bPushButton; ++ pInfo->bPopupButton = bPopupButton; ++ pInfo->bFilterActive = bFilterActive; + pInfo->pLinesAttr = pLinesAttr; + pInfo->mpTLBRLine = pTLBRLine; + pInfo->mpBLTRLine = pBLTRLine; +@@ -512,7 +518,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX + nCurRow >= aEmbedRange.aStart.Row() && + nCurRow <= aEmbedRange.aEnd.Row(); + +- if (bPushButton || bScenario) ++ if (bScenario) + { + pInfo->pBackground = ScGlobal::GetButtonBrushItem(); + pThisRowInfo->bEmptyBack = FALSE; +diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx +index 925f34e..f71b842 100644 +--- sc/source/core/data/global2.cxx ++++ sc/source/core/data/global2.cxx +@@ -56,6 +56,7 @@ + #include "sc.hrc" + #include "globstr.hrc" + ++using ::std::vector; + + // ----------------------------------------------------------------------- + +@@ -817,7 +818,6 @@ bool PivotField::operator==( const PivotField& r ) const + + ScPivotParam::ScPivotParam() + : nCol(0), nRow(0), nTab(0), +- ppLabelArr( NULL ), nLabels(0), + nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0), + bIgnoreEmptyRows(FALSE), bDetectCategories(FALSE), + bMakeTotalCol(TRUE), bMakeTotalRow(TRUE) +@@ -828,23 +828,22 @@ ScPivotParam::ScPivotParam() + + ScPivotParam::ScPivotParam( const ScPivotParam& r ) + : nCol( r.nCol ), nRow( r.nRow ), nTab( r.nTab ), +- ppLabelArr( NULL ), nLabels(0), + nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0), + bIgnoreEmptyRows(r.bIgnoreEmptyRows), + bDetectCategories(r.bDetectCategories), + bMakeTotalCol(r.bMakeTotalCol), + bMakeTotalRow(r.bMakeTotalRow) + { +- SetLabelData ( r.ppLabelArr, r.nLabels ); + SetPivotArrays ( r.aPageArr, r.aColArr, r.aRowArr, r.aDataArr, + r.nPageCount, r.nColCount, r.nRowCount, r.nDataCount ); ++ ++ SetLabelData(r.maLabelArray); + } + + //------------------------------------------------------------------------ + + __EXPORT ScPivotParam::~ScPivotParam() + { +- ClearLabelData(); + } + + //------------------------------------------------------------------------ +@@ -860,22 +859,6 @@ __EXPORT ScPivotParam::~ScPivotParam() + //UNUSED2009-05 ClearPivotArrays(); + //UNUSED2009-05 } + +-//------------------------------------------------------------------------ +- +-void __EXPORT ScPivotParam::ClearLabelData() +-{ +- if ( (nLabels > 0) && ppLabelArr ) +- { +- for ( SCSIZE i=0; i& r) + { +- ClearLabelData(); +- +- if ( (nLab > 0) && pLabArr ) ++ vector aNewArray; ++ aNewArray.reserve(r.size()); ++ for (vector::const_iterator itr = r.begin(), itrEnd = r.end(); ++ itr != itrEnd; ++itr) + { +- nLabels = (nLab>MAX_LABELS) ? MAX_LABELS : nLab; +- ppLabelArr = new LabelData*[nLabels]; +- for ( SCSIZE i=0; iequals(GetItemName())) ++ maItemInfo.SetVisName(*pVisName); + } + + void XclExpPTItem::WriteBody( XclExpStream& rStrm ) +@@ -1029,6 +1035,31 @@ sal_uInt16 XclExpPTField::GetItemIndex( const String& rName, sal_uInt16 nDefault + + // fill data -------------------------------------------------------------- + ++/** ++ * Calc's subtotal names are escaped with backslashes ('\'), while Excel's ++ * are not escaped at all. ++ */ ++static OUString lcl_convertCalcSubtotalName(const OUString& rName) ++{ ++ OUStringBuffer aBuf; ++ const sal_Unicode* p = rName.getStr(); ++ sal_Int32 n = rName.getLength(); ++ bool bEscaped = false; ++ for (sal_Int32 i = 0; i < n; ++i) ++ { ++ const sal_Unicode c = p[i]; ++ if (!bEscaped && c == sal_Unicode('\\')) ++ { ++ bEscaped = true; ++ continue; ++ } ++ ++ aBuf.append(c); ++ bEscaped = false; ++ } ++ return aBuf.makeStringAndClear(); ++} ++ + void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) + { + // orientation +@@ -1040,8 +1071,16 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) + ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.GetShowEmpty() ); + + // visible name +- if( rSaveDim.HasLayoutName() && (rSaveDim.GetLayoutName() != GetFieldName()) ) +- maFieldInfo.SetVisName( rSaveDim.GetLayoutName() ); ++ const OUString* pLayoutName = rSaveDim.GetLayoutName(); ++ if (pLayoutName && !pLayoutName->equals(GetFieldName())) ++ maFieldInfo.SetVisName(*pLayoutName); ++ ++ const rtl::OUString* pSubtotalName = rSaveDim.GetSubtotalName(); ++ if (pSubtotalName) ++ { ++ OUString aSubName = lcl_convertCalcSubtotalName(*pSubtotalName); ++ maFieldExtInfo.mpFieldTotalName.reset(new rtl::OUString(aSubName)); ++ } + + // subtotals + XclPTSubtotalVec aSubtotals; +@@ -1108,7 +1147,11 @@ void XclExpPTField::SetDataPropertiesFromDim( const ScDPSaveDimension& rSaveDim + rDataInfo.SetApiAggFunc( eFunc ); + + // visible name +- rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); ++ const rtl::OUString* pVisName = rSaveDim.GetLayoutName(); ++ if (pVisName) ++ rDataInfo.SetVisName(*pVisName); ++ else ++ rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); + + // result field reference + if( const DataPilotFieldReference* pFieldRef = rSaveDim.GetReferenceValue() ) +@@ -1217,9 +1260,10 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r + // pivot table properties from DP object + mnOutScTab = rOutScRange.aStart.Tab(); + maPTInfo.maTableName = rDPObj.GetName(); +- maPTInfo.maDataName = ScGlobal::GetRscString( STR_PIVOT_DATA ); + maPTInfo.mnCacheIdx = mrPCache.GetCacheIndex(); + ++ maPTViewEx9Info.Init( rDPObj ); ++ + if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) + { + // additional properties from ScDPSaveData +@@ -1299,6 +1343,10 @@ void XclExpPivotTable::Save( XclExpStream& rStrm ) + WriteSxli( rStrm, maPTInfo.mnDataCols, maPTInfo.mnColFields ); + // SXEX + WriteSxex( rStrm ); ++ // QSISXTAG ++ WriteQsiSxTag( rStrm ); ++ // SXVIEWEX9 ++ WriteSxViewEx9( rStrm ); + } + } + +@@ -1332,6 +1380,15 @@ void XclExpPivotTable::SetPropertiesFromDP( const ScDPSaveData& rSaveData ) + ::set_flag( maPTInfo.mnFlags, EXC_SXVIEW_COLGRAND, rSaveData.GetColumnGrand() ); + ::set_flag( maPTExtInfo.mnFlags, EXC_SXEX_DRILLDOWN, rSaveData.GetDrillDown() ); + mbFilterBtn = rSaveData.GetFilterButton(); ++ const ScDPSaveDimension* pDim = rSaveData.GetExistingDataLayoutDimension(); ++ if (!pDim) ++ return; ++ ++ const rtl::OUString* pLayoutName = pDim->GetLayoutName(); ++ if (pLayoutName) ++ maPTInfo.maDataName = *pLayoutName; ++ else ++ maPTInfo.maDataName = ScGlobal::GetRscString(STR_PIVOT_DATA); + } + + void XclExpPivotTable::SetFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) +@@ -1439,13 +1496,21 @@ void XclExpPivotTable::Finalize() + rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1; + if( maDataFields.empty() ) + ++rnDataXclRow; ++ ++ bool bExtraHeaderRow = (0 == maPTViewEx9Info.mnGridLayout && maPTInfo.mnColFields == 0); ++ if (bExtraHeaderRow) ++ // Insert an extra row only when there is no column field. ++ ++rnDataXclRow; ++ + rnXclCol2 = ::std::max( rnXclCol2, rnDataXclCol ); + rnXclRow2 = ::std::max( rnXclRow2, rnDataXclRow ); + maPTInfo.mnDataCols = rnXclCol2 - rnDataXclCol + 1; + maPTInfo.mnDataRows = rnXclRow2 - rnDataXclRow + 1; + + // first heading +- maPTInfo.mnFirstHeadRow = rnXclRow1 + 1; ++ maPTInfo.mnFirstHeadRow = rnXclRow1; ++ if (bExtraHeaderRow) ++ maPTInfo.mnFirstHeadRow += 2; + } + + // records ---------------------------------------------------------------- +@@ -1525,6 +1590,72 @@ void XclExpPivotTable::WriteSxex( XclExpStream& rStrm ) const + rStrm.EndRecord(); + } + ++void XclExpPivotTable::WriteQsiSxTag( XclExpStream& rStrm ) const ++{ ++ rStrm.StartRecord( 0x0802, 32 ); ++ ++ sal_uInt16 nRecordType = 0x0802; ++ sal_uInt16 nDummyFlags = 0x0000; ++ sal_uInt16 nTableType = 1; // 0 = query table : 1 = pivot table ++ ++ rStrm << nRecordType << nDummyFlags << nTableType; ++ ++ // General flags ++ bool bEnableRefresh = true; ++ bool bPCacheInvalid = false; ++ bool bOlapPTReport = false; ++ ++ sal_uInt16 nFlags = 0x0000; ++ if (bEnableRefresh) nFlags |= 0x0001; ++ if (bPCacheInvalid) nFlags |= 0x0002; ++ if (bOlapPTReport) nFlags |= 0x0004; ++ rStrm << nFlags; ++ ++ // Feature-specific options. The value differs depending on the table ++ // type, but we assume the table type is always pivot table. ++ sal_uInt32 nOptions = 0x00000000; ++ bool bNoStencil = false; ++ bool bHideTotal = false; ++ bool bEmptyRows = false; ++ bool bEmptyCols = false; ++ if (bNoStencil) nOptions |= 0x00000001; ++ if (bHideTotal) nOptions |= 0x00000002; ++ if (bEmptyRows) nOptions |= 0x00000008; ++ if (bEmptyCols) nOptions |= 0x00000010; ++ rStrm << nOptions; ++ ++ enum ExcelVersion ++ { ++ Excel2000 = 0, ++ ExcelXP = 1, ++ Excel2003 = 2, ++ Excel2007 = 3 ++ }; ++ ExcelVersion eXclVer = Excel2000; ++ sal_uInt8 nOffsetBytes = 16; ++ rStrm << static_cast(eXclVer) // version table last refreshed ++ << static_cast(eXclVer) // minimum version to refresh ++ << nOffsetBytes ++ << static_cast(eXclVer); // first version created ++ ++ rStrm << XclExpString(maPTInfo.maTableName); ++ rStrm << static_cast(0x0001); // no idea what this is for. ++ ++ rStrm.EndRecord(); ++} ++ ++void XclExpPivotTable::WriteSxViewEx9( XclExpStream& rStrm ) const ++{ ++ // Until we sync the autoformat ids only export if using grid header layout ++ // That could only have been set via xls import so far. ++ if ( 0 == maPTViewEx9Info.mnGridLayout ) ++ { ++ rStrm.StartRecord( EXC_ID_SXVIEWEX9, 17 ); ++ rStrm << maPTViewEx9Info; ++ rStrm.EndRecord(); ++ } ++} ++ + // ============================================================================ + + namespace { +diff --git sc/source/filter/excel/xestring.cxx sc/source/filter/excel/xestring.cxx +index eb36b4a..c210911 100644 +--- sc/source/filter/excel/xestring.cxx ++++ sc/source/filter/excel/xestring.cxx +@@ -423,7 +423,8 @@ void XclExpString::WriteFormats( XclExpStream& rStrm, bool bWriteSize ) const + + void XclExpString::Write( XclExpStream& rStrm ) const + { +- WriteHeader( rStrm ); ++ if (!mbSkipHeader) ++ WriteHeader( rStrm ); + WriteBuffer( rStrm ); + if( IsWriteFormats() ) // only in BIFF8 included in string + WriteFormats( rStrm ); +@@ -589,6 +590,7 @@ void XclExpString::Init( sal_Int32 nCurrLen, XclStrFlags nFlags, sal_uInt16 nMax + mbSmartFlags = bBiff8 && ::get_flag( nFlags, EXC_STR_SMARTFLAGS ); + mbSkipFormats = ::get_flag( nFlags, EXC_STR_SEPARATEFORMATS ); + mbWrapped = false; ++ mbSkipHeader = ::get_flag( nFlags, EXC_STR_NOHEADER ); + mnMaxLen = nMaxLen; + SetStrLen( nCurrLen ); + +diff --git sc/source/filter/excel/xipivot.cxx sc/source/filter/excel/xipivot.cxx +index acd371f..bae2192 100644 +--- sc/source/filter/excel/xipivot.cxx ++++ sc/source/filter/excel/xipivot.cxx +@@ -48,7 +48,9 @@ + #include "dpdimsave.hxx" + #include "dpobject.hxx" + #include "dpshttab.hxx" ++#include "dpoutputgeometry.hxx" + #include "scitems.hxx" ++#include "attrib.hxx" + + #include "xltracer.hxx" + #include "xistream.hxx" +@@ -60,13 +62,17 @@ + #include "excform.hxx" + #include "xltable.hxx" + ++#include ++ + using ::rtl::OUString; ++using ::rtl::OUStringBuffer; + using ::com::sun::star::sheet::DataPilotFieldOrientation; + using ::com::sun::star::sheet::DataPilotFieldOrientation_DATA; + using ::com::sun::star::sheet::DataPilotFieldSortInfo; + using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; + using ::com::sun::star::sheet::DataPilotFieldLayoutInfo; + using ::com::sun::star::sheet::DataPilotFieldReference; ++using ::std::vector; + + // ============================================================================ + // Pivot cache +@@ -847,6 +853,11 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) + } + } + ++bool XclImpPivotCache::IsRefreshOnLoad() const ++{ ++ return static_cast(maPCInfo.mnFlags & 0x0004); ++} ++ + // ============================================================================ + // Pivot table + // ============================================================================ +@@ -882,6 +893,8 @@ void XclImpPTItem::ConvertItem( ScDPSaveDimension& rSaveDim ) const + ScDPSaveMember& rMember = *rSaveDim.GetMemberByName( *pItemName ); + rMember.SetIsVisible( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN ) ); + rMember.SetShowDetails( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL ) ); ++ if (maItemInfo.HasVisName()) ++ rMember.SetLayoutName(*maItemInfo.GetVisName()); + } + } + +@@ -1022,6 +1035,28 @@ void XclImpPTField::ConvertDataField( ScDPSaveData& rSaveData ) const + + // private -------------------------------------------------------------------- + ++/** ++ * Convert Excel-encoded subtotal name to a Calc-encoded one. ++ */ ++static OUString lcl_convertExcelSubtotalName(const OUString& rName) ++{ ++ OUStringBuffer aBuf; ++ const sal_Unicode* p = rName.getStr(); ++ sal_Int32 n = rName.getLength(); ++ for (sal_Int32 i = 0; i < n; ++i) ++ { ++ const sal_Unicode c = p[i]; ++ if (c == sal_Unicode('\\')) ++ { ++ aBuf.append(c); ++ aBuf.append(c); ++ } ++ else ++ aBuf.append(c); ++ } ++ return aBuf.makeStringAndClear(); ++} ++ + ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) const + { + const String& rFieldName = GetFieldName(); +@@ -1043,7 +1078,7 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con + // visible name + if( const String* pVisName = maFieldInfo.GetVisName() ) + if( pVisName->Len() > 0 ) +- rSaveDim.SetLayoutName( pVisName ); ++ rSaveDim.SetLayoutName( *pVisName ); + + // subtotal function(s) + XclPTSubtotalVec aSubtotalVec; +@@ -1075,6 +1110,13 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con + // grouping info + pCacheField->ConvertGroupField( rSaveData, mrPTable.GetVisFieldNames() ); + ++ // custom subtotal name ++ if (maFieldExtInfo.mpFieldTotalName.get()) ++ { ++ OUString aSubName = lcl_convertExcelSubtotalName(*maFieldExtInfo.mpFieldTotalName); ++ rSaveDim.SetSubtotalName(aSubName); ++ } ++ + return &rSaveDim; + } + +@@ -1099,7 +1141,7 @@ void XclImpPTField::ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const Xcl + // visible name + if( const String* pVisName = rDataInfo.GetVisName() ) + if( pVisName->Len() > 0 ) +- rSaveDim.SetLayoutName( pVisName ); ++ rSaveDim.SetLayoutName( *pVisName ); + + // aggregation function + rSaveDim.SetFunction( static_cast< USHORT >( rDataInfo.GetApiAggFunc() ) ); +@@ -1134,7 +1176,8 @@ void XclImpPTField::ConvertItems( ScDPSaveDimension& rSaveDim ) const + + XclImpPivotTable::XclImpPivotTable( const XclImpRoot& rRoot ) : + XclImpRoot( rRoot ), +- maDataOrientField( *this, EXC_SXIVD_DATA ) ++ maDataOrientField( *this, EXC_SXIVD_DATA ), ++ mpDPObj(NULL) + { + } + +@@ -1296,6 +1339,11 @@ void XclImpPivotTable::ReadSxex( XclImpStream& rStrm ) + rStrm >> maPTExtInfo; + } + ++void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm ) ++{ ++ rStrm >> maPTViewEx9Info; ++} ++ + // ---------------------------------------------------------------------------- + + void XclImpPivotTable::Convert() +@@ -1331,6 +1379,10 @@ void XclImpPivotTable::Convert() + if( const XclImpPTField* pField = GetField( *aIt ) ) + pField->ConvertPageField( aSaveData ); + ++ // We need to import hidden fields because hidden fields may contain ++ // special settings for subtotals (aggregation function, filters, custom ++ // name etc.) and members (hidden, custom name etc.). ++ + // hidden fields + for( sal_uInt16 nField = 0, nCount = GetFieldCount(); nField < nCount; ++nField ) + if( const XclImpPTField* pField = GetField( nField ) ) +@@ -1359,11 +1411,111 @@ void XclImpPivotTable::Convert() + // create the DataPilot + ScDPObject* pDPObj = new ScDPObject( GetDocPtr() ); + pDPObj->SetName( maPTInfo.maTableName ); ++ if (maPTInfo.maDataName.Len() > 0) ++ aSaveData.GetDataLayoutDimension()->SetLayoutName(maPTInfo.maDataName); ++ ++ if (maPTViewEx9Info.maGrandTotalName.Len() > 0) ++ aSaveData.SetGrandTotalName(maPTViewEx9Info.maGrandTotalName); ++ + pDPObj->SetSaveData( aSaveData ); + pDPObj->SetSheetDesc( aDesc ); + pDPObj->SetOutRange( aOutRange ); + pDPObj->SetAlive( TRUE ); +- GetDoc().GetDPCollection()->Insert( pDPObj ); ++ pDPObj->SetHeaderLayout( maPTViewEx9Info.mnGridLayout == 0 ); ++ ++ GetDoc().GetDPCollection()->InsertNewTable(pDPObj); ++ mpDPObj = pDPObj; ++ ++ ApplyMergeFlags(aOutRange, aSaveData); ++} ++ ++void XclImpPivotTable::MaybeRefresh() ++{ ++ if (mpDPObj && mxPCache->IsRefreshOnLoad()) ++ { ++ // 'refresh table on load' flag is set. Refresh the table now. Some ++ // Excel files contain partial table output when this flag is set. ++ mpDPObj->Output(maOutScRange.aStart); ++ } ++} ++ ++void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData) ++{ ++ // Apply merge flags for varoius datapilot controls. ++ ++ ScDPOutputGeometry aGeometry(rOutRange, false, ScDPOutputGeometry::XLS); ++ aGeometry.setColumnFieldCount(maPTInfo.mnColFields); ++ aGeometry.setPageFieldCount(maPTInfo.mnPageFields); ++ aGeometry.setDataFieldCount(maPTInfo.mnDataFields); ++ ++ // Excel includes data layout field in the row field count. We need to ++ // subtract it. ++ bool bDataLayout = maPTInfo.mnDataFields > 1; ++ aGeometry.setRowFieldCount(maPTInfo.mnRowFields - static_cast(bDataLayout)); ++ ++ ScDocument& rDoc = GetDoc(); ++ ++ vector aPageBtns; ++ aGeometry.getPageFieldPositions(aPageBtns); ++ vector::const_iterator itr = aPageBtns.begin(), itrEnd = aPageBtns.end(); ++ for (; itr != itrEnd; ++itr) ++ { ++ sal_uInt16 nMFlag = SC_MF_BUTTON; ++ String aName; ++ rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); ++ if (rSaveData.HasInvisibleMember(aName)) ++ nMFlag |= SC_MF_HIDDEN_MEMBER; ++ ++ rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); ++ rDoc.ApplyFlagsTab(itr->Col()+1, itr->Row(), itr->Col()+1, itr->Row(), itr->Tab(), SC_MF_AUTO); ++ } ++ ++ vector aColBtns; ++ aGeometry.getColumnFieldPositions(aColBtns); ++ itr = aColBtns.begin(); ++ itrEnd = aColBtns.end(); ++ for (; itr != itrEnd; ++itr) ++ { ++ sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; ++ String aName; ++ rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); ++ if (rSaveData.HasInvisibleMember(aName)) ++ nMFlag |= SC_MF_HIDDEN_MEMBER; ++ rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); ++ } ++ ++ vector aRowBtns; ++ aGeometry.getRowFieldPositions(aRowBtns); ++ if (aRowBtns.empty()) ++ { ++ if (bDataLayout) ++ { ++ // No row fields, but the data layout button exists. ++ SCROW nRow = aGeometry.getRowFieldHeaderRow(); ++ SCCOL nCol = rOutRange.aStart.Col(); ++ SCTAB nTab = rOutRange.aStart.Tab(); ++ rDoc.ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, SC_MF_BUTTON); ++ } ++ } ++ else ++ { ++ itr = aRowBtns.begin(); ++ itrEnd = aRowBtns.end(); ++ for (; itr != itrEnd; ++itr) ++ { ++ sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; ++ String aName; ++ rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); ++ if (rSaveData.HasInvisibleMember(aName)) ++ nMFlag |= SC_MF_HIDDEN_MEMBER; ++ rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); ++ } ++ if (bDataLayout) ++ { ++ --itr; // move back to the last row field position. ++ rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), SC_MF_BUTTON); ++ } ++ } + } + + // ============================================================================ +@@ -1458,6 +1610,12 @@ void XclImpPivotTableManager::ReadSxex( XclImpStream& rStrm ) + maPTables.back()->ReadSxex( rStrm ); + } + ++void XclImpPivotTableManager::ReadSxViewEx9( XclImpStream& rStrm ) ++{ ++ if( !maPTables.empty() ) ++ maPTables.back()->ReadSxViewEx9( rStrm ); ++} ++ + // ---------------------------------------------------------------------------- + + void XclImpPivotTableManager::ReadPivotCaches( XclImpStream& rStrm ) +@@ -1472,5 +1630,11 @@ void XclImpPivotTableManager::ConvertPivotTables() + (*aIt)->Convert(); + } + ++void XclImpPivotTableManager::MaybeRefreshPivotTables() ++{ ++ for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt ) ++ (*aIt)->MaybeRefresh(); ++} ++ + // ============================================================================ + +diff --git sc/source/filter/excel/xlpivot.cxx sc/source/filter/excel/xlpivot.cxx +index e3544b5..c915903 100644 +--- sc/source/filter/excel/xlpivot.cxx ++++ sc/source/filter/excel/xlpivot.cxx +@@ -31,6 +31,7 @@ + // MARKER(update_precomp.py): autogen include statement, do not remove + #include "precompiled_sc.hxx" + #include "dpgroup.hxx" ++#include "dpsave.hxx" + #include "xestream.hxx" + #include "xistream.hxx" + #include "xestring.hxx" +@@ -581,7 +582,9 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldInfo& rInfo ) + XclPTFieldExtInfo::XclPTFieldExtInfo() : + mnFlags( EXC_SXVDEX_DEFAULTFLAGS ), + mnSortField( EXC_SXVDEX_SORT_OWN ), +- mnShowField( EXC_SXVDEX_SHOW_NONE ) ++ mnShowField( EXC_SXVDEX_SHOW_NONE ), ++ mnNumFmt(0), ++ mpFieldTotalName(NULL) + { + } + +@@ -639,10 +642,19 @@ void XclPTFieldExtInfo::SetApiLayoutMode( sal_Int32 nLayoutMode ) + + XclImpStream& operator>>( XclImpStream& rStrm, XclPTFieldExtInfo& rInfo ) + { +- return rStrm +- >> rInfo.mnFlags +- >> rInfo.mnSortField +- >> rInfo.mnShowField; ++ sal_uInt8 nNameLen = 0; ++ rStrm >> rInfo.mnFlags ++ >> rInfo.mnSortField ++ >> rInfo.mnShowField ++ >> rInfo.mnNumFmt ++ >> nNameLen; ++ ++ rStrm.Ignore(10); ++ if (nNameLen != 0xFF) ++ // Custom field total name is used. Pick it up. ++ rInfo.mpFieldTotalName.reset(new rtl::OUString(rStrm.ReadUniString(nNameLen, 0))); ++ ++ return rStrm; + } + + XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) +@@ -650,9 +662,23 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) + rStrm << rInfo.mnFlags + << rInfo.mnSortField + << rInfo.mnShowField +- << EXC_SXVDEX_FORMAT_NONE +- << sal_uInt16( 0xFFFF ); // unknown +- rStrm.WriteZeroBytes( 8 ); // unknown ++ << EXC_SXVDEX_FORMAT_NONE; ++ ++ if (rInfo.mpFieldTotalName.get() && rInfo.mpFieldTotalName->getLength() > 0) ++ { ++ rtl::OUString aFinalName = *rInfo.mpFieldTotalName; ++ if (aFinalName.getLength() >= 254) ++ aFinalName = aFinalName.copy(0, 254); ++ sal_uInt8 nNameLen = static_cast(aFinalName.getLength()); ++ rStrm << nNameLen; ++ rStrm.WriteZeroBytes(10); ++ rStrm << XclExpString(aFinalName, EXC_STR_NOHEADER); ++ } ++ else ++ { ++ rStrm << sal_uInt16(0xFFFF); ++ rStrm.WriteZeroBytes(8); ++ } + return rStrm; + } + +@@ -923,3 +949,86 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ) + + // ============================================================================ + ++// Pivot table autoformat settings ============================================ ++ ++/** ++classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 ++default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 ++report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 ++report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 ++report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 ++report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 ++report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 ++report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 ++report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 ++report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 ++report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 ++report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 ++table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 ++table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 ++table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 ++table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 ++table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 ++table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 ++table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 ++table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 ++table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 ++table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 ++none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 ++**/ ++ ++XclPTViewEx9Info::XclPTViewEx9Info() : ++ mbReport( 0 ), ++ mnAutoFormat( 0 ), ++ mnGridLayout( 0x10 ) ++{ ++} ++ ++void XclPTViewEx9Info::Init( const ScDPObject& rDPObj ) ++{ ++ if( rDPObj.GetHeaderLayout() ) ++ { ++ mbReport = 0; ++ mnAutoFormat = 1; ++ mnGridLayout = 0; ++ } ++ else ++ { ++ // Report1 for now ++ // TODO : sync with autoformat indicies ++ mbReport = 2; ++ mnAutoFormat = 1; ++ mnGridLayout = 0x10; ++ } ++ ++ const ScDPSaveData* pData = rDPObj.GetSaveData(); ++ if (pData) ++ { ++ const rtl::OUString* pGrandTotal = pData->GetGrandTotalName(); ++ if (pGrandTotal) ++ maGrandTotalName = *pGrandTotal; ++ } ++} ++ ++XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ) ++{ ++ rStrm.Ignore( 2 ); ++ rStrm >> rInfo.mbReport; /// 2 for report* fmts ? ++ rStrm.Ignore( 6 ); ++ rStrm >> rInfo.mnAutoFormat >> rInfo.mnGridLayout; ++ rInfo.maGrandTotalName = rStrm.ReadUniString(); ++ return rStrm; ++} ++ ++XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ) ++{ ++ return rStrm ++ << EXC_PT_AUTOFMT_HEADER ++ << rInfo.mbReport ++ << EXC_PT_AUTOFMT_ZERO ++ << EXC_PT_AUTOFMT_FLAGS ++ << rInfo.mnAutoFormat ++ << rInfo.mnGridLayout ++ << XclExpString(rInfo.maGrandTotalName, EXC_STR_DEFAULT, EXC_PT_MAXSTRLEN); ++} ++ +diff --git sc/source/filter/inc/xepivot.hxx sc/source/filter/inc/xepivot.hxx +index 32ba1a0..de9d284 100644 +--- sc/source/filter/inc/xepivot.hxx ++++ sc/source/filter/inc/xepivot.hxx +@@ -413,6 +413,10 @@ private: + /** Writes the SXEX records containing additional pivot table info. */ + void WriteSxex( XclExpStream& rStrm ) const; + ++ void WriteQsiSxTag( XclExpStream& rStrm ) const; ++ /** Writes the SX_AUTOFORMAT records with the autoformat id and header layout */ ++ void WriteSxViewEx9( XclExpStream& rStrm ) const; ++ + // ------------------------------------------------------------------------ + private: + typedef XclExpRecordList< XclExpPTField > XclExpPTFieldList; +@@ -422,6 +426,7 @@ private: + const XclExpPivotCache& mrPCache; /// The pivot cache this pivot table bases on. + XclPTInfo maPTInfo; /// Info about the pivot table (SXVIEW record). + XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). ++ XclPTViewEx9Info maPTViewEx9Info; /// The selected autoformat (SXVIEWEX9) + XclExpPTFieldList maFieldList; /// All fields in pivot cache order. + ScfUInt16Vec maRowFields; /// Row field indexes. + ScfUInt16Vec maColFields; /// Column field indexes. +diff --git sc/source/filter/inc/xestring.hxx sc/source/filter/inc/xestring.hxx +index f023a12..706b12c 100644 +--- sc/source/filter/inc/xestring.hxx ++++ sc/source/filter/inc/xestring.hxx +@@ -323,6 +323,7 @@ private: + bool mbSmartFlags; /// true = omit flags on empty string; false = always write flags. + bool mbSkipFormats; /// true = skip formats on export; false = write complete formatted string. + bool mbWrapped; /// true = text contains several paragraphs. ++ bool mbSkipHeader; /// ture = skip length and flags when writing string bytes. + }; + + inline bool operator==( const XclExpString& rLeft, const XclExpString& rRight ) +diff --git sc/source/filter/inc/xipivot.hxx sc/source/filter/inc/xipivot.hxx +index fffd4f0..d043a95 100644 +--- sc/source/filter/inc/xipivot.hxx ++++ sc/source/filter/inc/xipivot.hxx +@@ -186,6 +186,8 @@ public: + /** Reads the entire pivot cache stream. Uses decrypter from passed stream. */ + void ReadPivotCacheStream( XclImpStream& rStrm ); + ++ bool IsRefreshOnLoad() const; ++ + private: + typedef ::std::vector< XclImpPCFieldRef > XclImpPCFieldVec; + +@@ -350,12 +352,19 @@ public: + void ReadSxdi( XclImpStream& rStrm ); + /** Reads an SXEX record containing additional settings for the pivot table. */ + void ReadSxex( XclImpStream& rStrm ); ++ /** Reads an SXVIEWEX9 record that specifies the pivot tables ++ * autoformat. */ ++ void ReadSxViewEx9( XclImpStream& rStrm ); + + // ------------------------------------------------------------------------ + + /** Inserts the pivot table into the Calc document. */ + void Convert(); + ++ void MaybeRefresh(); ++ ++ void ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData); ++ + // ------------------------------------------------------------------------ + private: + typedef ::std::vector< XclImpPTFieldRef > XclImpPTFieldVec; +@@ -364,6 +373,7 @@ private: + + XclPTInfo maPTInfo; /// General info about the pivot table (SXVIEW record). + XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). ++ XclPTViewEx9Info maPTViewEx9Info; /// (SXVIEWEX9 record) + XclImpPTFieldVec maFields; /// Vector containing all fields. + XclImpPTFieldRef mxCurrField; /// Current field for importing additional info. + ScfStringVec maVisFieldNames; /// Vector containing all visible field names. +@@ -374,6 +384,7 @@ private: + ScfUInt16Vec maFiltDataFields; /// Filtered data field indexes. + XclImpPTField maDataOrientField; /// Special data field orientation field. + ScRange maOutScRange; /// Output range in the Calc document. ++ ScDPObject* mpDPObj; + }; + + typedef ScfRef< XclImpPivotTable > XclImpPivotTableRef; +@@ -422,6 +433,9 @@ public: + void ReadSxvi( XclImpStream& rStrm ); + /** Reads an SXEX record containing additional settings for a pivot table. */ + void ReadSxex( XclImpStream& rStrm ); ++ /** Reads an SXVIEWEX9 record that specifies the pivot tables ++ * autoformat. */ ++ void ReadSxViewEx9( XclImpStream& rStrm ); + + // ------------------------------------------------------------------------ + +@@ -430,6 +444,8 @@ public: + /** Inserts all pivot tables into the Calc document. */ + void ConvertPivotTables(); + ++ void MaybeRefreshPivotTables(); ++ + private: + typedef ::std::vector< XclImpPivotCacheRef > XclImpPivotCacheVec; + typedef ::std::vector< XclImpPivotTableRef > XclImpPivotTableVec; +diff --git sc/source/filter/inc/xlpivot.hxx sc/source/filter/inc/xlpivot.hxx +index 380a64d..8b5bd4e 100644 +--- sc/source/filter/inc/xlpivot.hxx ++++ sc/source/filter/inc/xlpivot.hxx +@@ -41,6 +41,9 @@ + #include + #include "ftools.hxx" + #include "xladdress.hxx" ++#include "dpobject.hxx" ++ ++#include + + class XclImpStream; + class XclExpStream; +@@ -73,6 +76,10 @@ const sal_uInt16 EXC_PT_MAXDATACOUNT = 256; + // pivot table items + const sal_uInt16 EXC_PT_MAXITEMCOUNT = 32500; + ++const sal_uInt16 EXC_PT_AUTOFMT_HEADER = 0x810; ++const sal_uInt16 EXC_PT_AUTOFMT_ZERO = 0; ++const sal_uInt32 EXC_PT_AUTOFMT_FLAGS = 0x20; ++ + /** Data type of a pivot cache item. */ + enum XclPCItemType + { +@@ -396,6 +403,9 @@ const double EXC_SXDBEX_CREATION_DATE = 51901.029652778; + const sal_uInt16 EXC_ID_SXFDBTYPE = 0x01BB; + const sal_uInt16 EXC_SXFDBTYPE_DEFAULT = 0x0000; + ++// (0x0810) SXVIEWEX9 --------------------------------------------------------- ++const sal_uInt16 EXC_ID_SXVIEWEX9 = 0x0810; ++ + // ============================================================================ + // Pivot cache + // ============================================================================ +@@ -663,6 +673,8 @@ struct XclPTFieldExtInfo + sal_uInt32 mnFlags; /// Several flags and number of items for AutoShow. + sal_uInt16 mnSortField; /// Index to data field sorting bases on. + sal_uInt16 mnShowField; /// Index to data field AutoShow bases on. ++ sal_uInt16 mnNumFmt; ++ ::std::auto_ptr mpFieldTotalName; + + explicit XclPTFieldExtInfo(); + +@@ -786,5 +798,23 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ); + + // ============================================================================ + ++// Pivot table autoformat settings ============================================== ++ ++/** Pivot table autoformat settings (SXVIEWEX9 record). */ ++struct XclPTViewEx9Info ++{ ++ sal_uInt32 mbReport; /// 2 for report* fmts ? ++ sal_uInt8 mnAutoFormat; /// AutoFormat ID ++ sal_uInt8 mnGridLayout; /// 0 == gridlayout, 0x10 == modern ++ String maGrandTotalName; ++ ++ explicit XclPTViewEx9Info(); ++ void Init( const ScDPObject& rDPObj ); ++}; ++ ++XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ); ++XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ); ++ ++// ============================================================================ + #endif + +diff --git sc/source/filter/inc/xlstring.hxx sc/source/filter/inc/xlstring.hxx +index 626b11b..0a078a4 100644 +--- sc/source/filter/inc/xlstring.hxx ++++ sc/source/filter/inc/xlstring.hxx +@@ -43,6 +43,7 @@ const XclStrFlags EXC_STR_FORCEUNICODE = 0x0001; /// Always use UCS-2 cha + const XclStrFlags EXC_STR_8BITLENGTH = 0x0002; /// 8-bit string length field (default: 16-bit). + const XclStrFlags EXC_STR_SMARTFLAGS = 0x0004; /// Omit flags on empty string (default: read/write always). BIFF8 only. + const XclStrFlags EXC_STR_SEPARATEFORMATS = 0x0008; /// Import: Keep old formats when reading unformatted string (default: clear formats); Export: Write unformatted string. ++const XclStrFlags EXC_STR_NOHEADER = 0x0010; /// Export: Don't write the length and flag fields. + + // ---------------------------------------------------------------------------- + +diff --git sc/source/filter/xml/XMLExportDataPilot.cxx sc/source/filter/xml/XMLExportDataPilot.cxx +index a382a95..eeecd3b 100644 +--- sc/source/filter/xml/XMLExportDataPilot.cxx ++++ sc/source/filter/xml/XMLExportDataPilot.cxx +@@ -68,6 +68,7 @@ + + using namespace com::sun::star; + using namespace xmloff::token; ++using ::rtl::OUString; + + ScXMLExportDataPilot::ScXMLExportDataPilot(ScXMLExport& rTempExport) + : rExport(rTempExport), +@@ -448,7 +449,10 @@ void ScXMLExportDataPilot::WriteLayoutInfo(ScDPSaveDimension* pDim) + + void ScXMLExportDataPilot::WriteSubTotals(ScDPSaveDimension* pDim) + { ++ using sheet::GeneralFunction; ++ + sal_Int32 nSubTotalCount = pDim->GetSubTotalsCount(); ++ const OUString* pLayoutName = pDim->GetSubtotalName(); + if (nSubTotalCount > 0) + { + SvXMLElementExport aElemSTs(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTALS, sal_True, sal_True); +@@ -456,8 +460,11 @@ void ScXMLExportDataPilot::WriteSubTotals(ScDPSaveDimension* pDim) + for (sal_Int32 nSubTotal = 0; nSubTotal < nSubTotalCount; nSubTotal++) + { + rtl::OUString sFunction; +- ScXMLConverter::GetStringFromFunction( sFunction, (sheet::GeneralFunction)pDim->GetSubTotalFunc(nSubTotal) ); ++ GeneralFunction nFunc = static_cast(pDim->GetSubTotalFunc(nSubTotal)); ++ ScXMLConverter::GetStringFromFunction( sFunction, nFunc); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_FUNCTION, sFunction); ++ if (pLayoutName && nFunc == sheet::GeneralFunction_AUTO) ++ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); + SvXMLElementExport aElemST(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTAL, sal_True, sal_True); + } + } +@@ -473,6 +480,9 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim) + for (ScDPSaveDimension::MemberList::const_iterator i=rMembers.begin(); i != rMembers.end() ; i++) + { + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString((*i)->GetName())); ++ const OUString* pLayoutName = (*i)->GetLayoutName(); ++ if (pLayoutName) ++ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); + rtl::OUStringBuffer sBuffer; + SvXMLUnitConverter::convertBool(sBuffer, (*i)->GetIsVisible()); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, sBuffer.makeStringAndClear()); +@@ -670,6 +680,10 @@ void ScXMLExportDataPilot::WriteGroupDimElements(ScDPSaveDimension* pDim, const + void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData) + { + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, rtl::OUString(pDim->GetName())); ++ const OUString* pLayoutName = pDim->GetLayoutName(); ++ if (pLayoutName) ++ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); ++ + if (pDim->IsDataLayout()) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TRUE); + rtl::OUString sValueStr; +@@ -707,6 +721,15 @@ void ScXMLExportDataPilot::WriteDimensions(ScDPSaveData* pDPSave) + } + } + ++void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const OUString* pGrandTotal) ++{ ++ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, bVisible ? XML_TRUE : XML_FALSE); ++ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ORIENTATION, eOrient); ++ if (pGrandTotal) ++ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pGrandTotal); ++ SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, sal_True, sal_True); ++} ++ + void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference & /* xSpreadDoc */) + { + pDoc = rExport.GetDocument(); +@@ -775,6 +798,20 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference GetDrillDown()) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE); + SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True); ++ ++ // grand total elements. ++ ++ const OUString* pGrandTotalName = pDPSave->GetGrandTotalName(); ++ if (bRowGrand && bColumnGrand) ++ { ++ WriteGrandTotal(XML_BOTH, true, pGrandTotalName); ++ } ++ else ++ { ++ WriteGrandTotal(XML_ROW, bRowGrand, pGrandTotalName); ++ WriteGrandTotal(XML_COLUMN, bColumnGrand, pGrandTotalName); ++ } ++ + rExport.CheckAttrList(); + if ((*pDPs)[i]->IsSheetData()) + { +diff --git sc/source/filter/xml/XMLExportDataPilot.hxx sc/source/filter/xml/XMLExportDataPilot.hxx +index 87c5894..a3f6cf8 100644 +--- sc/source/filter/xml/XMLExportDataPilot.hxx ++++ sc/source/filter/xml/XMLExportDataPilot.hxx +@@ -34,6 +34,7 @@ + #include + #include + #include "global.hxx" ++#include "xmloff/xmltoken.hxx" + + class ScXMLExport; + class ScDocument; +@@ -69,6 +70,8 @@ class ScXMLExportDataPilot + void WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData); + void WriteDimensions(ScDPSaveData* pDPSave); + ++ void WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const ::rtl::OUString* pGrandTotal); ++ + public: + ScXMLExportDataPilot(ScXMLExport& rExport); + ~ScXMLExportDataPilot(); +diff --git sc/source/filter/xml/xmldpimp.cxx sc/source/filter/xml/xmldpimp.cxx +index 470827b..070fbc2 100644 +--- sc/source/filter/xml/xmldpimp.cxx ++++ sc/source/filter/xml/xmldpimp.cxx +@@ -48,6 +48,7 @@ + #include "dpgroup.hxx" + #include "dpdimsave.hxx" + #include "rangeutl.hxx" ++#include "dpoutputgeometry.hxx" + + #include + #include +@@ -65,6 +66,8 @@ + + using namespace com::sun::star; + using namespace xmloff::token; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::xml::sax::XAttributeList; + using ::rtl::OUString; + + //------------------------------------------------------------------ +@@ -113,6 +116,9 @@ void ScXMLDataPilotTablesContext::EndElement() + { + } + ++ScXMLDataPilotTableContext::GrandTotalItem::GrandTotalItem() : ++ mbVisible(false) {} ++ + ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, + USHORT nPrfx, + const ::rtl::OUString& rLName, +@@ -126,6 +132,10 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, + sDataPilotTableName(), + sApplicationData(), + sGrandTotal(GetXMLToken(XML_BOTH)), ++ mnRowFieldCount(0), ++ mnColFieldCount(0), ++ mnPageFieldCount(0), ++ mnDataFieldCount(0), + bIsNative(sal_True), + bIgnoreEmptyRows(sal_False), + bIdentifyCategories(sal_False), +@@ -159,6 +169,19 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, + case XML_TOK_DATA_PILOT_TABLE_ATTR_GRAND_TOTAL : + { + sGrandTotal = sValue; ++ if (IsXMLToken(sValue, XML_BOTH)) ++ { ++ maRowGrandTotal.mbVisible = true; ++ maColGrandTotal.mbVisible = true; ++ } ++ else if (IsXMLToken(sValue, XML_ROW)) ++ { ++ maRowGrandTotal.mbVisible = true; ++ } ++ else if (IsXMLToken(sValue, XML_COLUMN)) ++ { ++ maColGrandTotal.mbVisible = true; ++ } + } + break; + case XML_TOK_DATA_PILOT_TABLE_ATTR_IGNORE_EMPTY_ROWS : +@@ -238,6 +261,11 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( USHORT nPref + nSourceType = SERVICE; + } + break; ++ case XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL: ++ { ++ pContext = new ScXMLDataPilotGrandTotalContext(GetScImport(), nPrefix, rLName, xAttrList, this); ++ } ++ break; + case XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE : + { + pContext = new ScXMLSourceCellRangeContext(GetScImport(), nPrefix, rLName, xAttrList, this); +@@ -256,7 +284,13 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( USHORT nPref + } + + void ScXMLDataPilotTableContext::SetButtons() +-{ ++{ ++ ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter, ScDPOutputGeometry::ODF); ++ aGeometry.setColumnFieldCount(mnColFieldCount); ++ aGeometry.setRowFieldCount(mnRowFieldCount); ++ aGeometry.setPageFieldCount(mnPageFieldCount); ++ aGeometry.setDataFieldCount(mnDataFieldCount); ++ + OUString sAddress; + sal_Int32 nOffset = 0; + while( nOffset >= 0 ) +@@ -268,8 +302,21 @@ void ScXMLDataPilotTableContext::SetButtons() + sal_Int32 nAddrOffset(0); + if (pDoc && ScRangeStringConverter::GetAddressFromString( aScAddress, sAddress, pDoc, ::formula::FormulaGrammar::CONV_OOO, nAddrOffset )) + { +- ScMergeFlagAttr aAttr( SC_MF_BUTTON ); +- pDoc->ApplyAttr( aScAddress.Col(), aScAddress.Row(), aScAddress.Tab(), aAttr ); ++ ScDPOutputGeometry::FieldType eType = aGeometry.getFieldButtonType(aScAddress); ++ ++ sal_Int16 nMFlag = SC_MF_BUTTON; ++ if (eType == ScDPOutputGeometry::Column || eType == ScDPOutputGeometry::Row) ++ nMFlag |= SC_MF_BUTTON_POPUP; ++ ++ // Use the cell's string value to see if this field contains a ++ // hidden member. Isn't there a better way? GetString() is ++ // quite expensive... ++ String aCellStr; ++ pDoc->GetString(aScAddress.Col(), aScAddress.Row(), aScAddress.Tab(), aCellStr); ++ if (maHiddenMemberFields.count(aCellStr)) ++ nMFlag |= SC_MF_HIDDEN_MEMBER; ++ ++ pDoc->ApplyFlagsTab(aScAddress.Col(), aScAddress.Row(), aScAddress.Col(), aScAddress.Row(), aScAddress.Tab(), nMFlag); + } + } + } +@@ -278,7 +325,7 @@ void ScXMLDataPilotTableContext::SetButtons() + pDPObject->RefreshAfterLoad(); + } + +-void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim) ++void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim, bool bHasHiddenMember) + { + if (pDPSave) + { +@@ -288,6 +335,38 @@ void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim) + pDPSave->GetExistingDimensionByName(pDim->GetName()) ) + pDim->SetDupFlag( TRUE ); + ++ if (!pDim->IsDataLayout()) ++ { ++ switch (pDim->GetOrientation()) ++ { ++ case sheet::DataPilotFieldOrientation_ROW: ++ ++mnRowFieldCount; ++ break; ++ case sheet::DataPilotFieldOrientation_COLUMN: ++ ++mnColFieldCount; ++ break; ++ case sheet::DataPilotFieldOrientation_PAGE: ++ ++mnPageFieldCount; ++ break; ++ case sheet::DataPilotFieldOrientation_DATA: ++ ++mnDataFieldCount; ++ break; ++ case sheet::DataPilotFieldOrientation_HIDDEN: ++ default: ++ ; ++ } ++ ++ if (bHasHiddenMember) ++ { ++ // the layout name takes priority over the original name, ++ // since this data is used against cell values. ++ const OUString* pLayoutName = pDim->GetLayoutName(); ++ if (pLayoutName) ++ maHiddenMemberFields.insert(*pLayoutName); ++ else ++ maHiddenMemberFields.insert(pDim->GetName()); ++ } ++ } + pDPSave->AddDimension(pDim); + } + } +@@ -362,26 +441,15 @@ void ScXMLDataPilotTableContext::EndElement() + } + break; + } +- if (IsXMLToken(sGrandTotal, XML_BOTH)) +- { +- pDPSave->SetRowGrand(sal_True); +- pDPSave->SetColumnGrand(sal_True); +- } +- else if (IsXMLToken(sGrandTotal, XML_ROW)) +- { +- pDPSave->SetRowGrand(sal_True); +- pDPSave->SetColumnGrand(sal_False); +- } +- else if (IsXMLToken(sGrandTotal, XML_COLUMN)) +- { +- pDPSave->SetRowGrand(sal_False); +- pDPSave->SetColumnGrand(sal_True); +- } +- else +- { +- pDPSave->SetRowGrand(sal_False); +- pDPSave->SetColumnGrand(sal_False); +- } ++ ++ pDPSave->SetRowGrand(maRowGrandTotal.mbVisible); ++ pDPSave->SetColumnGrand(maColGrandTotal.mbVisible); ++ if (maRowGrandTotal.maDisplayName.getLength()) ++ // TODO: Right now, we only support one grand total name for both ++ // column and row totals. Take the value from the row total for ++ // now. ++ pDPSave->SetGrandTotalName(maRowGrandTotal.maDisplayName); ++ + pDPSave->SetIgnoreEmptyRows(bIgnoreEmptyRows); + pDPSave->SetRepeatIfEmpty(bIdentifyCategories); + pDPSave->SetFilterButton(bShowFilter); +@@ -393,12 +461,36 @@ void ScXMLDataPilotTableContext::EndElement() + { + ScDPCollection* pDPCollection = pDoc->GetDPCollection(); + pDPObject->SetAlive(sal_True); +- pDPCollection->Insert(pDPObject); ++ pDPCollection->InsertNewTable(pDPObject); + } + SetButtons(); + } + } + ++void ScXMLDataPilotTableContext::SetGrandTotal( ++ XMLTokenEnum eOrientation, bool bVisible, const OUString& rDisplayName) ++{ ++ switch (eOrientation) ++ { ++ case XML_BOTH: ++ maRowGrandTotal.mbVisible = bVisible; ++ maRowGrandTotal.maDisplayName = rDisplayName; ++ maColGrandTotal.mbVisible = bVisible; ++ maColGrandTotal.maDisplayName = rDisplayName; ++ break; ++ case XML_ROW: ++ maRowGrandTotal.mbVisible = bVisible; ++ maRowGrandTotal.maDisplayName = rDisplayName; ++ break; ++ case XML_COLUMN: ++ maColGrandTotal.mbVisible = bVisible; ++ maColGrandTotal.maDisplayName = rDisplayName; ++ break; ++ default: ++ ; ++ } ++} ++ + ScXMLDPSourceSQLContext::ScXMLDPSourceSQLContext( ScXMLImport& rImport, + USHORT nPrfx, + const ::rtl::OUString& rLName, +@@ -643,6 +735,80 @@ void ScXMLSourceServiceContext::EndElement() + { + } + ++ScXMLImport& ScXMLDataPilotGrandTotalContext::GetScImport() ++{ ++ return static_cast(GetImport()); ++} ++ ++ScXMLDataPilotGrandTotalContext::ScXMLDataPilotGrandTotalContext( ++ ScXMLImport& rImport, USHORT nPrefix, const OUString& rLName, const Reference& xAttrList, ++ ScXMLDataPilotTableContext* pTableContext ) : ++ SvXMLImportContext( rImport, nPrefix, rLName ), ++ mpTableContext(pTableContext), ++ meOrientation(NONE), ++ mbVisible(false) ++{ ++ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; ++ const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotGrandTotalAttrTokenMap(); ++ for (sal_Int16 i = 0; i < nAttrCount; ++i) ++ { ++ const OUString& rAttrName = xAttrList->getNameByIndex(i); ++ const OUString& rAttrValue = xAttrList->getValueByIndex(i); ++ ++ OUString aLocalName; ++ USHORT nLocalPrefix = GetScImport().GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName); ++ switch (rAttrTokenMap.Get(nLocalPrefix, aLocalName)) ++ { ++ case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY: ++ mbVisible = IsXMLToken(rAttrValue, XML_TRUE); ++ break; ++ case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION: ++ if (IsXMLToken(rAttrValue, XML_BOTH)) ++ meOrientation = BOTH; ++ else if (IsXMLToken(rAttrValue, XML_ROW)) ++ meOrientation = ROW; ++ else if (IsXMLToken(rAttrValue, XML_COLUMN)) ++ meOrientation = COLUMN; ++ break; ++ case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME: ++ maDisplayName = rAttrValue; ++ break; ++ default: ++ ; ++ } ++ } ++} ++ ++ScXMLDataPilotGrandTotalContext::~ScXMLDataPilotGrandTotalContext() ++{ ++} ++ ++SvXMLImportContext* ScXMLDataPilotGrandTotalContext::CreateChildContext( ++ USHORT /*nPrefix*/, const ::rtl::OUString& /*rLocalName*/, const Reference& /*xAttrList*/ ) ++{ ++ return NULL; ++} ++ ++void ScXMLDataPilotGrandTotalContext::EndElement() ++{ ++ XMLTokenEnum eOrient = XML_NONE; ++ switch (meOrientation) ++ { ++ case BOTH: ++ eOrient = XML_BOTH; ++ break; ++ case ROW: ++ eOrient = XML_ROW; ++ break; ++ case COLUMN: ++ eOrient = XML_COLUMN; ++ break; ++ default: ++ ; ++ } ++ mpTableContext->SetGrandTotal(eOrient, mbVisible, maDisplayName); ++} ++ + ScXMLSourceCellRangeContext::ScXMLSourceCellRangeContext( ScXMLImport& rImport, + USHORT nPrfx, + const ::rtl::OUString& rLName, +@@ -723,10 +889,12 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, + bIsGroupField(sal_False), + bDateValue(sal_False), + bAutoStart(sal_False), +- bAutoEnd(sal_False) ++ bAutoEnd(sal_False), ++ mbHasHiddenMember(false) + { + sal_Bool bHasName(sal_False); + sal_Bool bDataLayout(sal_False); ++ OUString aDisplayName; + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotFieldAttrTokenMap(); + for( sal_Int16 i=0; i < nAttrCount; ++i ) +@@ -745,6 +913,11 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, + bHasName = sal_True; + } + break; ++ case XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME: ++ { ++ aDisplayName = sValue; ++ } ++ break; + case XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD : + { + bDataLayout = IsXMLToken(sValue, XML_TRUE); +@@ -774,7 +947,11 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, + } + } + if (bHasName) ++ { + pDim = new ScDPSaveDimension(String(sName), bDataLayout); ++ if (aDisplayName.getLength()) ++ pDim->SetLayoutName(aDisplayName); ++ } + } + + ScXMLDataPilotFieldContext::~ScXMLDataPilotFieldContext() +@@ -808,6 +985,22 @@ SvXMLImportContext *ScXMLDataPilotFieldContext::CreateChildContext( USHORT nPref + return pContext; + } + ++void ScXMLDataPilotFieldContext::AddMember(ScDPSaveMember* pMember) ++{ ++ if (pDim) ++ pDim->AddMember(pMember); ++ ++ if (!pMember->GetIsVisible()) ++ // This member is hidden. ++ mbHasHiddenMember = true; ++} ++ ++void ScXMLDataPilotFieldContext::SetSubTotalName(const OUString& rName) ++{ ++ if (pDim) ++ pDim->SetSubtotalName(rName); ++} ++ + void ScXMLDataPilotFieldContext::AddGroup(const ::std::vector& rMembers, const rtl::OUString& rName) + { + ScXMLDataPilotGroup aGroup; +@@ -828,7 +1021,7 @@ void ScXMLDataPilotFieldContext::EndElement() + String sPage(sSelectedPage); + pDim->SetCurrentPage(&sPage); + } +- pDataPilotTable->AddDimension(pDim); ++ pDataPilotTable->AddDimension(pDim, mbHasHiddenMember); + if (bIsGroupField) + { + ScDPNumGroupInfo aInfo; +@@ -1199,6 +1392,8 @@ SvXMLImportContext *ScXMLDataPilotSubTotalsContext::CreateChildContext( USHORT n + void ScXMLDataPilotSubTotalsContext::EndElement() + { + pDataPilotField->SetSubTotals(pFunctions, nFunctionCount); ++ if (maDisplayName.getLength()) ++ pDataPilotField->SetSubTotalName(maDisplayName); + } + + void ScXMLDataPilotSubTotalsContext::AddFunction(sal_Int16 nFunction) +@@ -1221,6 +1416,11 @@ void ScXMLDataPilotSubTotalsContext::AddFunction(sal_Int16 nFunction) + } + } + ++void ScXMLDataPilotSubTotalsContext::SetDisplayName(const OUString& rName) ++{ ++ maDisplayName = rName; ++} ++ + ScXMLDataPilotSubTotalContext::ScXMLDataPilotSubTotalContext( ScXMLImport& rImport, + USHORT nPrfx, + const ::rtl::OUString& rLName, +@@ -1247,6 +1447,8 @@ ScXMLDataPilotSubTotalContext::ScXMLDataPilotSubTotalContext( ScXMLImport& rImpo + pDataPilotSubTotals->AddFunction( sal::static_int_cast( + ScXMLConverter::GetFunctionFromString( sValue ) ) ); + } ++ case XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME: ++ pDataPilotSubTotals->SetDisplayName(sValue); + break; + } + } +@@ -1344,6 +1546,10 @@ ScXMLDataPilotMemberContext::ScXMLDataPilotMemberContext( ScXMLImport& rImport, + bHasName = sal_True; + } + break; ++ case XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME: ++ { ++ maDisplayName = sValue; ++ } + case XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY : + { + bDisplay = IsXMLToken(sValue, XML_TRUE); +@@ -1380,6 +1586,8 @@ void ScXMLDataPilotMemberContext::EndElement() + if (bHasName) // #i53407# don't check sName, empty name is allowed + { + ScDPSaveMember* pMember = new ScDPSaveMember(String(sName)); ++ if (maDisplayName.getLength()) ++ pMember->SetLayoutName(maDisplayName); + pMember->SetIsVisible(bDisplay); + pMember->SetShowDetails(bDisplayDetails); + pDataPilotField->AddMember(pMember); +diff --git sc/source/filter/xml/xmldpimp.hxx sc/source/filter/xml/xmldpimp.hxx +index dfbba92..b4df6b1 100644 +--- sc/source/filter/xml/xmldpimp.hxx ++++ sc/source/filter/xml/xmldpimp.hxx +@@ -41,6 +41,8 @@ + #include "dpobject.hxx" + #include "dpsave.hxx" + ++#include ++ + class ScXMLImport; + class ScDPSaveNumGroupDimension; + class ScDPSaveGroupDimension; +@@ -79,10 +81,21 @@ public: + + class ScXMLDataPilotTableContext : public SvXMLImportContext + { ++ typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash > StringSet; ++ StringSet maHiddenMemberFields; ++ ++ struct GrandTotalItem ++ { ++ ::rtl::OUString maDisplayName; ++ bool mbVisible; ++ GrandTotalItem(); ++ }; + ScDocument* pDoc; + ScDPObject* pDPObject; + ScDPSaveData* pDPSave; + ScDPDimensionSaveData* pDPDimSaveData; ++ GrandTotalItem maRowGrandTotal; ++ GrandTotalItem maColGrandTotal; + rtl::OUString sDataPilotTableName; + rtl::OUString sApplicationData; + rtl::OUString sGrandTotal; +@@ -100,6 +113,10 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext + ScAddress aFilterOutputPosition; + ScQueryParam aSourceQueryParam; + ScMySourceType nSourceType; ++ sal_uInt32 mnRowFieldCount; ++ sal_uInt32 mnColFieldCount; ++ sal_uInt32 mnPageFieldCount; ++ sal_uInt32 mnDataFieldCount; + sal_Bool bIsNative; + sal_Bool bIgnoreEmptyRows; + sal_Bool bIdentifyCategories; +@@ -131,6 +148,7 @@ public: + + virtual void EndElement(); + ++ void SetGrandTotal(::xmloff::token::XMLTokenEnum eOrientation, bool bVisible, const ::rtl::OUString& rDisplayName); + void SetDatabaseName(const rtl::OUString& sValue) { sDatabaseName = sValue; } + void SetSourceObject(const rtl::OUString& sValue) { sSourceObject = sValue; } + void SetNative(const sal_Bool bValue) { bIsNative = bValue; } +@@ -147,7 +165,7 @@ public: + void SetFilterSourceRange(const ScRange& aValue) { aFilterSourceRange = aValue; } + // void SetFilterIsCaseSensitive(const sal_Bool bValue) { aSourceQueryParam.bCaseSens = bValue; } + // void SetFilterSkipDuplicates(const sal_Bool bValue) { aSourceQueryParam.bDuplicate = !bValue; } +- void AddDimension(ScDPSaveDimension* pDim); ++ void AddDimension(ScDPSaveDimension* pDim, bool bHasHiddenMember); + void AddGroupDim(const ScDPSaveNumGroupDimension& aNumGroupDim); + void AddGroupDim(const ScDPSaveGroupDimension& aGroupDim); + void SetButtons(); +@@ -253,6 +271,34 @@ public: + virtual void EndElement(); + }; + ++class ScXMLDataPilotGrandTotalContext : public SvXMLImportContext ++{ ++ enum Orientation { COLUMN, ROW, BOTH, NONE }; ++ ++ ScXMLImport& GetScImport(); ++ ++ ScXMLDataPilotTableContext* mpTableContext; ++ ::rtl::OUString maDisplayName; ++ Orientation meOrientation; ++ bool mbVisible; ++ ++public: ++ ScXMLDataPilotGrandTotalContext( ++ ScXMLImport& rImport, USHORT nPrefix, const ::rtl::OUString& rLName, ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::xml::sax::XAttributeList>& xAttrList, ++ ScXMLDataPilotTableContext* pTableContext ); ++ ++ virtual ~ScXMLDataPilotGrandTotalContext(); ++ ++ virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, ++ const ::rtl::OUString& rLocalName, ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); ++ ++ virtual void EndElement(); ++}; ++ + class ScXMLSourceCellRangeContext : public SvXMLImportContext + { + ScXMLDataPilotTableContext* pDataPilotTable; +@@ -300,12 +346,13 @@ class ScXMLDataPilotFieldContext : public SvXMLImportContext + sal_Int32 nGroupPart; + sal_Int16 nFunction; + sal_Int16 nOrientation; +- sal_Bool bShowEmpty; +- sal_Bool bSelectedPage; +- sal_Bool bIsGroupField; +- sal_Bool bDateValue; +- sal_Bool bAutoStart; +- sal_Bool bAutoEnd; ++ sal_Bool bShowEmpty:1; ++ sal_Bool bSelectedPage:1; ++ sal_Bool bIsGroupField:1; ++ sal_Bool bDateValue:1; ++ sal_Bool bAutoStart:1; ++ sal_Bool bAutoEnd:1; ++ bool mbHasHiddenMember:1; + + const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } + ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } +@@ -329,7 +376,8 @@ public: + + void SetShowEmpty(const sal_Bool bValue) { if (pDim) pDim->SetShowEmpty(bValue); } + void SetSubTotals(const sal_uInt16* pFunctions, const sal_Int16 nCount) { if(pDim) pDim->SetSubTotals(nCount, pFunctions); } +- void AddMember(ScDPSaveMember* pMember) { if (pDim) pDim->AddMember(pMember); } ++ void AddMember(ScDPSaveMember* pMember); ++ void SetSubTotalName(const ::rtl::OUString& rName); + void SetFieldReference(const com::sun::star::sheet::DataPilotFieldReference& aRef) { if (pDim) pDim->SetReferenceValue(&aRef); } + void SetAutoShowInfo(const com::sun::star::sheet::DataPilotFieldAutoShowInfo& aInfo) { if (pDim) pDim->SetAutoShowInfo(&aInfo); } + void SetSortInfo(const com::sun::star::sheet::DataPilotFieldSortInfo& aInfo) { if (pDim) pDim->SetSortInfo(&aInfo); } +@@ -453,6 +501,7 @@ class ScXMLDataPilotSubTotalsContext : public SvXMLImportContext + + sal_Int16 nFunctionCount; + sal_uInt16* pFunctions; ++ ::rtl::OUString maDisplayName; + + const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } + ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } +@@ -476,6 +525,7 @@ public: + + virtual void EndElement(); + void AddFunction(sal_Int16 nFunction); ++ void SetDisplayName(const ::rtl::OUString& rName); + }; + + class ScXMLDataPilotSubTotalContext : public SvXMLImportContext +@@ -533,6 +583,7 @@ class ScXMLDataPilotMemberContext : public SvXMLImportContext + ScXMLDataPilotFieldContext* pDataPilotField; + + rtl::OUString sName; ++ rtl::OUString maDisplayName; + sal_Bool bDisplay; + sal_Bool bDisplayDetails; + sal_Bool bHasName; +diff --git sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx +index a45add1..7d9e882 100644 +--- sc/source/filter/xml/xmlimprt.cxx ++++ sc/source/filter/xml/xmlimprt.cxx +@@ -1345,6 +1345,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableElemTokenMap() + { + { XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL }, + { XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE }, ++ { XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL }, + { XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_QUERY, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY }, + { XML_NAMESPACE_TABLE, XML_SOURCE_SERVICE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE }, + { XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE }, +@@ -1378,6 +1379,24 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceServiceAttrTokenMap() + return *pDataPilotTableSourceServiceAttrTokenMap; + } + ++const SvXMLTokenMap& ScXMLImport::GetDataPilotGrandTotalAttrTokenMap() ++{ ++ if (!pDataPilotGrandTotalAttrTokenMap) ++ { ++ static __FAR_DATA SvXMLTokenMapEntry aDataPilotGrandTotalAttrTokenMap[] = ++ { ++ { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY }, ++ { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION }, ++ { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME }, ++ XML_TOKEN_MAP_END ++ }; ++ ++ pDataPilotGrandTotalAttrTokenMap = new SvXMLTokenMap( aDataPilotGrandTotalAttrTokenMap ); ++ } ++ ++ return *pDataPilotGrandTotalAttrTokenMap; ++} ++ + const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceCellRangeAttrTokenMap() + { + if( !pDataPilotTableSourceCellRangeAttrTokenMap ) +@@ -1417,6 +1436,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotFieldAttrTokenMap() + static __FAR_DATA SvXMLTokenMapEntry aDataPilotFieldAttrTokenMap[] = + { + { XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME }, ++ { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD }, + { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION }, + { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION }, +@@ -1508,6 +1528,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotSubTotalAttrTokenMap() + static __FAR_DATA SvXMLTokenMapEntry aDataPilotSubTotalAttrTokenMap[] = + { + { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION }, ++ { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME }, + XML_TOKEN_MAP_END + }; + +@@ -1540,6 +1561,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotMemberAttrTokenMap() + static __FAR_DATA SvXMLTokenMapEntry aDataPilotMemberAttrTokenMap[] = + { + { XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME }, ++ { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY }, + { XML_NAMESPACE_TABLE, XML_SHOW_DETAILS, XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS }, + XML_TOKEN_MAP_END +@@ -1675,6 +1697,7 @@ ScXMLImport::ScXMLImport( + pDataPilotTableAttrTokenMap( 0 ), + pDataPilotTableElemTokenMap( 0 ), + pDataPilotTableSourceServiceAttrTokenMap( 0 ), ++ pDataPilotGrandTotalAttrTokenMap(NULL), + pDataPilotTableSourceCellRangeElemTokenMap( 0 ), + pDataPilotTableSourceCellRangeAttrTokenMap( 0 ), + pDataPilotFieldAttrTokenMap( 0 ), +diff --git sc/source/filter/xml/xmlimprt.hxx sc/source/filter/xml/xmlimprt.hxx +index f9cdfe0..139acf5 100644 +--- sc/source/filter/xml/xmlimprt.hxx ++++ sc/source/filter/xml/xmlimprt.hxx +@@ -489,6 +489,7 @@ enum ScXMLDataPilotTableElemTokens + { + XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL, + XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE, ++ XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL, + XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY, + XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE, + XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE, +@@ -504,6 +505,13 @@ enum ScXMLDataPilotTableSourceServiceAttrTokens + XML_TOK_SOURCE_SERVICE_ATTR_PASSWORD + }; + ++enum ScXMLDataPilotGrandTotalAttrTokens ++{ ++ XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY, ++ XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION, ++ XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME ++}; ++ + enum ScXMLDataPilotTableSourceCellRangeElemTokens + { + XML_TOK_SOURCE_CELL_RANGE_ELEM_FILTER +@@ -517,6 +525,7 @@ enum ScXMLDataPilotTableSourceCellRangeAttrTokens + enum ScXMLDataPilotFieldAttrTokens + { + XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME, ++ XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME, + XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD, + XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION, + XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION, +@@ -552,7 +561,8 @@ enum ScXMLDataPilotSubTotalsElemTokens + + enum ScXMLDataPilotSubTotalAttrTokens + { +- XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION ++ XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION, ++ XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME + }; + + enum ScXMLDataPilotMembersElemTokens +@@ -563,6 +573,7 @@ enum ScXMLDataPilotMembersElemTokens + enum ScXMLDataPilotMemberAttrTokens + { + XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME, ++ XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME, + XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY, + XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS + }; +@@ -723,6 +734,7 @@ class ScXMLImport: public SvXMLImport + SvXMLTokenMap *pDataPilotTableAttrTokenMap; + SvXMLTokenMap *pDataPilotTableElemTokenMap; + SvXMLTokenMap *pDataPilotTableSourceServiceAttrTokenMap; ++ SvXMLTokenMap *pDataPilotGrandTotalAttrTokenMap; + SvXMLTokenMap *pDataPilotTableSourceCellRangeElemTokenMap; + SvXMLTokenMap *pDataPilotTableSourceCellRangeAttrTokenMap; + SvXMLTokenMap *pDataPilotFieldAttrTokenMap; +@@ -886,6 +898,7 @@ public: + const SvXMLTokenMap& GetDataPilotTableAttrTokenMap(); + const SvXMLTokenMap& GetDataPilotTableElemTokenMap(); + const SvXMLTokenMap& GetDataPilotTableSourceServiceAttrTokenMap(); ++ const SvXMLTokenMap& GetDataPilotGrandTotalAttrTokenMap(); + const SvXMLTokenMap& GetDataPilotTableSourceCellRangeElemTokenMap(); + const SvXMLTokenMap& GetDataPilotTableSourceCellRangeAttrTokenMap(); + const SvXMLTokenMap& GetDataPilotFieldAttrTokenMap(); +diff --git sc/source/ui/Accessibility/AccessibleContextBase.cxx sc/source/ui/Accessibility/AccessibleContextBase.cxx +index efde039..8978bfa 100644 +--- sc/source/ui/Accessibility/AccessibleContextBase.cxx ++++ sc/source/ui/Accessibility/AccessibleContextBase.cxx +@@ -628,3 +628,8 @@ void ScAccessibleContextBase::IsObjectValid() const + if (rBHelper.bDisposed || rBHelper.bInDispose) + throw lang::DisposedException(); + } ++ ++void ScAccessibleContextBase::SetRole(sal_Int16 nRole) ++{ ++ maRole = nRole; ++} +diff --git sc/source/ui/Accessibility/AccessibleFilterMenu.cxx sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +new file mode 100644 +index 0000000..8a76393 +--- /dev/null ++++ sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +@@ -0,0 +1,402 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++ ++#include "precompiled_sc.hxx" ++#include "AccessibleGlobal.hxx" ++#include "AccessibleFilterMenu.hxx" ++#include "AccessibleFilterMenuItem.hxx" ++#include "unoguard.hxx" ++#include "global.hxx" ++#include "document.hxx" ++#include "docpool.hxx" ++ ++#include "tools/gen.hxx" ++#include "svx/unoedsrc.hxx" ++#include "svx/editdata.hxx" ++#include "svx/outliner.hxx" ++#include "svtools/itemset.hxx" ++#include "vcl/unohelp.hxx" ++#include "dpcontrol.hxx" ++ ++#include ++#include ++#include ++#include ++#include ++ ++using namespace ::com::sun::star; ++using namespace ::com::sun::star::accessibility; ++using namespace ::com::sun::star::accessibility::AccessibleStateType; ++ ++using ::com::sun::star::uno::Any; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::uno::Sequence; ++using ::com::sun::star::uno::UNO_QUERY; ++using ::com::sun::star::lang::IndexOutOfBoundsException; ++using ::com::sun::star::lang::IllegalArgumentException; ++using ::com::sun::star::uno::RuntimeException; ++using ::rtl::OUString; ++using ::std::for_each; ++using ::std::vector; ++ ++// ============================================================================ ++ ++namespace { ++ ++class AddRemoveEventListener : public ::std::unary_function > ++{ ++public: ++ explicit AddRemoveEventListener(const Reference& rListener, bool bAdd) : ++ mxListener(rListener), mbAdd(bAdd) {} ++ ++ void operator() (const Reference& xAccessible) const ++ { ++ if (!xAccessible.is()) ++ return; ++ ++ Reference xBc(xAccessible, UNO_QUERY); ++ if (xBc.is()) ++ { ++ if (mbAdd) ++ xBc->addEventListener(mxListener); ++ else ++ xBc->removeEventListener(mxListener); ++ } ++ } ++private: ++ Reference mxListener; ++ bool mbAdd; ++}; ++ ++} ++ ++// ============================================================================ ++ ++ScAccessibleFilterMenu::ScAccessibleFilterMenu(const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, size_t nMenuPos, ScDocument* pDoc) : ++ ScAccessibleContextBase(rxParent, AccessibleRole::MENU), ++ mnMenuPos(nMenuPos), ++ mpWindow(pWin), ++ mpDoc(pDoc), ++ mbEnabled(true) ++{ ++ SetName(rName); ++} ++ ++ScAccessibleFilterMenu::~ScAccessibleFilterMenu() ++{ ++} ++ ++// XAccessibleComponent ++ ++Reference ScAccessibleFilterMenu::getAccessibleAtPoint( const ::com::sun::star::awt::Point& /*rPoint*/ ) ++ throw (RuntimeException) ++{ ++ return this; ++} ++ ++sal_Bool ScAccessibleFilterMenu::isVisible() throw (RuntimeException) ++{ ++ return mpWindow->IsVisible(); ++} ++ ++void ScAccessibleFilterMenu::grabFocus() ++ throw (RuntimeException) ++{ ++} ++ ++sal_Int32 ScAccessibleFilterMenu::getForeground() ++ throw (RuntimeException) ++{ ++ return 0; ++} ++ ++sal_Int32 ScAccessibleFilterMenu::getBackground() ++ throw (RuntimeException) ++{ ++ return 0; ++} ++ ++// XAccessibleContext ++ ++OUString ScAccessibleFilterMenu::getAccessibleName() throw (RuntimeException) ++{ ++ return ScAccessibleContextBase::getAccessibleName(); ++} ++ ++sal_Int32 ScAccessibleFilterMenu::getAccessibleChildCount() ++ throw (RuntimeException) ++{ ++ return getMenuItemCount(); ++} ++ ++Reference ScAccessibleFilterMenu::getAccessibleChild(sal_Int32 nIndex) ++ throw (RuntimeException, IndexOutOfBoundsException) ++{ ++ if (maMenuItems.size() <= static_cast(nIndex)) ++ throw IndexOutOfBoundsException(); ++ ++ return maMenuItems[nIndex]; ++} ++ ++Reference ScAccessibleFilterMenu::getAccessibleStateSet() ++ throw (RuntimeException) ++{ ++ updateStates(); ++ return mxStateSet; ++} ++ ++OUString ScAccessibleFilterMenu::getImplementationName() ++ throw (RuntimeException) ++{ ++ return OUString::createFromAscii("ScAccessibleFilterMenu"); ++} ++ ++// XAccessibleEventBroadcaster ++ ++void ScAccessibleFilterMenu::addEventListener( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) ++ throw (com::sun::star::uno::RuntimeException) ++{ ++ ScAccessibleContextBase::addEventListener(xListener); ++ for_each(maMenuItems.begin(), maMenuItems.end(), AddRemoveEventListener(xListener, true)); ++} ++ ++void ScAccessibleFilterMenu::removeEventListener( ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) ++ throw (com::sun::star::uno::RuntimeException) ++{ ++ ScAccessibleContextBase::removeEventListener(xListener); ++ for_each(maMenuItems.begin(), maMenuItems.end(), AddRemoveEventListener(xListener, false)); ++} ++ ++// XAccessibleSelection ++ ++void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) ++ throw (IndexOutOfBoundsException, RuntimeException) ++{ ++ if (static_cast(nChildIndex) >= maMenuItems.size()) ++ throw IndexOutOfBoundsException(); ++ ++ mpWindow->setSelectedMenuItem(nChildIndex, false, true); ++} ++ ++sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex) ++ throw (IndexOutOfBoundsException, RuntimeException) ++{ ++ if (static_cast(nChildIndex) >= maMenuItems.size()) ++ throw IndexOutOfBoundsException(); ++ ++ return mpWindow->isMenuItemSelected(static_cast(nChildIndex)); ++} ++ ++void ScAccessibleFilterMenu::clearAccessibleSelection() throw (RuntimeException) ++{ ++ mpWindow->clearSelectedMenuItem(); ++} ++ ++void ScAccessibleFilterMenu::selectAllAccessibleChildren() throw (RuntimeException) ++{ ++ // not suported - this is a menu, you can't select all menu items. ++} ++ ++sal_Int32 ScAccessibleFilterMenu::getSelectedAccessibleChildCount() throw (RuntimeException) ++{ ++ // Since this is a menu, either one menu item is selected, or none at all. ++ return mpWindow->getSelectedMenuItem() == ScMenuFloatingWindow::MENU_NOT_SELECTED ? 0 : 1; ++} ++ ++Reference ScAccessibleFilterMenu::getSelectedAccessibleChild(sal_Int32 nChildIndex) ++ throw (IndexOutOfBoundsException, RuntimeException) ++{ ++ if (static_cast(nChildIndex) >= maMenuItems.size()) ++ throw IndexOutOfBoundsException(); ++ ++ return maMenuItems[nChildIndex]; ++} ++ ++void ScAccessibleFilterMenu::deselectAccessibleChild(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) ++{ ++ if (static_cast(nChildIndex) >= maMenuItems.size()) ++ throw IndexOutOfBoundsException(); ++ ++ mpWindow->selectMenuItem(nChildIndex, false, false); ++} ++ ++// XInterface ++ ++uno::Any SAL_CALL ScAccessibleFilterMenu::queryInterface( uno::Type const & rType ) ++ throw (RuntimeException) ++{ ++ Any any = ScAccessibleContextBase::queryInterface(rType); ++ if (any.hasValue()) ++ return any; ++ ++ return ScAccessibleFilterMenu_BASE::queryInterface(rType); ++} ++ ++void SAL_CALL ScAccessibleFilterMenu::acquire() throw () ++{ ++ ScAccessibleContextBase::acquire(); ++} ++ ++void SAL_CALL ScAccessibleFilterMenu::release() throw () ++{ ++ ScAccessibleContextBase::release(); ++} ++ ++// XTypeProvider ++ ++Sequence ScAccessibleFilterMenu::getImplementationId() ++ throw (RuntimeException) ++{ ++ Sequence aId(16); ++ return aId; ++} ++ ++Rectangle ScAccessibleFilterMenu::GetBoundingBoxOnScreen() const ++ throw (RuntimeException) ++{ ++ if (mnMenuPos == ScMenuFloatingWindow::MENU_NOT_SELECTED) ++ return Rectangle(); ++ ++ // Menu object's bounding box is the bounding box of the menu item that ++ // launches the menu, which belongs to the parent window. ++ ScMenuFloatingWindow* pParentWin = mpWindow->getParentMenuWindow(); ++ if (!pParentWin) ++ return Rectangle(); ++ ++ if (!pParentWin->IsVisible()) ++ return Rectangle(); ++ ++ Point aPos = pParentWin->OutputToAbsoluteScreenPixel(Point(0,0)); ++ Point aMenuPos; ++ Size aMenuSize; ++ pParentWin->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); ++ Rectangle aRect(aPos + aMenuPos, aMenuSize); ++ return aRect; ++} ++ ++Rectangle ScAccessibleFilterMenu::GetBoundingBox() const ++ throw (RuntimeException) ++{ ++ if (mnMenuPos == ScMenuFloatingWindow::MENU_NOT_SELECTED) ++ return Rectangle(); ++ ++ // Menu object's bounding box is the bounding box of the menu item that ++ // launches the menu, which belongs to the parent window. ++ ScMenuFloatingWindow* pParentWin = mpWindow->getParentMenuWindow(); ++ if (!pParentWin) ++ return Rectangle(); ++ ++ if (!pParentWin->IsVisible()) ++ return Rectangle(); ++ ++ Point aMenuPos; ++ Size aMenuSize; ++ pParentWin->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); ++ Rectangle aRect(aMenuPos, aMenuSize); ++ return aRect; ++} ++ ++void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled, size_t nMenuPos) ++{ ++ // Check weather this menu item is a sub menu or a regular menu item. ++ ScMenuFloatingWindow* pSubMenu = mpWindow->getSubMenuWindow(nMenuPos); ++ Reference xAccessible; ++ if (pSubMenu) ++ { ++ xAccessible = pSubMenu->CreateAccessible(); ++ ScAccessibleFilterMenu* p = ++ static_cast(xAccessible.get()); ++ p->setEnabled(bEnabled); ++ p->setMenuPos(nMenuPos); ++ } ++ else ++ { ++ xAccessible.set(new ScAccessibleFilterMenuItem(this, mpWindow, rName, nMenuPos)); ++ ScAccessibleFilterMenuItem* p = ++ static_cast(xAccessible.get()); ++ p->setEnabled(bEnabled); ++ } ++ maMenuItems.push_back(xAccessible); ++} ++ ++void ScAccessibleFilterMenu::setMenuPos(size_t nMenuPos) ++{ ++ mnMenuPos = nMenuPos; ++} ++ ++void ScAccessibleFilterMenu::setEnabled(bool bEnabled) ++{ ++ mbEnabled = bEnabled; ++} ++ ++sal_Int32 ScAccessibleFilterMenu::getMenuItemCount() const ++{ ++ return maMenuItems.size(); ++} ++ ++bool ScAccessibleFilterMenu::isSelected() const ++{ ++ // Check to see if any of the child menu items is selected. ++ return mpWindow->isMenuItemSelected(mnMenuPos); ++} ++ ++bool ScAccessibleFilterMenu::isFocused() const ++{ ++ return isSelected(); ++} ++ ++void ScAccessibleFilterMenu::updateStates() ++{ ++ if (!mxStateSet.is()) ++ mxStateSet.set(new ScAccessibleStateSet); ++ ++ ScAccessibleStateSet* p = static_cast( ++ mxStateSet.get()); ++ ++ p->clear(); ++ ++ p->insert(ENABLED); ++ p->insert(FOCUSABLE); ++ p->insert(SELECTABLE); ++ p->insert(SENSITIVE); ++ p->insert(OPAQUE); ++ ++ if (isFocused()) ++ p->insert(FOCUSED); ++ ++ if (isSelected()) ++ p->insert(SELECTED); ++} +diff --git sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +new file mode 100644 +index 0000000..7216819 +--- /dev/null ++++ sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +@@ -0,0 +1,209 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++ ++#include "precompiled_sc.hxx" ++#include "AccessibleGlobal.hxx" ++#include "AccessibleFilterMenuItem.hxx" ++#include "dpcontrol.hxx" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++using namespace ::com::sun::star; ++using namespace ::com::sun::star::accessibility; ++using namespace ::com::sun::star::accessibility::AccessibleStateType; ++ ++using ::com::sun::star::uno::Any; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::uno::Sequence; ++using ::com::sun::star::uno::UNO_QUERY; ++using ::com::sun::star::lang::IndexOutOfBoundsException; ++using ::com::sun::star::uno::RuntimeException; ++using ::rtl::OUString; ++ ++ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem( ++ const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, size_t nMenuPos) : ++ ScAccessibleContextBase(rxParent, AccessibleRole::MENU_ITEM), ++ mpWindow(pWin), ++ maName(rName), ++ mnMenuPos(nMenuPos), ++ mbEnabled(true) ++{ ++ SetName(rName); ++} ++ ++ScAccessibleFilterMenuItem::~ScAccessibleFilterMenuItem() ++{ ++} ++ ++sal_Int32 ScAccessibleFilterMenuItem::getAccessibleChildCount() ++ throw (RuntimeException) ++{ ++ return 0; ++} ++ ++Reference ScAccessibleFilterMenuItem::getAccessibleChild(sal_Int32 /*nIndex*/) ++ throw (RuntimeException, IndexOutOfBoundsException) ++{ ++ throw IndexOutOfBoundsException(); ++ return Reference(); ++} ++ ++Reference ScAccessibleFilterMenuItem::getAccessibleStateSet() ++ throw (RuntimeException) ++{ ++ updateStateSet(); ++ return mxStateSet; ++} ++ ++OUString ScAccessibleFilterMenuItem::getImplementationName() ++ throw (RuntimeException) ++{ ++ return OUString::createFromAscii("ScAccessibleFilterMenuItem"); ++} ++ ++// XAccessibleAction ++ ++sal_Int32 ScAccessibleFilterMenuItem::getAccessibleActionCount() throw (RuntimeException) ++{ ++ return 1; ++} ++ ++sal_Bool ScAccessibleFilterMenuItem::doAccessibleAction(sal_Int32 /*nIndex*/) ++ throw (IndexOutOfBoundsException, RuntimeException) ++{ ++ mpWindow->executeMenuItem(mnMenuPos); ++ return true; ++} ++ ++OUString ScAccessibleFilterMenuItem::getAccessibleActionDescription(sal_Int32 /*nIndex*/) ++ throw (IndexOutOfBoundsException, RuntimeException) ++{ ++ return OUString::createFromAscii("click"); ++} ++ ++Reference ScAccessibleFilterMenuItem::getAccessibleActionKeyBinding( ++ sal_Int32 /*nIndex*/) throw (IndexOutOfBoundsException, RuntimeException) ++{ ++ return Reference(); ++} ++ ++Any SAL_CALL ScAccessibleFilterMenuItem::queryInterface( uno::Type const & rType ) ++ throw (RuntimeException) ++{ ++ Any any = ScAccessibleContextBase::queryInterface(rType); ++ if (any.hasValue()) ++ return any; ++ ++ return ScAccessibleFilterMenuItem_BASE::queryInterface(rType); ++} ++ ++void SAL_CALL ScAccessibleFilterMenuItem::acquire() throw () ++{ ++ ScAccessibleContextBase::acquire(); ++} ++ ++void SAL_CALL ScAccessibleFilterMenuItem::release() throw () ++{ ++ ScAccessibleContextBase::release(); ++} ++ ++bool ScAccessibleFilterMenuItem::isSelected() const ++{ ++ return mpWindow->isMenuItemSelected(mnMenuPos); ++} ++ ++bool ScAccessibleFilterMenuItem::isFocused() const ++{ ++ return isSelected(); ++} ++ ++void ScAccessibleFilterMenuItem::setEnabled(bool bEnabled) ++{ ++ mbEnabled = bEnabled; ++} ++ ++Rectangle ScAccessibleFilterMenuItem::GetBoundingBoxOnScreen() const ++ throw (RuntimeException) ++{ ++ if (!mpWindow->IsVisible()) ++ return Rectangle(); ++ ++ Point aPos = mpWindow->OutputToAbsoluteScreenPixel(Point(0,0)); ++ Point aMenuPos; ++ Size aMenuSize; ++ mpWindow->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); ++ Rectangle aRect(aPos + aMenuPos, aMenuSize); ++ return aRect; ++} ++ ++Rectangle ScAccessibleFilterMenuItem::GetBoundingBox() const ++ throw (RuntimeException) ++{ ++ if (!mpWindow->IsVisible()) ++ return Rectangle(); ++ ++ Point aMenuPos; ++ Size aMenuSize; ++ mpWindow->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); ++ Rectangle aRect(aMenuPos, aMenuSize); ++ return aRect; ++} ++ ++void ScAccessibleFilterMenuItem::updateStateSet() ++{ ++ if (!mxStateSet.is()) ++ mxStateSet.set(new ScAccessibleStateSet); ++ ++ ScAccessibleStateSet* p = static_cast( ++ mxStateSet.get()); ++ ++ p->clear(); ++ ++ p->insert(ENABLED); ++ p->insert(FOCUSABLE); ++ p->insert(SELECTABLE); ++ p->insert(SENSITIVE); ++ p->insert(OPAQUE); ++ ++ if (isFocused()) ++ p->insert(FOCUSED); ++ ++ if (isSelected()) ++ p->insert(SELECTED); ++} ++ +diff --git sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx +new file mode 100644 +index 0000000..e9834f8 +--- /dev/null ++++ sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx +@@ -0,0 +1,137 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++ ++#include "precompiled_sc.hxx" ++#include "AccessibleFilterTopWindow.hxx" ++#include "AccessibleFilterMenu.hxx" ++#include "dpcontrol.hxx" ++ ++#include ++ ++using namespace ::com::sun::star; ++using namespace ::com::sun::star::accessibility; ++using ::com::sun::star::lang::IndexOutOfBoundsException; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::uno::RuntimeException; ++using ::rtl::OUString; ++ ++ScAccessibleFilterTopWindow::ScAccessibleFilterTopWindow( ++ const Reference& rxParent, ScDPFieldPopupWindow* pWin, const OUString& rName, ScDocument* pDoc) : ++ ScAccessibleFilterMenu(rxParent, pWin, rName, ScMenuFloatingWindow::MENU_NOT_SELECTED, pDoc), ++ mpWindow(pWin), ++ mpDoc(pDoc) ++{ ++ SetName(rName); ++} ++ ++ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow() ++{ ++} ++ ++// XAccessibleContext ++ ++sal_Int32 ScAccessibleFilterTopWindow::getAccessibleChildCount() throw (RuntimeException) ++{ ++ sal_Int32 nMenuCount = getMenuItemCount(); ++ return nMenuCount + 6; ++} ++ ++Reference ScAccessibleFilterTopWindow::getAccessibleChild( ++ sal_Int32 nIndex) throw (RuntimeException, IndexOutOfBoundsException) ++{ ++ if (nIndex >= getAccessibleChildCount()) ++ throw IndexOutOfBoundsException(); ++ ++ sal_Int32 nMenuCount = getMenuItemCount(); ++ if (nIndex < nMenuCount) ++ return ScAccessibleFilterMenu::getAccessibleChild(nIndex); ++ ++ nIndex -= nMenuCount; ++ switch (nIndex) ++ { ++ case 0: ++ return mxAccListBox; ++ case 1: ++ return mxAccToggleAll; ++ case 2: ++ return mxAccSingleOnBtn; ++ case 3: ++ return mxAccSingleOffBtn; ++ case 4: ++ return mxAccOkBtn; ++ case 5: ++ return mxAccCancelBtn; ++ default: ++ ; ++ } ++ ++ return Reference(); ++} ++ ++OUString ScAccessibleFilterTopWindow::getImplementationName() throw (RuntimeException) ++{ ++ return OUString::createFromAscii("ScAccessibleFilterTopWindow"); ++} ++ ++Reference ScAccessibleFilterTopWindow::getAccessibleChildMenu() ++{ ++ if (!mxAccMenu.is()) ++ mxAccMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), ScMenuFloatingWindow::MENU_NOT_SELECTED, mpDoc)); ++ return mxAccMenu; ++} ++ ++void ScAccessibleFilterTopWindow::setAccessibleChild( ++ const Reference& rAccessible, ChildControlType eType) ++{ ++ switch (eType) ++ { ++ case LISTBOX: ++ mxAccListBox = rAccessible; ++ break; ++ case TOGGLE_ALL: ++ mxAccToggleAll = rAccessible; ++ break; ++ case SINGLE_ON_BTN: ++ mxAccSingleOnBtn = rAccessible; ++ break; ++ case SINGLE_OFF_BTN: ++ mxAccSingleOffBtn = rAccessible; ++ break; ++ case OK_BTN: ++ mxAccOkBtn = rAccessible; ++ break; ++ case CANCEL_BTN: ++ mxAccCancelBtn = rAccessible; ++ break; ++ } ++} ++ +diff --git sc/source/ui/Accessibility/AccessibleGlobal.cxx sc/source/ui/Accessibility/AccessibleGlobal.cxx +new file mode 100644 +index 0000000..f37bd4b +--- /dev/null ++++ sc/source/ui/Accessibility/AccessibleGlobal.cxx +@@ -0,0 +1,98 @@ ++/************************************************************************* ++ * ++ * 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: AccessibleDataPilotControl.hxx,v $ ++ * $Revision: 1.6 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++ ++#include "precompiled_sc.hxx" ++#include "AccessibleGlobal.hxx" ++ ++using ::com::sun::star::uno::RuntimeException; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::uno::Sequence; ++using ::std::set; ++ ++ScAccessibleStateSet::ScAccessibleStateSet() ++{ ++} ++ ++ScAccessibleStateSet::~ScAccessibleStateSet() ++{ ++} ++ ++// XAccessibleStateSet ++ ++sal_Bool SAL_CALL ScAccessibleStateSet::isEmpty() throw (RuntimeException) ++{ ++ return maStates.empty(); ++} ++ ++sal_Bool SAL_CALL ScAccessibleStateSet::contains(sal_Int16 nState) ++ throw (RuntimeException) ++{ ++ return maStates.count(nState) != 0; ++} ++ ++sal_Bool SAL_CALL ScAccessibleStateSet::containsAll( ++ const Sequence& aStateSet) throw (RuntimeException) ++{ ++ sal_Int32 n = aStateSet.getLength(); ++ for (sal_Int32 i = 0; i < n; ++i) ++ { ++ if (!maStates.count(aStateSet[i])) ++ // This state is not set. ++ return false; ++ } ++ // All specified states are set. ++ return true; ++} ++ ++Sequence SAL_CALL ScAccessibleStateSet::getStates() ++ throw (RuntimeException) ++{ ++ Sequence aSeq(0); ++ set::const_iterator itr = maStates.begin(), itrEnd = maStates.end(); ++ for (size_t i = 0; itr != itrEnd; ++itr, ++i) ++ { ++ aSeq.realloc(i+1); ++ aSeq[i] = *itr; ++ } ++ return aSeq; ++} ++ ++void ScAccessibleStateSet::insert(sal_Int16 nState) ++{ ++ maStates.insert(nState); ++} ++ ++void ScAccessibleStateSet::clear() ++{ ++ maStates.clear(); ++} ++ +diff --git sc/source/ui/Accessibility/makefile.mk sc/source/ui/Accessibility/makefile.mk +index dfa5ac9..2942914 100644 +--- sc/source/ui/Accessibility/makefile.mk ++++ sc/source/ui/Accessibility/makefile.mk +@@ -47,12 +47,16 @@ SLOFILES = \ + $(SLO)$/AccessibleContextBase.obj \ + $(SLO)$/AccessibleTableBase.obj \ + $(SLO)$/AccessibleDocument.obj \ ++ $(SLO)$/AccessibleGlobal.obj \ + $(SLO)$/AccessibleSpreadsheet.obj \ + $(SLO)$/AccessibleCell.obj \ + $(SLO)$/AccessibilityHints.obj \ + $(SLO)$/AccessibleDocumentBase.obj \ + $(SLO)$/AccessibleCellBase.obj \ + $(SLO)$/AccessibleDocumentPagePreview.obj \ ++ $(SLO)$/AccessibleFilterMenu.obj \ ++ $(SLO)$/AccessibleFilterMenuItem.obj \ ++ $(SLO)$/AccessibleFilterTopWindow.obj \ + $(SLO)$/AccessiblePreviewTable.obj \ + $(SLO)$/AccessiblePreviewCell.obj \ + $(SLO)$/AccessiblePreviewHeaderCell.obj \ +@@ -68,11 +72,15 @@ EXCEPTIONSFILES= \ + $(SLO)$/AccessibleContextBase.obj \ + $(SLO)$/AccessibleTableBase.obj \ + $(SLO)$/AccessibleDocument.obj \ ++ $(SLO)$/AccessibleGlobal.obj \ + $(SLO)$/AccessibleSpreadsheet.obj \ + $(SLO)$/AccessibleCell.obj \ + $(SLO)$/AccessibleDocumentBase.obj \ + $(SLO)$/AccessibleCellBase.obj \ + $(SLO)$/AccessibleDocumentPagePreview.obj \ ++ $(SLO)$/AccessibleFilterMenu.obj \ ++ $(SLO)$/AccessibleFilterMenuItem.obj \ ++ $(SLO)$/AccessibleFilterTopWindow.obj \ + $(SLO)$/AccessiblePreviewTable.obj \ + $(SLO)$/AccessiblePreviewCell.obj \ + $(SLO)$/AccessiblePreviewHeaderCell.obj \ +diff --git sc/source/ui/cctrl/dpcontrol.cxx sc/source/ui/cctrl/dpcontrol.cxx +new file mode 100644 +index 0000000..2f09c88 +--- /dev/null ++++ sc/source/ui/cctrl/dpcontrol.cxx +@@ -0,0 +1,1419 @@ ++/************************************************************************* ++ * ++ * 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: document.hxx,v $ ++ * $Revision: 1.115.36.9 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++// INCLUDE --------------------------------------------------------------- ++ ++#include "dpcontrol.hxx" ++#include "dpcontrol.hrc" ++ ++#include "vcl/outdev.hxx" ++#include "vcl/settings.hxx" ++#include "vcl/wintypes.hxx" ++#include "vcl/decoview.hxx" ++#include "strload.hxx" ++#include "global.hxx" ++ ++#include "AccessibleFilterMenu.hxx" ++#include "AccessibleFilterTopWindow.hxx" ++ ++#include ++#include ++ ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::accessibility::XAccessible; ++using ::com::sun::star::accessibility::XAccessibleContext; ++using ::rtl::OUString; ++using ::rtl::OUStringHash; ++using ::std::vector; ++using ::std::hash_map; ++using ::std::auto_ptr; ++ ++ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY) : ++ mpOutDev(pOutDev), ++ mpStyle(pStyle), ++ mbBaseButton(true), ++ mbPopupButton(false), ++ mbHasHiddenMember(false), ++ mbPopupPressed(false) ++{ ++ if (pZoomX) ++ maZoomX = *pZoomX; ++ else ++ maZoomX = Fraction(1, 1); ++ ++ if (pZoomY) ++ maZoomY = *pZoomY; ++ else ++ maZoomY = Fraction(1, 1); ++} ++ ++ScDPFieldButton::~ScDPFieldButton() ++{ ++} ++ ++void ScDPFieldButton::setText(const OUString& rText) ++{ ++ maText = rText; ++} ++ ++void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize) ++{ ++ maPos = rPos; ++ maSize = rSize; ++} ++ ++void ScDPFieldButton::setDrawBaseButton(bool b) ++{ ++ mbBaseButton = b; ++} ++ ++void ScDPFieldButton::setDrawPopupButton(bool b) ++{ ++ mbPopupButton = b; ++} ++ ++void ScDPFieldButton::setHasHiddenMember(bool b) ++{ ++ mbHasHiddenMember = b; ++} ++ ++void ScDPFieldButton::setPopupPressed(bool b) ++{ ++ mbPopupPressed = b; ++} ++ ++void ScDPFieldButton::draw() ++{ ++ const long nMargin = 2; ++ bool bOldMapEnablaed = mpOutDev->IsMapModeEnabled(); ++ mpOutDev->EnableMapMode(false); ++ ++ if (mbBaseButton) ++ { ++ // Background ++ Rectangle aRect(maPos, maSize); ++ mpOutDev->SetLineColor(mpStyle->GetFaceColor()); ++ mpOutDev->SetFillColor(mpStyle->GetFaceColor()); ++ mpOutDev->DrawRect(aRect); ++ ++ // Border lines ++ mpOutDev->SetLineColor(mpStyle->GetLightColor()); ++ mpOutDev->DrawLine(Point(maPos), Point(maPos.X(), maPos.Y()+maSize.Height()-1)); ++ mpOutDev->DrawLine(Point(maPos), Point(maPos.X()+maSize.Width()-1, maPos.Y())); ++ ++ mpOutDev->SetLineColor(mpStyle->GetShadowColor()); ++ mpOutDev->DrawLine(Point(maPos.X(), maPos.Y()+maSize.Height()-1), ++ Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); ++ mpOutDev->DrawLine(Point(maPos.X()+maSize.Width()-1, maPos.Y()), ++ Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); ++ ++ // Field name. ++ Font aTextFont( mpStyle->GetLabelFont() ); ++ double fFontHeight = 12.0; ++ fFontHeight *= static_cast(maZoomY.GetNumerator()) / static_cast(maZoomY.GetDenominator()); ++ aTextFont.SetHeight(fFontHeight); ++ mpOutDev->SetFont(aTextFont); ++ ++ Point aTextPos = maPos; ++ long nTHeight = static_cast(fFontHeight); ++ aTextPos.setX(maPos.getX() + nMargin); ++ aTextPos.setY(maPos.getY() + (maSize.Height()-nTHeight)/2); ++ mpOutDev->DrawText(aTextPos, maText); ++ } ++ ++ if (mbPopupButton) ++ drawPopupButton(); ++ ++ mpOutDev->EnableMapMode(bOldMapEnablaed); ++} ++ ++void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const ++{ ++ long nW = maSize.getWidth()*0.5; ++ long nH = maSize.getHeight(); ++ if (nW > 18) ++ nW = 18; ++ if (nH > 18) ++ nH = 18; ++ ++ rPos.setX(maPos.getX() + maSize.getWidth() - nW); ++ rPos.setY(maPos.getY() + maSize.getHeight() - nH); ++ rSize.setWidth(nW); ++ rSize.setHeight(nH); ++} ++ ++bool ScDPFieldButton::isPopupButton() const ++{ ++ return mbPopupButton; ++} ++ ++void ScDPFieldButton::drawPopupButton() ++{ ++ Point aPos; ++ Size aSize; ++ getPopupBoundingBox(aPos, aSize); ++ ++ // Background & outer black border ++ mpOutDev->SetLineColor(COL_BLACK); ++ mpOutDev->SetFillColor(mpStyle->GetFaceColor()); ++ mpOutDev->DrawRect(Rectangle(aPos, aSize)); ++ ++ if (!mbPopupPressed) ++ { ++ // border lines ++ mpOutDev->SetLineColor(mpStyle->GetLightColor()); ++ mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+1, aPos.Y()+aSize.Height()-2)); ++ mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+aSize.Width()-2, aPos.Y()+1)); ++ ++ mpOutDev->SetLineColor(mpStyle->GetShadowColor()); ++ mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+aSize.Height()-2), ++ Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); ++ mpOutDev->DrawLine(Point(aPos.X()+aSize.Width()-2, aPos.Y()+1), ++ Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); ++ } ++ ++ // the arrowhead ++ Color aArrowColor = mbHasHiddenMember ? mpStyle->GetHighlightLinkColor() : mpStyle->GetButtonTextColor(); ++ mpOutDev->SetLineColor(aArrowColor); ++ mpOutDev->SetFillColor(aArrowColor); ++ Point aCenter(aPos.X() + (aSize.Width() >> 1), aPos.Y() + (aSize.Height() >> 1)); ++ Point aPos1, aPos2; ++ aPos1.X() = aCenter.X() - 4; ++ aPos2.X() = aCenter.X() + 4; ++ aPos1.Y() = aCenter.Y() - 3; ++ aPos2.Y() = aCenter.Y() - 3; ++ ++ if (mbPopupPressed) ++ { ++ aPos1.X() += 1; ++ aPos2.X() += 1; ++ aPos1.Y() += 1; ++ aPos2.Y() += 1; ++ } ++ ++ do ++ { ++ ++aPos1.X(); ++ --aPos2.X(); ++ ++aPos1.Y(); ++ ++aPos2.Y(); ++ mpOutDev->DrawLine(aPos1, aPos2); ++ } ++ while (aPos1 != aPos2); ++ ++ if (mbHasHiddenMember) ++ { ++ // tiny little box to display in presence of hidden member(s). ++ Point aBoxPos(aPos.X() + aSize.Width() - 5, aPos.Y() + aSize.Height() - 5); ++ if (mbPopupPressed) ++ { ++ aBoxPos.X() += 1; ++ aBoxPos.Y() += 1; ++ } ++ Size aBoxSize(3, 3); ++ mpOutDev->DrawRect(Rectangle(aBoxPos, aBoxSize)); ++ } ++} ++ ++// ============================================================================ ++ ++ScMenuFloatingWindow::MenuItemData::MenuItemData() : ++ mbEnabled(true), ++ mpAction(static_cast(NULL)), ++ mpSubMenuWin(static_cast(NULL)) ++{ ++} ++ ++// ---------------------------------------------------------------------------- ++ ++ScMenuFloatingWindow::SubMenuItemData::SubMenuItemData(ScMenuFloatingWindow* pParent) : ++ mpSubMenu(NULL), ++ mnMenuPos(MENU_NOT_SELECTED), ++ mpParent(pParent) ++{ ++ maTimer.SetTimeoutHdl( LINK(this, ScMenuFloatingWindow::SubMenuItemData, TimeoutHdl) ); ++ maTimer.SetTimeout(mpParent->GetSettings().GetMouseSettings().GetMenuDelay()); ++} ++ ++void ScMenuFloatingWindow::SubMenuItemData::reset() ++{ ++ mpSubMenu = NULL; ++ mnMenuPos = MENU_NOT_SELECTED; ++ maTimer.Stop(); ++} ++ ++IMPL_LINK( ScMenuFloatingWindow::SubMenuItemData, TimeoutHdl, void*, EMPTYARG ) ++{ ++ mpParent->handleMenuTimeout(this); ++ return 0; ++} ++ ++// ---------------------------------------------------------------------------- ++ ++size_t ScMenuFloatingWindow::MENU_NOT_SELECTED = 999; ++ ++ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel) : ++ PopupMenuFloatingWindow(pParent), ++ maOpenTimer(this), ++ maCloseTimer(this), ++ maName(OUString::createFromAscii("ScMenuFloatingWindow")), ++ mnSelectedMenu(MENU_NOT_SELECTED), ++ mnClickedMenu(MENU_NOT_SELECTED), ++ mpDoc(pDoc), ++ mpParentMenu(dynamic_cast(pParent)), ++ mpActiveSubMenu(NULL) ++{ ++ SetMenuStackLevel(nMenuStackLevel); ++ ++ // TODO: How do we get the right font to use here ? ++ const sal_uInt16 nPopupFontHeight = 12; ++ const StyleSettings& rStyle = GetSettings().GetStyleSettings(); ++ maLabelFont = rStyle.GetLabelFont(); ++ maLabelFont.SetHeight(nPopupFontHeight); ++ SetFont(maLabelFont); ++ ++ SetText(OUString::createFromAscii("ScMenuFloatingWindow")); ++ SetPopupModeEndHdl( LINK(this, ScMenuFloatingWindow, PopupEndHdl) ); ++} ++ ++ScMenuFloatingWindow::~ScMenuFloatingWindow() ++{ ++ EndPopupMode(); ++} ++ ++void ScMenuFloatingWindow::MouseMove(const MouseEvent& rMEvt) ++{ ++ const Point& rPos = rMEvt.GetPosPixel(); ++ size_t nSelectedMenu = getEnclosingMenuItem(rPos); ++ setSelectedMenuItem(nSelectedMenu, true, false); ++ ++ Window::MouseMove(rMEvt); ++} ++ ++void ScMenuFloatingWindow::MouseButtonDown(const MouseEvent& rMEvt) ++{ ++ const Point& rPos = rMEvt.GetPosPixel(); ++ mnClickedMenu = getEnclosingMenuItem(rPos); ++ Window::MouseButtonDown(rMEvt); ++} ++ ++void ScMenuFloatingWindow::MouseButtonUp(const MouseEvent& rMEvt) ++{ ++ executeMenuItem(mnClickedMenu); ++ mnClickedMenu = MENU_NOT_SELECTED; ++ Window::MouseButtonUp(rMEvt); ++} ++ ++void ScMenuFloatingWindow::KeyInput(const KeyEvent& rKEvt) ++{ ++ const KeyCode& rKeyCode = rKEvt.GetKeyCode(); ++ bool bHandled = true; ++ size_t nSelectedMenu = mnSelectedMenu; ++ size_t nLastMenuPos = maMenuItems.size() - 1; ++ switch (rKeyCode.GetCode()) ++ { ++ case KEY_UP: ++ if (nSelectedMenu == MENU_NOT_SELECTED || nSelectedMenu == 0) ++ nSelectedMenu = nLastMenuPos; ++ else ++ --nSelectedMenu; ++ setSelectedMenuItem(nSelectedMenu, false, false); ++ break; ++ case KEY_DOWN: ++ if (nSelectedMenu == MENU_NOT_SELECTED || nSelectedMenu == nLastMenuPos) ++ nSelectedMenu = 0; ++ else ++ ++nSelectedMenu; ++ setSelectedMenuItem(nSelectedMenu, false, false); ++ break; ++ case KEY_LEFT: ++ if (mpParentMenu) ++ mpParentMenu->endSubMenu(this); ++ break; ++ case KEY_RIGHT: ++ { ++ if (mnSelectedMenu >= maMenuItems.size() || mnSelectedMenu == MENU_NOT_SELECTED) ++ break; ++ ++ const MenuItemData& rMenu = maMenuItems[mnSelectedMenu]; ++ if (!rMenu.mbEnabled || !rMenu.mpSubMenuWin) ++ break; ++ ++ maOpenTimer.mnMenuPos = mnSelectedMenu; ++ maOpenTimer.mpSubMenu = rMenu.mpSubMenuWin.get(); ++ launchSubMenu(true); ++ } ++ break; ++ case KEY_RETURN: ++ if (nSelectedMenu != MENU_NOT_SELECTED) ++ executeMenuItem(nSelectedMenu); ++ break; ++ default: ++ bHandled = false; ++ } ++ ++ if (!bHandled) ++ Window::KeyInput(rKEvt); ++} ++ ++void ScMenuFloatingWindow::Paint(const Rectangle& /*rRect*/) ++{ ++ const StyleSettings& rStyle = GetSettings().GetStyleSettings(); ++ Color aBackColor = rStyle.GetMenuColor(); ++ Color aBorderColor = rStyle.GetShadowColor(); ++ ++ Rectangle aCtrlRect(Point(0, 0), GetOutputSizePixel()); ++ ++ // Window background ++ bool bNativeDrawn = true; ++ if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) ++ { ++ SetClipRegion(); ++ bNativeDrawn = DrawNativeControl( ++ CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED, ++ ImplControlValue(), OUString()); ++ } ++ else ++ bNativeDrawn = false; ++ ++ if (!bNativeDrawn) ++ { ++ SetFillColor(aBackColor); ++ SetLineColor(aBorderColor); ++ DrawRect(aCtrlRect); ++ } ++ ++ // Menu items ++ SetTextColor(rStyle.GetMenuTextColor()); ++ drawAllMenuItems(); ++} ++ ++Reference ScMenuFloatingWindow::CreateAccessible() ++{ ++ if (!mxAccessible.is()) ++ { ++ Reference xAccParent = mpParentMenu ? ++ mpParentMenu->GetAccessible() : GetAccessibleParentWindow()->GetAccessible(); ++ ++ mxAccessible.set(new ScAccessibleFilterMenu(xAccParent, this, maName, 999, getDoc())); ++ ScAccessibleFilterMenu* p = static_cast( ++ mxAccessible.get()); ++ ++ vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); ++ for (itr = itrBeg; itr != itrEnd; ++itr) ++ { ++ size_t nPos = ::std::distance(itrBeg, itr); ++ p->appendMenuItem(itr->maText, itr->mbEnabled, nPos); ++ } ++ } ++ ++ return mxAccessible; ++} ++ ++void ScMenuFloatingWindow::addMenuItem(const OUString& rText, bool bEnabled, Action* pAction) ++{ ++ MenuItemData aItem; ++ aItem.maText = rText; ++ aItem.mbEnabled = bEnabled; ++ aItem.mpAction.reset(pAction); ++ maMenuItems.push_back(aItem); ++} ++ ++ScMenuFloatingWindow* ScMenuFloatingWindow::addSubMenuItem(const OUString& rText, bool bEnabled) ++{ ++ MenuItemData aItem; ++ aItem.maText = rText; ++ aItem.mbEnabled = bEnabled; ++ aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this, mpDoc, GetMenuStackLevel()+1)); ++ aItem.mpSubMenuWin->setName(rText); ++ maMenuItems.push_back(aItem); ++ return aItem.mpSubMenuWin.get(); ++} ++ ++void ScMenuFloatingWindow::drawMenuItem(size_t nPos) ++{ ++ if (nPos >= maMenuItems.size()) ++ return; ++ ++ Point aPos; ++ Size aSize; ++ getMenuItemPosSize(nPos, aPos, aSize); ++ ++ DecorationView aDecoView(this); ++ long nXOffset = 5; ++ long nYOffset = (aSize.Height() - maLabelFont.GetHeight())/2; ++ DrawCtrlText(Point(aPos.X()+nXOffset, aPos.Y() + nYOffset), maMenuItems[nPos].maText, 0, STRING_LEN, ++ maMenuItems[nPos].mbEnabled ? TEXT_DRAW_MNEMONIC : TEXT_DRAW_DISABLE); ++ ++ if (maMenuItems[nPos].mpSubMenuWin) ++ { ++ long nFontHeight = maLabelFont.GetHeight(); ++ Point aMarkerPos = aPos; ++ aMarkerPos.Y() += aSize.Height()/2 - nFontHeight/4 + 1; ++ aMarkerPos.X() += aSize.Width() - nFontHeight + nFontHeight/4; ++ Size aMarkerSize(nFontHeight/2, nFontHeight/2); ++ aDecoView.DrawSymbol(Rectangle(aMarkerPos, aMarkerSize), ++ SYMBOL_SPIN_RIGHT, GetTextColor(), 0); ++ } ++} ++ ++void ScMenuFloatingWindow::drawAllMenuItems() ++{ ++ size_t n = maMenuItems.size(); ++ for (size_t i = 0; i < n; ++i) ++ highlightMenuItem(i, i == mnSelectedMenu); ++} ++ ++const Font& ScMenuFloatingWindow::getLabelFont() const ++{ ++ return maLabelFont; ++} ++ ++void ScMenuFloatingWindow::executeMenuItem(size_t nPos) ++{ ++ if (nPos >= maMenuItems.size()) ++ return; ++ ++ if (!maMenuItems[nPos].mpAction) ++ // no action is defined. ++ return; ++ ++ maMenuItems[nPos].mpAction->execute(); ++ terminateAllPopupMenus(); ++} ++ ++void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bEnsureSubMenu) ++{ ++ if (mnSelectedMenu == nPos) ++ // nothing to do. ++ return; ++ ++ if (bEnsureSubMenu) ++ { ++ // Dismiss any child popup menu windows. ++ if (mnSelectedMenu < maMenuItems.size() && ++ maMenuItems[mnSelectedMenu].mpSubMenuWin && ++ maMenuItems[mnSelectedMenu].mpSubMenuWin->IsVisible()) ++ { ++ maMenuItems[mnSelectedMenu].mpSubMenuWin->ensureSubMenuNotVisible(); ++ } ++ ++ // The popup is not visible, yet a menu item is selected. The request ++ // most likely comes from the accessible object. Make sure this ++ // window, as well as all its parent windows are visible. ++ if (!IsVisible() && mpParentMenu) ++ mpParentMenu->ensureSubMenuVisible(this); ++ } ++ ++ selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); ++ selectMenuItem(nPos, true, bSubMenuTimer); ++ mnSelectedMenu = nPos; ++ ++ fireMenuHighlightedEvent(); ++} ++ ++size_t ScMenuFloatingWindow::getSelectedMenuItem() const ++{ ++ return mnSelectedMenu; ++} ++ ++void ScMenuFloatingWindow::handleMenuTimeout(SubMenuItemData* pTimer) ++{ ++ if (pTimer == &maOpenTimer) ++ { ++ // Close any open submenu immediately. ++ if (maCloseTimer.mpSubMenu) ++ { ++ maCloseTimer.mpSubMenu->EndPopupMode(); ++ maCloseTimer.mpSubMenu = NULL; ++ maCloseTimer.maTimer.Stop(); ++ } ++ ++ launchSubMenu(false); ++ } ++ else if (pTimer == &maCloseTimer) ++ { ++ // end submenu. ++ if (maCloseTimer.mpSubMenu) ++ { ++ maOpenTimer.mpSubMenu = NULL; ++ ++ maCloseTimer.mpSubMenu->EndPopupMode(); ++ maCloseTimer.mpSubMenu = NULL; ++ ++ highlightMenuItem(maOpenTimer.mnMenuPos, false); ++ maOpenTimer.mnMenuPos = MENU_NOT_SELECTED; ++ } ++ } ++} ++ ++void ScMenuFloatingWindow::queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu) ++{ ++ if (!pMenu) ++ return; ++ ++ // Set the submenu on launch queue. ++ if (maOpenTimer.mpSubMenu) ++ { ++ if (maOpenTimer.mpSubMenu == pMenu) ++ { ++ if (pMenu == maCloseTimer.mpSubMenu) ++ maCloseTimer.reset(); ++ return; ++ } ++ ++ // new submenu is being requested. ++ queueCloseSubMenu(); ++ } ++ ++ maOpenTimer.mpSubMenu = pMenu; ++ maOpenTimer.mnMenuPos = nPos; ++ maOpenTimer.maTimer.Start(); ++} ++ ++void ScMenuFloatingWindow::queueCloseSubMenu() ++{ ++ if (!maOpenTimer.mpSubMenu) ++ // There is no submenu to close. ++ return; ++ ++ // Stop any submenu on queue for opening. ++ maOpenTimer.maTimer.Stop(); ++ ++ maCloseTimer.mpSubMenu = maOpenTimer.mpSubMenu; ++ maCloseTimer.mnMenuPos = maOpenTimer.mnMenuPos; ++ maCloseTimer.maTimer.Start(); ++} ++ ++void ScMenuFloatingWindow::launchSubMenu(bool bSetMenuPos) ++{ ++ Point aPos; ++ Size aSize; ++ getMenuItemPosSize(maOpenTimer.mnMenuPos, aPos, aSize); ++ ScMenuFloatingWindow* pSubMenu = maOpenTimer.mpSubMenu; ++ ++ if (!pSubMenu) ++ return; ++ ++ sal_uInt32 nOldFlags = GetPopupModeFlags(); ++ SetPopupModeFlags(nOldFlags | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE); ++ pSubMenu->resizeToFitMenuItems(); // set the size before launching the popup to get it positioned correctly. ++ pSubMenu->StartPopupMode( ++ Rectangle(aPos,aSize), (FLOATWIN_POPUPMODE_RIGHT | FLOATWIN_POPUPMODE_GRABFOCUS)); ++ pSubMenu->AddPopupModeWindow(this); ++ if (bSetMenuPos) ++ pSubMenu->setSelectedMenuItem(0, false, false); // select menu item after the popup becomes fully visible. ++ SetPopupModeFlags(nOldFlags); ++} ++ ++void ScMenuFloatingWindow::endSubMenu(ScMenuFloatingWindow* pSubMenu) ++{ ++ if (!pSubMenu) ++ return; ++ ++ pSubMenu->EndPopupMode(); ++ maOpenTimer.reset(); ++ ++ size_t nMenuPos = getSubMenuPos(pSubMenu); ++ if (nMenuPos != MENU_NOT_SELECTED) ++ { ++ highlightMenuItem(nMenuPos, true); ++ mnSelectedMenu = nMenuPos; ++ fireMenuHighlightedEvent(); ++ } ++} ++ ++void ScMenuFloatingWindow::fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const ++{ ++ vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); ++ for (itr = itrBeg; itr != itrEnd; ++itr) ++ { ++ size_t nPos = ::std::distance(itrBeg, itr); ++ pAccMenu->appendMenuItem(itr->maText, itr->mbEnabled, nPos); ++ } ++} ++ ++ScDocument* ScMenuFloatingWindow::getDoc() ++{ ++ return mpDoc; ++} ++ ++void ScMenuFloatingWindow::resizeToFitMenuItems() ++{ ++ if (maMenuItems.empty()) ++ return; ++ ++ vector::const_iterator itr = maMenuItems.begin(), itrEnd = maMenuItems.end(); ++ long nTextWidth = 0; ++ for (; itr != itrEnd; ++itr) ++ nTextWidth = ::std::max(GetTextWidth(itr->maText), nTextWidth); ++ ++ size_t nLastPos = maMenuItems.size()-1; ++ Point aPos; ++ Size aSize; ++ getMenuItemPosSize(nLastPos, aPos, aSize); ++ aPos.X() += nTextWidth + 15; ++ aPos.Y() += aSize.Height() + 5; ++ SetOutputSizePixel(Size(aPos.X(), aPos.Y())); ++} ++ ++void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer) ++{ ++ if (nPos >= maMenuItems.size() || nPos == MENU_NOT_SELECTED) ++ { ++ queueCloseSubMenu(); ++ return; ++ } ++ ++ if (!maMenuItems[nPos].mbEnabled) ++ { ++ queueCloseSubMenu(); ++ return; ++ } ++ ++ highlightMenuItem(nPos, bSelected); ++ ++ if (bSelected) ++ { ++ if (mpParentMenu) ++ mpParentMenu->setSubMenuFocused(this); ++ ++ if (bSubMenuTimer) ++ { ++ if (maMenuItems[nPos].mpSubMenuWin) ++ { ++ ScMenuFloatingWindow* pSubMenu = maMenuItems[nPos].mpSubMenuWin.get(); ++ queueLaunchSubMenu(nPos, pSubMenu); ++ } ++ else ++ queueCloseSubMenu(); ++ } ++ } ++} ++ ++void ScMenuFloatingWindow::clearSelectedMenuItem() ++{ ++ selectMenuItem(mnSelectedMenu, false, false); ++ mnSelectedMenu = MENU_NOT_SELECTED; ++} ++ ++ScMenuFloatingWindow* ScMenuFloatingWindow::getSubMenuWindow(size_t nPos) const ++{ ++ if (maMenuItems.size() <= nPos) ++ return NULL; ++ ++ return maMenuItems[nPos].mpSubMenuWin.get(); ++} ++ ++size_t ScMenuFloatingWindow::getMenuItemCount() const ++{ ++ return maMenuItems.size(); ++} ++ ++OUString ScMenuFloatingWindow::getMenuItemName(size_t nPos) const ++{ ++ if (maMenuItems.size() <= nPos) ++ return ScGlobal::GetEmptyString(); ++ ++ return maMenuItems[nPos].maText; ++} ++ ++bool ScMenuFloatingWindow::isMenuItemEnabled(size_t nPos) const ++{ ++ if (maMenuItems.size() <= nPos) ++ return false; ++ ++ return maMenuItems[nPos].mbEnabled; ++} ++ ++bool ScMenuFloatingWindow::isMenuItemSelected(size_t nPos) const ++{ ++ return nPos == mnSelectedMenu; ++} ++ ++void ScMenuFloatingWindow::setName(const OUString& rName) ++{ ++ maName = rName; ++} ++ ++const OUString& ScMenuFloatingWindow::getName() const ++{ ++ return maName; ++} ++ ++void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) ++{ ++ if (nPos == MENU_NOT_SELECTED) ++ return; ++ ++ const StyleSettings& rStyle = GetSettings().GetStyleSettings(); ++ Color aBackColor = rStyle.GetMenuColor(); ++ SetFillColor(aBackColor); ++ SetLineColor(aBackColor); ++ ++ Point aPos; ++ Size aSize; ++ getMenuItemPosSize(nPos, aPos, aSize); ++ Region aRegion(Rectangle(aPos,aSize)); ++ ++ if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) ++ { ++ Push(PUSH_CLIPREGION); ++ IntersectClipRegion(Rectangle(aPos, aSize)); ++ Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel()); ++ DrawNativeControl( ++ CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED, ++ ImplControlValue(), OUString()); ++ ++ Pop(); ++ } ++ ++ bool bNativeDrawn = true; ++ if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM)) ++ { ++ ControlState nState = bSelected ? CTRL_STATE_SELECTED : 0; ++ if (maMenuItems[nPos].mbEnabled) ++ nState |= CTRL_STATE_ENABLED; ++ bNativeDrawn = DrawNativeControl( ++ CTRL_MENU_POPUP, PART_MENU_ITEM, aRegion, nState, ImplControlValue(), OUString()); ++ } ++ else ++ bNativeDrawn = false; ++ ++ if (!bNativeDrawn) ++ { ++ if (bSelected) ++ { ++ aBackColor = rStyle.GetMenuHighlightColor(); ++ SetFillColor(aBackColor); ++ SetLineColor(aBackColor); ++ } ++ DrawRect(Rectangle(aPos,aSize)); ++ } ++ ++ Color aTextColor = bSelected ? rStyle.GetMenuHighlightTextColor() : rStyle.GetMenuTextColor(); ++ SetTextColor(aTextColor); ++ drawMenuItem(nPos); ++} ++ ++void ScMenuFloatingWindow::getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const ++{ ++ const sal_uInt16 nLeftMargin = 5; ++ const sal_uInt16 nTopMargin = 5; ++ const sal_uInt16 nMenuItemHeight = maLabelFont.GetHeight()*1.8; ++ ++ Size aWndSize = GetSizePixel(); ++ ++ Point aPos1(nLeftMargin, nTopMargin); ++ Size aSize1(aWndSize.Width() - nLeftMargin*2, nMenuItemHeight); ++ ++ rPos = aPos1; ++ rPos.Y() += aSize1.Height()*nPos; ++ rSize = aSize1; ++} ++ ++ScMenuFloatingWindow* ScMenuFloatingWindow::getParentMenuWindow() const ++{ ++ return mpParentMenu; ++} ++ ++size_t ScMenuFloatingWindow::getEnclosingMenuItem(const Point& rPos) const ++{ ++ size_t n = maMenuItems.size(); ++ for (size_t i = 0; i < n; ++i) ++ { ++ Point aPos; ++ Size aSize; ++ getMenuItemPosSize(i, aPos, aSize); ++ Rectangle aRect(aPos, aSize); ++ if (aRect.IsInside(rPos)) ++ return i; ++ } ++ return MENU_NOT_SELECTED; ++} ++ ++size_t ScMenuFloatingWindow::getSubMenuPos(ScMenuFloatingWindow* pSubMenu) ++{ ++ size_t n = maMenuItems.size(); ++ for (size_t i = 0; i < n; ++i) ++ { ++ if (maMenuItems[i].mpSubMenuWin.get() == pSubMenu) ++ return i; ++ } ++ return MENU_NOT_SELECTED; ++} ++ ++void ScMenuFloatingWindow::fireMenuHighlightedEvent() ++{ ++ if (mnSelectedMenu == MENU_NOT_SELECTED) ++ return; ++ ++ if (!mxAccessible.is()) ++ return; ++ ++ Reference xAccCxt = mxAccessible->getAccessibleContext(); ++ if (!xAccCxt.is()) ++ return; ++ ++ Reference xAccMenu = xAccCxt->getAccessibleChild(mnSelectedMenu); ++ if (!xAccMenu.is()) ++ return; ++ ++ VclAccessibleEvent aEvent(VCLEVENT_MENU_HIGHLIGHT, xAccMenu); ++ FireVclEvent(&aEvent); ++} ++ ++void ScMenuFloatingWindow::setSubMenuFocused(ScMenuFloatingWindow* pSubMenu) ++{ ++ maCloseTimer.reset(); ++ size_t nMenuPos = getSubMenuPos(pSubMenu); ++ if (mnSelectedMenu != nMenuPos) ++ { ++ highlightMenuItem(nMenuPos, true); ++ mnSelectedMenu = nMenuPos; ++ } ++} ++ ++void ScMenuFloatingWindow::ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu) ++{ ++ if (mpParentMenu) ++ mpParentMenu->ensureSubMenuVisible(this); ++ ++ if (pSubMenu->IsVisible()) ++ return; ++ ++ // Find the menu position of the submenu. ++ size_t nMenuPos = getSubMenuPos(pSubMenu); ++ if (nMenuPos != MENU_NOT_SELECTED) ++ { ++ setSelectedMenuItem(nMenuPos, false, false); ++ ++ Point aPos; ++ Size aSize; ++ getMenuItemPosSize(nMenuPos, aPos, aSize); ++ ++ sal_uInt32 nOldFlags = GetPopupModeFlags(); ++ SetPopupModeFlags(nOldFlags | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE); ++ pSubMenu->resizeToFitMenuItems(); // set the size before launching the popup to get it positioned correctly. ++ pSubMenu->StartPopupMode( ++ Rectangle(aPos,aSize), (FLOATWIN_POPUPMODE_RIGHT | FLOATWIN_POPUPMODE_GRABFOCUS)); ++ pSubMenu->AddPopupModeWindow(this); ++ SetPopupModeFlags(nOldFlags); ++ } ++} ++ ++void ScMenuFloatingWindow::ensureSubMenuNotVisible() ++{ ++ if (mnSelectedMenu <= maMenuItems.size() && ++ maMenuItems[mnSelectedMenu].mpSubMenuWin && ++ maMenuItems[mnSelectedMenu].mpSubMenuWin->IsVisible()) ++ { ++ maMenuItems[mnSelectedMenu].mpSubMenuWin->ensureSubMenuNotVisible(); ++ } ++ ++ EndPopupMode(); ++} ++ ++void ScMenuFloatingWindow::terminateAllPopupMenus() ++{ ++ EndPopupMode(); ++ if (mpParentMenu) ++ mpParentMenu->terminateAllPopupMenus(); ++} ++ ++IMPL_LINK( ScMenuFloatingWindow, PopupEndHdl, void*, EMPTYARG ) ++{ ++ clearSelectedMenuItem(); ++ return 0; ++} ++ ++// ============================================================================ ++ ++ScDPFieldPopupWindow::Member::Member() : ++ mbVisible(true) ++{ ++} ++ ++// ---------------------------------------------------------------------------- ++ ++ScDPFieldPopupWindow::CancelButton::CancelButton(ScDPFieldPopupWindow* pParent) : ++ ::CancelButton(pParent), mpParent(pParent) {} ++ ++void ScDPFieldPopupWindow::CancelButton::Click() ++{ ++ mpParent->EndPopupMode(); ++ ::CancelButton::Click(); ++} ++ ++// ---------------------------------------------------------------------------- ++ ++ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc) : ++ ScMenuFloatingWindow(pParent, pDoc), ++ maChecks(this, 0), ++ maChkToggleAll(this, 0), ++ maBtnSelectSingle (this, 0), ++ maBtnUnselectSingle(this, 0), ++ maBtnOk(this), ++ maBtnCancel(this), ++ mnCurTabStop(0), ++ mpExtendedData(NULL), ++ mpOKAction(NULL), ++ maWndSize(160, 330), ++ mePrevToggleAllState(STATE_DONTKNOW) ++{ ++ maTabStopCtrls.reserve(7); ++ maTabStopCtrls.push_back(this); ++ maTabStopCtrls.push_back(&maChecks); ++ maTabStopCtrls.push_back(&maChkToggleAll); ++ maTabStopCtrls.push_back(&maBtnSelectSingle); ++ maTabStopCtrls.push_back(&maBtnUnselectSingle); ++ maTabStopCtrls.push_back(&maBtnOk); ++ maTabStopCtrls.push_back(&maBtnCancel); ++ ++ const StyleSettings& rStyle = GetSettings().GetStyleSettings(); ++ ++ Point aPos; ++ Size aSize; ++ getSectionPosSize(aPos, aSize, WHOLE); ++ SetOutputSizePixel(aSize); ++ Size aOutSize = GetOutputSizePixel(); ++ ++ getSectionPosSize(aPos, aSize, BTN_OK); ++ maBtnOk.SetPosSizePixel(aPos, aSize); ++ maBtnOk.SetFont(getLabelFont()); ++ maBtnOk.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); ++ maBtnOk.Show(); ++ ++ getSectionPosSize(aPos, aSize, BTN_CANCEL); ++ maBtnCancel.SetPosSizePixel(aPos, aSize); ++ maBtnCancel.SetFont(getLabelFont()); ++ maBtnCancel.Show(); ++ ++ getSectionPosSize(aPos, aSize, LISTBOX_AREA_INNER); ++ maChecks.SetPosSizePixel(aPos, aSize); ++ maChecks.SetFont(getLabelFont()); ++ maChecks.SetCheckButtonHdl( LINK(this, ScDPFieldPopupWindow, CheckHdl) ); ++ maChecks.Show(); ++ ++ getSectionPosSize(aPos, aSize, CHECK_TOGGLE_ALL); ++ maChkToggleAll.SetPosSizePixel(aPos, aSize); ++ maChkToggleAll.SetFont(getLabelFont()); ++ maChkToggleAll.SetText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_TOGGLE_ALL).GetString()); ++ maChkToggleAll.SetControlBackground(rStyle.GetMenuColor()); ++ maChkToggleAll.SetClickHdl( LINK(this, ScDPFieldPopupWindow, TriStateHdl) ); ++ maChkToggleAll.Show(); ++ ++ getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT); ++ maBtnSelectSingle.SetPosSizePixel(aPos, aSize); ++ maBtnSelectSingle.SetQuickHelpText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_SELECT_CURRENT).GetString()); ++ maBtnSelectSingle.SetModeImage(Image(ScResId(RID_IMG_SELECT_CURRENT)), BMP_COLOR_NORMAL); ++ maBtnSelectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); ++ maBtnSelectSingle.Show(); ++ ++ getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT); ++ maBtnUnselectSingle.SetPosSizePixel(aPos, aSize); ++ maBtnUnselectSingle.SetQuickHelpText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_UNSELECT_CURRENT).GetString()); ++ maBtnUnselectSingle.SetModeImage(Image(ScResId(RID_IMG_UNSELECT_CURRENT)), BMP_COLOR_NORMAL); ++ maBtnUnselectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); ++ maBtnUnselectSingle.Show(); ++} ++ ++ScDPFieldPopupWindow::~ScDPFieldPopupWindow() ++{ ++} ++ ++void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const ++{ ++ // constant parameters. ++ const sal_uInt16 nListBoxMargin = 5; // horizontal distance from the side of the dialog to the listbox border. ++ const sal_uInt16 nListBoxInnerPadding = 5; ++ const sal_uInt16 nTopMargin = 5; ++ const sal_uInt16 nMenuHeight = 60; ++ const sal_uInt16 nSingleItemBtnAreaHeight = 32; // height of the middle area below the list box where the single-action buttons are. ++ const sal_uInt16 nBottomBtnAreaHeight = 50; // height of the bottom area where the OK and Cancel buttons are. ++ const sal_uInt16 nBtnWidth = 60; ++ const sal_uInt16 nLabelHeight = getLabelFont().GetHeight(); ++ const sal_uInt16 nBtnHeight = nLabelHeight*2; ++ const sal_uInt16 nBottomMargin = 10; ++ const sal_uInt16 nMenuListMargin = 20; ++ ++ // parameters calculated from constants. ++ const sal_uInt16 nListBoxWidth = maWndSize.Width() - nListBoxMargin*2; ++ const sal_uInt16 nListBoxHeight = maWndSize.Height() - nTopMargin - nMenuHeight - ++ nMenuListMargin - nSingleItemBtnAreaHeight - nBottomBtnAreaHeight; ++ ++ const sal_uInt16 nSingleBtnAreaY = nTopMargin + nMenuHeight + nListBoxHeight + nMenuListMargin - 1; ++ ++ switch (eType) ++ { ++ case WHOLE: ++ { ++ rPos = Point(0, 0); ++ rSize = maWndSize; ++ } ++ break; ++ case LISTBOX_AREA_OUTER: ++ { ++ rPos = Point(nListBoxMargin, nTopMargin + nMenuHeight + nMenuListMargin); ++ rSize = Size(nListBoxWidth, nListBoxHeight); ++ } ++ break; ++ case LISTBOX_AREA_INNER: ++ { ++ rPos = Point(nListBoxMargin, nTopMargin + nMenuHeight + nMenuListMargin); ++ rPos.X() += nListBoxInnerPadding; ++ rPos.Y() += nListBoxInnerPadding; ++ ++ rSize = Size(nListBoxWidth, nListBoxHeight); ++ rSize.Width() -= nListBoxInnerPadding*2; ++ rSize.Height() -= nListBoxInnerPadding*2; ++ } ++ break; ++ case SINGLE_BTN_AREA: ++ { ++ rPos = Point(nListBoxMargin, nSingleBtnAreaY); ++ rSize = Size(nListBoxWidth, nSingleItemBtnAreaHeight); ++ } ++ break; ++ case CHECK_TOGGLE_ALL: ++ { ++ long h = nLabelHeight*3/2; // check box height is heuristically 150% of the text height. ++ rPos = Point(nListBoxMargin, nSingleBtnAreaY); ++ rPos.X() += 5; ++ rPos.Y() += (nSingleItemBtnAreaHeight - h)/2; ++ rSize = Size(70, h); ++ } ++ break; ++ case BTN_SINGLE_SELECT: ++ { ++ long h = 26; ++ rPos = Point(nListBoxMargin, nSingleBtnAreaY); ++ rPos.X() += 75; ++ rPos.Y() += (nSingleItemBtnAreaHeight - h)/2; ++ rSize = Size(h, h); ++ } ++ break; ++ case BTN_SINGLE_UNSELECT: ++ { ++ long h = 26; ++ rPos = Point(nListBoxMargin, nSingleBtnAreaY); ++ rPos.X() += 75 + h + 10; ++ rPos.Y() += (nSingleItemBtnAreaHeight - h)/2; ++ rSize = Size(h, h); ++ } ++ break; ++ case BTN_OK: ++ { ++ long x = (maWndSize.Width() - nBtnWidth*2)/3; ++ long y = maWndSize.Height() - nBottomMargin - nBtnHeight; ++ rPos = Point(x, y); ++ rSize = Size(nBtnWidth, nBtnHeight); ++ } ++ break; ++ case BTN_CANCEL: ++ { ++ long x = (maWndSize.Width() - nBtnWidth*2)/3*2 + nBtnWidth; ++ long y = maWndSize.Height() - nBottomMargin - nBtnHeight; ++ rPos = Point(x, y); ++ rSize = Size(nBtnWidth, nBtnHeight); ++ } ++ break; ++ default: ++ ; ++ } ++} ++ ++void ScDPFieldPopupWindow::setAllMemberState(bool bSet) ++{ ++ size_t n = maMembers.size(); ++ for (size_t i = 0; i < n; ++i) ++ maChecks.CheckEntryPos(i, bSet); ++} ++ ++void ScDPFieldPopupWindow::selectCurrentMemberOnly(bool bSet) ++{ ++ setAllMemberState(!bSet); ++ sal_uInt16 nSelected = maChecks.GetSelectEntryPos(); ++ maChecks.CheckEntryPos(nSelected, bSet); ++} ++ ++void ScDPFieldPopupWindow::cycleFocus(bool bReverse) ++{ ++ maTabStopCtrls[mnCurTabStop]->SetFakeFocus(false); ++ maTabStopCtrls[mnCurTabStop]->LoseFocus(); ++ if (mnCurTabStop == 0) ++ clearSelectedMenuItem(); ++ ++ if (bReverse) ++ { ++ if (mnCurTabStop > 0) ++ --mnCurTabStop; ++ else ++ mnCurTabStop = maTabStopCtrls.size() - 1; ++ } ++ else ++ { ++ ++mnCurTabStop; ++ if (mnCurTabStop >= maTabStopCtrls.size()) ++ mnCurTabStop = 0; ++ } ++ maTabStopCtrls[mnCurTabStop]->SetFakeFocus(true); ++ maTabStopCtrls[mnCurTabStop]->GrabFocus(); ++} ++ ++IMPL_LINK( ScDPFieldPopupWindow, ButtonHdl, Button*, pBtn ) ++{ ++ if (pBtn == &maBtnOk) ++ close(true); ++ else if (pBtn == &maBtnSelectSingle) ++ { ++ selectCurrentMemberOnly(true); ++ CheckHdl(&maChecks); ++ } ++ else if (pBtn == &maBtnUnselectSingle) ++ { ++ selectCurrentMemberOnly(false); ++ CheckHdl(&maChecks); ++ } ++ return 0; ++} ++ ++IMPL_LINK( ScDPFieldPopupWindow, TriStateHdl, TriStateBox*, EMPTYARG ) ++{ ++ switch (mePrevToggleAllState) ++ { ++ case STATE_NOCHECK: ++ maChkToggleAll.SetState(STATE_CHECK); ++ setAllMemberState(true); ++ break; ++ case STATE_CHECK: ++ maChkToggleAll.SetState(STATE_NOCHECK); ++ setAllMemberState(false); ++ break; ++ case STATE_DONTKNOW: ++ default: ++ maChkToggleAll.SetState(STATE_CHECK); ++ setAllMemberState(true); ++ break; ++ } ++ ++ mePrevToggleAllState = maChkToggleAll.GetState(); ++ return 0; ++} ++ ++IMPL_LINK( ScDPFieldPopupWindow, CheckHdl, SvTreeListBox*, pChecks ) ++{ ++ if (pChecks != &maChecks) ++ return 0; ++ ++ size_t nNumChecked = maChecks.GetCheckedEntryCount(); ++ if (nNumChecked == maMembers.size()) ++ // all members visible ++ maChkToggleAll.SetState(STATE_CHECK); ++ else if (nNumChecked == 0) ++ // no members visible ++ maChkToggleAll.SetState(STATE_NOCHECK); ++ else ++ maChkToggleAll.SetState(STATE_DONTKNOW); ++ ++ mePrevToggleAllState = maChkToggleAll.GetState(); ++ return 0; ++} ++ ++void ScDPFieldPopupWindow::MouseMove(const MouseEvent& rMEvt) ++{ ++ ScMenuFloatingWindow::MouseMove(rMEvt); ++ ++ size_t nSelectedMenu = getSelectedMenuItem(); ++ if (nSelectedMenu == MENU_NOT_SELECTED) ++ queueCloseSubMenu(); ++} ++ ++long ScDPFieldPopupWindow::Notify(NotifyEvent& rNEvt) ++{ ++ switch (rNEvt.GetType()) ++ { ++ case EVENT_KEYUP: ++ { ++ const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); ++ const KeyCode& rCode = pKeyEvent->GetKeyCode(); ++ bool bShift = rCode.IsShift(); ++ if (rCode.GetCode() == KEY_TAB) ++ { ++ cycleFocus(bShift); ++ return true; ++ } ++ } ++ break; ++ } ++ return ScMenuFloatingWindow::Notify(rNEvt); ++} ++ ++void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) ++{ ++ ScMenuFloatingWindow::Paint(rRect); ++ ++ const StyleSettings& rStyle = GetSettings().GetStyleSettings(); ++ Color aMemberBackColor = rStyle.GetFieldColor(); ++ Color aBorderColor = rStyle.GetShadowColor(); ++ ++ Point aPos; ++ Size aSize; ++ getSectionPosSize(aPos, aSize, LISTBOX_AREA_OUTER); ++ ++ // Member list box background ++ SetFillColor(aMemberBackColor); ++ SetLineColor(aBorderColor); ++ DrawRect(Rectangle(aPos,aSize)); ++ ++ // Single-action button box ++ getSectionPosSize(aPos, aSize, SINGLE_BTN_AREA); ++ SetFillColor(rStyle.GetMenuColor()); ++ DrawRect(Rectangle(aPos,aSize)); ++} ++ ++Window* ScDPFieldPopupWindow::GetPreferredKeyInputWindow() ++{ ++ return maTabStopCtrls[mnCurTabStop]; ++} ++ ++Reference ScDPFieldPopupWindow::CreateAccessible() ++{ ++ if (!mxAccessible.is()) ++ { ++ mxAccessible.set(new ScAccessibleFilterTopWindow( ++ GetAccessibleParentWindow()->GetAccessible(), this, getName(), getDoc())); ++ ScAccessibleFilterTopWindow* pAccTop = static_cast(mxAccessible.get()); ++ fillMenuItemsToAccessible(pAccTop); ++ ++ pAccTop->setAccessibleChild( ++ maChecks.CreateAccessible(), ScAccessibleFilterTopWindow::LISTBOX); ++ pAccTop->setAccessibleChild( ++ maChkToggleAll.CreateAccessible(), ScAccessibleFilterTopWindow::TOGGLE_ALL); ++ pAccTop->setAccessibleChild( ++ maBtnSelectSingle.CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_ON_BTN); ++ pAccTop->setAccessibleChild( ++ maBtnUnselectSingle.CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_OFF_BTN); ++ pAccTop->setAccessibleChild( ++ maBtnOk.CreateAccessible(), ScAccessibleFilterTopWindow::OK_BTN); ++ pAccTop->setAccessibleChild( ++ maBtnCancel.CreateAccessible(), ScAccessibleFilterTopWindow::CANCEL_BTN); ++ } ++ ++ return mxAccessible; ++} ++ ++void ScDPFieldPopupWindow::setMemberSize(size_t n) ++{ ++ maMembers.reserve(n); ++} ++ ++void ScDPFieldPopupWindow::addMember(const OUString& rName, bool bVisible) ++{ ++ Member aMember; ++ aMember.maName = rName; ++ aMember.mbVisible = bVisible; ++ maMembers.push_back(aMember); ++} ++ ++void ScDPFieldPopupWindow::initMembers() ++{ ++ size_t n = maMembers.size(); ++ size_t nVisMemCount = 0; ++ for (size_t i = 0; i < n; ++i) ++ { ++ maChecks.InsertEntry(maMembers[i].maName); ++ maChecks.CheckEntryPos(i, maMembers[i].mbVisible); ++ if (maMembers[i].mbVisible) ++ ++nVisMemCount; ++ } ++ if (nVisMemCount == n) ++ { ++ // all members visible ++ maChkToggleAll.SetState(STATE_CHECK); ++ mePrevToggleAllState = STATE_CHECK; ++ } ++ else if (nVisMemCount == 0) ++ { ++ // no members visible ++ maChkToggleAll.SetState(STATE_NOCHECK); ++ mePrevToggleAllState = STATE_NOCHECK; ++ } ++ else ++ { ++ maChkToggleAll.SetState(STATE_DONTKNOW); ++ mePrevToggleAllState = STATE_DONTKNOW; ++ } ++} ++ ++const Size& ScDPFieldPopupWindow::getWindowSize() const ++{ ++ return maWndSize; ++} ++ ++void ScDPFieldPopupWindow::getResult(hash_map& rResult) ++{ ++ typedef hash_map ResultMap; ++ ResultMap aResult; ++ size_t n = maMembers.size(); ++ for (size_t i = 0; i < n; ++i) ++ { ++ bool bState = maChecks.IsChecked(i); ++ aResult.insert(ResultMap::value_type(maMembers[i].maName, bState)); ++ } ++ rResult.swap(aResult); ++} ++ ++void ScDPFieldPopupWindow::close(bool bOK) ++{ ++ if (bOK && mpOKAction.get()) ++ mpOKAction->execute(); ++ ++ EndPopupMode(); ++} ++ ++void ScDPFieldPopupWindow::setExtendedData(ExtendedData* p) ++{ ++ mpExtendedData.reset(p); ++} ++ ++ScDPFieldPopupWindow::ExtendedData* ScDPFieldPopupWindow::getExtendedData() ++{ ++ return mpExtendedData.get(); ++} ++ ++void ScDPFieldPopupWindow::setOKAction(Action* p) ++{ ++ mpOKAction.reset(p); ++} ++ +diff --git sc/source/ui/cctrl/dpcontrol.src sc/source/ui/cctrl/dpcontrol.src +new file mode 100644 +index 0000000..31cbb62 +--- /dev/null ++++ sc/source/ui/cctrl/dpcontrol.src +@@ -0,0 +1,82 @@ ++/************************************************************************* ++ * ++ * 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: globstr.src,v $ ++ * $Revision: 1.74.96.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#include "dpcontrol.hrc" ++ ++Resource RID_POPUP_FILTER ++{ ++ String STR_MENU_SORT_ASC ++ { ++ Text [ en-US ] = "Sort Ascending" ; ++ }; ++ ++ String STR_MENU_SORT_DESC ++ { ++ Text [ en-US ] = "Sort Descending" ; ++ }; ++ ++ String STR_MENU_SORT_CUSTOM ++ { ++ Text [ en-US ] = "Custom Sort" ; ++ }; ++ ++ String STR_BTN_TOGGLE_ALL ++ { ++ Text [ en-US ] = "All" ; ++ }; ++ ++ String STR_BTN_SELECT_CURRENT ++ { ++ Text [ en-US ] = "Show only the current item." ; ++ }; ++ ++ String STR_BTN_UNSELECT_CURRENT ++ { ++ Text [ en-US ] = "Hide only the current item." ; ++ }; ++}; ++ ++Image RID_IMG_SELECT_CURRENT ++{ ++ ImageBitmap = Bitmap ++ { ++ File = "popup_select_current.png"; ++ }; ++ MaskColor = STD_MASKCOLOR; ++}; ++ ++Image RID_IMG_UNSELECT_CURRENT ++{ ++ ImageBitmap = Bitmap ++ { ++ File = "popup_unselect_current.png"; ++ }; ++ MaskColor = STD_MASKCOLOR; ++}; +diff --git sc/source/ui/cctrl/makefile.mk sc/source/ui/cctrl/makefile.mk +index e7b96af..43ff4bd 100644 +--- sc/source/ui/cctrl/makefile.mk ++++ sc/source/ui/cctrl/makefile.mk +@@ -45,22 +45,30 @@ LIBTARGET=NO + # --- Files -------------------------------------------------------- + + EXCEPTIONSFILES= \ +- $(SLO)$/tbzoomsliderctrl.obj ++ $(SLO)$/tbzoomsliderctrl.obj \ ++ $(SLO)$/dpcontrol.obj + + SLOFILES = \ + $(SLO)$/popmenu.obj \ + $(SLO)$/tbinsert.obj \ + $(SLO)$/cbuttonw.obj \ ++ $(SLO)$/dpcontrol.obj \ + $(SLO)$/editfield.obj \ + $(EXCEPTIONSFILES) + ++SRS1NAME=$(TARGET) ++SRC1FILES = \ ++ dpcontrol.src ++ + LIB1TARGET=$(SLB)$/$(TARGET).lib + LIB1OBJFILES= \ + $(SLO)$/popmenu.obj \ + $(SLO)$/tbinsert.obj \ + $(SLO)$/cbuttonw.obj \ ++ $(SLO)$/dpcontrol.obj \ + $(SLO)$/tbzoomsliderctrl.obj + ++ + # --- Tagets ------------------------------------------------------- + + .INCLUDE : target.mk +diff --git sc/source/ui/dbgui/pvfundlg.cxx sc/source/ui/dbgui/pvfundlg.cxx +index 08a5e03..ec140d8 100644 +--- sc/source/ui/dbgui/pvfundlg.cxx ++++ sc/source/ui/dbgui/pvfundlg.cxx +@@ -48,12 +48,15 @@ + #include "pvfundlg.hrc" + #include "globstr.hrc" + ++#include ++ + // ============================================================================ + + using namespace ::com::sun::star::sheet; + + using ::rtl::OUString; + using ::com::sun::star::uno::Sequence; ++using ::std::vector; + + // ============================================================================ + +@@ -86,6 +89,25 @@ bool lclFillListBox( ListBoxType& rLBox, const Sequence< OUString >& rStrings, U + return bEmpty; + } + ++template< typename ListBoxType > ++bool lclFillListBox( ListBoxType& rLBox, const vector& rMembers, USHORT nEmptyPos = LISTBOX_APPEND ) ++{ ++ bool bEmpty = false; ++ vector::const_iterator itr = rMembers.begin(), itrEnd = rMembers.end(); ++ for (; itr != itrEnd; ++itr) ++ { ++ OUString aName = itr->getDisplayName(); ++ if (aName.getLength()) ++ rLBox.InsertEntry(aName); ++ else ++ { ++ rLBox.InsertEntry(ScGlobal::GetRscString(STR_EMPTYDATA), nEmptyPos); ++ bEmpty = true; ++ } ++ } ++ return bEmpty; ++} ++ + /** Searches for a listbox entry, starts search at specified position. */ + USHORT lclFindListBoxEntry( const ListBox& rLBox, const String& rEntry, USHORT nStartPos ) + { +@@ -253,7 +275,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& + maLbFunc.SetSelection( nFuncMask ); + + // field name +- maFtName.SetText( rLabelData.maName ); ++ maFtName.SetText(rLabelData.getDisplayName()); + + // "More button" controls + maBtnMore.AddWindow( &maFlDisplay ); +@@ -271,7 +293,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& + + // base field list box + for( ScDPLabelDataVec::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt ) +- maLbBaseField.InsertEntry( aIt->maName ); ++ maLbBaseField.InsertEntry(aIt->getDisplayName()); + + // base item list box + maLbBaseItem.SetSeparatorPos( SC_BASEITEM_USER_POS - 1 ); +@@ -414,8 +436,6 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const + rLabelData.mnUsedHier = maLabelData.mnUsedHier; + rLabelData.mbShowAll = maCbShowAll.IsChecked(); + rLabelData.maMembers = maLabelData.maMembers; +- rLabelData.maVisible = maLabelData.maVisible; +- rLabelData.maShowDet = maLabelData.maShowDet; + rLabelData.maSortInfo = maLabelData.maSortInfo; + rLabelData.maLayoutInfo = maLabelData.maLayoutInfo; + rLabelData.maShowInfo = maLabelData.maShowInfo; +@@ -424,7 +444,7 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const + void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ) + { + // field name +- maFtName.SetText( rLabelData.maName ); ++ maFtName.SetText(rLabelData.getDisplayName()); + + // radio buttons + maRbNone.SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); +@@ -547,9 +567,8 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const + + rLabelData.maMembers = maLabelData.maMembers; + ULONG nVisCount = maLbHide.GetEntryCount(); +- rLabelData.maVisible.realloc( nVisCount ); + for( USHORT nPos = 0; nPos < nVisCount; ++nPos ) +- rLabelData.maVisible[ nPos ] = !maLbHide.IsChecked( nPos ); ++ rLabelData.maMembers[nPos].mbVisible = !maLbHide.IsChecked(nPos); + + // *** HIERARCHY *** + +@@ -563,7 +582,8 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou + sal_Int32 nSortMode = maLabelData.maSortInfo.Mode; + + // sort fields list box +- maLbSortBy.InsertEntry( maLabelData.maName ); ++ maLbSortBy.InsertEntry(maLabelData.getDisplayName()); ++ + for( ScDPNameVec::const_iterator aIt = rDataFields.begin(), aEnd = rDataFields.end(); aIt != aEnd; ++aIt ) + { + maLbSortBy.InsertEntry( *aIt ); +@@ -656,8 +676,9 @@ void ScDPSubtotalOptDlg::InitHideListBox() + { + maLbHide.Clear(); + lclFillListBox( maLbHide, maLabelData.maMembers ); +- for( sal_Int32 nVisIdx = 0, nVisSize = maLabelData.maVisible.getLength(); nVisIdx < nVisSize; ++nVisIdx ) +- maLbHide.CheckEntryPos( static_cast< USHORT >( nVisIdx ), !maLabelData.maVisible[ nVisIdx ] ); ++ size_t n = maLabelData.maMembers.size(); ++ for (size_t i = 0; i < n; ++i) ++ maLbHide.CheckEntryPos(static_cast(i), !maLabelData.maMembers[i].mbVisible); + bool bEnable = maLbHide.GetEntryCount() > 0; + maFlHide.Enable( bEnable ); + maLbHide.Enable( bEnable ); +@@ -690,8 +711,7 @@ IMPL_LINK( ScDPSubtotalOptDlg, SelectHdl, ListBox*, pLBox ) + { + if( pLBox == &maLbHierarchy ) + { +- mrDPObj.GetMembers( maLabelData.mnCol, maLbHierarchy.GetSelectEntryPos(), +- maLabelData.maMembers, &maLabelData.maVisible, &maLabelData.maShowDet ); ++ mrDPObj.GetMembers(maLabelData.mnCol, maLbHierarchy.GetSelectEntryPos(), maLabelData.maMembers); + InitHideListBox(); + } + return 0; +@@ -705,7 +725,9 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR + maLbDims ( this, ScResId( LB_DIMS ) ), + maBtnOk ( this, ScResId( BTN_OK ) ), + maBtnCancel ( this, ScResId( BTN_CANCEL ) ), +- maBtnHelp ( this, ScResId( BTN_HELP ) ) ++ maBtnHelp ( this, ScResId( BTN_HELP ) ), ++ ++ mrDPObj(rDPObj) + { + FreeResource(); + +@@ -719,7 +741,13 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR + { + const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : 0; + if ( !pDimension || (pDimension->GetOrientation() != nOrient) ) ++ { ++ const OUString* pLayoutName = pDimension->GetLayoutName(); ++ if (pLayoutName) ++ aName = *pLayoutName; + maLbDims.InsertEntry( aName ); ++ maNameIndexMap.insert(DimNameIndexMap::value_type(aName, nDim)); ++ } + } + } + if( maLbDims.GetEntryCount() ) +@@ -735,7 +763,17 @@ short ScDPShowDetailDlg::Execute() + + String ScDPShowDetailDlg::GetDimensionName() const + { +- return maLbDims.GetSelectEntry(); ++ // Look up the internal dimension name which may be different from the ++ // displayed field name. ++ String aSelectedName = maLbDims.GetSelectEntry(); ++ DimNameIndexMap::const_iterator itr = maNameIndexMap.find(aSelectedName); ++ if (itr == maNameIndexMap.end()) ++ // This should never happen! ++ return aSelectedName; ++ ++ long nDim = itr->second; ++ BOOL bIsDataLayout = false; ++ return mrDPObj.GetDimName(nDim, bIsDataLayout); + } + + IMPL_LINK( ScDPShowDetailDlg, DblClickHdl, ListBox*, pLBox ) +diff --git sc/source/ui/dbgui/pvlaydlg.cxx sc/source/ui/dbgui/pvlaydlg.cxx +index 21b2706..7392386 100644 +--- sc/source/ui/dbgui/pvlaydlg.cxx ++++ sc/source/ui/dbgui/pvlaydlg.cxx +@@ -63,6 +63,8 @@ + #include "sc.hrc" //CHINA001 + #include "scabstdlg.hxx" //CHINA001 + using namespace com::sun::star; ++using ::rtl::OUString; ++using ::std::vector; + + //---------------------------------------------------------------------------- + +@@ -378,24 +380,23 @@ void ScDPLayoutDlg::StateChanged( StateChangedType nStateChange ) + + //---------------------------------------------------------------------------- + +-void ScDPLayoutDlg::InitWndSelect( LabelData** ppLabelArr, long nLabels ) ++void ScDPLayoutDlg::InitWndSelect( const vector& rLabels ) + { +- if ( ppLabelArr ) ++ size_t nLabelCount = rLabels.size(); ++ if (nLabelCount > MAX_LABELS) ++ nLabelCount = MAX_LABELS; ++ size_t nLast = (nLabelCount > PAGE_SIZE) ? (PAGE_SIZE - 1) : (nLabelCount - 1); ++ ++ aLabelDataArr.clear(); ++ aLabelDataArr.reserve( nLabelCount ); ++ for ( size_t i=0; i < nLabelCount; i++ ) + { +- size_t nLabelCount = static_cast< size_t >( (nLabels > MAX_LABELS) ? MAX_LABELS : nLabels ); +- size_t nLast = (nLabelCount > PAGE_SIZE) ? (PAGE_SIZE - 1) : (nLabelCount - 1); ++ aLabelDataArr.push_back(*rLabels[i]); + +- aLabelDataArr.clear(); +- aLabelDataArr.reserve( nLabelCount ); +- for ( size_t i=0; i < nLabelCount; i++ ) ++ if ( i <= nLast ) + { +- aLabelDataArr.push_back( *ppLabelArr[i] ); +- +- if ( i <= nLast ) +- { +- aWndSelect.AddField( aLabelDataArr[i].maName, i ); +- aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) ); +- } ++ aWndSelect.AddField(aLabelDataArr[i].getDisplayName(), i); ++ aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) ); + } + } + } +@@ -493,18 +494,19 @@ void ScDPLayoutDlg::InitFocus() + + void ScDPLayoutDlg::InitFields() + { +- InitWndSelect( thePivotData.ppLabelArr, static_cast(thePivotData.nLabels) ); ++ InitWndSelect(thePivotData.maLabelArray); + InitWnd( thePivotData.aPageArr, static_cast(thePivotData.nPageCount), TYPE_PAGE ); + InitWnd( thePivotData.aColArr, static_cast(thePivotData.nColCount), TYPE_COL ); + InitWnd( thePivotData.aRowArr, static_cast(thePivotData.nRowCount), TYPE_ROW ); + InitWnd( thePivotData.aDataArr, static_cast(thePivotData.nDataCount), TYPE_DATA ); + ++ size_t nLabels = thePivotData.maLabelArray.size(); + aSlider.SetPageSize( PAGE_SIZE ); + aSlider.SetVisibleSize( PAGE_SIZE ); + aSlider.SetLineSize( LINE_SIZE ); +- aSlider.SetRange( Range( 0, static_cast(((thePivotData.nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) ); ++ aSlider.SetRange( Range( 0, static_cast(((nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) ); + +- if ( thePivotData.nLabels > PAGE_SIZE ) ++ if ( nLabels > PAGE_SIZE ) + { + aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) ); + aSlider.Show(); +@@ -594,7 +596,7 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po + + if ( !bDataArr ) + { +- if ( toWnd->AddField( rData.maName, ++ if ( toWnd->AddField( rData.getDisplayName(), + DlgPos2WndPos( rAtPos, *toWnd ), + nAddedAt ) ) + { +@@ -605,9 +607,9 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po + else + { + USHORT nMask = fData.mnFuncMask; +- String aStr( GetFuncString( nMask, rData.mbIsValue ) ); +- +- aStr += rData.maName; ++ OUString aStr = GetFuncString( nMask, rData.mbIsValue ); ++ ++ aStr += rData.getDisplayName(); + + if ( toWnd->AddField( aStr, + DlgPos2WndPos( rAtPos, *toWnd ), +@@ -1215,7 +1217,7 @@ String ScDPLayoutDlg::GetLabelString( SCsCOL nCol ) + ScDPLabelData* pData = GetLabelData( nCol ); + DBG_ASSERT( pData, "LabelData not found" ); + if (pData) +- return pData->maName; ++ return pData->getDisplayName(); + return String(); + } + +@@ -1491,6 +1493,8 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) + nPageCount, nColCount, nRowCount, nDataCount ); + if ( bFit ) + { ++ ScDPSaveData* pOldSaveData = xDlgDPObject->GetSaveData(); ++ + ScRange aOutRange( aAdrDest ); // bToNewTable is passed separately + + ScDPSaveData aSaveData; +@@ -1522,31 +1526,63 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) + pDim->SetSortInfo( &aIt->maSortInfo ); + pDim->SetLayoutInfo( &aIt->maLayoutInfo ); + pDim->SetAutoShowInfo( &aIt->maShowInfo ); ++ ScDPSaveDimension* pOldDim = NULL; ++ if (pOldSaveData) ++ { ++ // Transfer the existing layout names to new dimension instance. ++ pOldDim = pOldSaveData->GetExistingDimensionByName(aIt->maName); ++ if (pOldDim) ++ { ++ const OUString* pLayoutName = pOldDim->GetLayoutName(); ++ if (pLayoutName) ++ pDim->SetLayoutName(*pLayoutName); ++ ++ const OUString* pSubtotalName = pOldDim->GetSubtotalName(); ++ if (pSubtotalName) ++ pDim->SetSubtotalName(*pSubtotalName); ++ } ++ } + + bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL ); + + // visibility of members +- if( const rtl::OUString* pItem = aIt->maMembers.getConstArray() ) ++ for (vector::const_iterator itr = aIt->maMembers.begin(), itrEnd = aIt->maMembers.end(); ++ itr != itrEnd; ++itr) + { +- sal_Int32 nIdx = 0; +- sal_Int32 nVisSize = aIt->maVisible.getLength(); +- sal_Int32 nShowSize = aIt->maShowDet.getLength(); +- for( const rtl::OUString* pEnd = pItem + aIt->maMembers.getLength(); pItem != pEnd; ++pItem, ++nIdx ) ++ ScDPSaveMember* pMember = pDim->GetMemberByName(itr->maName); ++ ++ // #i40054# create/access members only if flags are not default ++ // (or in manual sorting mode - to keep the order) ++ if (bManualSort || !itr->mbVisible || !itr->mbShowDetails) ++ { ++ pMember->SetIsVisible(itr->mbVisible); ++ pMember->SetShowDetails(itr->mbShowDetails); ++ } ++ if (pOldDim) + { +- // #i40054# create/access members only if flags are not default +- // (or in manual sorting mode - to keep the order) +- bool bIsVisible = (nIdx >= nVisSize) || aIt->maVisible[ nIdx ]; +- bool bShowDetails = (nIdx >= nShowSize) || aIt->maShowDet[ nIdx ]; +- if( bManualSort || !bIsVisible || !bShowDetails ) ++ // Transfer the existing layout name. ++ ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(itr->maName); ++ if (pOldMember) + { +- ScDPSaveMember* pMember = pDim->GetMemberByName( *pItem ); +- pMember->SetIsVisible( bIsVisible ); +- pMember->SetShowDetails( bShowDetails ); ++ const OUString* pLayoutName = pOldMember->GetLayoutName(); ++ if (pLayoutName) ++ pMember->SetLayoutName(*pLayoutName); + } + } + } + } + } ++ ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension(); ++ if (pDim && pOldSaveData) ++ { ++ ScDPSaveDimension* pOldDim = pOldSaveData->GetDataLayoutDimension(); ++ if (pOldDim) ++ { ++ const OUString* pLayoutName = pOldDim->GetLayoutName(); ++ if (pLayoutName) ++ pDim->SetLayoutName(*pLayoutName); ++ } ++ } + + USHORT nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE ); + ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable ); +@@ -1720,7 +1756,7 @@ IMPL_LINK( ScDPLayoutDlg, ScrollHdl, ScrollBar *, EMPTYARG ) + for ( i=0; iGetDPCollection()->Free( pOldObj ); // object is deleted here ++ pDoc->GetDPCollection()->FreeTable( pOldObj ); // object is deleted here + + rDocShell.PostPaintGridAll(); //! only necessary parts + rDocShell.PostPaint( aRange.aStart.Col(), aRange.aStart.Row(), nTab, +@@ -1278,7 +1278,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb + + pDestObj = new ScDPObject( *pNewObj ); + pDestObj->SetAlive(TRUE); +- if ( !pDoc->GetDPCollection()->Insert(pDestObj) ) ++ if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) ) + { + DBG_ERROR("cannot insert DPObject"); + DELETEZ( pDestObj ); +diff --git sc/source/ui/inc/AccessibleContextBase.hxx sc/source/ui/inc/AccessibleContextBase.hxx +index 5cb0723..fdc378a 100644 +--- sc/source/ui/inc/AccessibleContextBase.hxx ++++ sc/source/ui/inc/AccessibleContextBase.hxx +@@ -319,6 +319,8 @@ protected: + /// Use this method to set initial Description without notification + void SetDescription(const rtl::OUString& rDesc) { msDescription = rDesc; } + ++ void SetRole(sal_Int16 nRole); ++ + /// Reference to the parent object. + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible> mxParent; +diff --git sc/source/ui/inc/dbfunc.hxx sc/source/ui/inc/dbfunc.hxx +index fcdb170..bb43553 100644 +--- sc/source/ui/inc/dbfunc.hxx ++++ sc/source/ui/inc/dbfunc.hxx +@@ -80,7 +80,7 @@ public: + void GotoDBArea( const String& rDBName ); + + // DB-Bereich vom Cursor +- ScDBData* GetDBData( BOOL bMarkArea = TRUE, ScGetDBMode eMode = SC_DB_MAKE ); ++ ScDBData* GetDBData( BOOL bMarkArea = TRUE, ScGetDBMode eMode = SC_DB_MAKE, bool bShrinkToData = false ); + + void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList ); + +@@ -99,6 +99,7 @@ public: + void UngroupDataPilot(); + void DataPilotInput( const ScAddress& rPos, const String& rString ); + ++ bool DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = NULL ); + BOOL DataPilotMove( const ScRange& rSource, const ScAddress& rDest ); + + BOOL HasSelectionForDrillDown( USHORT& rOrientation ); +diff --git sc/source/ui/inc/dpcontrol.hrc sc/source/ui/inc/dpcontrol.hrc +new file mode 100644 +index 0000000..6d21b56 +--- /dev/null ++++ sc/source/ui/inc/dpcontrol.hrc +@@ -0,0 +1,43 @@ ++/************************************************************************* ++ * ++ * 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: protectiondlg.hrc,v $ ++ * $Revision: 1.1.2.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef __DPCONTROL_HRC__ ++#define __DPCONTROL_HRC__ ++ ++#include ++ ++#define STR_MENU_SORT_ASC 1 ++#define STR_MENU_SORT_DESC 2 ++#define STR_MENU_SORT_CUSTOM 3 ++#define STR_BTN_TOGGLE_ALL 4 ++#define STR_BTN_SELECT_CURRENT 5 ++#define STR_BTN_UNSELECT_CURRENT 6 ++ ++#endif +diff --git sc/source/ui/inc/dpcontrol.hxx sc/source/ui/inc/dpcontrol.hxx +new file mode 100644 +index 0000000..2380d5d +--- /dev/null ++++ sc/source/ui/inc/dpcontrol.hxx +@@ -0,0 +1,366 @@ ++/************************************************************************* ++ * ++ * 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: document.hxx,v $ ++ * $Revision: 1.115.36.9 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_DPCONTROL_HXX ++#define SC_DPCONTROL_HXX ++ ++#include "rtl/ustring.hxx" ++#include "tools/gen.hxx" ++#include "tools/fract.hxx" ++#include "vcl/popupmenuwindow.hxx" ++#include "vcl/button.hxx" ++#include "vcl/scrbar.hxx" ++#include "vcl/timer.hxx" ++#include "svx/checklbx.hxx" ++ ++#include ++#include ++#include ++ ++namespace com { namespace sun { namespace star { ++ ++ namespace accessibility { ++ class XAccessible; ++ } ++ ++}}} ++ ++class OutputDevice; ++class Point; ++class Size; ++class StyleSettings; ++class Window; ++class ScDocument; ++class ScAccessibleFilterMenu; ++ ++/** ++ * This class takes care of physically drawing field button controls inside ++ * data pilot tables. ++ */ ++class ScDPFieldButton ++{ ++public: ++ ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX = NULL, const Fraction* pZoomY = NULL); ++ ~ScDPFieldButton(); ++ ++ void setText(const ::rtl::OUString& rText); ++ void setBoundingBox(const Point& rPos, const Size& rSize); ++ void setDrawBaseButton(bool b); ++ void setDrawPopupButton(bool b); ++ void setHasHiddenMember(bool b); ++ void setPopupPressed(bool b); ++ void draw(); ++ ++ void getPopupBoundingBox(Point& rPos, Size& rSize) const; ++ bool isPopupButton() const; ++ ++private: ++ void drawPopupButton(); ++ ++private: ++ Point maPos; ++ Size maSize; ++ ::rtl::OUString maText; ++ Fraction maZoomX; ++ Fraction maZoomY; ++ OutputDevice* mpOutDev; ++ const StyleSettings* mpStyle; ++ bool mbBaseButton; ++ bool mbPopupButton; ++ bool mbHasHiddenMember; ++ bool mbPopupPressed; ++}; ++ ++// ============================================================================ ++ ++class ScMenuFloatingWindow : public PopupMenuFloatingWindow ++{ ++public: ++ static size_t MENU_NOT_SELECTED; ++ /** ++ * Action to perform when an event takes place. Create a sub-class of ++ * this to implement the desired action. ++ */ ++ class Action ++ { ++ public: ++ virtual void execute() = 0; ++ }; ++ ++ explicit ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel = 0); ++ virtual ~ScMenuFloatingWindow(); ++ ++ virtual void MouseMove(const MouseEvent& rMEvt); ++ virtual void MouseButtonDown(const MouseEvent& rMEvt); ++ virtual void MouseButtonUp(const MouseEvent& rMEvt); ++ virtual void KeyInput(const KeyEvent& rKEvt); ++ virtual void Paint(const Rectangle& rRect); ++ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); ++ ++ void addMenuItem(const ::rtl::OUString& rText, bool bEnabled, Action* pAction); ++ ScMenuFloatingWindow* addSubMenuItem(const ::rtl::OUString& rText, bool bEnabled); ++ void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bEnsureSubMenu); ++ void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer); ++ void clearSelectedMenuItem(); ++ ScMenuFloatingWindow* getSubMenuWindow(size_t nPos) const; ++ size_t getMenuItemCount() const; ++ ::rtl::OUString getMenuItemName(size_t nPos) const; ++ bool isMenuItemEnabled(size_t nPos) const; ++ bool isMenuItemSelected(size_t nPos) const; ++ size_t getSelectedMenuItem() const; ++ ++ void setName(const ::rtl::OUString& rName); ++ const ::rtl::OUString& getName() const; ++ ++ void executeMenuItem(size_t nPos); ++ void getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const; ++ ScMenuFloatingWindow* getParentMenuWindow() const; ++ ++protected: ++ ++ void drawMenuItem(size_t nPos); ++ void drawAllMenuItems(); ++ const Font& getLabelFont() const; ++ ++ void queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu); ++ void queueCloseSubMenu(); ++ void launchSubMenu(bool bSetMenuPos); ++ void endSubMenu(ScMenuFloatingWindow* pSubMenu); ++ ++ void fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const; ++ ++ ScDocument* getDoc(); ++ ++protected: ++ ::com::sun::star::uno::Reference< ++ ::com::sun::star::accessibility::XAccessible > mxAccessible; ++ ++private: ++ struct SubMenuItemData; ++ void handleMenuTimeout(SubMenuItemData* pTimer); ++ ++ void resizeToFitMenuItems(); ++ void highlightMenuItem(size_t nPos, bool bSelected); ++ ++ size_t getEnclosingMenuItem(const Point& rPos) const; ++ size_t getSubMenuPos(ScMenuFloatingWindow* pSubMenu); ++ ++ /** ++ * Fire a menu highlight event since the accessibility framework needs ++ * this to track focus on menu items. ++ */ ++ void fireMenuHighlightedEvent(); ++ ++ /** ++ * Make sure that the specified submenu is permanently up, the submenu ++ * close timer is not active, and the correct menu item associated with ++ * the submenu is highlighted. ++ */ ++ void setSubMenuFocused(ScMenuFloatingWindow* pSubMenu); ++ ++ /** ++ * When a menu item of an invisible submenu is selected, we need to make ++ * sure that all its parent menu(s) are visible, with the right menu item ++ * highlighted in each of the parents. Calling this method ensures it. ++ */ ++ void ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu); ++ ++ /** ++ * Dismiss any visible child submenus when a menu item of a parent menu is ++ * selected. ++ */ ++ void ensureSubMenuNotVisible(); ++ ++ /** ++ * Dismiss all visible popup menus and set focus back to the application ++ * window. This method is called e.g. when a menu action is fired. ++ */ ++ void terminateAllPopupMenus(); ++ ++ DECL_LINK( PopupEndHdl, void* ); ++ ++private: ++ ++ struct MenuItemData ++ { ++ ::rtl::OUString maText; ++ bool mbEnabled; ++ ++ ::boost::shared_ptr mpAction; ++ ::boost::shared_ptr mpSubMenuWin; ++ ++ MenuItemData(); ++ }; ++ ++ ::std::vector maMenuItems; ++ ++ struct SubMenuItemData ++ { ++ Timer maTimer; ++ ScMenuFloatingWindow* mpSubMenu; ++ size_t mnMenuPos; ++ ++ DECL_LINK( TimeoutHdl, void* ); ++ ++ SubMenuItemData(ScMenuFloatingWindow* pParent); ++ void reset(); ++ ++ private: ++ ScMenuFloatingWindow* mpParent; ++ }; ++ SubMenuItemData maOpenTimer; ++ SubMenuItemData maCloseTimer; ++ ++ Font maLabelFont; ++ ++ // Name of this menu window, taken from the menu item of the parent window ++ // that launches it (if this is a sub menu). If this is a top-level menu ++ // window, then this name can be anything. ++ ::rtl::OUString maName; ++ ++ size_t mnSelectedMenu; ++ size_t mnClickedMenu; ++ ++ ScDocument* mpDoc; ++ ++ ScMenuFloatingWindow* mpParentMenu; ++ ScMenuFloatingWindow* mpActiveSubMenu; ++}; ++ ++// ============================================================================ ++ ++/** ++ * This class implements a popup window for field button, for quick access ++ * of hide-item list, and possibly more stuff related to field options. ++ */ ++class ScDPFieldPopupWindow : public ScMenuFloatingWindow ++{ ++public: ++ /** ++ * Extended data that the client code may need to store. Create a ++ * sub-class of this and store data there. ++ */ ++ struct ExtendedData {}; ++ ++ explicit ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc); ++ virtual ~ScDPFieldPopupWindow(); ++ ++ virtual void MouseMove(const MouseEvent& rMEvt); ++ virtual long Notify(NotifyEvent& rNEvt); ++ virtual void Paint(const Rectangle& rRect); ++ virtual Window* GetPreferredKeyInputWindow(); ++ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); ++ ++ void setMemberSize(size_t n); ++ void addMember(const ::rtl::OUString& rName, bool bVisible); ++ void initMembers(); ++ ++ const Size& getWindowSize() const; ++ ++ void getResult(::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rResult); ++ void close(bool bOK); ++ ++ /** ++ * Set auxiliary data that the client code might need. Note that this ++ * popup window class manages its life time; no explicit deletion of the ++ * instance is needed in the client code. ++ */ ++ void setExtendedData(ExtendedData* p); ++ ++ /** ++ * Get the store auxiliary data, or NULL if no such data is stored. ++ */ ++ ExtendedData* getExtendedData(); ++ ++ void setOKAction(Action* p); ++ ++private: ++ struct Member ++ { ++ ::rtl::OUString maName; ++ bool mbVisible; ++ ++ Member(); ++ }; ++ ++ class CancelButton : public ::CancelButton ++ { ++ public: ++ CancelButton(ScDPFieldPopupWindow* pParent); ++ ++ virtual void Click(); ++ ++ private: ++ ScDPFieldPopupWindow* mpParent; ++ }; ++ ++ enum SectionType { ++ WHOLE, // entire window ++ LISTBOX_AREA_OUTER, // box enclosing the check box items. ++ LISTBOX_AREA_INNER, // box enclosing the check box items. ++ SINGLE_BTN_AREA, // box enclosing the single-action buttons. ++ CHECK_TOGGLE_ALL, // check box for toggling all items. ++ BTN_SINGLE_SELECT, ++ BTN_SINGLE_UNSELECT, ++ BTN_OK, // OK button ++ BTN_CANCEL, // Cancel button ++ }; ++ void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const; ++ ++ void setAllMemberState(bool bSet); ++ void selectCurrentMemberOnly(bool bSet); ++ void cycleFocus(bool bReverse = false); ++ ++ DECL_LINK( ButtonHdl, Button* ); ++ DECL_LINK( TriStateHdl, TriStateBox* ); ++ DECL_LINK( CheckHdl, SvTreeListBox* ); ++ ++private: ++ SvxCheckListBox maChecks; ++ ++ TriStateBox maChkToggleAll; ++ ImageButton maBtnSelectSingle; ++ ImageButton maBtnUnselectSingle; ++ ++ OKButton maBtnOk; ++ CancelButton maBtnCancel; ++ ++ ::std::vector maTabStopCtrls; ++ size_t mnCurTabStop; ++ ++ ::std::vector maMembers; ++ ::std::auto_ptr mpExtendedData; ++ ::std::auto_ptr mpOKAction; ++ ++ const Size maWndSize; /// hard-coded window size. ++ TriState mePrevToggleAllState; ++}; ++ ++#endif +diff --git sc/source/ui/inc/gridwin.hxx sc/source/ui/inc/gridwin.hxx +index 914ae51..4013e1a 100644 +--- sc/source/ui/inc/gridwin.hxx ++++ sc/source/ui/inc/gridwin.hxx +@@ -37,15 +37,19 @@ + #include "viewdata.hxx" + #include "cbutton.hxx" + #include ++#include + #include + + #include ++#include + + // --------------------------------------------------------------------------- + + struct ScTableInfo; + class ScViewSelectionEngine; + class ScDPObject; ++class ScDPFieldPopupWindow; ++class ScDPFieldButton; + class ScOutputData; + class ScFilterListBox; + class AutoFilterPopup; +@@ -121,6 +125,8 @@ private: + + ScFilterListBox* pFilterBox; + FloatingWindow* pFilterFloat; ++ ::std::auto_ptr mpDPFieldPopup; ++ ::std::auto_ptr mpFilterButton; + + USHORT nCursorHideCount; + +@@ -187,12 +193,23 @@ private: + BOOL TestMouse( const MouseEvent& rMEvt, BOOL bAction ); + + BOOL DoPageFieldSelection( SCCOL nCol, SCROW nRow ); ++ bool DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); + void DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); + + void DPMouseMove( const MouseEvent& rMEvt ); + void DPMouseButtonUp( const MouseEvent& rMEvt ); + void DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ); + ++ /** ++ * Check if the mouse click is on a field popup button. ++ * ++ * @return bool true if the field popup menu has been launched and no ++ * further mouse event handling is necessary, false otherwise. ++ */ ++ bool DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj); ++ void DPLaunchFieldPopupMenu( ++ const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj); ++ + void RFMouseMove( const MouseEvent& rMEvt, BOOL bUp ); + + void PagebreakMove( const MouseEvent& rMEvt, BOOL bUp ); +@@ -315,9 +332,11 @@ public: + + void DoAutoFilterMenue( SCCOL nCol, SCROW nRow, BOOL bDataSelect ); + void DoScenarioMenue( const ScRange& rScenRange ); +- void DoPageFieldMenue( SCCOL nCol, SCROW nRow ); + +- BOOL HasPageFieldData( SCCOL nCol, SCROW nRow ) const; ++ void LaunchPageFieldMenu( SCCOL nCol, SCROW nRow ); ++ void LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ); ++ ++ ::com::sun::star::sheet::DataPilotFieldOrientation GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const; + + void DrawButtons( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + ScTableInfo& rTabInfo, OutputDevice* pContentDev ); +@@ -357,6 +376,8 @@ public: + + void CheckNeedsRepaint(); + ++ void UpdateDPFromFieldPopupMenu(); ++ + // #114409# + void CursorChanged(); + void DrawLayerCreated(); +diff --git sc/source/ui/inc/pvfundlg.hxx sc/source/ui/inc/pvfundlg.hxx +index 804f162..1707cd6 100644 +--- sc/source/ui/inc/pvfundlg.hxx ++++ sc/source/ui/inc/pvfundlg.hxx +@@ -55,6 +55,8 @@ + #include + #include "pivot.hxx" + ++#include ++ + // ============================================================================ + + typedef sfx::ListBoxWrapper< sal_Int32 > ScDPListBoxWrapper; +@@ -217,6 +219,11 @@ public: + + virtual short Execute(); + ++ /** ++ * @return String internal name of the selected field. Note that this may ++ * be different from the name displayed in the dialog if the field ++ * has a layout name. ++ */ + String GetDimensionName() const; + + private: +@@ -228,6 +235,10 @@ private: + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; ++ ++ typedef ::std::hash_map DimNameIndexMap; ++ DimNameIndexMap maNameIndexMap; ++ ScDPObject& mrDPObj; + }; + + // ============================================================================ +diff --git sc/source/ui/inc/pvlaydlg.hxx sc/source/ui/inc/pvlaydlg.hxx +index f94a7ed..2f7e628 100644 +--- sc/source/ui/inc/pvlaydlg.hxx ++++ sc/source/ui/inc/pvlaydlg.hxx +@@ -193,7 +193,7 @@ private: + private: + ScDPFieldWindow& GetFieldWindow ( ScDPFieldType eType ); + void Init (); +- void InitWndSelect ( LabelData** ppLabelArr, long nLabels ); ++ void InitWndSelect ( const ::std::vector& rLabels ); + void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType ); + void InitFocus (); + void InitFields (); +diff --git sc/source/ui/undo/undodat.cxx sc/source/ui/undo/undodat.cxx +index 73ebf38..f4fb524 100644 +--- sc/source/ui/undo/undodat.cxx ++++ sc/source/ui/undo/undodat.cxx +@@ -1879,7 +1879,7 @@ void __EXPORT ScUndoDataPilot::Undo() + else + { + // delete inserted object +- pDoc->GetDPCollection()->Free(pDocObj); ++ pDoc->GetDPCollection()->FreeTable(pDocObj); + } + } + } +@@ -1889,7 +1889,7 @@ void __EXPORT ScUndoDataPilot::Undo() + + ScDPObject* pDestObj = new ScDPObject( *pOldDPObject ); + pDestObj->SetAlive(TRUE); +- if ( !pDoc->GetDPCollection()->Insert(pDestObj) ) ++ if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) ) + { + DBG_ERROR("cannot insert DPObject"); + DELETEZ( pDestObj ); +diff --git sc/source/ui/unoobj/dapiuno.cxx sc/source/ui/unoobj/dapiuno.cxx +index a4ec67a..2039ea0 100644 +--- sc/source/ui/unoobj/dapiuno.cxx ++++ sc/source/ui/unoobj/dapiuno.cxx +@@ -1626,8 +1626,13 @@ OUString SAL_CALL ScDataPilotFieldObj::getName() throw(RuntimeException) + if( pDim->IsDataLayout() ) + aName = OUString( RTL_CONSTASCII_USTRINGPARAM( SC_DATALAYOUT_NAME ) ); + else +- aName = pDim->GetLayoutName(); +- } ++ { ++ const rtl::OUString* pLayoutName = pDim->GetLayoutName(); ++ if (pLayoutName) ++ aName = *pLayoutName; ++ else ++ aName = pDim->GetName(); ++ } } + return aName; + } + +@@ -1639,7 +1644,7 @@ void SAL_CALL ScDataPilotFieldObj::setName( const OUString& rName ) throw(Runtim + if( pDim && !pDim->IsDataLayout() ) + { + String aName( rName ); +- pDim->SetLayoutName( &aName ); ++ pDim->SetLayoutName(aName); + SetDPObject( pDPObj ); + } + } +@@ -3069,7 +3074,7 @@ Sequence SAL_CALL ScDataPilotItemsObj::getElementNames() + ScUnoGuard aGuard; + Sequence< OUString > aSeq; + if( ScDPObject* pDPObj = GetDPObject() ) +- pDPObj->GetMembers( lcl_GetObjectIndex( pDPObj, maFieldId ), aSeq ); ++ pDPObj->GetMemberNames( lcl_GetObjectIndex( pDPObj, maFieldId ), aSeq ); + return aSeq; + } + +diff --git sc/source/ui/unoobj/miscuno.cxx sc/source/ui/unoobj/miscuno.cxx +index 0f6a291..0c9122a 100644 +--- sc/source/ui/unoobj/miscuno.cxx ++++ sc/source/ui/unoobj/miscuno.cxx +@@ -39,6 +39,9 @@ + #include "unoguard.hxx" + + using namespace com::sun::star; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::uno::Any; ++using ::rtl::OUString; + + //------------------------------------------------------------------------ + +@@ -137,6 +140,26 @@ sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference& xProp, const OUString& rName, const OUString& rDefault ) ++{ ++ OUString aRet = rDefault; ++ if (!xProp.is()) ++ return aRet; ++ ++ try ++ { ++ Any any = xProp->getPropertyValue(rName); ++ any >>= aRet; ++ } ++ catch (const uno::Exception&) ++ { ++ } ++ ++ return aRet; ++} ++ + // static + sal_Bool ScUnoHelpFunctions::GetBoolFromAny( const uno::Any& aAny ) + { +@@ -180,6 +203,20 @@ void ScUnoHelpFunctions::SetBoolInAny( uno::Any& rAny, sal_Bool bValue ) + rAny.setValue( &bValue, getBooleanCppuType() ); + } + ++// static ++void ScUnoHelpFunctions::SetOptionalPropertyValue( ++ Reference& rPropSet, const sal_Char* pPropName, const Any& rVal ) ++{ ++ try ++ { ++ rPropSet->setPropertyValue(OUString::createFromAscii(pPropName), rVal); ++ } ++ catch (const beans::UnknownPropertyException&) ++ { ++ // ignored - not supported. ++ } ++} ++ + //------------------------------------------------------------------------ + + ScIndexEnumeration::ScIndexEnumeration(const uno::Reference& rInd, +diff --git sc/source/ui/view/cellsh2.cxx sc/source/ui/view/cellsh2.cxx +index d07feb0..90c6883 100644 +--- sc/source/ui/view/cellsh2.cxx ++++ sc/source/ui/view/cellsh2.cxx +@@ -764,7 +764,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) + { + // select database range or data + pTabViewShell->GetDBData( TRUE, SC_DB_OLD ); +- const ScMarkData& rMark = GetViewData()->GetMarkData(); ++ ScMarkData& rMark = GetViewData()->GetMarkData(); + if ( !rMark.IsMarked() && !rMark.IsMultiMarked() ) + pTabViewShell->MarkDataArea( FALSE ); + +@@ -830,6 +830,19 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) + ScMarkType eType = GetViewData()->GetSimpleArea(aRange); + if ( (eType & SC_MARK_SIMPLE) == SC_MARK_SIMPLE ) + { ++ // Shrink the range to the data area. ++ SCCOL nStartCol = aRange.aStart.Col(), nEndCol = aRange.aEnd.Col(); ++ SCROW nStartRow = aRange.aStart.Row(), nEndRow = aRange.aEnd.Row(); ++ if (pDoc->ShrinkToDataArea(aRange.aStart.Tab(), nStartCol, nStartRow, nEndCol, nEndRow)) ++ { ++ aRange.aStart.SetCol(nStartCol); ++ aRange.aStart.SetRow(nStartRow); ++ aRange.aEnd.SetCol(nEndCol); ++ aRange.aEnd.SetRow(nEndRow); ++ rMark.SetMarkArea(aRange); ++ pTabViewShell->MarkRange(aRange); ++ } ++ + BOOL bOK = TRUE; + if ( pDoc->HasSubTotalCells( aRange ) ) + { +diff --git sc/source/ui/view/dbfunc.cxx sc/source/ui/view/dbfunc.cxx +index b372240..05dce54 100644 +--- sc/source/ui/view/dbfunc.cxx ++++ sc/source/ui/view/dbfunc.cxx +@@ -107,14 +107,30 @@ void ScDBFunc::GotoDBArea( const String& rDBName ) + + // aktuellen Datenbereich fuer Sortieren / Filtern suchen + +-ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode ) ++ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode, bool bShrinkToData ) + { + ScDocShell* pDocSh = GetViewData()->GetDocShell(); + ScDBData* pData = NULL; + ScRange aRange; + ScMarkType eMarkType = GetViewData()->GetSimpleArea(aRange); + if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED ) ++ { ++ if (bShrinkToData) ++ { ++ // Shrink the range to only include data area. ++ ScDocument* pDoc = pDocSh->GetDocument(); ++ SCCOL nCol1 = aRange.aStart.Col(), nCol2 = aRange.aEnd.Col(); ++ SCROW nRow1 = aRange.aStart.Row(), nRow2 = aRange.aEnd.Row(); ++ if (pDoc->ShrinkToDataArea(aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2)) ++ { ++ aRange.aStart.SetCol(nCol1); ++ aRange.aEnd.SetCol(nCol2); ++ aRange.aStart.SetRow(nRow1); ++ aRange.aEnd.SetRow(nRow2); ++ } ++ } + pData = pDocSh->GetDBData( aRange, eMode, FALSE ); ++ } + else if ( eMode != SC_DB_OLD ) + pData = pDocSh->GetDBData( + ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(), +diff --git sc/source/ui/view/dbfunc3.cxx sc/source/ui/view/dbfunc3.cxx +index 4b50b5b..86fc703 100644 +--- sc/source/ui/view/dbfunc3.cxx ++++ sc/source/ui/view/dbfunc3.cxx +@@ -44,19 +44,17 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + #include + #include +-#include +- +-#include + #include ++#include + #include +-#include +-#include +-#include + #include +-#include +-#include ++#include + + #include "global.hxx" + #include "globstr.hrc" +@@ -81,9 +79,13 @@ + #include "patattr.hxx" + #include "unonames.hxx" + #include "cell.hxx" ++#include "userlist.hxx" + + #include ++#include + #include ++#include ++#include + + using namespace com::sun::star; + using ::com::sun::star::uno::Any; +@@ -91,7 +93,16 @@ using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::beans::XPropertySet; ++using ::com::sun::star::container::XNameAccess; ++using ::com::sun::star::sheet::XDimensionsSupplier; ++using ::rtl::OUString; ++using ::rtl::OUStringHash; ++using ::rtl::OUStringBuffer; + using ::std::auto_ptr; ++using ::std::list; ++using ::std::vector; ++using ::std::hash_map; ++using ::std::hash_set; + + // STATIC DATA ----------------------------------------------------------- + +@@ -1351,123 +1362,323 @@ void ScDBFunc::UngroupDataPilot() + } + } + ++static OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUString& rMemberName) ++{ ++ sal_Int32 n = rSubtotal.getLength(); ++ const sal_Unicode* p = rSubtotal.getStr(); ++ OUStringBuffer aBuf, aWordBuf; ++ for (sal_Int32 i = 0; i < n; ++i) ++ { ++ sal_Unicode c = p[i]; ++ if (c == sal_Unicode(' ')) ++ { ++ OUString aWord = aWordBuf.makeStringAndClear(); ++ if (aWord.equals(rMemberName)) ++ aBuf.append(sal_Unicode('?')); ++ else ++ aBuf.append(aWord); ++ aBuf.append(c); ++ } ++ else if (c == sal_Unicode('\\')) ++ { ++ // Escape a backslash character. ++ aWordBuf.append(c); ++ aWordBuf.append(c); ++ } ++ else if (c == sal_Unicode('?')) ++ { ++ // A literal '?' must be escaped with a backslash ('\'); ++ aWordBuf.append(sal_Unicode('\\')); ++ aWordBuf.append(c); ++ } ++ else ++ aWordBuf.append(c); ++ } ++ ++ if (aWordBuf.getLength() > 0) ++ { ++ OUString aWord = aWordBuf.makeStringAndClear(); ++ if (aWord.equals(rMemberName)) ++ aBuf.append(sal_Unicode('?')); ++ else ++ aBuf.append(aWord); ++ } ++ ++ return aBuf.makeStringAndClear(); ++} ++ + void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString ) + { ++ using namespace ::com::sun::star::sheet; ++ + String aNewName( rString ); + + ScDocument* pDoc = GetViewData()->GetDocument(); + ScDPObject* pDPObj = pDoc->GetDPAtCursor( rPos.Col(), rPos.Row(), rPos.Tab() ); +- if ( pDPObj ) ++ if (!pDPObj) ++ return; ++ ++ String aOldText; ++ pDoc->GetString( rPos.Col(), rPos.Row(), rPos.Tab(), aOldText ); ++ ++ if ( aOldText == rString ) + { +- String aOldText; +- pDoc->GetString( rPos.Col(), rPos.Row(), rPos.Tab(), aOldText ); ++ // nothing to do: silently exit ++ return; ++ } ++ ++ USHORT nErrorId = 0; + +- if ( aOldText == rString ) ++ pDPObj->BuildAllDimensionMembers(); ++ ScDPSaveData aData( *pDPObj->GetSaveData() ); ++ BOOL bChange = FALSE; ++ ++ USHORT nOrient = DataPilotFieldOrientation_HIDDEN; ++ long nField = pDPObj->GetHeaderDim( rPos, nOrient ); ++ if ( nField >= 0 ) ++ { ++ // changing a field title ++ if ( aData.GetExistingDimensionData() ) + { +- // nothing to do: silently exit +- return; +- } ++ // only group dimensions can be renamed + +- USHORT nErrorId = 0; ++ ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); ++ ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aOldText ); ++ if ( pGroupDim ) ++ { ++ // valid name: not empty, no existing dimension (group or other) ++ if ( rString.Len() && !pDPObj->IsDimNameInUse(rString) ) ++ { ++ pGroupDim->Rename( aNewName ); + +- ScDPSaveData aData( *pDPObj->GetSaveData() ); +- BOOL bChange = FALSE; ++ // also rename in SaveData to preserve the field settings ++ ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aOldText ); ++ pSaveDim->SetName( aNewName ); + +- USHORT nOrient = sheet::DataPilotFieldOrientation_HIDDEN; +- long nField = pDPObj->GetHeaderDim( rPos, nOrient ); +- if ( nField >= 0 ) ++ bChange = TRUE; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } ++ } ++ else if (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW) ++ { ++ BOOL bDataLayout = false; ++ String aDimName = pDPObj->GetDimName(nField, bDataLayout); ++ ScDPSaveDimension* pDim = bDataLayout ? aData.GetDataLayoutDimension() : aData.GetDimensionByName(aDimName); ++ if (pDim) ++ { ++ if (rString.Len()) ++ { ++ if (rString.EqualsIgnoreCaseAscii(aDimName)) ++ { ++ pDim->RemoveLayoutName(); ++ bChange = true; ++ } ++ else if (!pDPObj->IsDimNameInUse(rString)) ++ { ++ pDim->SetLayoutName(rString); ++ bChange = true; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } ++ } ++ } ++ else if (pDPObj->IsDataDescriptionCell(rPos)) ++ { ++ // There is only one data dimension. ++ ScDPSaveDimension* pDim = aData.GetFirstDimension(sheet::DataPilotFieldOrientation_DATA); ++ if (pDim) + { +- // changing a field title ++ if (rString.Len()) ++ { ++ if (rString.EqualsIgnoreCaseAscii(pDim->GetName())) ++ { ++ pDim->RemoveLayoutName(); ++ bChange = true; ++ } ++ else if (!pDPObj->IsDimNameInUse(rString)) ++ { ++ pDim->SetLayoutName(rString); ++ bChange = true; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } ++ } ++ else ++ { ++ // This is not a field header. ++ sheet::DataPilotTableHeaderData aPosData; ++ pDPObj->GetHeaderPositionData(rPos, aPosData); + +- if ( aData.GetExistingDimensionData() ) ++ if ( (aPosData.Flags & MemberResultFlags::HASMEMBER) && aOldText.Len() ) ++ { ++ if ( aData.GetExistingDimensionData() && !(aPosData.Flags & MemberResultFlags::SUBTOTAL)) + { +- // only group dimensions can be renamed ++ BOOL bIsDataLayout; ++ String aDimName = pDPObj->GetDimName( aPosData.Dimension, bIsDataLayout ); + + ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); +- ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aOldText ); ++ ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName ); + if ( pGroupDim ) + { +- // valid name: not empty, no existing dimension (group or other) +- if ( aNewName.Len() && !pDPObj->IsDimNameInUse( aNewName ) ) ++ // valid name: not empty, no existing group in this dimension ++ //! ignore case? ++ if ( aNewName.Len() && !pGroupDim->GetNamedGroup( aNewName ) ) + { +- pGroupDim->Rename( aNewName ); ++ ScDPSaveGroupItem* pGroup = pGroupDim->GetNamedGroupAcc( aOldText ); ++ if ( pGroup ) ++ pGroup->Rename( aNewName ); // rename the existing group ++ else ++ { ++ // create a new group to replace the automatic group ++ ScDPSaveGroupItem aGroup( aNewName ); ++ aGroup.AddElement( aOldText ); ++ pGroupDim->AddGroupItem( aGroup ); ++ } + +- // also rename in SaveData to preserve the field settings +- ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aOldText ); +- pSaveDim->SetName( aNewName ); ++ // in both cases also adjust savedata, to preserve member settings (show details) ++ ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aDimName ); ++ ScDPSaveMember* pSaveMember = pSaveDim->GetExistingMemberByName( aOldText ); ++ if ( pSaveMember ) ++ pSaveMember->SetName( aNewName ); + + bChange = TRUE; + } + else + nErrorId = STR_INVALIDNAME; +- } ++ } + } +- } +- else +- { +- // renaming a group (item)? +- // allow only on the item name itself - not on empty cells, not on subtotals +- +- sheet::DataPilotTableHeaderData aPosData; +- pDPObj->GetHeaderPositionData(rPos, aPosData); +- if ( ( aPosData.Flags & sheet::MemberResultFlags::HASMEMBER ) && +- ! ( aPosData.Flags & sheet::MemberResultFlags::SUBTOTAL ) && +- aOldText.Len() ) ++ else if ((aPosData.Flags & MemberResultFlags::GRANDTOTAL)) + { +- if ( aData.GetExistingDimensionData() ) ++ aData.SetGrandTotalName(rString); ++ bChange = true; ++ } ++ else if (aPosData.Dimension >= 0 && aPosData.MemberName.getLength() > 0) ++ { ++ BOOL bDataLayout = false; ++ String aDimName = pDPObj->GetDimName(static_cast(aPosData.Dimension), bDataLayout); ++ if (bDataLayout) + { +- BOOL bIsDataLayout; +- String aDimName = pDPObj->GetDimName( aPosData.Dimension, bIsDataLayout ); ++ // data dimension ++ do ++ { ++ if ((aPosData.Flags & MemberResultFlags::SUBTOTAL)) ++ break; ++ ++ ScDPSaveDimension* pDim = aData.GetDimensionByName(aPosData.MemberName); ++ if (!pDim) ++ break; + +- ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); +- ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName ); +- if ( pGroupDim ) ++ if (!rString.Len()) ++ { ++ nErrorId = STR_INVALIDNAME; ++ break; ++ } ++ ++ if (aPosData.MemberName.equalsIgnoreAsciiCase(rString)) ++ { ++ pDim->RemoveLayoutName(); ++ bChange = true; ++ } ++ else if (!pDPObj->IsDimNameInUse(rString)) ++ { ++ pDim->SetLayoutName(rString); ++ bChange = true; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } ++ while (false); ++ } ++ else ++ { ++ // field member ++ do + { +- // valid name: not empty, no existing group in this dimension +- //! ignore case? +- if ( aNewName.Len() && !pGroupDim->GetNamedGroup( aNewName ) ) ++ ScDPSaveDimension* pDim = aData.GetDimensionByName(aDimName); ++ if (!pDim) ++ break; ++ ++ ScDPSaveMember* pMem = pDim->GetExistingMemberByName(aPosData.MemberName); ++ if (!pMem) ++ break; ++ ++ if ((aPosData.Flags & MemberResultFlags::SUBTOTAL)) + { +- ScDPSaveGroupItem* pGroup = pGroupDim->GetNamedGroupAcc( aOldText ); +- if ( pGroup ) +- pGroup->Rename( aNewName ); // rename the existing group +- else +- { +- // create a new group to replace the automatic group +- ScDPSaveGroupItem aGroup( aNewName ); +- aGroup.AddElement( aOldText ); +- pGroupDim->AddGroupItem( aGroup ); +- } ++ // Change subtotal only when the table has one data dimension. ++ if (aData.GetDataDimensionCount() > 1) ++ break; + +- // in both cases also adjust savedata, to preserve member settings (show details) +- ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aDimName ); +- ScDPSaveMember* pSaveMember = pSaveDim->GetExistingMemberByName( aOldText ); +- if ( pSaveMember ) +- pSaveMember->SetName( aNewName ); ++ // display name for subtotal is allowed only if the subtotal type is 'Automatic'. ++ if (pDim->GetSubTotalsCount() != 1) ++ break; + +- bChange = TRUE; ++ if (pDim->GetSubTotalFunc(0) != sheet::GeneralFunction_AUTO) ++ break; ++ ++ const OUString* pLayoutName = pMem->GetLayoutName(); ++ String aMemberName; ++ if (pLayoutName) ++ aMemberName = *pLayoutName; ++ else ++ aMemberName = aPosData.MemberName; ++ ++ String aNew = lcl_replaceMemberNameInSubtotal(rString, aMemberName); ++ pDim->SetSubtotalName(aNew); ++ bChange = true; + } + else +- nErrorId = STR_INVALIDNAME; ++ { ++ // Check to make sure the member name isn't ++ // already used. ++ if (rString.Len()) ++ { ++ if (rString.EqualsIgnoreCaseAscii(pMem->GetName())) ++ { ++ pMem->RemoveLayoutName(); ++ bChange = true; ++ } ++ else if (!pDim->IsMemberNameInUse(rString)) ++ { ++ pMem->SetLayoutName(rString); ++ bChange = true; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } ++ else ++ nErrorId = STR_INVALIDNAME; ++ } + } ++ while (false); + } + } + } ++ } + +- if ( bChange ) +- { +- // apply changes +- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); +- ScDPObject* pNewObj = new ScDPObject( *pDPObj ); +- pNewObj->SetSaveData( aData ); +- aFunc.DataPilotUpdate( pDPObj, pNewObj, TRUE, FALSE ); +- delete pNewObj; +- } +- else +- { +- if ( !nErrorId ) +- nErrorId = STR_ERR_DATAPILOT_INPUT; +- ErrorMessage( nErrorId ); +- } ++ if ( bChange ) ++ { ++ // apply changes ++ ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); ++ ScDPObject* pNewObj = new ScDPObject( *pDPObj ); ++ pNewObj->SetSaveData( aData ); ++ aFunc.DataPilotUpdate( pDPObj, pNewObj, TRUE, FALSE ); ++ delete pNewObj; ++ } ++ else ++ { ++ if ( !nErrorId ) ++ nErrorId = STR_ERR_DATAPILOT_INPUT; ++ ErrorMessage( nErrorId ); + } + } + +@@ -1484,6 +1695,134 @@ void lcl_MoveToEnd( ScDPSaveDimension& rDim, const String& rItemName ) + // puts it to the end of the list even if it was in the list before. + } + ++bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId ) ++{ ++ ScDocument* pDoc = GetViewData()->GetDocument(); ++ ScDPObject* pDPObj = pDoc->GetDPAtCursor(rPos.Col(), rPos.Row(), rPos.Tab()); ++ if (!pDPObj) ++ return false; ++ ++ // We need to run this to get all members later. ++ pDPObj->BuildAllDimensionMembers(); ++ ++ USHORT nOrientation; ++ long nDimIndex = pDPObj->GetHeaderDim(rPos, nOrientation); ++ if (nDimIndex < 0) ++ // Invalid dimension index. Bail out. ++ return false; ++ ++ BOOL bDataLayout; ++ ScDPSaveData* pSaveData = pDPObj->GetSaveData(); ++ if (!pSaveData) ++ return false; ++ ++ ScDPSaveData aNewSaveData(*pSaveData); ++ String aDimName = pDPObj->GetDimName(nDimIndex, bDataLayout); ++ ScDPSaveDimension* pSaveDim = aNewSaveData.GetDimensionByName(aDimName); ++ if (!pSaveDim) ++ return false; ++ ++ typedef ScDPSaveDimension::MemberList MemList; ++ const MemList& rDimMembers = pSaveDim->GetMembers(); ++ list aMembers; ++ hash_set aMemberSet; ++ size_t nMemberCount = 0; ++ for (MemList::const_iterator itr = rDimMembers.begin(), itrEnd = rDimMembers.end(); ++ itr != itrEnd; ++itr) ++ { ++ ScDPSaveMember* pMem = *itr; ++ aMembers.push_back(pMem->GetName()); ++ aMemberSet.insert(pMem->GetName()); ++ ++nMemberCount; ++ } ++ ++ // Sort the member list in ascending order. ++ aMembers.sort(); ++ ++ // Collect and rank those custom sort strings that also exist in the member name list. ++ ++ typedef hash_map UserSortMap; ++ UserSortMap aSubStrs; ++ sal_uInt16 nSubCount = 0; ++ if (pUserListId) ++ { ++ ScUserList* pUserList = ScGlobal::GetUserList(); ++ if (!pUserList) ++ return false; ++ ++ { ++ sal_uInt16 n = pUserList->GetCount(); ++ if (!n || *pUserListId >= n) ++ return false; ++ } ++ ++ ScUserListData* pData = static_cast((*pUserList)[*pUserListId]); ++ if (pData) ++ { ++ sal_uInt16 n = pData->GetSubCount(); ++ for (sal_uInt16 i = 0; i < n; ++i) ++ { ++ OUString aSub = pData->GetSubStr(i); ++ if (!aMemberSet.count(aSub)) ++ // This string doesn't exist in the member name set. Don't add this. ++ continue; ++ ++ aSubStrs.insert(UserSortMap::value_type(aSub, nSubCount++)); ++ } ++ } ++ } ++ ++ // Rank all members. ++ ++ vector aRankedNames(nMemberCount); ++ sal_uInt16 nCurStrId = 0; ++ for (list::const_iterator itr = aMembers.begin(), itrEnd = aMembers.end(); ++ itr != itrEnd; ++itr) ++ { ++ OUString aName = *itr; ++ sal_uInt16 nRank = 0; ++ UserSortMap::const_iterator itrSub = aSubStrs.find(aName); ++ if (itrSub == aSubStrs.end()) ++ nRank = nSubCount + nCurStrId++; ++ else ++ nRank = itrSub->second; ++ ++ if (!bAscending) ++ nRank = nMemberCount - nRank - 1; ++ ++ aRankedNames[nRank] = aName; ++ } ++ ++ // Re-order ScDPSaveMember instances with the new ranks. ++ ++ for (vector::const_iterator itr = aRankedNames.begin(), itrEnd = aRankedNames.end(); ++ itr != itrEnd; ++itr) ++ { ++ const ScDPSaveMember* pOldMem = pSaveDim->GetExistingMemberByName(*itr); ++ if (!pOldMem) ++ // All members are supposed to be present. ++ continue; ++ ++ ScDPSaveMember* pNewMem = new ScDPSaveMember(*pOldMem); ++ pSaveDim->AddMember(pNewMem); ++ } ++ ++ // Set the sorting mode to manual for now. We may introduce a new sorting ++ // mode later on. ++ ++ sheet::DataPilotFieldSortInfo aSortInfo; ++ aSortInfo.Mode = sheet::DataPilotFieldSortMode::MANUAL; ++ pSaveDim->SetSortInfo(&aSortInfo); ++ ++ // Update the datapilot with the newly sorted field members. ++ ++ auto_ptr pNewObj(new ScDPObject(*pDPObj)); ++ pNewObj->SetSaveData(aNewSaveData); ++ ScDBDocFunc aFunc(*GetViewData()->GetDocShell()); ++ ++ return aFunc.DataPilotUpdate(pDPObj, pNewObj.get(), true, false); ++} ++ + BOOL ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest ) + { + BOOL bRet = FALSE; +@@ -1529,7 +1868,7 @@ BOOL ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest ) + + // get all member names in source order + uno::Sequence aMemberNames; +- pDPObj->GetMembers( aDestData.Dimension, aMemberNames ); ++ pDPObj->GetMemberNames( aDestData.Dimension, aMemberNames ); + + bool bInserted = false; + +diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx +index 2b65eb8..42b22a6 100644 +--- sc/source/ui/view/gridwin.cxx ++++ sc/source/ui/view/gridwin.cxx +@@ -121,6 +121,7 @@ + #include "validat.hxx" + #include "tabprotection.hxx" + #include "postit.hxx" ++#include "dpcontrol.hxx" + + #include "drawview.hxx" + #include +@@ -369,6 +370,8 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic + pNoteMarker( NULL ), + pFilterBox( NULL ), + pFilterFloat( NULL ), ++ mpDPFieldPopup(NULL), ++ mpFilterButton(NULL), + nCursorHideCount( 0 ), + bMarking( FALSE ), + nButtonDown( 0 ), +@@ -445,14 +448,26 @@ void __EXPORT ScGridWindow::Resize( const Size& ) + + void ScGridWindow::ClickExtern() + { +- // #i81298# don't delete the filter box when called from its select handler +- // (possible through row header size update) +- // #i84277# when initializing the filter box, a Basic error can deactivate the view +- if ( pFilterBox && ( pFilterBox->IsInSelect() || pFilterBox->IsInInit() ) ) +- return; ++ do ++ { ++ // #i81298# don't delete the filter box when called from its select handler ++ // (possible through row header size update) ++ // #i84277# when initializing the filter box, a Basic error can deactivate the view ++ if ( pFilterBox && ( pFilterBox->IsInSelect() || pFilterBox->IsInInit() ) ) ++ { ++ break; ++ } ++ ++ DELETEZ(pFilterBox); ++ DELETEZ(pFilterFloat); ++ } ++ while (false); + +- DELETEZ(pFilterBox); +- DELETEZ(pFilterFloat); ++ if (mpDPFieldPopup.get()) ++ { ++ mpDPFieldPopup->close(false); ++ mpDPFieldPopup.reset(); ++ } + } + + IMPL_LINK( ScGridWindow, PopupModeEndHdl, FloatingWindow*, EMPTYARG ) +@@ -507,7 +522,7 @@ void ScGridWindow::ExecPageFieldSelect( SCCOL nCol, SCROW nRow, BOOL bHasSelecti + } + } + +-void ScGridWindow::DoPageFieldMenue( SCCOL nCol, SCROW nRow ) ++void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow ) + { + //! merge position/size handling with DoAutoFilterMenue + +@@ -658,6 +673,22 @@ void ScGridWindow::DoPageFieldMenue( SCCOL nCol, SCROW nRow ) + CaptureMouse(); + } + ++void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ) ++{ ++ SCTAB nTab = pViewData->GetTabNo(); ++ ScDPObject* pDPObj = pViewData->GetDocument()->GetDPAtCursor(nCol, nRow, nTab); ++ if (!pDPObj) ++ return; ++ ++ // Get the geometry of the cell. ++ Point aScrPos = pViewData->GetScrPos(nCol, nRow, eWhich); ++ long nSizeX, nSizeY; ++ pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY); ++ Size aScrSize(nSizeX-1, nSizeY-1); ++ ++ DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol, nRow, nTab), pDPObj); ++} ++ + void ScGridWindow::DoScenarioMenue( const ScRange& rScenRange ) + { + delete pFilterBox; +@@ -1619,52 +1650,8 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) + pDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG ); + if (pAttr->HasAutoFilter()) + { +- Point aScrPos = pViewData->GetScrPos(nPosX,nPosY,eWhich); +- long nSizeX; +- long nSizeY; +- Point aDiffPix = aPos; +- +- aDiffPix -= aScrPos; +- BOOL bLayoutRTL = pDoc->IsLayoutRTL( nTab ); +- if ( bLayoutRTL ) +- aDiffPix.X() = -aDiffPix.X(); +- +- pViewData->GetMergeSizePixel( nPosX, nPosY, nSizeX, nSizeY ); +- +- // Breite des Buttons ist nicht von der Zellhoehe abhaengig +- Size aButSize = aComboButton.GetSizePixel(); +- long nButWidth = Min( aButSize.Width(), nSizeX ); +- long nButHeight = Min( aButSize.Height(), nSizeY ); +- +- if ( aDiffPix.X() >= nSizeX - nButWidth && +- aDiffPix.Y() >= nSizeY - nButHeight ) +- { +- if ( DoPageFieldSelection( nPosX, nPosY ) ) +- return; +- +- BOOL bFilterActive = IsAutoFilterActive( nPosX, nPosY, +- pViewData->GetTabNo() ); +- +- aComboButton.SetOptSizePixel(); +- DrawComboButton( aScrPos, nSizeX, nSizeY, bFilterActive, TRUE ); +- +-#if 0 +- if ( bWasFilterBox +- && (SCsCOL)nOldColFBox == nPosX +- && (SCsROW)nOldRowFBox == nPosY ) +- { +- // Verhindern, dass an gleicher Stelle eine +- // FilterBox geoeffnet wird, wenn diese gerade +- // geloescht wurde +- +- nMouseStatus = SC_GM_FILTER; // fuer ButtonDraw im MouseButtonUp(); +- return; +- } +-#endif +- DoAutoFilterMenue( nPosX, nPosY, FALSE ); +- ++ if (DoAutoFilterButton(nPosX, nPosY, rMEvt)) + return; +- } + } + if (pAttr->HasButton()) + { +@@ -1794,11 +1781,17 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) + { + if ( pFilterBox && pFilterBox->GetMode() == SC_FILTERBOX_FILTER ) + { +- BOOL bFilterActive = IsAutoFilterActive( pFilterBox->GetCol(), pFilterBox->GetRow(), +- pViewData->GetTabNo() ); +- HideCursor(); +- aComboButton.Draw( bFilterActive ); +- ShowCursor(); ++ if (mpFilterButton.get()) ++ { ++ bool bFilterActive = IsAutoFilterActive( ++ pFilterBox->GetCol(), pFilterBox->GetRow(), pViewData->GetTabNo() ); ++ ++ mpFilterButton->setHasHiddenMember(bFilterActive); ++ mpFilterButton->setPopupPressed(false); ++ HideCursor(); ++ mpFilterButton->draw(); ++ ShowCursor(); ++ } + } + nMouseStatus = SC_GM_NONE; + ReleaseMouse(); +@@ -2218,9 +2211,14 @@ void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt ) + nMouseStatus = SC_GM_NONE; + if ( pFilterBox->GetMode() == SC_FILTERBOX_FILTER ) + { +- HideCursor(); +- aComboButton.Draw( FALSE ); +- ShowCursor(); ++ if (mpFilterButton.get()) ++ { ++ mpFilterButton->setHasHiddenMember(false); ++ mpFilterButton->setPopupPressed(false); ++ HideCursor(); ++ mpFilterButton->draw(); ++ ShowCursor(); ++ } + } + ReleaseMouse(); + pFilterBox->MouseButtonDown( MouseEvent( aRelPos, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT ) ); +diff --git sc/source/ui/view/gridwin2.cxx sc/source/ui/view/gridwin2.cxx +index 7c59936..f5386d2 100644 +--- sc/source/ui/view/gridwin2.cxx ++++ sc/source/ui/view/gridwin2.cxx +@@ -55,48 +55,124 @@ + #include "dpoutput.hxx" // ScDPPositionData + #include "dpshttab.hxx" + #include "dbdocfun.hxx" ++#include "dpcontrol.hxx" ++#include "dpcontrol.hrc" ++#include "strload.hxx" ++#include "userlist.hxx" + + #include + #include "scabstdlg.hxx" //CHINA001 +-using namespace com::sun::star; + ++#include ++#include ++ ++using namespace com::sun::star; ++using ::com::sun::star::sheet::DataPilotFieldOrientation; ++using ::std::vector; ++using ::std::auto_ptr; ++using ::std::hash_map; ++using ::rtl::OUString; ++using ::rtl::OUStringHash; + + // STATIC DATA ----------------------------------------------------------- + + // ----------------------------------------------------------------------- + +-BOOL ScGridWindow::HasPageFieldData( SCCOL nCol, SCROW nRow ) const ++DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const + { ++ using namespace ::com::sun::star::sheet; ++ + ScDocument* pDoc = pViewData->GetDocument(); + SCTAB nTab = pViewData->GetTabNo(); +- ScDPObject* pDPObj = pDoc->GetDPAtCursor(nCol, nRow, nTab); +- if ( pDPObj && nCol > 0 ) ++ ScDPObject* pDPObj = pDoc->GetDPAtCursor(nCol, nRow, nTab); ++ if (!pDPObj) ++ return DataPilotFieldOrientation_HIDDEN; ++ ++ USHORT nOrient = DataPilotFieldOrientation_HIDDEN; ++ ++ // Check for page field first. ++ if (nCol > 0) + { + // look for the dimension header left of the drop-down arrow +- USHORT nOrient = sheet::DataPilotFieldOrientation_HIDDEN; + long nField = pDPObj->GetHeaderDim( ScAddress( nCol-1, nRow, nTab ), nOrient ); +- if ( nField >= 0 && nOrient == sheet::DataPilotFieldOrientation_PAGE ) ++ if ( nField >= 0 && nOrient == DataPilotFieldOrientation_PAGE ) + { + BOOL bIsDataLayout = FALSE; + String aFieldName = pDPObj->GetDimName( nField, bIsDataLayout ); + if ( aFieldName.Len() && !bIsDataLayout ) +- return TRUE; ++ return DataPilotFieldOrientation_PAGE; + } + } +- return FALSE; ++ ++ nOrient = sheet::DataPilotFieldOrientation_HIDDEN; ++ ++ // Now, check for row/column field. ++ long nField = pDPObj->GetHeaderDim(ScAddress(nCol, nRow, nTab), nOrient); ++ if (nField >= 0 && (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW) ) ++ { ++ BOOL bIsDataLayout = FALSE; ++ String aFieldName = pDPObj->GetDimName(nField, bIsDataLayout); ++ if (aFieldName.Len() && !bIsDataLayout) ++ return static_cast(nOrient); ++ } ++ ++ return DataPilotFieldOrientation_HIDDEN; + } + + // private method for mouse button handling + BOOL ScGridWindow::DoPageFieldSelection( SCCOL nCol, SCROW nRow ) + { +- if ( HasPageFieldData( nCol, nRow ) ) ++ if (GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE) + { +- DoPageFieldMenue( nCol, nRow ); ++ LaunchPageFieldMenu( nCol, nRow ); + return TRUE; + } + return FALSE; + } + ++bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ) ++{ ++ ScDocument* pDoc = pViewData->GetDocument(); ++ SCTAB nTab = pViewData->GetTabNo(); ++ Point aScrPos = pViewData->GetScrPos(nCol, nRow, eWhich); ++ Point aDiffPix = rMEvt.GetPosPixel(); ++ ++ aDiffPix -= aScrPos; ++ BOOL bLayoutRTL = pDoc->IsLayoutRTL( nTab ); ++ if ( bLayoutRTL ) ++ aDiffPix.X() = -aDiffPix.X(); ++ ++ long nSizeX, nSizeY; ++ pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); ++ Size aScrSize(nSizeX-1, nSizeY-1); ++ ++ // Check if the mouse cursor is clicking on the popup arrow box. ++ mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY())); ++ mpFilterButton->setBoundingBox(aScrPos, aScrSize); ++ Point aPopupPos; ++ Size aPopupSize; ++ mpFilterButton->getPopupBoundingBox(aPopupPos, aPopupSize); ++ Rectangle aRec(aPopupPos, aPopupSize); ++ if (aRec.IsInside(rMEvt.GetPosPixel())) ++ { ++ if ( DoPageFieldSelection( nCol, nRow ) ) ++ return true; ++ ++ bool bFilterActive = IsAutoFilterActive(nCol, nRow, nTab); ++ mpFilterButton->setHasHiddenMember(bFilterActive); ++ mpFilterButton->setDrawBaseButton(false); ++ mpFilterButton->setDrawPopupButton(true); ++ mpFilterButton->setPopupPressed(true); ++ HideCursor(); ++ mpFilterButton->draw(); ++ ShowCursor(); ++ DoAutoFilterMenue(nCol, nRow, false); ++ return true; ++ } ++ ++ return false; ++} ++ + void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ) + { + ScDocument* pDoc = pViewData->GetDocument(); +@@ -114,6 +190,15 @@ void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt + bDPMouse = TRUE; + nDPField = nField; + pDragDPObj = pDPObj; ++ ++ if (DPTestFieldPopupArrow(rMEvt, aPos, pDPObj)) ++ { ++ // field name pop up menu has been launched. Don't activate ++ // field move. ++ bDPMouse = false; ++ return; ++ } ++ + DPTestMouse( rMEvt, TRUE ); + StartTracking(); + } +@@ -282,6 +367,223 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) + pViewData->GetView()->ResetTimer(); + } + ++bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj) ++{ ++ // Get the geometry of the cell. ++ Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich); ++ long nSizeX, nSizeY; ++ pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeX, nSizeY); ++ Size aScrSize(nSizeX-1, nSizeY-1); ++ ++ // Check if the mouse cursor is clicking on the popup arrow box. ++ ScDPFieldButton aBtn(this, &GetSettings().GetStyleSettings()); ++ aBtn.setBoundingBox(aScrPos, aScrSize); ++ Point aPopupPos; ++ Size aPopupSize; ++ aBtn.getPopupBoundingBox(aPopupPos, aPopupSize); ++ Rectangle aRec(aPopupPos, aPopupSize); ++ if (aRec.IsInside(rMEvt.GetPosPixel())) ++ { ++ // Mouse cursor inside the popup arrow box. Launch the field menu. ++ DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, rPos, pDPObj); ++ return true; ++ } ++ ++ return false; ++} ++ ++namespace { ++ ++struct DPFieldPopupData : public ScDPFieldPopupWindow::ExtendedData ++{ ++ ScPivotParam maDPParam; ++ ScDPObject* mpDPObj; ++ long mnDim; ++}; ++ ++class DPFieldPopupOKAction : public ScMenuFloatingWindow::Action ++{ ++public: ++ explicit DPFieldPopupOKAction(ScGridWindow* p) : ++ mpGridWindow(p) {} ++ ++ virtual void execute() ++ { ++ mpGridWindow->UpdateDPFromFieldPopupMenu(); ++ } ++private: ++ ScGridWindow* mpGridWindow; ++}; ++ ++class PopupSortAction : public ScMenuFloatingWindow::Action ++{ ++public: ++ enum SortType { ASCENDING, DESCENDING, CUSTOM }; ++ ++ explicit PopupSortAction(const ScAddress& rPos, SortType eType, sal_uInt16 nUserListIndex, ScTabViewShell* pViewShell) : ++ maPos(rPos), meType(eType), mnUserListIndex(nUserListIndex), mpViewShell(pViewShell) {} ++ ++ virtual void execute() ++ { ++ switch (meType) ++ { ++ case ASCENDING: ++ mpViewShell->DataPilotSort(maPos, true); ++ break; ++ case DESCENDING: ++ mpViewShell->DataPilotSort(maPos, false); ++ break; ++ case CUSTOM: ++ mpViewShell->DataPilotSort(maPos, true, &mnUserListIndex); ++ break; ++ default: ++ ; ++ } ++ } ++ ++private: ++ ScAddress maPos; ++ SortType meType; ++ sal_uInt16 mnUserListIndex; ++ ScTabViewShell* mpViewShell; ++}; ++ ++} ++ ++void ScGridWindow::DPLaunchFieldPopupMenu( ++ const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj) ++{ ++ // We need to get the list of field members. ++ auto_ptr pDPData(new DPFieldPopupData); ++ pDPObj->FillLabelData(pDPData->maDPParam); ++ pDPData->mpDPObj = pDPObj; ++ ++ USHORT nOrient; ++ pDPData->mnDim = pDPObj->GetHeaderDim(rPos, nOrient); ++ ++ if (pDPData->maDPParam.maLabelArray.size() <= static_cast(pDPData->mnDim)) ++ // out-of-bound dimension ID. This should never happen! ++ return; ++ ++ const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim]; ++ ++ mpDPFieldPopup.reset(new ScDPFieldPopupWindow(this, pViewData->GetDocument())); ++ mpDPFieldPopup->setName(OUString::createFromAscii("DataPilot field member popup")); ++ mpDPFieldPopup->setExtendedData(pDPData.release()); ++ mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this)); ++ { ++ // Populate field members. ++ size_t n = rLabelData.maMembers.size(); ++ mpDPFieldPopup->setMemberSize(n); ++ for (size_t i = 0; i < n; ++i) ++ { ++ const ScDPLabelData::Member& rMem = rLabelData.maMembers[i]; ++ mpDPFieldPopup->addMember(rMem.getDisplayName(), rMem.mbVisible); ++ } ++ mpDPFieldPopup->initMembers(); ++ } ++ ++ vector aUserSortNames; ++ ScUserList* pUserList = ScGlobal::GetUserList(); ++ if (pUserList) ++ { ++ sal_uInt16 n = pUserList->GetCount(); ++ aUserSortNames.reserve(n); ++ for (sal_uInt16 i = 0; i < n; ++i) ++ { ++ ScUserListData* pData = static_cast((*pUserList)[i]); ++ aUserSortNames.push_back(pData->GetString()); ++ } ++ } ++ ++ // Populate the menus. ++ ScTabViewShell* pViewShell = pViewData->GetViewShell(); ++ mpDPFieldPopup->addMenuItem( ++ ScRscStrLoader(RID_POPUP_FILTER, STR_MENU_SORT_ASC).GetString(), true, ++ new PopupSortAction(rPos, PopupSortAction::ASCENDING, 0, pViewShell)); ++ mpDPFieldPopup->addMenuItem( ++ ScRscStrLoader(RID_POPUP_FILTER, STR_MENU_SORT_DESC).GetString(), true, ++ new PopupSortAction(rPos, PopupSortAction::DESCENDING, 0, pViewShell)); ++ ScMenuFloatingWindow* pSubMenu = mpDPFieldPopup->addSubMenuItem( ++ ScRscStrLoader(RID_POPUP_FILTER, STR_MENU_SORT_CUSTOM).GetString(), !aUserSortNames.empty()); ++ ++ if (pSubMenu && !aUserSortNames.empty()) ++ { ++ size_t n = aUserSortNames.size(); ++ for (size_t i = 0; i < n; ++i) ++ { ++ pSubMenu->addMenuItem( ++ aUserSortNames[i], true, ++ new PopupSortAction(rPos, PopupSortAction::CUSTOM, i, pViewShell)); ++ } ++ } ++ ++ Rectangle aCellRect(rScrPos, rScrSize); ++ const Size& rPopupSize = mpDPFieldPopup->getWindowSize(); ++ if (rScrSize.getWidth() > rPopupSize.getWidth()) ++ { ++ // If the cell width is larger than the popup window width, launch it ++ // right-aligned with the cell. ++ long nXOffset = rScrSize.getWidth() - rPopupSize.getWidth(); ++ aCellRect.SetPos(Point(rScrPos.X() + nXOffset, rScrPos.Y())); ++ } ++ mpDPFieldPopup->SetPopupModeEndHdl( LINK(this, ScGridWindow, PopupModeEndHdl) ); ++ mpDPFieldPopup->StartPopupMode(aCellRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS)); ++} ++ ++void ScGridWindow::UpdateDPFromFieldPopupMenu() ++{ ++ typedef hash_map MemNameMapType; ++ typedef hash_map MemVisibilityType; ++ ++ if (!mpDPFieldPopup.get()) ++ return; ++ ++ DPFieldPopupData* pDPData = static_cast(mpDPFieldPopup->getExtendedData()); ++ if (!pDPData) ++ return; ++ ++ ScDPObject* pDPObj = pDPData->mpDPObj; ++ ScDPObject aNewDPObj(*pDPObj); ++ aNewDPObj.BuildAllDimensionMembers(); ++ ScDPSaveData* pSaveData = aNewDPObj.GetSaveData(); ++ ++ BOOL bIsDataLayout; ++ String aDimName = pDPObj->GetDimName(pDPData->mnDim, bIsDataLayout); ++ ScDPSaveDimension* pDim = pSaveData->GetDimensionByName(aDimName); ++ if (!pDim) ++ return; ++ ++ // Build a map of layout names to original names. ++ const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim]; ++ MemNameMapType aMemNameMap; ++ for (vector::const_iterator itr = rLabelData.maMembers.begin(), itrEnd = rLabelData.maMembers.end(); ++ itr != itrEnd; ++itr) ++ aMemNameMap.insert(MemNameMapType::value_type(itr->maLayoutName, itr->maName)); ++ ++ // The raw result may contain a mixture of layout names and original names. ++ MemVisibilityType aRawResult; ++ mpDPFieldPopup->getResult(aRawResult); ++ ++ MemVisibilityType aResult; ++ for (MemVisibilityType::const_iterator itr = aRawResult.begin(), itrEnd = aRawResult.end(); itr != itrEnd; ++itr) ++ { ++ MemNameMapType::const_iterator itrNameMap = aMemNameMap.find(itr->first); ++ if (itrNameMap == aMemNameMap.end()) ++ // This is an original member name. Use it as-is. ++ aResult.insert(MemVisibilityType::value_type(itr->first, itr->second)); ++ else ++ { ++ // This is a layout name. Get the original member name and use it. ++ aResult.insert(MemVisibilityType::value_type(itrNameMap->second, itr->second)); ++ } ++ } ++ pDim->UpdateMemberVisibility(aResult); ++ ++ ScDBDocFunc aFunc(*pViewData->GetDocShell()); ++ aFunc.DataPilotUpdate(pDPObj, &aNewDPObj, true, false); ++} ++ + void ScGridWindow::DPMouseMove( const MouseEvent& rMEvt ) + { + DPTestMouse( rMEvt, TRUE ); +diff --git sc/source/ui/view/gridwin4.cxx sc/source/ui/view/gridwin4.cxx +index 76d6e02..1cd54a2 100644 +--- sc/source/ui/view/gridwin4.cxx ++++ sc/source/ui/view/gridwin4.cxx +@@ -73,6 +73,7 @@ + #include "editutil.hxx" + #include "inputopt.hxx" + #include "fillinfo.hxx" ++#include "dpcontrol.hxx" + #include "sc.hrc" + #include + +@@ -1203,6 +1204,8 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 + { + aComboButton.SetOutputDevice( pContentDev ); + ++ ScDPFieldButton aCellBtn(pContentDev, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY()); ++ + SCCOL nCol; + SCROW nRow; + SCSIZE nArrY; +@@ -1284,14 +1287,14 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 + bool bArrowState = bSimpleQuery && bColumnFound; + long nSizeX; + long nSizeY; +- + pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); +- aComboButton.SetOptSizePixel(); +- DrawComboButton( pViewData->GetScrPos( nCol, nRow, eWhich ), +- nSizeX, nSizeY, bArrowState ); ++ Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich ); + +- aComboButton.SetPosPixel( aOldPos ); // alten Zustand +- aComboButton.SetSizePixel( aOldSize ); // fuer MouseUp/Down ++ aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1)); ++ aCellBtn.setDrawBaseButton(false); ++ aCellBtn.setDrawPopupButton(true); ++ aCellBtn.setHasHiddenMember(bArrowState); ++ aCellBtn.draw(); + } + } + } +@@ -1318,13 +1321,14 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 + nPosX -= nSizeX - 2; + } + +- pContentDev->SetLineColor( GetSettings().GetStyleSettings().GetLightColor() ); +- pContentDev->DrawLine( Point(nPosX,nPosY), Point(nPosX,nPosY+nSizeY-1) ); +- pContentDev->DrawLine( Point(nPosX,nPosY), Point(nPosX+nSizeX-1,nPosY) ); +- pContentDev->SetLineColor( GetSettings().GetStyleSettings().GetDarkShadowColor() ); +- pContentDev->DrawLine( Point(nPosX,nPosY+nSizeY-1), Point(nPosX+nSizeX-1,nPosY+nSizeY-1) ); +- pContentDev->DrawLine( Point(nPosX+nSizeX-1,nPosY), Point(nPosX+nSizeX-1,nPosY+nSizeY-1) ); +- pContentDev->SetLineColor( COL_BLACK ); ++ String aStr; ++ pDoc->GetString(nCol, nRow, nTab, aStr); ++ aCellBtn.setText(aStr); ++ aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1)); ++ aCellBtn.setDrawBaseButton(true); ++ aCellBtn.setDrawPopupButton(pInfo->bPopupButton); ++ aCellBtn.setHasHiddenMember(pInfo->bFilterActive); ++ aCellBtn.draw(); + } + } + } +diff --git sc/source/ui/view/tabview.cxx sc/source/ui/view/tabview.cxx +index 917d7ff..925a2b7 100644 +--- sc/source/ui/view/tabview.cxx ++++ sc/source/ui/view/tabview.cxx +@@ -200,6 +200,8 @@ + #include "AccessibilityHints.hxx" + #include "appoptio.hxx" + ++#include ++ + #include + #include + +@@ -212,6 +214,8 @@ + // fuer Rad-Maus + #define SC_DELTA_ZOOM 10 + ++using namespace ::com::sun::star; ++ + // STATIC DATA ----------------------------------------------------------- + + +@@ -2476,7 +2480,7 @@ sal_Bool ScTabView::HasPageFieldDataAtCursor() const + SCCOL nCol = aViewData.GetCurX(); + SCROW nRow = aViewData.GetCurY(); + if (pWin) +- return pWin->HasPageFieldData( nCol, nRow ); ++ return pWin->GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE; + + return sal_False; + } +@@ -2486,15 +2490,23 @@ void ScTabView::StartDataSelect() + ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()]; + SCCOL nCol = aViewData.GetCurX(); + SCROW nRow = aViewData.GetCurY(); +- if (pWin) +- { +- // #i36598# If the cursor is on a page field's data cell, +- // no meaningful input is possible anyway, so this function +- // can be used to select a page field entry. + +- if ( pWin->HasPageFieldData( nCol, nRow ) ) +- pWin->DoPageFieldMenue( nCol, nRow ); +- else ++ if (!pWin) ++ return; ++ ++ switch (pWin->GetDPFieldOrientation(nCol, nRow)) ++ { ++ case sheet::DataPilotFieldOrientation_PAGE: ++ // #i36598# If the cursor is on a page field's data cell, ++ // no meaningful input is possible anyway, so this function ++ // can be used to select a page field entry. ++ pWin->LaunchPageFieldMenu( nCol, nRow ); ++ break; ++ case sheet::DataPilotFieldOrientation_COLUMN: ++ case sheet::DataPilotFieldOrientation_ROW: ++ pWin->LaunchDPFieldMenu( nCol, nRow ); ++ break; ++ default: + pWin->DoAutoFilterMenue( nCol, nRow, TRUE ); + } + } +diff --git sc/util/makefile.mk sc/util/makefile.mk +index 4fdc5ac..2b56e37 100644 +--- sc/util/makefile.mk ++++ sc/util/makefile.mk +@@ -58,6 +58,7 @@ RESLIB1LIST=\ + $(SRS)$/formdlgs.srs \ + $(SRS)$/pagedlg.srs \ + $(SRS)$/navipi.srs \ ++ $(SRS)$/cctrl.srs \ + $(SOLARCOMMONRESDIR)$/sfx.srs + + RESLIB1NAME=sc diff --git a/applied_patches/0007-cws-koheidatapilot03-vcl.diff b/applied_patches/0007-cws-koheidatapilot03-vcl.diff new file mode 100644 index 000000000..7e225554e --- /dev/null +++ b/applied_patches/0007-cws-koheidatapilot03-vcl.diff @@ -0,0 +1,507 @@ +diff --git vcl/inc/vcl/popupmenuwindow.hxx vcl/inc/vcl/popupmenuwindow.hxx +new file mode 100644 +index 0000000..ef31da0 +--- /dev/null ++++ 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 ++ * ++ * 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 vcl/inc/vcl/vclevent.hxx vcl/inc/vcl/vclevent.hxx +index 8d84666..59163ca 100644 +--- vcl/inc/vcl/vclevent.hxx ++++ vcl/inc/vcl/vclevent.hxx +@@ -35,11 +35,19 @@ + #include + #include + ++#include ++ + #include + + class Window; + class Menu; + ++namespace com { namespace sun { namespace star { ++ namespace accessibility { ++ class XAccessible; ++ } ++}}} ++ + #define VCLEVENT_OBJECT_DYING 1 + + // VclWindowEvent: +@@ -239,6 +247,16 @@ 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 ); ++ ::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 + { + public: +diff --git vcl/inc/vcl/window.h vcl/inc/vcl/window.h +index b81aed8..0e25330 100644 +--- vcl/inc/vcl/window.h ++++ vcl/inc/vcl/window.h +@@ -358,7 +358,8 @@ public: + mbToolbarFloatingWindow:1, + mbCallHandlersDuringInputDisabled:1, + mbDisableAccessibleLabelForRelation:1, +- mbDisableAccessibleLabeledByRelation:1; ++ mbDisableAccessibleLabeledByRelation:1, ++ mbFakeFocusSet:1; + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer; + }; +diff --git vcl/inc/vcl/window.hxx vcl/inc/vcl/window.hxx +index d927ab0..945f1c5 100644 +--- vcl/inc/vcl/window.hxx ++++ 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 vcl/prj/d.lst vcl/prj/d.lst +index d9c14f4..7ac2c74 100644 +--- vcl/prj/d.lst ++++ vcl/prj/d.lst +@@ -84,6 +84,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl\plug\vcl + ..\inc\vcl\octree.hxx %_DEST%\inc%_EXT%\vcl\octree.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 +diff --git vcl/source/app/vclevent.cxx vcl/source/app/vclevent.cxx +index 75ef1ea..fef22ff 100644 +--- vcl/source/app/vclevent.cxx ++++ vcl/source/app/vclevent.cxx +@@ -34,10 +34,24 @@ + #include "vcl/vclevent.hxx" + #include "vcl/svdata.hxx" + ++#include ++ ++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& rxAccessible ) : ++ VclSimpleEvent(n), ++ mxAccessible(rxAccessible) {} ++ ++Reference VclAccessibleEvent::GetAccessible() const ++{ ++ return mxAccessible; ++} ++ + void VclEventListeners::Call( VclSimpleEvent* pEvent ) const + { + // Copy the list, because this can be destroyed when calling a Link... +diff --git vcl/source/window/makefile.mk vcl/source/window/makefile.mk +index 169cf44..d17ea6c 100644 +--- vcl/source/window/makefile.mk ++++ vcl/source/window/makefile.mk +@@ -69,6 +69,7 @@ SLOFILES= \ + $(SLO)$/mnemonic.obj \ + $(SLO)$/mnemonicengine.obj \ + $(SLO)$/msgbox.obj \ ++ $(SLO)$/popupmenuwindow.obj \ + $(SLO)$/scrwnd.obj \ + $(SLO)$/seleng.obj \ + $(SLO)$/split.obj \ +diff --git vcl/source/window/popupmenuwindow.cxx vcl/source/window/popupmenuwindow.cxx +new file mode 100644 +index 0000000..869f52b +--- /dev/null ++++ vcl/source/window/popupmenuwindow.cxx +@@ -0,0 +1,82 @@ ++/************************************************************************* ++ * ++ * 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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_vcl.hxx" ++ ++#include "vcl/popupmenuwindow.hxx" ++ ++#include ++ ++struct PopupMenuFloatingWindow::ImplData ++{ ++ sal_uInt16 mnMenuStackLevel; // Store the stack level of a popup menu. 0 = top-level menu. ++ ++ ImplData(); ++ ~ImplData(); ++}; ++ ++PopupMenuFloatingWindow::ImplData::ImplData() : ++ mnMenuStackLevel( ::std::numeric_limits::max() ) ++{ ++} ++ ++PopupMenuFloatingWindow::ImplData::~ImplData() ++{ ++} ++ ++// ============================================================================ ++ ++PopupMenuFloatingWindow::PopupMenuFloatingWindow( Window* pParent, WinBits nStyle ) : ++ FloatingWindow(pParent, nStyle), ++ mpImplData(new ImplData) ++{ ++} ++ ++PopupMenuFloatingWindow::~PopupMenuFloatingWindow() ++{ ++ delete mpImplData; ++} ++ ++sal_uInt16 PopupMenuFloatingWindow::GetMenuStackLevel() const ++{ ++ return mpImplData->mnMenuStackLevel; ++} ++ ++void PopupMenuFloatingWindow::SetMenuStackLevel( sal_uInt16 nLevel ) ++{ ++ mpImplData->mnMenuStackLevel = nLevel; ++} ++ ++bool PopupMenuFloatingWindow::IsPopupMenu() const ++{ ++ return mpImplData->mnMenuStackLevel != ::std::numeric_limits::max(); ++} ++ +diff --git vcl/source/window/window.cxx vcl/source/window/window.cxx +index 2b14764..4ff4999 100644 +--- vcl/source/window/window.cxx ++++ vcl/source/window/window.cxx +@@ -690,6 +690,7 @@ void Window::ImplInitWindowData( WindowType nType ) + mpWindowImpl->mbCallHandlersDuringInputDisabled = FALSE; // TRUE: call event handlers even if input is disabled + mpWindowImpl->mbDisableAccessibleLabelForRelation = FALSE; // TRUE: do not set LabelFor relation on accessible objects + mpWindowImpl->mbDisableAccessibleLabeledByRelation = FALSE; // TRUE: do not set LabeledBy relation on accessible objects ++ mpWindowImpl->mbFakeFocusSet = FALSE; // TRUE: pretend as if the window has focus. + + mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active + } +@@ -3901,6 +3902,20 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow, + } + } + ++static bool IsWindowFocused(const WindowImpl& rWinImpl) ++{ ++ if (rWinImpl.mpSysObj) ++ return true; ++ ++ if (rWinImpl.mpFrameData->mbHasFocus) ++ return true; ++ ++ if (rWinImpl.mbFakeFocusSet) ++ return true; ++ ++ return false; ++} ++ + // ----------------------------------------------------------------------- + void Window::ImplGrabFocus( USHORT nFlags ) + { +@@ -3972,9 +3987,7 @@ void Window::ImplGrabFocus( USHORT nFlags ) + pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame; + } + +- BOOL bHasFocus = TRUE; +- if ( !mpWindowImpl->mpSysObj && !mpWindowImpl->mpFrameData->mbHasFocus ) +- bHasFocus = FALSE; ++ bool bHasFocus = IsWindowFocused(*mpWindowImpl); + + BOOL bMustNotGrabFocus = FALSE; + // #100242#, check parent hierarchy if some floater prohibits grab focus +@@ -5367,6 +5380,11 @@ void Window::CallEventListeners( ULONG nEvent, void* pData ) + } + } + ++void Window::FireVclEvent( VclSimpleEvent* pEvent ) ++{ ++ ImplGetSVData()->mpApp->ImplCallEventListeners(pEvent); ++} ++ + // ----------------------------------------------------------------------- + + void Window::AddEventListener( const Link& rEventListener ) +@@ -7742,6 +7760,11 @@ void Window::GrabFocusToDocument() + } + } + ++void Window::SetFakeFocus( bool bFocus ) ++{ ++ ImplGetWindowImpl()->mbFakeFocusSet = bFocus; ++} ++ + // ----------------------------------------------------------------------- + + BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const +diff --git vcl/unx/gtk/a11y/atkutil.cxx vcl/unx/gtk/a11y/atkutil.cxx +index 5206c8c..be6f95e 100644 +--- vcl/unx/gtk/a11y/atkutil.cxx ++++ vcl/unx/gtk/a11y/atkutil.cxx +@@ -659,7 +659,16 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent) + static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + */ + case VCLEVENT_MENU_HIGHLIGHT: +- handle_menu_highlighted(static_cast< ::VclMenuEvent const * >(pEvent)); ++ if (const VclMenuEvent* pMenuEvent = dynamic_cast(pEvent)) ++ { ++ handle_menu_highlighted(pMenuEvent); ++ } ++ else if (const VclAccessibleEvent* pAccEvent = dynamic_cast(pEvent)) ++ { ++ uno::Reference< accessibility::XAccessible > xAccessible = pAccEvent->GetAccessible(); ++ if (xAccessible.is()) ++ atk_wrapper_focus_tracker_notify_when_idle(xAccessible); ++ } + break; + + case VCLEVENT_TOOLBOX_HIGHLIGHT: +diff --git vcl/unx/gtk/a11y/atkwindow.cxx vcl/unx/gtk/a11y/atkwindow.cxx +index e98a809..23ba24c 100644 +--- vcl/unx/gtk/a11y/atkwindow.cxx ++++ vcl/unx/gtk/a11y/atkwindow.cxx +@@ -33,6 +33,7 @@ + + #include + #include ++#include "vcl/popupmenuwindow.hxx" + + #include "atkwindow.hxx" + #include "atkwrapper.hxx" +@@ -108,6 +109,17 @@ init_from_window( AtkObject *accessible, Window *pWindow ) + pChild->SetAccessibleRole( AccessibleRole::LABEL ); + accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); + } ++ else if ( pWindow->GetType() == WINDOW_BORDERWINDOW && pChild->GetType() == WINDOW_FLOATINGWINDOW ) ++ { ++ PopupMenuFloatingWindow* p = dynamic_cast(pChild); ++ if (p && p->IsPopupMenu() && p->GetMenuStackLevel() == 0) ++ { ++ // This is a top-level menu popup. Register it. ++ role = ATK_ROLE_POPUP_MENU; ++ pChild->SetAccessibleRole( AccessibleRole::POPUP_MENU ); ++ accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); ++ } ++ } + } + break; + } +@@ -136,6 +148,23 @@ ooo_window_wrapper_real_focus_gtk (GtkWidget *, GdkEventFocus *) + + /*****************************************************************************/ + ++static bool ++isChildPopupMenu(Window* pWindow) ++{ ++ Window* pChild = pWindow->GetAccessibleChildWindow(0); ++ if (!pChild) ++ return false; ++ ++ if (WINDOW_FLOATINGWINDOW != pChild->GetType()) ++ return false; ++ ++ PopupMenuFloatingWindow* p = dynamic_cast(pChild); ++ if (!p) ++ return false; ++ ++ return p->IsPopupMenu(); ++} ++ + static void + ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data) + { +@@ -157,8 +186,16 @@ ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data) + */ + if( WINDOW_BORDERWINDOW == pWindow->GetType() ) + { +- ooo_wrapper_registry_add( xAccessible, obj ); +- g_object_set_data( G_OBJECT(obj), "ooo:atk-wrapper-key", xAccessible.get() ); ++ if ( isChildPopupMenu(pWindow) ) ++ { ++ AtkObject *child = atk_object_wrapper_new( xAccessible, obj ); ++ ooo_wrapper_registry_add( xAccessible, child ); ++ } ++ else ++ { ++ ooo_wrapper_registry_add( xAccessible, obj ); ++ g_object_set_data( G_OBJECT(obj), "ooo:atk-wrapper-key", xAccessible.get() ); ++ } + } + else + { +diff --git vcl/unx/gtk/a11y/atkwrapper.cxx vcl/unx/gtk/a11y/atkwrapper.cxx +index 599f283..ac508bd 100644 +--- vcl/unx/gtk/a11y/atkwrapper.cxx ++++ vcl/unx/gtk/a11y/atkwrapper.cxx +@@ -514,6 +514,60 @@ wrapper_ref_relation_set( AtkObject *atk_obj ) + + /*****************************************************************************/ + ++#if 0 ++struct { ++ sal_Int16 value; ++ const sal_Char* name; ++} aStateTypeTable[] = { ++ { accessibility::AccessibleStateType::INVALID, "INVALID" }, ++ { accessibility::AccessibleStateType::ACTIVE, "ACTIVE" }, ++ { accessibility::AccessibleStateType::ARMED, "ARMED" }, ++ { accessibility::AccessibleStateType::BUSY, "BUSY" }, ++ { accessibility::AccessibleStateType::CHECKED, "CHECKED" }, ++ { accessibility::AccessibleStateType::DEFUNC, "DEFUNC" }, ++ { accessibility::AccessibleStateType::EDITABLE, "EDITABLE" }, ++ { accessibility::AccessibleStateType::ENABLED, "ENABLED" }, ++ { accessibility::AccessibleStateType::EXPANDABLE, "EXPANDABLE" }, ++ { accessibility::AccessibleStateType::EXPANDED, "EXPANDED" }, ++ { accessibility::AccessibleStateType::FOCUSABLE, "FOCUSABLE" }, ++ { accessibility::AccessibleStateType::FOCUSED, "FOCUSED" }, ++ { accessibility::AccessibleStateType::HORIZONTAL, "HORIZONTAL" }, ++ { accessibility::AccessibleStateType::ICONIFIED, "ICONIFIED" }, ++ { accessibility::AccessibleStateType::INDETERMINATE, "INDETERMINATE" }, ++ { accessibility::AccessibleStateType::MANAGES_DESCENDANTS, "MANAGES_DESCENDANTS" }, ++ { accessibility::AccessibleStateType::MODAL, "MODAL" }, ++ { accessibility::AccessibleStateType::MULTI_LINE, "MULTI_LINE" }, ++ { accessibility::AccessibleStateType::MULTI_SELECTABLE, "MULTI_SELECTABLE" }, ++ { accessibility::AccessibleStateType::OPAQUE, "OPAQUE" }, ++ { accessibility::AccessibleStateType::PRESSED, "PRESSED" }, ++ { accessibility::AccessibleStateType::RESIZABLE, "RESIZABLE" }, ++ { accessibility::AccessibleStateType::SELECTABLE, "SELECTABLE" }, ++ { accessibility::AccessibleStateType::SELECTED, "SELECTED" }, ++ { accessibility::AccessibleStateType::SENSITIVE, "SENSITIVE" }, ++ { accessibility::AccessibleStateType::SHOWING, "SHOWING" }, ++ { accessibility::AccessibleStateType::SINGLE_LINE, "SINGLE_LINE" }, ++ { accessibility::AccessibleStateType::STALE, "STALE" }, ++ { accessibility::AccessibleStateType::TRANSIENT, "TRANSIENT" }, ++ { accessibility::AccessibleStateType::VERTICAL, "VERTICAL" }, ++ { accessibility::AccessibleStateType::VISIBLE, "VISIBLE" } ++}; ++ ++static void printStates(const uno::Sequence& rStates) ++{ ++ sal_Int32 n = rStates.getLength(); ++ size_t nTypes = sizeof(aStateTypeTable)/sizeof(aStateTypeTable[0]); ++ for (sal_Int32 i = 0; i < n; ++i) ++ { ++ for (size_t j = 0; j < nTypes; ++j) ++ { ++ if (aStateTypeTable[j].value == rStates[i]) ++ printf("%s ", aStateTypeTable[j].name); ++ } ++ } ++ printf("\n"); ++} ++#endif ++ + static AtkStateSet * + wrapper_ref_state_set( AtkObject *atk_obj ) + { diff --git a/applied_patches/0008-cws-koheidatapilot03-xmloff.diff b/applied_patches/0008-cws-koheidatapilot03-xmloff.diff new file mode 100644 index 000000000..af2b5a1ed --- /dev/null +++ b/applied_patches/0008-cws-koheidatapilot03-xmloff.diff @@ -0,0 +1,24 @@ +diff --git xmloff/inc/xmloff/xmltoken.hxx xmloff/inc/xmloff/xmltoken.hxx +index 0010b61..a1ac269 100644 +--- xmloff/inc/xmloff/xmltoken.hxx ++++ xmloff/inc/xmloff/xmltoken.hxx +@@ -516,6 +516,7 @@ namespace xmloff { namespace token { + XML_DATA_LABEL_SYMBOL, + XML_DATA_LABEL_TEXT, + XML_DATA_PILOT_FIELD, ++ XML_DATA_PILOT_GRAND_TOTAL, + XML_DATA_PILOT_LEVEL, + XML_DATA_PILOT_MEMBER, + XML_DATA_PILOT_MEMBERS, +diff --git xmloff/source/core/xmltoken.cxx xmloff/source/core/xmltoken.cxx +index 70319b4..e1357c3 100644 +--- xmloff/source/core/xmltoken.cxx ++++ xmloff/source/core/xmltoken.cxx +@@ -524,6 +524,7 @@ namespace xmloff { namespace token { + TOKEN( "data-label-symbol", XML_DATA_LABEL_SYMBOL ), + TOKEN( "data-label-text", XML_DATA_LABEL_TEXT ), + TOKEN( "data-pilot-field", XML_DATA_PILOT_FIELD ), ++ TOKEN( "data-pilot-grand-total", XML_DATA_PILOT_GRAND_TOTAL ), + TOKEN( "data-pilot-level", XML_DATA_PILOT_LEVEL ), + TOKEN( "data-pilot-member", XML_DATA_PILOT_MEMBER ), + TOKEN( "data-pilot-members", XML_DATA_PILOT_MEMBERS ), diff --git a/applied_patches/0009-cws-koheicsvimport-filter.diff b/applied_patches/0009-cws-koheicsvimport-filter.diff new file mode 100644 index 000000000..ea495eea2 --- /dev/null +++ b/applied_patches/0009-cws-koheicsvimport-filter.diff @@ -0,0 +1,26 @@ +diff --git filter/source/config/fragments/filters/HTML__StarCalc_.xcu filter/source/config/fragments/filters/HTML__StarCalc_.xcu +index f691055..876f989 100644 +--- filter/source/config/fragments/filters/HTML__StarCalc_.xcu ++++ filter/source/config/fragments/filters/HTML__StarCalc_.xcu +@@ -1,6 +1,6 @@ + +- IMPORT EXPORT ALIEN +- ++ IMPORT EXPORT ALIEN USEOPTIONS ++ com.sun.star.comp.Calc.FilterOptionsDialog + + + 0 +diff --git filter/source/config/fragments/filters/calc_HTML_WebQuery.xcu filter/source/config/fragments/filters/calc_HTML_WebQuery.xcu +index 1a3aa01..9f6735e 100644 +--- filter/source/config/fragments/filters/calc_HTML_WebQuery.xcu ++++ filter/source/config/fragments/filters/calc_HTML_WebQuery.xcu +@@ -1,6 +1,6 @@ + +- IMPORT ALIEN +- ++ IMPORT ALIEN USEOPTIONS ++ com.sun.star.comp.Calc.FilterOptionsDialog + + + 0 diff --git a/applied_patches/0010-cws-koheicsvimport-officecfg.diff b/applied_patches/0010-cws-koheicsvimport-officecfg.diff new file mode 100644 index 000000000..9bf0b52fe --- /dev/null +++ b/applied_patches/0010-cws-koheicsvimport-officecfg.diff @@ -0,0 +1,102 @@ +diff --git officecfg/registry/schema/org/openoffice/Office/Calc.xcs officecfg/registry/schema/org/openoffice/Office/Calc.xcs +index fd7c52e..ff5a13c 100644 +--- officecfg/registry/schema/org/openoffice/Office/Calc.xcs ++++ officecfg/registry/schema/org/openoffice/Office/Calc.xcs +@@ -1019,6 +1019,97 @@ + NULL + + ++ ++ ++ Contains the dialogs settings. ++ ++ ++ ++ Contains setting for Text CSV Import ++ ++ ++ ++ muthusuba ++ Merge Delimiter check box status ++ ++ ++ false ++ ++ ++ ++ kyoshida ++ If true, quoted field is always imported as text ++ with no exception. ++ ++ ++ true ++ ++ ++ ++ kyoshida ++ If true, Calc tries to detect special number format, such as date and scientific notation. ++ ++ ++ false ++ ++ ++ ++ kyoshida ++ Language to use for CSV import. This determines how the numbers are parsed. ++ ++ ++ 0 ++ ++ ++ ++ muthusuba ++ List of Separators - as a String ++ ++ ++ ; ++ ++ ++ ++ muthusuba ++ Text Separators ++ ++ ++ " ++ ++ ++ ++ muthusuba ++ Fixed width ++ ++ ++ false ++ ++ ++ ++ muthusuba ++ From Row ++ ++ ++ 1 ++ ++ ++ ++ muthusuba ++ Char Set ++ ++ ++ -1 ++ ++ ++ ++ muthusuba ++ Fixed Width List of separators ++ ++ ++ ++ ++ ++ + + + Contains settings that affect cell calculation. diff --git a/applied_patches/0011-cws-koheicsvimport-sc.diff b/applied_patches/0011-cws-koheicsvimport-sc.diff new file mode 100644 index 000000000..e6e0bcf77 --- /dev/null +++ b/applied_patches/0011-cws-koheicsvimport-sc.diff @@ -0,0 +1,2677 @@ +diff --git sc/inc/column.hxx sc/inc/column.hxx +index ec87323..9854109 100644 +--- sc/inc/column.hxx ++++ sc/inc/column.hxx +@@ -239,7 +239,9 @@ public: + + // TRUE = Zahlformat gesetzt + BOOL SetString( SCROW nRow, SCTAB nTab, const String& rString, +- formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO ); ++ formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO, ++ SvNumberFormatter* pFormatter = NULL, ++ bool bDetectNumberFormat = true ); + void SetValue( SCROW nRow, const double& rVal); + void SetError( SCROW nRow, const USHORT nError); + +diff --git sc/inc/document.hxx sc/inc/document.hxx +index 14d606e..e41d15c 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -716,7 +716,9 @@ public: + SC_DLLPUBLIC void PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, + ULONG nFormatIndex, BOOL bForceTab = FALSE); + // return TRUE = Zahlformat gesetzt +- SC_DLLPUBLIC BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString ); ++ SC_DLLPUBLIC BOOL SetString( ++ SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, ++ SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); + SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal ); + void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError); + +diff --git sc/inc/filter.hxx sc/inc/filter.hxx +index 4e72620..bcb15f1 100644 +--- sc/inc/filter.hxx ++++ sc/inc/filter.hxx +@@ -42,6 +42,7 @@ class SvStream; + class ScAddress; + class ScDocument; + class ScRange; ++class SvNumberFormatter; + + // Return-Werte Im-/Exportfilter (ULONG) + +@@ -92,7 +93,9 @@ class ScEEAbsImport { + virtual ~ScEEAbsImport() {} + virtual ULONG Read( SvStream& rStream, const String& rBaseURL ) = 0; + virtual ScRange GetRange() = 0; +- virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0 ) = 0; ++ virtual void WriteToDocument( ++ BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0, ++ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0; + }; + + class ScFormatFilterPlugin { +@@ -109,7 +112,8 @@ class ScFormatFilterPlugin { + virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos, + const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL ) = 0; + virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange ) = 0; +- virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE ) = 0; ++ virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, ++ BOOL bCalcWidthHeight = TRUE, SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) = 0; + + // various import helpers + virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ) = 0; +diff --git sc/inc/optutil.hxx sc/inc/optutil.hxx +index ae7e8f5..73b29d6 100644 +--- sc/inc/optutil.hxx ++++ sc/inc/optutil.hxx +@@ -33,6 +33,7 @@ + + #include + #include ++#include "scdllapi.h" + + + class ScOptionsUtil +@@ -44,13 +45,13 @@ public: + + // ConfigItem for classes that use items from several sub trees + +-class ScLinkConfigItem : public utl::ConfigItem ++class SC_DLLPUBLIC ScLinkConfigItem : public utl::ConfigItem + { + Link aCommitLink; + + public: +- ScLinkConfigItem( const rtl::OUString rSubTree ); +- ScLinkConfigItem( const rtl::OUString rSubTree, sal_Int16 nMode ); ++ ScLinkConfigItem( const rtl::OUString& rSubTree ); ++ ScLinkConfigItem( const rtl::OUString& rSubTree, sal_Int16 nMode ); + void SetCommitLink( const Link& rLink ); + + virtual void Notify( const com::sun::star::uno::Sequence& aPropertyNames ); +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index 3e0a1f8..d67b625 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -1638,8 +1638,9 @@ + #define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150) + #define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) + #define RID_POPUP_FILTER (SC_DIALOGS_START + 152) ++#define RID_SCDLG_TEXT_IMPORT_OPTIONS (SC_DIALOGS_START + 153) + +-#define SC_DIALOGS_END (SC_DIALOGS_START + 153) ++#define SC_DIALOGS_END (SC_DIALOGS_START + 154) + + #ifndef STD_MASKCOLOR + #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } +diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx +index de99888..f5a40ee 100644 +--- sc/inc/scabstdlg.hxx ++++ sc/inc/scabstdlg.hxx +@@ -41,6 +41,7 @@ + #include "sc.hrc" + #include "global.hxx" + #include "pivot.hxx" ++#include "i18npool/lang.h" + + #include + +@@ -297,6 +298,14 @@ class AbstractScImportOptionsDlg : public VclAbstractDialog //add for ScImportO + public: + virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0; + }; ++ ++class AbstractScTextImportOptionsDlg : public VclAbstractDialog //add for ScLangChooserDlg ++{ ++public: ++ virtual LanguageType GetLanguageType() const = 0; ++ virtual bool IsDateConversionSet() const = 0; ++}; ++ + //-------Scabstract fractory --------------------------- + class ScAbstractDialogFactory + { +@@ -307,6 +316,8 @@ public: + SvStream* pInStream, int nId, + sal_Unicode cSep = '\t') = 0; + ++ virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg( Window* pParent, int nId ) = 0; ++ + virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg + ScAutoFormat* pAutoFormat, + const ScAutoFormatData* pSelFormatData, +diff --git sc/inc/stringutil.hxx sc/inc/stringutil.hxx +new file mode 100644 +index 0000000..4ca8629 +--- /dev/null ++++ sc/inc/stringutil.hxx +@@ -0,0 +1,56 @@ ++/************************************************************************* ++ * ++ * 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: table.hxx,v $ ++ * $Revision: 1.35 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_STRINGUTIL_HXX ++#define SC_STRINGUTIL_HXX ++ ++#include "rtl/ustring.hxx" ++ ++class ScStringUtil ++{ ++public: ++ /** ++ * Check if a given string is a simple decimal number (e.g. 12.345). We ++ * don't do any elaborate parsing here; we only check for the simplest ++ * case of decimal number format. ++ * ++ * @param rStr string to parse ++ * @param dsep decimal separator ++ * @param gsep group separator (aka thousands separator) ++ * @param rVal value of successfully parsed number ++ * ++ * @return true if the string is a valid number, false otherwise. ++ */ ++ static bool parseSimpleNumber( ++ const ::rtl::OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal); ++}; ++ ++ ++#endif +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 715e119..f8d8609 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -260,7 +260,8 @@ public: + void PutCell( SCCOL nCol, SCROW nRow, ScBaseCell* pCell ); + void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell); + // TRUE = Zahlformat gesetzt +- BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString ); ++ BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, ++ SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); + void SetValue( SCCOL nCol, SCROW nRow, const double& rVal ); + void SetError( SCCOL nCol, SCROW nRow, USHORT nError); + +diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx +index b2c954a..242c5c0 100644 +--- sc/source/core/data/column3.cxx ++++ sc/source/core/data/column3.cxx +@@ -54,6 +54,13 @@ + #include "markdata.hxx" + #include "detfunc.hxx" // fuer Notizen bei DeleteRange + #include "postit.hxx" ++#include "stringutil.hxx" ++ ++#include ++ ++using ::com::sun::star::i18n::LocaleDataItem; ++using ::rtl::OUString; ++using ::rtl::OUStringBuffer; + + // Err527 Workaround + extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx +@@ -1244,7 +1251,8 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 ) + + // TRUE = Zahlformat gesetzt + BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, +- formula::FormulaGrammar::AddressConvention eConv ) ++ formula::FormulaGrammar::AddressConvention eConv, ++ SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) + { + BOOL bNumFmtSet = FALSE; + if (VALIDROW(nRow)) +@@ -1256,7 +1264,8 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + double nVal; + sal_uInt32 nIndex, nOldIndex = 0; + sal_Unicode cFirstChar; +- SvNumberFormatter* pFormatter = pDocument->GetFormatTable(); ++ if (!pFormatter) ++ pFormatter = pDocument->GetFormatTable(); + SfxObjectShell* pDocSh = pDocument->GetDocumentShell(); + if ( pDocSh ) + bIsLoading = pDocSh->IsLoading(); +@@ -1323,46 +1332,78 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + if ( !bIsText ) + nIndex = nOldIndex = pFormatter->GetStandardIndex(); + } +- if ( !bIsText && +- pFormatter->IsNumberFormat(rString, nIndex, nVal) ) +- { // Zahl +- pNewCell = new ScValueCell( nVal ); +- if ( nIndex != nOldIndex) ++ ++ do ++ { ++ if (bIsText) ++ break; ++ ++ if (bDetectNumberFormat) + { +- // #i22345# New behavior: Apply the detected number format only if +- // the old one was the default number, date, time or boolean format. +- // Exception: If the new format is boolean, always apply it. ++ if (!pFormatter->IsNumberFormat(rString, nIndex, nVal)) ++ break; + +- BOOL bOverwrite = FALSE; +- const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex ); +- if ( pOldFormat ) ++ pNewCell = new ScValueCell( nVal ); ++ if ( nIndex != nOldIndex) + { +- short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED; +- if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE || +- nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL ) ++ // #i22345# New behavior: Apply the detected number format only if ++ // the old one was the default number, date, time or boolean format. ++ // Exception: If the new format is boolean, always apply it. ++ ++ BOOL bOverwrite = FALSE; ++ const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex ); ++ if ( pOldFormat ) + { +- if ( nOldIndex == pFormatter->GetStandardFormat( +- nOldType, pOldFormat->GetLanguage() ) ) ++ short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED; ++ if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE || ++ nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL ) + { +- bOverwrite = TRUE; // default of these types can be overwritten ++ if ( nOldIndex == pFormatter->GetStandardFormat( ++ nOldType, pOldFormat->GetLanguage() ) ) ++ { ++ bOverwrite = TRUE; // default of these types can be overwritten ++ } + } + } +- } +- if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL ) +- { +- bOverwrite = TRUE; // overwrite anything if boolean was detected +- } ++ if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL ) ++ { ++ bOverwrite = TRUE; // overwrite anything if boolean was detected ++ } + +- if ( bOverwrite ) +- { +- ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT, +- (UINT32) nIndex) ); +- bNumFmtSet = TRUE; ++ if ( bOverwrite ) ++ { ++ ApplyAttr( nRow, SfxUInt32Item( ATTR_VALUE_FORMAT, ++ (UINT32) nIndex) ); ++ bNumFmtSet = TRUE; ++ } + } + } ++ else ++ { ++ // Only check if the string is a regular number. ++ const LocaleDataWrapper* pLocale = pFormatter->GetLocaleData(); ++ if (!pLocale) ++ break; ++ ++ LocaleDataItem aLocaleItem = pLocale->getLocaleItem(); ++ const OUString& rDecSep = aLocaleItem.decimalSeparator; ++ const OUString& rGroupSep = aLocaleItem.thousandSeparator; ++ if (rDecSep.getLength() != 1 || rGroupSep.getLength() != 1) ++ break; ++ ++ sal_Unicode dsep = rDecSep.getStr()[0]; ++ sal_Unicode gsep = rGroupSep.getStr()[0]; ++ ++ if (!ScStringUtil::parseSimpleNumber(rString, dsep, gsep, nVal)) ++ break; ++ ++ pNewCell = new ScValueCell(nVal); ++ } + } +- else // Text +- pNewCell = new ScStringCell( rString ); ++ while (false); ++ ++ if (!pNewCell) ++ pNewCell = new ScStringCell(rString); + } + } + +diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx +index efb9693..6d6b8d1 100644 +--- sc/source/core/data/document.cxx ++++ sc/source/core/data/document.cxx +@@ -2359,10 +2359,11 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT + } + + +-BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString ) ++BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, ++ SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) + { +- if ( ValidTab(nTab) && pTab[nTab] ) +- return pTab[nTab]->SetString( nCol, nRow, nTab, rString ); ++ if ( ValidTab(nTab) && pTab[nTab] ) ++ return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter, bDetectNumberFormat ); + else + return FALSE; + } +diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx +index eac760e..29412c2 100644 +--- sc/source/core/data/table2.cxx ++++ sc/source/core/data/table2.cxx +@@ -846,10 +846,12 @@ void ScTable::PutCell( const ScAddress& rPos, ScBaseCell* pCell ) + //UNUSED2009-05 } + + +-BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString ) ++BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, ++ SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) + { + if (ValidColRow(nCol,nRow)) +- return aCol[nCol].SetString( nRow, nTabP, rString ); ++ return aCol[nCol].SetString( ++ nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat ); + else + return FALSE; + } +diff --git sc/source/core/tool/makefile.mk sc/source/core/tool/makefile.mk +index ac0aa23..0128310 100644 +--- sc/source/core/tool/makefile.mk ++++ sc/source/core/tool/makefile.mk +@@ -108,6 +108,7 @@ SLOFILES = \ + $(SLO)$/refupdat.obj \ + $(SLO)$/scmatrix.obj \ + $(SLO)$/sctictac.obj \ ++ $(SLO)$/stringutil.obj \ + $(SLO)$/subtotal.obj \ + $(SLO)$/token.obj \ + $(SLO)$/unitconv.obj \ +@@ -132,6 +133,7 @@ EXCEPTIONSFILES= \ + $(SLO)$/lookupcache.obj \ + $(SLO)$/prnsave.obj \ + $(SLO)$/reftokenhelper.obj \ ++ $(SLO)$/stringutil.obj \ + $(SLO)$/token.obj + + # [kh] POWERPC compiler problem +diff --git sc/source/core/tool/optutil.cxx sc/source/core/tool/optutil.cxx +index 69e720c..1ee7d04 100644 +--- sc/source/core/tool/optutil.cxx ++++ sc/source/core/tool/optutil.cxx +@@ -54,12 +54,12 @@ BOOL ScOptionsUtil::IsMetricSystem() + + //------------------------------------------------------------------ + +-ScLinkConfigItem::ScLinkConfigItem( const rtl::OUString rSubTree ) : ++ScLinkConfigItem::ScLinkConfigItem( const rtl::OUString& rSubTree ) : + ConfigItem( rSubTree ) + { + } + +-ScLinkConfigItem::ScLinkConfigItem( const rtl::OUString rSubTree, sal_Int16 nMode ) : ++ScLinkConfigItem::ScLinkConfigItem( const rtl::OUString& rSubTree, sal_Int16 nMode ) : + ConfigItem( rSubTree, nMode ) + { + } +diff --git sc/source/core/tool/stringutil.cxx sc/source/core/tool/stringutil.cxx +new file mode 100644 +index 0000000..ae6247f +--- /dev/null ++++ sc/source/core/tool/stringutil.cxx +@@ -0,0 +1,131 @@ ++/************************************************************************* ++ * ++ * 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: table.hxx,v $ ++ * $Revision: 1.35 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++// System - Includes ----------------------------------------------------- ++ ++#include "stringutil.hxx" ++#include "rtl/ustrbuf.hxx" ++#include "rtl/math.hxx" ++ ++using ::rtl::OUString; ++using ::rtl::OUStringBuffer; ++ ++bool ScStringUtil::parseSimpleNumber( ++ const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal) ++{ ++ if (gsep == 0x00A0) ++ // unicode space to ascii space ++ gsep = 0x0020; ++ ++ OUStringBuffer aBuf; ++ sal_Int32 n = rStr.getLength(); ++ const sal_Unicode* p = rStr.getStr(); ++ sal_Int32 nPosDSep = -1, nPosGSep = -1; ++ sal_uInt32 nDigitCount = 0; ++ ++ for (sal_Int32 i = 0; i < n; ++i) ++ { ++ sal_Unicode c = p[i]; ++ if (c == 0x00A0) ++ // unicode space to ascii space ++ c = 0x0020; ++ ++ if (sal_Unicode('0') <= c && c <= sal_Unicode('9')) ++ { ++ // this is a digit. ++ aBuf.append(c); ++ ++nDigitCount; ++ } ++ else if (c == dsep) ++ { ++ // this is a decimal separator. ++ ++ if (nPosDSep >= 0) ++ // a second decimal separator -> not a valid number. ++ return false; ++ ++ if (nPosGSep >= 0 && i - nPosGSep != 4) ++ // the number has a group separator and the decimal sep is not ++ // positioned correctly. ++ return false; ++ ++ nPosDSep = i; ++ nPosGSep = -1; ++ aBuf.append(c); ++ nDigitCount = 0; ++ } ++ else if (c == gsep) ++ { ++ // this is a group (thousand) separator. ++ ++ if (i == 0) ++ // not allowed as the first character. ++ return false; ++ ++ if (nPosDSep >= 0) ++ // not allowed after the decimal separator. ++ return false; ++ ++ if (nPosGSep >= 0 && nDigitCount != 3) ++ // must be exactly 3 digits since the last group separator. ++ return false; ++ ++ nPosGSep = i; ++ nDigitCount = 0; ++ } ++ else if (c == sal_Unicode('-') || c == sal_Unicode('+')) ++ { ++ // A sign must be the first character if it's given. ++ if (i == 0) ++ aBuf.append(c); ++ else ++ return false; ++ } ++ else ++ return false; ++ } ++ ++ // finished parsing the number. ++ ++ if (nPosGSep >= 0 && nDigitCount != 3) ++ // must be exactly 3 digits since the last group separator. ++ return false; ++ ++ rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok; ++ sal_Int32 nParseEnd = 0; ++ rVal = ::rtl::math::stringToDouble(aBuf.makeStringAndClear(), dsep, gsep, &eStatus, &nParseEnd); ++ if (eStatus != rtl_math_ConversionStatus_Ok) ++ return false; ++ ++ return true; ++} +diff --git sc/source/filter/html/htmlimp.cxx sc/source/filter/html/htmlimp.cxx +index 0ae9d9a..a0a0af1 100644 +--- sc/source/filter/html/htmlimp.cxx ++++ sc/source/filter/html/htmlimp.cxx +@@ -63,13 +63,14 @@ + //------------------------------------------------------------------------ + + FltError ScFormatFilterPluginImpl::ScImportHTML( SvStream &rStream, const String& rBaseURL, ScDocument *pDoc, +- ScRange& rRange, double nOutputFactor, BOOL bCalcWidthHeight ) ++ ScRange& rRange, double nOutputFactor, BOOL bCalcWidthHeight, SvNumberFormatter* pFormatter, ++ bool bConvertDate ) + { + ScHTMLImport aImp( pDoc, rBaseURL, rRange, bCalcWidthHeight ); + FltError nErr = (FltError) aImp.Read( rStream, rBaseURL ); + ScRange aR = aImp.GetRange(); + rRange.aEnd = aR.aEnd; +- aImp.WriteToDocument( TRUE, nOutputFactor ); ++ aImp.WriteToDocument( TRUE, nOutputFactor, pFormatter, bConvertDate ); + return nErr; + } + +@@ -137,9 +138,10 @@ void ScHTMLImport::InsertRangeName( ScDocument* pDoc, const String& rName, const + delete pRangeData; + } + +-void ScHTMLImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor ) ++void ScHTMLImport::WriteToDocument( ++ BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter, bool bConvertDate ) + { +- ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor ); ++ ScEEImport::WriteToDocument( bSizeColsRows, nOutputFactor, pFormatter, bConvertDate ); + + const ScHTMLParser* pParser = GetParser(); + const ScHTMLTable* pGlobTable = pParser->GetGlobalTable(); +diff --git sc/source/filter/inc/eeimport.hxx sc/source/filter/inc/eeimport.hxx +index fef4486..32d7d0a 100644 +--- sc/source/filter/inc/eeimport.hxx ++++ sc/source/filter/inc/eeimport.hxx +@@ -63,7 +63,9 @@ public: + virtual ULONG Read( SvStream& rStream, const String& rBaseURL ); + virtual ScRange GetRange() { return maRange; } + virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, +- double nOutputFactor = 1.0 ); ++ double nOutputFactor = 1.0, ++ SvNumberFormatter* pFormatter = NULL, ++ bool bConvertDate = true ); + }; + + #endif +diff --git sc/source/filter/inc/ftools.hxx sc/source/filter/inc/ftools.hxx +index 7e71708..5c05b27 100644 +--- sc/source/filter/inc/ftools.hxx ++++ sc/source/filter/inc/ftools.hxx +@@ -522,7 +522,9 @@ class ScFormatFilterPluginImpl : public ScFormatFilterPlugin { + virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos, + const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL ); + virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange ); +- virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE ); ++ virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange, ++ double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE, ++ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ); + + virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ); + virtual ScEEAbsImport *CreateHTMLImport( ScDocument* pDocP, const String& rBaseURL, const ScRange& rRange, BOOL bCalcWidthHeight ); +diff --git sc/source/filter/inc/htmlimp.hxx sc/source/filter/inc/htmlimp.hxx +index 9314458..a20e044 100644 +--- sc/source/filter/inc/htmlimp.hxx ++++ sc/source/filter/inc/htmlimp.hxx +@@ -45,7 +45,8 @@ public: + virtual ~ScHTMLImport(); + const ScHTMLParser* GetParser() const { return (ScHTMLParser*)mpParser; } + +- virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0 ); ++ virtual void WriteToDocument( BOOL bSizeColsRows = FALSE, double nOutputFactor = 1.0, ++ SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ); + + static String GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrigName ); + }; +diff --git sc/source/filter/rtf/eeimpars.cxx sc/source/filter/rtf/eeimpars.cxx +index 872b0a5..e78e371 100644 +--- sc/source/filter/rtf/eeimpars.cxx ++++ sc/source/filter/rtf/eeimpars.cxx +@@ -129,7 +129,7 @@ ULONG ScEEImport::Read( SvStream& rStream, const String& rBaseURL ) + } + + +-void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor ) ++void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNumberFormatter* pFormatter, bool bConvertDate ) + { + ScProgress* pProgress = new ScProgress( mpDoc->GetDocumentShell(), + ScGlobal::GetRscString( STR_LOAD_DOC ), mpParser->Count() ); +@@ -150,7 +150,8 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor ) + nLastMergedRow = SCROW_MAX; + BOOL bHasGraphics = FALSE; + ScEEParseEntry* pE; +- SvNumberFormatter* pFormatter = mpDoc->GetFormatTable(); ++ if (!pFormatter) ++ pFormatter = mpDoc->GetFormatTable(); + bool bNumbersEnglishUS = (pFormatter->GetLanguage() != LANGUAGE_ENGLISH_US); + if (bNumbersEnglishUS) + { +@@ -335,7 +336,7 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor ) + else if ( !pE->aSel.HasRange() ) + { + // maybe ALT text of IMG or similar +- mpDoc->SetString( nCol, nRow, nTab, pE->aAltText ); ++ mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, pFormatter ); + // wenn SelRange komplett leer kann nachfolgender Text im gleichen Absatz liegen! + } + else +@@ -380,7 +381,7 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor ) + if (bNumbersEnglishUS && !bEnUsRecognized) + mpDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aStr)); + else +- mpDoc->SetString( nCol, nRow, nTab, aStr ); ++ mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter, bConvertDate ); + } + } + else +diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx +index 219a657..e7a109b 100644 +--- sc/source/ui/attrdlg/scdlgfact.cxx ++++ sc/source/ui/attrdlg/scdlgfact.cxx +@@ -74,6 +74,7 @@ + #include "validate.hxx" //add for ScValidationDlg + #include "validate.hrc" //add for ScValidationDlg + #include "sortdlg.hxx" //add for ScSortDlg ++#include "textimportoptions.hxx" + #include "opredlin.hxx" //add for ScRedlineOptionsTabPage + #include "tpcalc.hxx" //add for ScTpCalcOptions + #include "tpprint.hxx" //add for ScTpPrintOptions +@@ -119,6 +120,7 @@ IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl); //add for ScNewScenarioDlg + IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); //add for ScShowTabDlg + IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); //add for ScStringInputDlg + IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); //add for ScImportOptionsDlg ++IMPL_ABSTDLG_BASE(AbstractScTextImportOptionsDlg_Impl); + IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg + + // AbstractTabDialog_Impl begin +@@ -624,6 +626,20 @@ void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOption + pDlg->GetImportOptions(rOptions); + } + // add for AbstractScImportOptionsDlg_Impl end ++ ++//add for AbstractScLangChooserDlg_Impl begin ++LanguageType AbstractScTextImportOptionsDlg_Impl::GetLanguageType() const ++{ ++ return pDlg->getLanguageType(); ++} ++ ++bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const ++{ ++ return pDlg->isDateConversionSet(); ++} ++ ++//add for AbstractScLangChooserDlg_Impl end ++ + // =========================Factories for createdialog =================== + + //add for ScImportAsciiDlg begin +@@ -646,6 +662,21 @@ AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg + } + // ScImportAsciiDlg end + ++AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg( Window* pParent, int nId ) ++{ ++ ScTextImportOptionsDlg* pDlg = NULL; ++ switch (nId) ++ { ++ case RID_SCDLG_TEXT_IMPORT_OPTIONS: ++ pDlg = new ScTextImportOptionsDlg(pParent); ++ break; ++ default: ++ ; ++ } ++ ++ return pDlg ? new AbstractScTextImportOptionsDlg_Impl(pDlg) : NULL; ++} ++ + //add for ScAutoFormatDlg begin + + AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg +diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx +index 6891530..933ae07 100644 +--- sc/source/ui/attrdlg/scdlgfact.hxx ++++ sc/source/ui/attrdlg/scdlgfact.hxx +@@ -65,6 +65,7 @@ class ScStringInputDlg; + class ScImportOptionsDlg; + class SfxTabDialog; + class ScSortWarningDlg; ++class ScTextImportOptionsDlg; + + #define DECL_ABSTDLG_BASE(Class,DialogClass) \ + DialogClass* pDlg; \ +@@ -350,6 +351,13 @@ class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg //add + virtual void GetImportOptions( ScImportOptions& rOptions ) const; + }; + ++class AbstractScTextImportOptionsDlg_Impl : public AbstractScTextImportOptionsDlg ++{ ++ DECL_ABSTDLG_BASE( AbstractScTextImportOptionsDlg_Impl, ScTextImportOptionsDlg) ++ virtual LanguageType GetLanguageType() const; ++ virtual bool IsDateConversionSet() const; ++}; ++ + //add for ScAttrDlg , ScHFEditDlg, ScStyleDlg, ScSubTotalDlg, ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg + class AbstractTabDialog_Impl : public SfxAbstractTabDialog + { +@@ -391,6 +399,8 @@ public: + SvStream* pInStream, int nId, + sal_Unicode cSep = '\t'); + ++ virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg( Window* pParent, int nId ); ++ + virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg + ScAutoFormat* pAutoFormat, + const ScAutoFormatData* pSelFormatData, +diff --git sc/source/ui/dbgui/asciiopt.cxx sc/source/ui/dbgui/asciiopt.cxx +index 8b385c2..6b26dee 100644 +--- sc/source/ui/dbgui/asciiopt.cxx ++++ sc/source/ui/dbgui/asciiopt.cxx +@@ -56,8 +56,11 @@ ScAsciiOptions::ScAsciiOptions() : + bFixedLen ( FALSE ), + aFieldSeps ( ';' ), + bMergeFieldSeps ( FALSE ), ++ bQuotedFieldAsText(false), ++ bDetectSpecialNumber(false), + cTextSep ( cDefaultTextSep ), + eCharSet ( gsl_getSystemTextEncoding() ), ++ eLang ( LANGUAGE_SYSTEM ), + bCharSetSystem ( FALSE ), + nStartRow ( 1 ), + nInfoCount ( 0 ), +@@ -71,8 +74,11 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) : + bFixedLen ( rOpt.bFixedLen ), + aFieldSeps ( rOpt.aFieldSeps ), + bMergeFieldSeps ( rOpt.bMergeFieldSeps ), ++ bQuotedFieldAsText(rOpt.bQuotedFieldAsText), ++ bDetectSpecialNumber(rOpt.bDetectSpecialNumber), + cTextSep ( rOpt.cTextSep ), + eCharSet ( rOpt.eCharSet ), ++ eLang ( rOpt.eLang ), + bCharSetSystem ( rOpt.bCharSetSystem ), + nStartRow ( rOpt.nStartRow ), + nInfoCount ( rOpt.nInfoCount ) +@@ -155,6 +161,7 @@ ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy ) + bFixedLen = rCpy.bFixedLen; + aFieldSeps = rCpy.aFieldSeps; + bMergeFieldSeps = rCpy.bMergeFieldSeps; ++ bQuotedFieldAsText = rCpy.bQuotedFieldAsText; + cTextSep = rCpy.cTextSep; + eCharSet = rCpy.eCharSet; + bCharSetSystem = rCpy.bCharSetSystem; +@@ -169,6 +176,7 @@ BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const + if ( bFixedLen == rCmp.bFixedLen && + aFieldSeps == rCmp.aFieldSeps && + bMergeFieldSeps == rCmp.bMergeFieldSeps && ++ bQuotedFieldAsText == rCmp.bQuotedFieldAsText && + cTextSep == rCmp.cTextSep && + eCharSet == rCmp.eCharSet && + bCharSetSystem == rCmp.bCharSetSystem && +@@ -248,13 +256,20 @@ void ScAsciiOptions::ReadFromString( const String& rString ) + eCharSet = ScGlobal::GetCharsetValue( aToken ); + } + ++ // Language ++ if (nCount >= 4) ++ { ++ aToken = rString.GetToken(3, ','); ++ eLang = static_cast(aToken.ToInt32()); ++ } ++ + // + // Startzeile + // + +- if ( nCount >= 4 ) ++ if ( nCount >= 5 ) + { +- aToken = rString.GetToken(3,','); ++ aToken = rString.GetToken(4,','); + nStartRow = aToken.ToInt32(); + } + +@@ -262,12 +277,12 @@ void ScAsciiOptions::ReadFromString( const String& rString ) + // Spalten-Infos + // + +- if ( nCount >= 5 ) ++ if ( nCount >= 6 ) + { + delete[] pColStart; + delete[] pColFormat; + +- aToken = rString.GetToken(4,','); ++ aToken = rString.GetToken(5,','); + nSub = aToken.GetTokenCount('/'); + nInfoCount = nSub / 2; + if (nInfoCount) +@@ -286,6 +301,20 @@ void ScAsciiOptions::ReadFromString( const String& rString ) + pColFormat = NULL; + } + } ++ ++ // Import quoted field as text. ++ if (nCount >= 7) ++ { ++ aToken = rString.GetToken(6, ','); ++ bQuotedFieldAsText = aToken.EqualsAscii("true") ? true : false; ++ } ++ ++ // Detect special nubmers. ++ if (nCount >= 8) ++ { ++ aToken = rString.GetToken(7, ','); ++ bDetectSpecialNumber = aToken.EqualsAscii("true") ? true : false; ++ } + } + + +@@ -336,6 +365,10 @@ String ScAsciiOptions::WriteToString() const + aOutStr += ScGlobal::GetCharsetString( eCharSet ); + aOutStr += ','; // Token-Ende + ++ // Language ++ aOutStr += String::CreateFromInt32(eLang); ++ aOutStr += ','; ++ + // + // Startzeile + // +@@ -357,6 +390,15 @@ String ScAsciiOptions::WriteToString() const + aOutStr += String::CreateFromInt32(pColFormat[nInfo]); + } + ++ aOutStr += ','; ++ ++ // Import quoted field as text. ++ aOutStr += String::CreateFromAscii(bQuotedFieldAsText ? "true" : "false"); ++ aOutStr += ','; ++ ++ // Detect special nubmers. ++ aOutStr += String::CreateFromAscii(bDetectSpecialNumber ? "true" : "false"); ++ + return aOutStr; + } + +diff --git sc/source/ui/dbgui/asciiopt.hrc sc/source/ui/dbgui/asciiopt.hrc +index 2dcfe00..6fde4ee 100644 +--- sc/source/ui/dbgui/asciiopt.hrc ++++ sc/source/ui/dbgui/asciiopt.hrc +@@ -29,31 +29,46 @@ + ************************************************************************/ + #include "sc.hrc" + //#define RID_SCDLG_ASCII 256 +-#define RB_SEPARATED 1 +-#define RB_FIXED 2 +-#define FT_CHARSET 3 +-#define LB_CHARSET 4 +-#define FL_SEPOPT 5 +-#define FT_FIELDSEP 6 +-#define CB_FIELDSEP 7 +-#define FT_TEXTSEP 8 +-#define CB_TEXTSEP 9 +-#define FL_FIELDOPT 10 +-#define FT_TYPE 12 +-#define FT_PREVIEW 13 +-#define LB_TYPE1 23 +-#define FL_WIDTH 30 +-#define BTN_OK 31 +-#define BTN_CANCEL 32 +-#define BTN_HELP 33 +-#define CTR_TABLEBOX 41 +-#define CKB_TAB 51 +-#define CKB_SPACE 52 +-#define CKB_SEMICOLON 53 +-#define CKB_COMMA 54 +-#define CKB_OTHER 55 +-#define ED_OTHER 56 +-#define FT_AT_ROW 59 +-#define NF_AT_ROW 60 +-#define CB_ASONCE 90 +-#define STR_TEXTTOCOLUMNS 100 ++#define BTN_OK 1 ++#define BTN_CANCEL 2 ++#define BTN_HELP 3 ++ ++#define FL_FIELDOPT 4 ++#define FT_CHARSET 5 ++#define LB_CHARSET 6 ++#define FT_CUSTOMLANG 7 ++#define LB_CUSTOMLANG 8 ++#define FT_AT_ROW 9 ++#define NF_AT_ROW 10 ++ ++#define FL_SEPOPT 11 ++#define RB_FIXED 12 ++#define RB_SEPARATED 13 ++#define CKB_TAB 14 ++#define CKB_COMMA 15 ++#define CKB_OTHER 16 ++#define ED_OTHER 17 ++#define CKB_SEMICOLON 18 ++#define CKB_SPACE 19 ++#define CB_ASONCE 20 ++#define CB_TEXTSEP 21 ++#define FT_TEXTSEP 22 ++ ++#define FL_OTHER_OPTIONS 23 ++#define CB_QUOTED_AS_TEXT 24 ++#define CB_DETECT_SPECIAL_NUMBER 25 ++ ++#define FL_WIDTH 26 ++#define FT_TYPE 27 ++#define LB_TYPE1 28 ++#define CTR_TABLEBOX 29 ++#define STR_TEXTTOCOLUMNS 30 ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git sc/source/ui/dbgui/asciiopt.src sc/source/ui/dbgui/asciiopt.src +index a01e819..2d8a7f9 100644 +--- sc/source/ui/dbgui/asciiopt.src ++++ sc/source/ui/dbgui/asciiopt.src +@@ -34,55 +34,44 @@ ModalDialog RID_SCDLG_ASCII + { + OutputSize = TRUE ; + SVLook = TRUE ; +- Size = MAP_APPFONT ( 320 , 247 ) ; ++ Size = MAP_APPFONT ( 320 , 305 ) ; + Text [ en-US ] = "Text Import" ; + Moveable = TRUE ; +- FixedLine FL_WIDTH +- { +- Pos = MAP_APPFONT ( 6 , 132 ) ; +- Size = MAP_APPFONT ( 252 , 8 ) ; +- Text [ en-US ] = "Fields" ; +- }; +- FixedText FT_TYPE ++ ++ OKButton BTN_OK + { +- Pos = MAP_APPFONT ( 12 , 145 ) ; +- Size = MAP_APPFONT ( 60 , 8 ) ; +- Text [ en-US ] = "Column t~ype"; ++ Pos = MAP_APPFONT ( 264 , 6 ) ; ++ Size = MAP_APPFONT ( 50 , 14 ) ; ++ TabStop = TRUE ; ++ DefButton = TRUE ; + }; +- ListBox LB_TYPE1 ++ CancelButton BTN_CANCEL + { +- Pos = MAP_APPFONT ( 76 , 143 ) ; +- Size = MAP_APPFONT ( 60 , 68 ) ; ++ Pos = MAP_APPFONT ( 264 , 23 ) ; ++ Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; +- DropDown = TRUE ; + }; +- FixedLine FL_SEPOPT +- { +- Pos = MAP_APPFONT ( 6 , 48 ) ; +- Size = MAP_APPFONT ( 252 , 8 ) ; +- Text [ en-US ] = "Separator options" ; +- }; +- RadioButton RB_FIXED ++ HelpButton BTN_HELP + { +- Pos = MAP_APPFONT ( 12 , 59 ) ; +- Size = MAP_APPFONT ( 243 , 10 ) ; +- Text [ en-US ] = "~Fixed width" ; ++ Pos = MAP_APPFONT ( 264 , 43 ) ; ++ Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; +- RadioButton RB_SEPARATED ++ ++ FixedLine FL_FIELDOPT + { +- Pos = MAP_APPFONT ( 12 , 73 ) ; +- Size = MAP_APPFONT ( 243 , 10 ) ; +- Text [ en-US ] = "~Separated by" ; +- TabStop = TRUE ; +- Check = TRUE ; ++ Pos = MAP_APPFONT ( 6 , 3 ) ; ++ Size = MAP_APPFONT ( 252 , 8 ) ; ++ Text [ en-US ] = "Import" ; + }; ++ + FixedText FT_CHARSET + { + Pos = MAP_APPFONT ( 12 , 16 ) ; + Size = MAP_APPFONT ( 60 , 8 ) ; + Text [ en-US ] = "Ch~aracter set" ; + }; ++ + ListBox LB_CHARSET + { + Pos = MAP_APPFONT ( 76 , 14 ) ; +@@ -91,75 +80,81 @@ ModalDialog RID_SCDLG_ASCII + DropDown = TRUE ; + Sort = TRUE; + }; +- FixedLine FL_FIELDOPT +- { +- Pos = MAP_APPFONT ( 6 , 3 ) ; +- Size = MAP_APPFONT ( 252 , 8 ) ; +- Text [ en-US ] = "Import" ; +- }; +- FixedText FT_TEXTSEP ++ ++ FixedText FT_CUSTOMLANG + { +- Pos = MAP_APPFONT ( 156 , 114 ) ; ++ Pos = MAP_APPFONT ( 12 , 32 ) ; + Size = MAP_APPFONT ( 60 , 8 ) ; +- Text [ en-US ] = "Te~xt delimiter" ; ++ Text [ en-US ] = "Language" ; + }; +- ComboBox CB_TEXTSEP ++ ++ ListBox LB_CUSTOMLANG + { +- Pos = MAP_APPFONT ( 218 , 112 ) ; +- Size = MAP_APPFONT ( 37 , 94 ) ; ++ Pos = MAP_APPFONT ( 76 , 30 ) ; ++ Size = MAP_APPFONT ( 130 , 61 ) ; + TabStop = TRUE ; + DropDown = TRUE ; ++ Sort = TRUE; + }; +- OKButton BTN_OK ++ ++ FixedText FT_AT_ROW + { +- Pos = MAP_APPFONT ( 264 , 6 ) ; +- Size = MAP_APPFONT ( 50 , 14 ) ; ++ Pos = MAP_APPFONT ( 12 , 48 ) ; ++ Size = MAP_APPFONT ( 60 , 8 ) ; ++ Text [ en-US ] = "From ro~w" ; ++ }; ++ ++ NumericField NF_AT_ROW ++ { ++ Border = TRUE ; ++ SVLook = TRUE ; ++ Pos = MAP_APPFONT ( 76 , 46 ) ; ++ Size = MAP_APPFONT ( 30 , 12 ) ; + TabStop = TRUE ; +- DefButton = TRUE ; ++ Spin = TRUE ; ++ Repeat = TRUE ; ++ Minimum = 1 ; + }; +- CancelButton BTN_CANCEL ++ ++ FixedLine FL_SEPOPT + { +- Pos = MAP_APPFONT ( 264 , 23 ) ; +- Size = MAP_APPFONT ( 50 , 14 ) ; ++ Pos = MAP_APPFONT ( 6 , 63 ) ; ++ Size = MAP_APPFONT ( 252 , 8 ) ; ++ Text [ en-US ] = "Separator options" ; ++ }; ++ RadioButton RB_FIXED ++ { ++ Pos = MAP_APPFONT ( 12 , 75 ) ; ++ Size = MAP_APPFONT ( 243 , 10 ) ; ++ Text [ en-US ] = "~Fixed width" ; + TabStop = TRUE ; + }; +- HelpButton BTN_HELP ++ RadioButton RB_SEPARATED + { +- Pos = MAP_APPFONT ( 264 , 43 ) ; +- Size = MAP_APPFONT ( 50 , 14 ) ; ++ Pos = MAP_APPFONT ( 12 , 89 ) ; ++ Size = MAP_APPFONT ( 243 , 10 ) ; ++ Text [ en-US ] = "~Separated by" ; + TabStop = TRUE ; ++ Check = TRUE ; + }; ++ + CheckBox CKB_TAB + { +- Pos = MAP_APPFONT ( 20 , 86 ) ; ++ Pos = MAP_APPFONT ( 20 , 102 ) ; + Size = MAP_APPFONT ( 68 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "~Tab" ; + }; +- CheckBox CKB_SEMICOLON +- { +- Pos = MAP_APPFONT ( 20 , 99 ) ; +- Size = MAP_APPFONT ( 68 , 10 ) ; +- TabStop = TRUE ; +- Text [ en-US ] = "S~emicolon" ; +- }; + CheckBox CKB_COMMA + { +- Pos = MAP_APPFONT ( 92 , 86 ) ; ++ Pos = MAP_APPFONT ( 92 , 102 ) ; + Size = MAP_APPFONT ( 68 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "~Comma" ; + }; +- CheckBox CKB_SPACE +- { +- Pos = MAP_APPFONT ( 92 , 99 ) ; +- Size = MAP_APPFONT ( 68 , 10 ) ; +- TabStop = TRUE ; +- Text [ en-US ] = "S~pace" ; +- }; + CheckBox CKB_OTHER + { +- Pos = MAP_APPFONT ( 164 , 86 ) ; ++ Pos = MAP_APPFONT ( 164 , 102 ) ; + Size = MAP_APPFONT ( 50 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "~Other" ; +@@ -167,43 +162,100 @@ ModalDialog RID_SCDLG_ASCII + Edit ED_OTHER + { + Border = TRUE ; +- Pos = MAP_APPFONT ( 218 , 84 ) ; ++ Pos = MAP_APPFONT ( 218 , 100 ) ; + Size = MAP_APPFONT ( 37 , 12 ) ; + TabStop = TRUE ; + MaxTextLength = 10 ; + }; +- FixedText FT_AT_ROW ++ ++ CheckBox CKB_SEMICOLON + { +- Pos = MAP_APPFONT ( 12 , 32 ) ; ++ Pos = MAP_APPFONT ( 20 , 115 ) ; ++ Size = MAP_APPFONT ( 68 , 10 ) ; ++ TabStop = TRUE ; ++ Text [ en-US ] = "S~emicolon" ; ++ }; ++ CheckBox CKB_SPACE ++ { ++ Pos = MAP_APPFONT ( 92 , 115 ) ; ++ Size = MAP_APPFONT ( 68 , 10 ) ; ++ TabStop = TRUE ; ++ Text [ en-US ] = "S~pace" ; ++ }; ++ ++ CheckBox CB_ASONCE ++ { ++ Pos = MAP_APPFONT ( 20 , 130 ) ; ++ Size = MAP_APPFONT ( 130 , 10 ) ; ++ TabStop = TRUE ; ++ Text [ en-US ] = "Merge ~delimiters" ; ++ }; ++ ++ ComboBox CB_TEXTSEP ++ { ++ Pos = MAP_APPFONT ( 218 , 128 ) ; ++ Size = MAP_APPFONT ( 37 , 94 ) ; ++ TabStop = TRUE ; ++ DropDown = TRUE ; ++ }; ++ FixedText FT_TEXTSEP ++ { ++ Pos = MAP_APPFONT ( 156 , 130 ) ; + Size = MAP_APPFONT ( 60 , 8 ) ; +- Text [ en-US ] = "From ro~w" ; ++ Text [ en-US ] = "Te~xt delimiter" ; + }; +- NumericField NF_AT_ROW ++ ++ FixedLine FL_OTHER_OPTIONS + { +- Border = TRUE ; +- SVLook = TRUE ; +- Pos = MAP_APPFONT ( 76 , 30 ) ; +- Size = MAP_APPFONT ( 30 , 12 ) ; ++ Pos = MAP_APPFONT ( 6 , 146 ) ; ++ Size = MAP_APPFONT ( 252 , 8 ) ; ++ Text [ en-US ] = "Other options" ; ++ }; ++ ++ CheckBox CB_QUOTED_AS_TEXT ++ { ++ Pos = MAP_APPFONT ( 20 , 158 ) ; ++ Size = MAP_APPFONT ( 130 , 10 ) ; + TabStop = TRUE ; +- Spin = TRUE ; +- Repeat = TRUE ; +- Minimum = 1 ; ++ Text [ en-US ] = "~Quoted field as text" ; ++ }; ++ ++ CheckBox CB_DETECT_SPECIAL_NUMBER ++ { ++ Pos = MAP_APPFONT ( 20 , 171 ) ; ++ Size = MAP_APPFONT ( 130 , 10 ) ; ++ TabStop = TRUE ; ++ Text [ en-US ] = "Detect special numbers" ; ++ }; ++ ++ FixedLine FL_WIDTH ++ { ++ Pos = MAP_APPFONT ( 6 , 187 ) ; ++ Size = MAP_APPFONT ( 252 , 8 ) ; ++ Text [ en-US ] = "Fields" ; ++ }; ++ FixedText FT_TYPE ++ { ++ Pos = MAP_APPFONT ( 12 , 200 ) ; ++ Size = MAP_APPFONT ( 60 , 8 ) ; ++ Text [ en-US ] = "Column t~ype"; ++ }; ++ ListBox LB_TYPE1 ++ { ++ Pos = MAP_APPFONT ( 76 , 198 ) ; ++ Size = MAP_APPFONT ( 60 , 68 ) ; ++ TabStop = TRUE ; ++ DropDown = TRUE ; + }; + Control CTR_TABLEBOX + { + HelpId = HID_SC_ASCII_TABCTR ; + Border = TRUE ; + DialogControl = TRUE ; +- Pos = MAP_APPFONT ( 12 , 159 ) ; ++ Pos = MAP_APPFONT ( 12 , 216 ) ; + Size = MAP_APPFONT ( 243 , 82 ) ; + }; +- CheckBox CB_ASONCE +- { +- Pos = MAP_APPFONT ( 20 , 114 ) ; +- Size = MAP_APPFONT ( 130 , 10 ) ; +- TabStop = TRUE ; +- Text [ en-US ] = "Merge ~delimiters" ; +- }; ++ + String STR_TEXTTOCOLUMNS + { + Text [ en-US ] = "Text to Columns" ; +diff --git sc/source/ui/dbgui/csvgrid.cxx sc/source/ui/dbgui/csvgrid.cxx +index ddbfb44..5725645 100644 +--- sc/source/ui/dbgui/csvgrid.cxx ++++ sc/source/ui/dbgui/csvgrid.cxx +@@ -737,7 +737,8 @@ void ScCsvGrid::ImplSetTextLineSep( + while( *pChar && (nColIx < sal::static_int_cast(CSV_MAXCOLCOUNT)) ) + { + // scan for next cell text +- pChar = ScImportExport::ScanNextFieldFromString( pChar, aCellText, cTextSep, pSepChars, bMergeSep ); ++ bool bIsQuoted = false; ++ pChar = ScImportExport::ScanNextFieldFromString( pChar, aCellText, cTextSep, pSepChars, bMergeSep, bIsQuoted ); + + // update column width + sal_Int32 nWidth = Max( CSV_MINCOLWIDTH, aCellText.Len() + sal_Int32( 1 ) ); +diff --git sc/source/ui/dbgui/csvruler.cxx sc/source/ui/dbgui/csvruler.cxx +index 5437f9b..7cd060d 100644 +--- sc/source/ui/dbgui/csvruler.cxx ++++ sc/source/ui/dbgui/csvruler.cxx +@@ -37,8 +37,76 @@ + #include "AccessibleCsvControl.hxx" + + ++#include ++#include ++#include ++#include "miscuno.hxx" ++ ++using namespace rtl; ++using namespace com::sun::star::uno; ++ ++ ++ ++// ============================================================================ ++#define SEP_PATH "Office.Calc/Dialogs/CSVImport" ++#define FIXED_WIDTH_LIST "FixedWidthList" ++ ++ + // ============================================================================ + ++static void load_FixedWidthList(ScCsvSplits &aSplits) ++{ ++ String sSplits; ++ OUString sFixedWidthLists; ++ ++ SequenceaValues; ++ const Any *pProperties; ++ Sequence aNames(1); ++ OUString* pNames = aNames.getArray(); ++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); ++ ++ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST ); ++ aValues = aItem.GetProperties( aNames ); ++ pProperties = aValues.getConstArray(); ++ ++ if( pProperties[0].hasValue() ) ++ { ++ aSplits.Clear(); ++ pProperties[0] >>= sFixedWidthLists; ++ ++ sSplits = String( sFixedWidthLists ); ++ ++ // String ends with a semi-colon so there is no 'int' after the last one. ++ for(int i=0;i aValues; ++ Any *pProperties; ++ Sequence aNames(1); ++ OUString* pNames = aNames.getArray(); ++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); ++ ++ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST ); ++ aValues = aItem.GetProperties( aNames ); ++ pProperties = aValues.getArray(); ++ pProperties[0] <<= sFixedWidthLists; ++ ++ aItem.PutProperties(aNames, aValues); ++} ++ + ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) : + ScCsvControl( rParent ), + mnPosCursorLast( 1 ) +@@ -48,6 +116,13 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) : + InitSizeData(); + maBackgrDev.SetFont( GetFont() ); + maRulerDev.SetFont( GetFont() ); ++ ++ load_FixedWidthList( maSplits ); ++} ++ ++ScCsvRuler::~ScCsvRuler() ++{ ++ save_FixedWidthList( maSplits ); + } + + +diff --git sc/source/ui/dbgui/makefile.mk sc/source/ui/dbgui/makefile.mk +index 5d71655..130e0a3 100644 +--- sc/source/ui/dbgui/makefile.mk ++++ sc/source/ui/dbgui/makefile.mk +@@ -53,6 +53,7 @@ SLOFILES = \ + $(SLO)$/pfiltdlg.obj \ + $(SLO)$/dbnamdlg.obj \ + $(SLO)$/expftext.obj \ ++ $(SLO)$/textimportoptions.obj \ + $(SLO)$/subtdlg.obj \ + $(SLO)$/tpsubt.obj \ + $(SLO)$/fieldwnd.obj \ +@@ -85,6 +86,7 @@ EXCEPTIONSFILES= \ + + SRS1NAME=$(TARGET) + SRC1FILES = \ ++ textimportoptions.src \ + pivot.src \ + pvfundlg.src \ + dpgroupdlg.src \ +@@ -114,7 +116,8 @@ LIB1OBJFILES = \ + $(SLO)$/csvruler.obj \ + $(SLO)$/csvgrid.obj \ + $(SLO)$/csvtablebox.obj \ +- $(SLO)$/asciiopt.obj ++ $(SLO)$/asciiopt.obj \ ++ $(SLO)$/textimportoptions.obj + + # --- Tagets ------------------------------------------------------- + +diff --git sc/source/ui/dbgui/scuiasciiopt.cxx sc/source/ui/dbgui/scuiasciiopt.cxx +index dc4a05f..c2a75b2 100644 +--- sc/source/ui/dbgui/scuiasciiopt.cxx ++++ sc/source/ui/dbgui/scuiasciiopt.cxx +@@ -44,6 +44,12 @@ + // ause + #include "editutil.hxx" + ++#include ++#include ++#include ++#include "miscuno.hxx" ++ ++ + //! TODO make dynamic + #ifdef WIN + const SCSIZE ASCIIDLG_MAXROWS = 10000; +@@ -51,6 +57,22 @@ const SCSIZE ASCIIDLG_MAXROWS = 10000; + const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT; + #endif + ++ ++using namespace rtl; ++using namespace com::sun::star::uno; ++ ++// Defines - CSV Import Preserve Options ++#define FIXED_WIDTH "FixedWidth" ++#define FROM_ROW "FromRow" ++#define CHAR_SET "CharSet" ++#define SEPARATORS "Separators" ++#define TEXT_SEPARATORS "TextSeparators" ++#define MERGE_DELIMITERS "MergeDelimiters" ++#define QUOTED_AS_TEXT "QuotedFieldAsText" ++#define DETECT_SPECIAL_NUM "DetectSpecialNumbers" ++#define LANGUAGE "Language" ++#define SEP_PATH "Office.Calc/Dialogs/CSVImport" ++ + // ============================================================================ + + void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect ) +@@ -98,11 +120,96 @@ sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList ) + return c; + } + ++static void load_Separators( OUString &sFieldSeparators, OUString &sTextSeparators, ++ bool &bMergeDelimiters, bool& bQuotedAsText, bool& bDetectSpecialNum, ++ bool &bFixedWidth, sal_Int32 &nFromRow, sal_Int32 &nCharSet, ++ sal_Int32& nLanguage ) ++{ ++ SequenceaValues; ++ const Any *pProperties; ++ Sequence aNames(9); ++ OUString* pNames = aNames.getArray(); ++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); ++ ++ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS ); ++ pNames[1] = OUString::createFromAscii( SEPARATORS ); ++ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS ); ++ pNames[3] = OUString::createFromAscii( FIXED_WIDTH ); ++ pNames[4] = OUString::createFromAscii( FROM_ROW ); ++ pNames[5] = OUString::createFromAscii( CHAR_SET ); ++ pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT ); ++ pNames[7] = OUString::createFromAscii( DETECT_SPECIAL_NUM ); ++ pNames[8] = OUString::createFromAscii( LANGUAGE ); ++ aValues = aItem.GetProperties( aNames ); ++ pProperties = aValues.getConstArray(); ++ if( pProperties[1].hasValue() ) ++ pProperties[1] >>= sFieldSeparators; ++ ++ if( pProperties[2].hasValue() ) ++ pProperties[2] >>= sTextSeparators; ++ ++ if( pProperties[0].hasValue() ) ++ bMergeDelimiters = ScUnoHelpFunctions::GetBoolFromAny( pProperties[0] ); ++ ++ if( pProperties[3].hasValue() ) ++ bFixedWidth = ScUnoHelpFunctions::GetBoolFromAny( pProperties[3] ); ++ ++ if( pProperties[4].hasValue() ) ++ pProperties[4] >>= nFromRow; ++ ++ if( pProperties[5].hasValue() ) ++ pProperties[5] >>= nCharSet; ++ ++ if ( pProperties[6].hasValue() ) ++ pProperties[6] >>= bQuotedAsText; ++ ++ if ( pProperties[7].hasValue() ) ++ pProperties[7] >>= bDetectSpecialNum; ++ ++ if ( pProperties[8].hasValue() ) ++ pProperties[8] >>= nLanguage; ++} ++ ++static void save_Separators( ++ String maSeparators, String maTxtSep, bool bMergeDelimiters, bool bQuotedAsText, ++ bool bDetectSpecialNum, bool bFixedWidth, sal_Int32 nFromRow, sal_Int32 nCharSet, sal_Int32 nLanguage ) ++{ ++ OUString sFieldSeparators = OUString( maSeparators ); ++ OUString sTextSeparators = OUString( maTxtSep ); ++ Sequence aValues; ++ Any *pProperties; ++ Sequence aNames(9); ++ OUString* pNames = aNames.getArray(); ++ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); ++ ++ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS ); ++ pNames[1] = OUString::createFromAscii( SEPARATORS ); ++ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS ); ++ pNames[3] = OUString::createFromAscii( FIXED_WIDTH ); ++ pNames[4] = OUString::createFromAscii( FROM_ROW ); ++ pNames[5] = OUString::createFromAscii( CHAR_SET ); ++ pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT ); ++ pNames[7] = OUString::createFromAscii( DETECT_SPECIAL_NUM ); ++ pNames[8] = OUString::createFromAscii( LANGUAGE ); ++ aValues = aItem.GetProperties( aNames ); ++ pProperties = aValues.getArray(); ++ pProperties[1] <<= sFieldSeparators; ++ pProperties[2] <<= sTextSeparators; ++ ScUnoHelpFunctions::SetBoolInAny( pProperties[0], bMergeDelimiters ); ++ ScUnoHelpFunctions::SetBoolInAny( pProperties[3], bFixedWidth ); ++ pProperties[4] <<= nFromRow; ++ pProperties[5] <<= nCharSet; ++ pProperties[6] <<= static_cast(bQuotedAsText); ++ pProperties[7] <<= static_cast(bDetectSpecialNum); ++ pProperties[8] <<= nLanguage; ++ ++ aItem.PutProperties(aNames, aValues); ++} + + // ---------------------------------------------------------------------------- + + ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, +- SvStream* pInStream, sal_Unicode cSep ) : ++ SvStream* pInStream, sal_Unicode /*cSep*/ ) : + ModalDialog ( pParent, ScResId( RID_SCDLG_ASCII ) ), + mpDatStream ( pInStream ), + mnStreamPos( pInStream ? pInStream->Tell() : 0 ), +@@ -113,6 +220,8 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, + aFlFieldOpt ( this, ScResId( FL_FIELDOPT ) ), + aFtCharSet ( this, ScResId( FT_CHARSET ) ), + aLbCharSet ( this, ScResId( LB_CHARSET ) ), ++ aFtCustomLang( this, ScResId( FT_CUSTOMLANG ) ), ++ aLbCustomLang( this, ScResId( LB_CUSTOMLANG ) ), + + aFtRow ( this, ScResId( FT_AT_ROW ) ), + aNfRow ( this, ScResId( NF_AT_ROW ) ), +@@ -128,6 +237,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, + aCkbOther ( this, ScResId( CKB_OTHER ) ), + aEdOther ( this, ScResId( ED_OTHER ) ), + aCkbAsOnce ( this, ScResId( CB_ASONCE) ), ++ aFlOtherOpt ( this, ScResId( FL_OTHER_OPTIONS ) ), ++ ++ aCkbQuotedAsText( this, ScResId(CB_QUOTED_AS_TEXT) ), ++ aCkbDetectNumber( this, ScResId(CB_DETECT_SPECIAL_NUMBER) ), + aFtTextSep ( this, ScResId( FT_TEXTSEP ) ), + aCbTextSep ( this, ScResId( CB_TEXTSEP ) ), + +@@ -146,14 +259,15 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, + aFldSepList ( ScResId( SCSTR_FIELDSEP ) ), + aTextSepList( ScResId( SCSTR_TEXTSEP ) ), + mcTextSep ( ScAsciiOptions::cDefaultTextSep ), +- maStrTextToColumns( ScResId( STR_TEXTTOCOLUMNS ) ) ++ maStrTextToColumns( ScResId( STR_TEXTTOCOLUMNS ) ), ++ mbFileImport(true) + { + FreeResource(); ++ mbFileImport = aDatName.Len() > 0; + + String aName = GetText(); + // aDatName is empty if invoked during paste from clipboard. +- BOOL bClipboard = (aDatName.Len() == 0); +- if (!bClipboard) ++ if (mbFileImport) + { + aName.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" - [")); + aName += aDatName; +@@ -161,20 +275,55 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, + } + SetText( aName ); + +- switch(cSep) ++ ++ OUString sFieldSeparators; ++ OUString sTextSeparators; ++ bool bMergeDelimiters = false; ++ bool bFixedWidth = false; ++ bool bQuotedFieldAsText = true; ++ bool bDetectSpecialNum = false; ++ sal_Int32 nFromRow = 1; ++ sal_Int32 nCharSet = -1; ++ sal_Int32 nLanguage = 0; ++ if (mbFileImport) ++ // load separators only when importing csv files. ++ load_Separators (sFieldSeparators, sTextSeparators, bMergeDelimiters, ++ bQuotedFieldAsText, bDetectSpecialNum, bFixedWidth, nFromRow, nCharSet, nLanguage); ++ maFieldSeparators = String(sFieldSeparators); ++ ++ if( bMergeDelimiters ) ++ aCkbAsOnce.Check(); ++ if (bQuotedFieldAsText) ++ aCkbQuotedAsText.Check(); ++ if (bDetectSpecialNum) ++ aCkbDetectNumber.Check(); ++ if( bFixedWidth ) ++ aRbFixed.Check(); ++ if( nFromRow != 1 ) ++ aNfRow.SetValue( nFromRow ); ++ ++ ByteString bString(maFieldSeparators,RTL_TEXTENCODING_MS_1252); ++ const sal_Char *aSep = bString.GetBuffer(); ++ int len = maFieldSeparators.Len(); ++ for (int i = 0; i < len; ++i) + { +- case '\t': aCkbTab.Check(); break; +- case ';': aCkbSemicolon.Check(); break; +- case ',': aCkbComma.Check(); break; +- case ' ': aCkbSpace.Check(); break; +- default: +- aCkbOther.Check(); +- aEdOther.SetText( cSep ); ++ switch( aSep[i] ) ++ { ++ case '\t': aCkbTab.Check(); break; ++ case ';': aCkbSemicolon.Check(); break; ++ case ',': aCkbComma.Check(); break; ++ case ' ': aCkbSpace.Check(); break; ++ default: ++ aCkbOther.Check(); ++ aEdOther.SetText( aEdOther.GetText() + OUString( aSep[i] ) ); ++ } + } ++ ++ // Get Separators from the dialog + maFieldSeparators = GetSeparators(); + + // Clipboard is always Unicode, else detect. +- BOOL bPreselectUnicode = bClipboard; ++ bool bPreselectUnicode = !mbFileImport; + // Sniff for Unicode / not + if( !bPreselectUnicode && mpDatStream ) + { +@@ -210,6 +359,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, + + // *** Separator characters *** + lcl_FillCombo( aCbTextSep, aTextSepList, mcTextSep ); ++ aCbTextSep.SetText( sTextSeparators ); + + Link aSeparatorHdl =LINK( this, ScImportAsciiDlg, SeparatorHdl ); + aCbTextSep.SetSelectHdl( aSeparatorHdl ); +@@ -218,6 +368,8 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, + aCkbSemicolon.SetClickHdl( aSeparatorHdl ); + aCkbComma.SetClickHdl( aSeparatorHdl ); + aCkbAsOnce.SetClickHdl( aSeparatorHdl ); ++ aCkbQuotedAsText.SetClickHdl( aSeparatorHdl ); ++ aCkbDetectNumber.SetClickHdl( aSeparatorHdl ); + aCkbSpace.SetClickHdl( aSeparatorHdl ); + aCkbOther.SetClickHdl( aSeparatorHdl ); + aEdOther.SetModifyHdl( aSeparatorHdl ); +@@ -230,9 +382,18 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, + aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser ); + aLbCharSet.SelectTextEncoding( bPreselectUnicode ? + RTL_TEXTENCODING_UNICODE : gsl_getSystemTextEncoding() ); ++ ++ if( nCharSet >= 0 ) ++ aLbCharSet.SelectEntryPos( nCharSet ); ++ + SetSelectedCharSet(); + aLbCharSet.SetSelectHdl( LINK( this, ScImportAsciiDlg, CharSetHdl ) ); + ++ aLbCustomLang.SetLanguageList( ++ LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, false, false); ++ aLbCustomLang.InsertLanguage(LANGUAGE_SYSTEM); ++ aLbCustomLang.SelectLanguage(static_cast(nLanguage), true); ++ + // *** column type ListBox *** + xub_StrLen nCount = aColumnUser.GetTokenCount(); + for (xub_StrLen i=0; i(aLbCustomLang.GetSelectLanguage()) ); + delete[] mpRowPosArray; + } + +@@ -339,6 +505,7 @@ void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt ) + { + rOpt.SetCharSet( meCharSet ); + rOpt.SetCharSetSystem( mbCharSetSystem ); ++ rOpt.SetLanguage(aLbCustomLang.GetSelectLanguage()); + rOpt.SetFixedLen( aRbFixed.IsChecked() ); + rOpt.SetStartRow( (long)aNfRow.GetValue() ); + maTableBox.FillColumnData( rOpt ); +@@ -348,6 +515,9 @@ void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt ) + rOpt.SetMergeSeps( aCkbAsOnce.IsChecked() ); + rOpt.SetTextSep( lcl_CharFromCombo( aCbTextSep, aTextSepList ) ); + } ++ ++ rOpt.SetQuotedAsText(aCkbQuotedAsText.IsChecked()); ++ rOpt.SetDetectSpecialNumber(aCkbDetectNumber.IsChecked()); + } + + void ScImportAsciiDlg::SetTextToColumnsMode() +@@ -355,8 +525,19 @@ void ScImportAsciiDlg::SetTextToColumnsMode() + SetText( maStrTextToColumns ); + aFtCharSet.Disable(); + aLbCharSet.Disable(); ++ aFtCustomLang.Disable(); ++ aLbCustomLang.SelectLanguage(LANGUAGE_SYSTEM); ++ aLbCustomLang.Disable(); + aFtRow.Disable(); + aNfRow.Disable(); ++ ++ // Quoted field as text option is not used for text-to-columns mode. ++ aCkbQuotedAsText.Check(false); ++ aCkbQuotedAsText.Disable(); ++ ++ // Always detect special numbers for text-to-columns mode. ++ aCkbDetectNumber.Check(); ++ aCkbDetectNumber.Disable(); + } + + void ScImportAsciiDlg::SetSelectedCharSet() +diff --git sc/source/ui/dbgui/textimportoptions.cxx sc/source/ui/dbgui/textimportoptions.cxx +new file mode 100644 +index 0000000..a59b42a +--- /dev/null ++++ sc/source/ui/dbgui/textimportoptions.cxx +@@ -0,0 +1,120 @@ ++/************************************************************************* ++ * ++ * 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: langbox.hxx,v $ ++ * $Revision: 1.4.242.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++#undef SC_DLLIMPLEMENTATION ++ ++//------------------------------------------------------------------------ ++ ++#include "textimportoptions.hxx" ++#include "textimportoptions.hrc" ++ ++#include "scresid.hxx" ++#include "vcl/window.hxx" ++#include "vcl/msgbox.hxx" ++#include "vcl/svapp.hxx" ++ ++ScTextImportOptionsDlg::ScTextImportOptionsDlg(Window* pParent) : ++ ModalDialog(pParent, ScResId(RID_SCDLG_TEXT_IMPORT_OPTIONS)), ++ ++ maBtnOk(this, ScResId(BTN_OK)), ++ maBtnCancel(this, ScResId(BTN_CANCEL)), ++ maBtnHelp(this, ScResId(BTN_HELP)), ++ maFlChooseLang(this, ScResId(FL_CHOOSE_LANG)), ++ maRbAutomatic(this, ScResId(RB_AUTOMATIC)), ++ maRbCustom(this, ScResId(RB_CUSTOM)), ++ maLbCustomLang(this, ScResId(LB_CUSTOM_LANG)), ++ maFlOption(this, ScResId(FL_OPTION)), ++ maBtnConvertDate(this, ScResId(BTN_CONVERT_DATE)) ++{ ++ init(); ++} ++ ++ScTextImportOptionsDlg::~ScTextImportOptionsDlg() ++{ ++} ++ ++short ScTextImportOptionsDlg::Execute() ++{ ++ return ModalDialog::Execute(); ++} ++ ++LanguageType ScTextImportOptionsDlg::getLanguageType() const ++{ ++ if (maRbAutomatic.IsChecked()) ++ return LANGUAGE_SYSTEM; ++ ++ return maLbCustomLang.GetSelectLanguage(); ++} ++ ++bool ScTextImportOptionsDlg::isDateConversionSet() const ++{ ++ return maBtnConvertDate.IsChecked(); ++} ++ ++void ScTextImportOptionsDlg::init() ++{ ++ Link aLink = LINK( this, ScTextImportOptionsDlg, OKHdl ); ++ maBtnOk.SetClickHdl(aLink); ++ aLink = LINK( this, ScTextImportOptionsDlg, RadioHdl ); ++ maRbAutomatic.SetClickHdl(aLink); ++ maRbCustom.SetClickHdl(aLink); ++ ++ maRbAutomatic.Check(true); ++ ++ maLbCustomLang.SetLanguageList( ++ LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, false, false); ++ ++ LanguageType eLang = Application::GetSettings().GetLanguage(); ++ maLbCustomLang.SelectLanguage(eLang); ++ maLbCustomLang.Disable(); ++} ++ ++IMPL_LINK( ScTextImportOptionsDlg, OKHdl, OKButton*, EMPTYARG ) ++{ ++ EndDialog(RET_OK); ++ return 0; ++} ++ ++IMPL_LINK( ScTextImportOptionsDlg, RadioHdl, RadioButton*, pBtn ) ++{ ++ if (pBtn == &maRbAutomatic) ++ { ++ maLbCustomLang.Disable(); ++ } ++ else if (pBtn == &maRbCustom) ++ { ++ maLbCustomLang.Enable(); ++ } ++ return 0; ++} ++ +diff --git sc/source/ui/dbgui/textimportoptions.src sc/source/ui/dbgui/textimportoptions.src +new file mode 100644 +index 0000000..4a4d158 +--- /dev/null ++++ sc/source/ui/dbgui/textimportoptions.src +@@ -0,0 +1,112 @@ ++/************************************************************************* ++ * ++ * 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: retypepassdlg.src,v $ ++ * $Revision: 1.1.2.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#include "textimportoptions.hrc" ++ ++ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS ++{ ++ Text [ en-US ] = "Import Options" ; ++ Size = MAP_APPFONT ( 190 , 101 ) ; ++ Moveable = TRUE ; ++ Closeable = TRUE ; ++ OutputSize = TRUE ; ++ ++ OKButton BTN_OK ++ { ++ Pos = MAP_APPFONT ( 135, 6 ) ; ++ Size = MAP_APPFONT ( 50, 14 ) ; ++ DefButton = TRUE ; ++ }; ++ ++ CancelButton BTN_CANCEL ++ { ++ Pos = MAP_APPFONT ( 135, 23 ) ; ++ Size = MAP_APPFONT ( 50, 14 ) ; ++ }; ++ ++ HelpButton BTN_HELP ++ { ++ Pos = MAP_APPFONT ( 135, 43 ) ; ++ Size = MAP_APPFONT ( 50, 14 ) ; ++ }; ++ ++ FixedLine FL_CHOOSE_LANG ++ { ++ Pos = MAP_APPFONT( 6, 3 ) ; ++ Size = MAP_APPFONT( 125, 14 ) ; ++ ++ Text [ en-US ] = "Select the language to use for import" ; ++ }; ++ ++ RadioButton RB_AUTOMATIC ++ { ++ Pos = MAP_APPFONT( 12, 20 ) ; ++ Size = MAP_APPFONT( 50, 10 ) ; ++ TabStop = TRUE ; ++ ++ Text [ en-US ] = "Automatic" ; ++ }; ++ ++ RadioButton RB_CUSTOM ++ { ++ Pos = MAP_APPFONT( 12, 34 ) ; ++ Size = MAP_APPFONT( 50, 10 ) ; ++ TabStop = TRUE ; ++ ++ Text [ en-US ] = "Custom" ; ++ }; ++ ++ ListBox LB_CUSTOM_LANG ++ { ++ Pos = MAP_APPFONT( 20, 50 ) ; ++ Size = MAP_APPFONT( 100, 55 ) ; ++ TabStop = TRUE ; ++ DropDown = TRUE ; ++ Sort = TRUE ; ++ }; ++ ++ FixedLine FL_OPTION ++ { ++ Pos = MAP_APPFONT( 6, 70 ); ++ Size = MAP_APPFONT( 125, 14 ); ++ ++ Text [ en-US ] = "Options" ; ++ }; ++ ++ CheckBox BTN_CONVERT_DATE ++ { ++ Pos = MAP_APPFONT( 12, 86 ); ++ Size = MAP_APPFONT( 125, 10 ); ++ TabStop = TRUE ; ++ ++ Text [ en-US ] = "Detect special numbers (such as dates)." ; ++ }; ++}; ++ +diff --git sc/source/ui/docshell/docsh.cxx sc/source/ui/docshell/docsh.cxx +index 8cb9ad8..8335542 100644 +--- sc/source/ui/docshell/docsh.cxx ++++ sc/source/ui/docshell/docsh.cxx +@@ -129,6 +129,8 @@ + #include + + using namespace com::sun::star; ++using ::rtl::OUString; ++using ::rtl::OUStringBuffer; + + // STATIC DATA ----------------------------------------------------------- + +@@ -794,6 +796,34 @@ BOOL __EXPORT ScDocShell::LoadFrom( SfxMedium& rMedium ) + return bRet; + } + ++static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLang, bool& rDateConvert) ++{ ++ OUStringBuffer aBuf; ++ OUString aTokens[2]; ++ sal_Int32 n = rOption.getLength(); ++ const sal_Unicode* p = rOption.getStr(); ++ sal_Int32 nTokenId = 0; ++ for (sal_Int32 i = 0; i < n; ++i) ++ { ++ const sal_Unicode c = p[i]; ++ if (c == sal_Unicode(' ')) ++ { ++ if (aBuf.getLength()) ++ aTokens[nTokenId++] = aBuf.makeStringAndClear(); ++ } ++ else ++ aBuf.append(c); ++ ++ if (nTokenId >= 2) ++ break; ++ } ++ ++ if (aBuf.getLength()) ++ aTokens[nTokenId] = aBuf.makeStringAndClear(); ++ ++ rLang = static_cast(aTokens[0].toInt32()); ++ rDateConvert = static_cast(aTokens[1].toInt32()); ++} + + BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) + { +@@ -1167,12 +1197,24 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium ) + SvStream* pInStream = rMedium.GetInStream(); + if (pInStream) + { ++ LanguageType eLang = LANGUAGE_SYSTEM; ++ bool bDateConvert = false; ++ SfxItemSet* pSet = rMedium.GetItemSet(); ++ const SfxPoolItem* pItem; ++ if ( pSet && SFX_ITEM_SET == ++ pSet->GetItemState( SID_FILE_FILTEROPTIONS, TRUE, &pItem ) ) ++ { ++ String aFilterOption = (static_cast(pItem))->GetValue(); ++ lcl_parseHtmlFilterOption(aFilterOption, eLang, bDateConvert); ++ } ++ + pInStream->Seek( 0 ); + ScRange aRange; + // HTML macht eigenes ColWidth/RowHeight + CalcOutputFactor(); ++ SvNumberFormatter aNumFormatter(aDocument.GetServiceManager(), eLang); + eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange, +- GetOutputFactor(), !bWebQuery ); ++ GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert ); + if (eError != eERR_OK) + { + if (!GetError()) +@@ -2149,6 +2191,11 @@ String ScDocShell::GetOwnFilterName() // static + return String::CreateFromAscii(pFilterSc50); + } + ++String ScDocShell::GetHtmlFilterName() ++{ ++ return String::CreateFromAscii(pFilterHtml); ++} ++ + String ScDocShell::GetWebQueryFilterName() // static + { + return String::CreateFromAscii(pFilterHtmlWebQ); +diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx +index 0590de5..08dfcfb 100644 +--- sc/source/ui/docshell/impex.cxx ++++ sc/source/ui/docshell/impex.cxx +@@ -905,12 +905,11 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm ) + // + + +-bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, +- const String& rStr, BYTE nColFormat, +- ::utl::TransliterationWrapper& rTransliteration, +- CalendarWrapper& rCalendar, +- ::utl::TransliterationWrapper* pSecondTransliteration, +- CalendarWrapper* pSecondCalendar ) ++static bool lcl_PutString( ++ ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, BYTE nColFormat, ++ SvNumberFormatter* pFormatter, bool bDetectNumFormat, ++ ::utl::TransliterationWrapper& rTransliteration, CalendarWrapper& rCalendar, ++ ::utl::TransliterationWrapper* pSecondTransliteration, CalendarWrapper* pSecondCalendar ) + { + bool bMultiLine = false; + if ( nColFormat == SC_COL_SKIP || !rStr.Len() || !ValidCol(nCol) || !ValidRow(nRow) ) +@@ -926,10 +925,10 @@ bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, + { + //! SetString mit Extra-Flag ??? + +- SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); +- sal_uInt32 nEnglish = pFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US); ++ SvNumberFormatter* pDocFormatter = pDoc->GetFormatTable(); ++ sal_uInt32 nEnglish = pDocFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US); + double fVal; +- if ( pFormatter->IsNumberFormat( rStr, nEnglish, fVal ) ) ++ if ( pDocFormatter->IsNumberFormat( rStr, nEnglish, fVal ) ) + { + // Zahlformat wird nicht auf englisch gesetzt + pDoc->SetValue( nCol, nRow, nTab, fVal ); +@@ -1065,9 +1064,9 @@ bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, + } + } + +- SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); ++ SvNumberFormatter* pDocFormatter = pDoc->GetFormatTable(); + if ( nYear < 100 ) +- nYear = pFormatter->ExpandTwoDigitYear( nYear ); ++ nYear = pDocFormatter->ExpandTwoDigitYear( nYear ); + + CalendarWrapper* pCalendar = (bSecondCal ? pSecondCalendar : &rCalendar); + sal_Int16 nNumMonths = pCalendar->getNumberOfMonthsInYear(); +@@ -1103,7 +1102,7 @@ bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, + pCalendar->setValue( i18n::CalendarFieldIndex::MILLISECOND, nMilli ); + if ( pCalendar->isValid() ) + { +- double fDiff = DateTime(*pFormatter->GetNullDate()) - ++ double fDiff = DateTime(*pDocFormatter->GetNullDate()) - + pCalendar->getEpochStart(); + // #i14974# must use getLocalDateTime to get the same + // date values as set above +@@ -1115,10 +1114,10 @@ bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, + LanguageType eDocLang = eLatin; //! which language for date formats? + + short nType = (nFound > 3 ? NUMBERFORMAT_DATETIME : NUMBERFORMAT_DATE); +- ULONG nFormat = pFormatter->GetStandardFormat( nType, eDocLang ); ++ ULONG nFormat = pDocFormatter->GetStandardFormat( nType, eDocLang ); + // maybe there is a special format including seconds or milliseconds + if (nFound > 5) +- nFormat = pFormatter->GetStandardFormat( fDays, nFormat, nType, eDocLang); ++ nFormat = pDocFormatter->GetStandardFormat( fDays, nFormat, nType, eDocLang); + + pDoc->PutCell( nCol, nRow, nTab, new ScValueCell(fDays), nFormat, FALSE ); + +@@ -1130,7 +1129,7 @@ bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, + + // Standard or date not determined -> SetString / EditCell + if( rStr.Search( _LF ) == STRING_NOTFOUND ) +- pDoc->SetString( nCol, nRow, nTab, rStr ); ++ pDoc->SetString( nCol, nRow, nTab, rStr, pFormatter, bDetectNumFormat ); + else + { + bMultiLine = true; +@@ -1140,7 +1139,7 @@ bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, + } + + +-String lcl_GetFixed( const String& rLine, xub_StrLen nStart, xub_StrLen nNext ) ++String lcl_GetFixed( const String& rLine, xub_StrLen nStart, xub_StrLen nNext, bool& rbIsQuoted ) + { + xub_StrLen nLen = rLine.Len(); + if (nNext > nLen) +@@ -1154,7 +1153,11 @@ String lcl_GetFixed( const String& rLine, xub_StrLen nStart, xub_StrLen nNext ) + while ( nSpace > nStart && pStr[nSpace-1] == ' ' ) + --nSpace; + +- return rLine.Copy( nStart, nSpace-nStart ); ++ rbIsQuoted = (pStr[nStart] == sal_Unicode('"') && pStr[nSpace-1] == sal_Unicode('"')); ++ if (rbIsQuoted) ++ return rLine.Copy(nStart+1, nSpace-nStart-2); ++ else ++ return rLine.Copy(nStart, nSpace-nStart); + } + + BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) +@@ -1187,9 +1190,9 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) + const BYTE* pColFormat = pExtOptions->GetColFormat(); + long nSkipLines = pExtOptions->GetStartRow(); + +- LanguageType eLatin, eCjk, eCtl; +- pDoc->GetLanguage( eLatin, eCjk, eCtl ); +- LanguageType eDocLang = eLatin; //! which language for date formats? ++ LanguageType eDocLang = pExtOptions->GetLanguage(); ++ SvNumberFormatter aNumFormatter(pDoc->GetServiceManager(), eDocLang); ++ bool bDetectNumFormat = pExtOptions->IsDetectSpecialNumber(); + + // For date recognition + ::utl::TransliterationWrapper aTransliteration( +@@ -1231,6 +1234,8 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) + // survives the toggle of bDetermineRange down at the end of the do{} loop. + bool bRangeIsDetermined = bDetermineRange; + ++ bool bQuotedAsText = pExtOptions && pExtOptions->IsQuotedAsText(); ++ + ULONG nOriginalStreamPos = rStrm.Tell(); + + do +@@ -1252,7 +1257,8 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) + // SC_COL_SKIP. + for ( i=0; i MAXCOL) + bOverflow = TRUE; // display warning on import +@@ -1260,11 +1266,15 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) + { + xub_StrLen nStart = pColStart[i]; + xub_StrLen nNext = ( i+1 < nInfoCount ) ? pColStart[i+1] : nLineLen; +- aCell = lcl_GetFixed( aLine, nStart, nNext ); +- bMultiLine |= lcl_PutString( pDoc, nCol, nRow, +- nTab, aCell, pColFormat[i], +- aTransliteration, aCalendar, +- pEnglishTransliteration, pEnglishCalendar); ++ bool bIsQuoted = false; ++ aCell = lcl_GetFixed( aLine, nStart, nNext, bIsQuoted ); ++ if (bIsQuoted && bQuotedAsText) ++ nFmt = SC_COL_TEXT; ++ ++ bMultiLine |= lcl_PutString( ++ pDoc, nCol, nRow, nTab, aCell, nFmt, ++ &aNumFormatter, bDetectNumFormat, aTransliteration, aCalendar, ++ pEnglishTransliteration, pEnglishCalendar); + } + ++nCol; + } +@@ -1281,7 +1291,8 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) + // SC_COL_SKIP. + while (*p && nCol <= MAXCOL+1) + { +- p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge ); ++ bool bIsQuoted = false; ++ p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge, bIsQuoted ); + + BYTE nFmt = SC_COL_STANDARD; + for ( i=nInfoStart; i MAXCOL) + bOverflow = TRUE; // display warning on import + else if (!bDetermineRange) +- bMultiLine |= lcl_PutString( pDoc, nCol, nRow, +- nTab, aCell, nFmt, aTransliteration, +- aCalendar, pEnglishTransliteration, +- pEnglishCalendar); ++ { ++ if (bIsQuoted && bQuotedAsText) ++ nFmt = SC_COL_TEXT; ++ ++ bMultiLine |= lcl_PutString( ++ pDoc, nCol, nRow, nTab, aCell, nFmt, ++ &aNumFormatter, bDetectNumFormat, aTransliteration, ++ aCalendar, pEnglishTransliteration, pEnglishCalendar); ++ } + ++nCol; + } + +@@ -1375,11 +1391,13 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) + + // static + const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* p, +- String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, BOOL bMergeSeps ) ++ String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted ) + { ++ rbIsQuoted = false; + rField.Erase(); + if ( *p == cStr ) // String in Anfuehrungszeichen + { ++ rbIsQuoted = true; + const sal_Unicode* p1; + p1 = p = lcl_ScanString( p, rField, cStr, DQM_ESCAPE ); + while ( *p && !ScGlobal::UnicodeStrChr( pSeps, *p ) ) +@@ -2038,7 +2056,7 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin { + virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress&, + const CharSet, UINT32 ) RETURN_ERROR + virtual FltError ScImportRTF( SvStream&, const String&, ScDocument*, ScRange& ) RETURN_ERROR +- virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL ) RETURN_ERROR ++ virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL, SvNumberFormatter*, bool ) RETURN_ERROR + + virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) { return NULL; } + virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const String&, const ScRange&, BOOL ) { return NULL; } +diff --git sc/source/ui/inc/asciiopt.hxx sc/source/ui/inc/asciiopt.hxx +index ec601a9..d3f9ba4 100644 +--- sc/source/ui/inc/asciiopt.hxx ++++ sc/source/ui/inc/asciiopt.hxx +@@ -55,7 +55,7 @@ + #include + #include + #include "csvtablebox.hxx" +- ++#include "i18npool/lang.h" + + // ============================================================================ + +@@ -65,8 +65,11 @@ private: + BOOL bFixedLen; + String aFieldSeps; + BOOL bMergeFieldSeps; ++ bool bQuotedFieldAsText; ++ bool bDetectSpecialNumber; + sal_Unicode cTextSep; + CharSet eCharSet; ++ LanguageType eLang; + BOOL bCharSetSystem; + long nStartRow; + USHORT nInfoCount; +@@ -93,20 +96,26 @@ public: + BOOL GetCharSetSystem() const { return bCharSetSystem; } + const String& GetFieldSeps() const { return aFieldSeps; } + BOOL IsMergeSeps() const { return bMergeFieldSeps; } ++ bool IsQuotedAsText() const { return bQuotedFieldAsText; } ++ bool IsDetectSpecialNumber() const { return bDetectSpecialNumber; } + sal_Unicode GetTextSep() const { return cTextSep; } + BOOL IsFixedLen() const { return bFixedLen; } + USHORT GetInfoCount() const { return nInfoCount; } + const xub_StrLen* GetColStart() const { return pColStart; } + const BYTE* GetColFormat() const { return pColFormat; } + long GetStartRow() const { return nStartRow; } ++ LanguageType GetLanguage() const { return eLang; } + + void SetCharSet( CharSet eNew ) { eCharSet = eNew; } + void SetCharSetSystem( BOOL bSet ) { bCharSetSystem = bSet; } + void SetFixedLen( BOOL bSet ) { bFixedLen = bSet; } + void SetFieldSeps( const String& rStr ) { aFieldSeps = rStr; } + void SetMergeSeps( BOOL bSet ) { bMergeFieldSeps = bSet; } ++ void SetQuotedAsText(bool bSet) { bQuotedFieldAsText = bSet; } ++ void SetDetectSpecialNumber(bool bSet) { bDetectSpecialNumber = bSet; } + void SetTextSep( sal_Unicode c ) { cTextSep = c; } + void SetStartRow( long nRow) { nStartRow= nRow; } ++ void SetLanguage(LanguageType e) { eLang = e; } + + void SetColInfo( USHORT nCount, const xub_StrLen* pStart, const BYTE* pFormat ); + void SetColumnInfo( const ScCsvExpDataVec& rDataVec ); +diff --git sc/source/ui/inc/csvruler.hxx sc/source/ui/inc/csvruler.hxx +index c251831..cd67708 100644 +--- sc/source/ui/inc/csvruler.hxx ++++ sc/source/ui/inc/csvruler.hxx +@@ -71,6 +71,7 @@ private: + // ------------------------------------------------------------------------ + public: + explicit ScCsvRuler( ScCsvControl& rParent ); ++ ~ScCsvRuler(); + + // common ruler handling -------------------------------------------------- + public: +diff --git sc/source/ui/inc/docsh.hxx sc/source/ui/inc/docsh.hxx +index 8aa9efe..07d372b 100644 +--- sc/source/ui/inc/docsh.hxx ++++ sc/source/ui/inc/docsh.hxx +@@ -398,6 +398,7 @@ public: + + static ScDocShell* GetShellByNum( USHORT nDocNo ); + static String GetOwnFilterName(); ++ static String GetHtmlFilterName(); + static String GetWebQueryFilterName(); + static String GetAsciiFilterName(); + static String GetLotusFilterName(); +diff --git sc/source/ui/inc/impex.hxx sc/source/ui/inc/impex.hxx +index 3abab58..5ef0f1f 100644 +--- sc/source/ui/inc/impex.hxx ++++ sc/source/ui/inc/impex.hxx +@@ -110,7 +110,7 @@ public: + + static BOOL IsFormatSupported( ULONG nFormat ); + static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p, +- String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, BOOL bMergeSeps ); ++ String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted ); + static void WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, BOOL bZero = FALSE ); + static void WriteUnicodeOrByteEndl( SvStream& rStrm ); + static inline BOOL IsEndianSwap( const SvStream& rStrm ); +diff --git sc/source/ui/inc/scuiasciiopt.hxx sc/source/ui/inc/scuiasciiopt.hxx +index 643fb3b..4515a86 100644 +--- sc/source/ui/inc/scuiasciiopt.hxx ++++ sc/source/ui/inc/scuiasciiopt.hxx +@@ -35,6 +35,8 @@ + + + #include "asciiopt.hxx" ++#include "svx/langbox.hxx" ++ + // ============================================================================ + + class ScImportAsciiDlg : public ModalDialog +@@ -49,6 +51,8 @@ class ScImportAsciiDlg : public ModalDialog + FixedLine aFlFieldOpt; + FixedText aFtCharSet; + SvxTextEncodingBox aLbCharSet; ++ FixedText aFtCustomLang; ++ SvxLanguageBox aLbCustomLang; + + FixedText aFtRow; + NumericField aNfRow; +@@ -64,6 +68,12 @@ class ScImportAsciiDlg : public ModalDialog + CheckBox aCkbOther; + Edit aEdOther; + CheckBox aCkbAsOnce; ++ ++ FixedLine aFlOtherOpt; ++ ++ CheckBox aCkbQuotedAsText; ++ CheckBox aCkbDetectNumber; ++ + FixedText aFtTextSep; + ComboBox aCbTextSep; + +@@ -87,6 +97,7 @@ class ScImportAsciiDlg : public ModalDialog + + CharSet meCharSet; /// Selected char set. + bool mbCharSetSystem; /// Is System char set selected? ++ bool mbFileImport; /// Is this dialog involked for csv file import ? + + public: + ScImportAsciiDlg( +diff --git sc/source/ui/inc/textimportoptions.hrc sc/source/ui/inc/textimportoptions.hrc +new file mode 100644 +index 0000000..eb981c1 +--- /dev/null ++++ sc/source/ui/inc/textimportoptions.hrc +@@ -0,0 +1,42 @@ ++/************************************************************************* ++ * ++ * 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: retypepassdlg.src,v $ ++ * $Revision: 1.1.2.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#include ++ ++#define BTN_OK 1 ++#define BTN_CANCEL 2 ++#define BTN_HELP 3 ++ ++#define FL_CHOOSE_LANG 4 ++#define RB_AUTOMATIC 5 ++#define RB_CUSTOM 6 ++#define LB_CUSTOM_LANG 7 ++#define FL_OPTION 8 ++#define BTN_CONVERT_DATE 9 +diff --git sc/source/ui/inc/textimportoptions.hxx sc/source/ui/inc/textimportoptions.hxx +new file mode 100644 +index 0000000..8ef489a +--- /dev/null ++++ sc/source/ui/inc/textimportoptions.hxx +@@ -0,0 +1,76 @@ ++/************************************************************************* ++ * ++ * 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: langbox.hxx,v $ ++ * $Revision: 1.4.242.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 ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_UI_IMPORTOPTIONS_HXX ++#define SC_UI_IMPORTOPTIONS_HXX ++ ++#include "vcl/dialog.hxx" ++#include "vcl/button.hxx" ++#include "vcl/fixed.hxx" ++#include "i18npool/lang.h" ++#include "svx/langbox.hxx" ++ ++class ScTextImportOptionsDlg : public ModalDialog ++{ ++public: ++ ScTextImportOptionsDlg(Window* pParent); ++ virtual ~ScTextImportOptionsDlg(); ++ ++ virtual short Execute(); ++ ++ LanguageType getLanguageType() const; ++ bool isDateConversionSet() const; ++ ++private: ++ void init(); ++ ++private: ++ OKButton maBtnOk; ++ CancelButton maBtnCancel; ++ HelpButton maBtnHelp; ++ ++ FixedLine maFlChooseLang; ++ ++ RadioButton maRbAutomatic; ++ RadioButton maRbCustom; ++ ++ SvxLanguageBox maLbCustomLang; ++ ++ FixedLine maFlOption; ++ ++ CheckBox maBtnConvertDate; ++ ++ DECL_LINK( OKHdl, OKButton* ); ++ ++ DECL_LINK( RadioHdl, RadioButton* ); ++}; ++ ++ ++#endif +diff --git sc/source/ui/unoobj/filtuno.cxx sc/source/ui/unoobj/filtuno.cxx +index 8b93ff9..02d2f9d 100644 +--- sc/source/ui/unoobj/filtuno.cxx ++++ sc/source/ui/unoobj/filtuno.cxx +@@ -51,7 +51,12 @@ + + #include "sc.hrc" //CHINA001 + #include "scabstdlg.hxx" //CHINA001 ++#include "i18npool/lang.h" ++ ++#include ++ + using namespace ::com::sun::star; ++using ::rtl::OUStringBuffer; + + //------------------------------------------------------------------------ + +@@ -146,6 +151,10 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) + sal_Int16 nRet = ui::dialogs::ExecutableDialogResults::CANCEL; + + String aFilterString( aFilterName ); ++ ++ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ++ DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); ++ + if ( !bExport && aFilterString == ScDocShell::GetAsciiFilterName() ) + { + // ascii import is special... +@@ -164,8 +173,6 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) + pInStream = utl::UcbStreamHelper::CreateStream( xInputStream ); + + //CHINA001 ScImportAsciiDlg* pDlg = new ScImportAsciiDlg( NULL, aPrivDatName, pInStream, cAsciiDel ); +- ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); +- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001 + AbstractScImportAsciiDlg* pDlg = pFact->CreateScImportAsciiDlg( NULL, aPrivDatName, pInStream, RID_SCDLG_ASCII, cAsciiDel); + DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001 + if ( pDlg->Execute() == RET_OK ) +@@ -178,6 +185,24 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) + delete pDlg; + delete pInStream; + } ++ else if ( aFilterString == ScDocShell::GetWebQueryFilterName() || aFilterString == ScDocShell::GetHtmlFilterName() ) ++ { ++ // HTML import. ++ ::std::auto_ptr pDlg( ++ pFact->CreateScTextImportOptionsDlg(NULL, RID_SCDLG_TEXT_IMPORT_OPTIONS)); ++ ++ if (pDlg->Execute() == RET_OK) ++ { ++ LanguageType eLang = pDlg->GetLanguageType(); ++ OUStringBuffer aBuf; ++ ++ aBuf.append(String::CreateFromInt32(static_cast(eLang))); ++ aBuf.append(sal_Unicode(' ')); ++ aBuf.append(pDlg->IsDateConversionSet() ? sal_Unicode('1') : sal_Unicode('0')); ++ aFilterOptions = aBuf.makeStringAndClear(); ++ nRet = ui::dialogs::ExecutableDialogResults::OK; ++ } ++ } + else + { + sal_Bool bMultiByte = sal_True; +@@ -249,8 +274,6 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) + //CHINA001 &aOptions, &aTitle, bMultiByte, bDBEnc, + //CHINA001 !bExport ); + //CHINA001 +- ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); +- DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001 + + AbstractScImportOptionsDlg* pDlg = pFact->CreateScImportOptionsDlg( NULL, RID_SCDLG_IMPORTOPT, + bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc, +diff --git sc/util/makefile.mk sc/util/makefile.mk +index 2b56e37..214e210 100644 +--- sc/util/makefile.mk ++++ sc/util/makefile.mk +@@ -283,6 +283,7 @@ LIB8OBJFILES = \ + $(SLO)$/dapidata.obj \ + $(SLO)$/crdlg.obj \ + $(SLO)$/scuiasciiopt.obj \ ++ $(SLO)$/textimportoptions.obj \ + $(SLO)$/scuiautofmt.obj \ + $(SLO)$/dpgroupdlg.obj \ + $(SLO)$/editfield.obj diff --git a/applied_patches/0012-cws-kohei03-chart2.diff b/applied_patches/0012-cws-kohei03-chart2.diff new file mode 100644 index 000000000..119afcce7 --- /dev/null +++ b/applied_patches/0012-cws-kohei03-chart2.diff @@ -0,0 +1,99 @@ +diff --git chart2/source/view/charttypes/PieChart.cxx chart2/source/view/charttypes/PieChart.cxx +index 80f856e..3596d17 100644 +--- chart2/source/view/charttypes/PieChart.cxx ++++ chart2/source/view/charttypes/PieChart.cxx +@@ -129,6 +129,8 @@ PieChart::PieChart( const uno::Reference& xChartTypeModel + , m_pPosHelper( new PiePositionHelper( NormalAxis_Z, (m_nDimension==3)?0.0:90.0 ) ) + , m_bUseRings(false) + { ++ ::rtl::math::setNan(&m_fMaxOffset); ++ + PlotterBase::m_pPosHelper = m_pPosHelper; + VSeriesPlotter::m_pMainPosHelper = m_pPosHelper; + m_pPosHelper->m_fRadiusOffset = 0.0; +@@ -248,27 +250,31 @@ double PieChart::getMinimumX() + { + return 0.5; + } +-double PieChart::getMaxOffset() const ++double PieChart::getMaxOffset() + { +- double fRet = 0.0; ++ if (!::rtl::math::isNan(m_fMaxOffset)) ++ // Value already cached. Use it. ++ return m_fMaxOffset; ++ ++ m_fMaxOffset = 0.0; + if( m_aZSlots.size()<=0 ) +- return fRet; ++ return m_fMaxOffset; + if( m_aZSlots[0].size()<=0 ) +- return fRet; ++ return m_fMaxOffset; + + const ::std::vector< VDataSeries* >& rSeriesList( m_aZSlots[0][0].m_aSeriesVector ); + if( rSeriesList.size()<=0 ) +- return fRet; ++ return m_fMaxOffset; + + VDataSeries* pSeries = rSeriesList[0]; + uno::Reference< beans::XPropertySet > xSeriesProp( pSeries->getPropertiesOfSeries() ); + if( !xSeriesProp.is() ) +- return fRet; ++ return m_fMaxOffset; + + double fExplodePercentage=0.0; + xSeriesProp->getPropertyValue( C2U( "Offset" )) >>= fExplodePercentage; +- if(fExplodePercentage>fRet) +- fRet=fExplodePercentage; ++ if(fExplodePercentage>m_fMaxOffset) ++ m_fMaxOffset=fExplodePercentage; + + uno::Sequence< sal_Int32 > aAttributedDataPointIndexList; + if( xSeriesProp->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= aAttributedDataPointIndexList ) +@@ -280,12 +286,12 @@ double PieChart::getMaxOffset() const + { + fExplodePercentage=0.0; + xPointProp->getPropertyValue( C2U( "Offset" )) >>= fExplodePercentage; +- if(fExplodePercentage>fRet) +- fRet=fExplodePercentage; ++ if(fExplodePercentage>m_fMaxOffset) ++ m_fMaxOffset=fExplodePercentage; + } + } + } +- return fRet; ++ return m_fMaxOffset; + } + double PieChart::getMaximumX() + { +@@ -357,6 +363,7 @@ void PieChart::createShapes() + nExplodeableSlot = m_aZSlots[0].size()-1; + + m_aLabelInfoList.clear(); ++ ::rtl::math::setNan(&m_fMaxOffset); + + //============================================================================= + for( double fSlotX=0; aXSlotIter != aXSlotEnd && (m_bUseRings||fSlotX<0.5 ); aXSlotIter++, fSlotX+=1.0 ) +diff --git chart2/source/view/charttypes/PieChart.hxx chart2/source/view/charttypes/PieChart.hxx +index e32a9e8..6447515 100644 +--- chart2/source/view/charttypes/PieChart.hxx ++++ chart2/source/view/charttypes/PieChart.hxx +@@ -105,7 +105,7 @@ private: //methods + , double fLogicZ, double fDepth, double fExplodePercentage + , tPropertyNameValueMap* pOverWritePropertiesMap ); + +- double getMaxOffset() const; ++ double getMaxOffset(); + bool detectLabelOverlapsAndMove(const ::com::sun::star::awt::Size& rPageSize);//returns true when there might be more to do + void resetLabelPositionsToPreviousState(); + struct PieLabelInfo; +@@ -137,6 +137,8 @@ private: //member + }; + + ::std::vector< PieLabelInfo > m_aLabelInfoList; ++ ++ double m_fMaxOffset; /// cached max offset value (init'ed to NaN) + }; + //............................................................................. + } //namespace chart diff --git a/applied_patches/0013-cws-kohei03-sc.diff b/applied_patches/0013-cws-kohei03-sc.diff new file mode 100644 index 000000000..bbd5526ff --- /dev/null +++ b/applied_patches/0013-cws-kohei03-sc.diff @@ -0,0 +1,3426 @@ +diff --git sc/inc/chart2uno.hxx sc/inc/chart2uno.hxx +index 93afe64..46b7ff0 100644 +--- sc/inc/chart2uno.hxx ++++ sc/inc/chart2uno.hxx +@@ -533,6 +533,14 @@ private: + }; + + ::std::list m_aDataArray; ++ ++ /** ++ * Cached data for getData. We may also need to cache data for the ++ * numerical and textural data series if they turn out to be bottlenecks ++ * under certain scenarios. ++ */ ++ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aMixedDataCache; ++ + ::com::sun::star::uno::Sequence m_aHiddenValues; + + // properties +diff --git sc/inc/chartlis.hxx sc/inc/chartlis.hxx +index a8a97d3..51ac644 100644 +--- sc/inc/chartlis.hxx ++++ sc/inc/chartlis.hxx +@@ -49,7 +49,7 @@ class ScChartUnoData; + #include + #include + +-class ScChartListener : public StrData, public SvtListener ++class SC_DLLPUBLIC ScChartListener : public StrData, public SvtListener + { + public: + class ExternalRefListener : public ScExternalRefManager::LinkListener +diff --git sc/inc/column.hxx sc/inc/column.hxx +index e4c7ed4..983ca1f 100644 +--- sc/inc/column.hxx ++++ sc/inc/column.hxx +@@ -114,7 +114,7 @@ private: + friend class ScDocument; // fuer FillInfo + friend class ScDocumentIterator; + friend class ScValueIterator; +-friend class ScQueryValueIterator; ++friend class ScDBQueryDataIterator; + friend class ScColumnIterator; + friend class ScQueryCellIterator; + friend class ScMarkedDataIter; +diff --git sc/inc/datauno.hxx sc/inc/datauno.hxx +index 3103875..44e0336 100644 +--- sc/inc/datauno.hxx ++++ sc/inc/datauno.hxx +@@ -32,6 +32,8 @@ + #define SC_DATAUNO_HXX + + #include "global.hxx" ++#include "queryparam.hxx" ++ + #include + #include + #include +diff --git sc/inc/dociter.hxx sc/inc/dociter.hxx +index d5d4235..350c611 100644 +--- sc/inc/dociter.hxx ++++ sc/inc/dociter.hxx +@@ -35,6 +35,9 @@ + #include + #include "global.hxx" + #include "scdllapi.h" ++#include "queryparam.hxx" ++ ++#include + + class ScDocument; + class ScBaseCell; +@@ -127,34 +130,91 @@ public: + } + }; + +-class ScQueryValueIterator // alle Zahlenwerte in einem Bereich durchgehen ++// ============================================================================ ++ ++class ScDBQueryDataIterator + { ++public: ++ struct Value ++ { ++ ::rtl::OUString maString; ++ double mfValue; ++ sal_uInt16 mnError; ++ bool mbIsNumber; ++ ++ Value(); ++ }; ++ + private: +- ScQueryParam aParam; +- ScDocument* pDoc; +- const ScAttrArray* pAttrArray; +- ULONG nNumFormat; // fuer CalcAsShown +- ULONG nNumFmtIndex; +- SCCOL nCol; +- SCROW nRow; +- SCSIZE nColRow; +- SCROW nAttrEndRow; +- SCTAB nTab; +- short nNumFmtType; +- BOOL bCalcAsShown; ++ class DataAccess ++ { ++ public: ++ DataAccess(const ScDBQueryDataIterator* pParent); ++ virtual ~DataAccess() = 0; ++ virtual bool getCurrent(Value& rValue) = 0; ++ virtual bool getFirst(Value& rValue) = 0; ++ virtual bool getNext(Value& rValue) = 0; ++ protected: ++ const ScDBQueryDataIterator* mpParent; ++ }; ++ ++ class DataAccessInternal : public DataAccess ++ { ++ public: ++ DataAccessInternal(const ScDBQueryDataIterator* pParent, ScDBQueryParamInternal* pParam, ScDocument* pDoc); ++ virtual ~DataAccessInternal(); ++ virtual bool getCurrent(Value& rValue); ++ virtual bool getFirst(Value& rValue); ++ virtual bool getNext(Value& rValue); ++ ++ private: ++ ScDBQueryParamInternal* mpParam; ++ ScDocument* mpDoc; ++ const ScAttrArray* pAttrArray; ++ ULONG nNumFormat; // for CalcAsShown ++ ULONG nNumFmtIndex; ++ SCCOL nCol; ++ SCROW nRow; ++ SCSIZE nColRow; ++ SCROW nAttrEndRow; ++ SCTAB nTab; ++ short nNumFmtType; ++ bool bCalcAsShown; ++ }; ++ ++ class DataAccessMatrix : public DataAccess ++ { ++ public: ++ DataAccessMatrix(const ScDBQueryDataIterator* pParent, ScDBQueryParamMatrix* pParam); ++ virtual ~DataAccessMatrix(); ++ virtual bool getCurrent(Value& rValue); ++ virtual bool getFirst(Value& rValue); ++ virtual bool getNext(Value& rValue); ++ ++ private: ++ bool isValidQuery(SCROW mnRow, const ScMatrix& rMat) const; ++ ++ ScDBQueryParamMatrix* mpParam; ++ SCROW mnCurRow; ++ SCROW mnRows; ++ SCCOL mnCols; ++ }; ++ ++ ::std::auto_ptr mpParam; ++ ::std::auto_ptr mpData; ++ ++ bool GetThis(Value& rValue); + +- BOOL GetThis(double& rValue, USHORT& rErr); + public: +- ScQueryValueIterator(ScDocument* pDocument, SCTAB nTable, +- const ScQueryParam& aParam); ++ ScDBQueryDataIterator(ScDocument* pDocument, ScDBQueryParamBase* pParam); + /// Does NOT reset rValue if no value found! +- BOOL GetFirst(double& rValue, USHORT& rErr); ++ bool GetFirst(Value& rValue); + /// Does NOT reset rValue if no value found! +- BOOL GetNext(double& rValue, USHORT& rErr); +- void GetCurNumFmtInfo( short& nType, ULONG& nIndex ) +- { nType = nNumFmtType; nIndex = nNumFmtIndex; } ++ bool GetNext(Value& rValue); + }; + ++// ============================================================================ ++ + class ScCellIterator // alle Zellen in einem Bereich durchgehen + { // bei SubTotal aber keine ausgeblendeten und + private: // SubTotalZeilen +diff --git sc/inc/document.hxx sc/inc/document.hxx +index 240765d..d01ee71 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -227,7 +227,7 @@ class ScDocument + { + friend class ScDocumentIterator; + friend class ScValueIterator; +-friend class ScQueryValueIterator; ++friend class ScDBQueryDataIterator; + friend class ScCellIterator; + friend class ScQueryCellIterator; + friend class ScHorizontalCellIterator; +diff --git sc/inc/dpcachetable.hxx sc/inc/dpcachetable.hxx +index 7a60535..0a22fb0 100644 +--- sc/inc/dpcachetable.hxx ++++ sc/inc/dpcachetable.hxx +@@ -60,6 +60,7 @@ class ScDPDimension; + class ScDPCollection; + struct ScDPCacheCell; + struct ScDPItemData; ++struct ScQueryParam; + class Date; + + // ---------------------------------------------------------------------------- +diff --git sc/inc/dpshttab.hxx sc/inc/dpshttab.hxx +index ede4933..8483ca2 100644 +--- sc/inc/dpshttab.hxx ++++ sc/inc/dpshttab.hxx +@@ -35,6 +35,7 @@ + #include "global.hxx" + #include "address.hxx" + #include "scdllapi.h" ++#include "queryparam.hxx" + + #include + +diff --git sc/inc/global.hxx sc/inc/global.hxx +index 57a6ff1..b401cb9 100644 +--- sc/inc/global.hxx ++++ sc/inc/global.hxx +@@ -817,47 +817,6 @@ struct ScQueryEntry + BOOL operator==( const ScQueryEntry& r ) const; + }; + +-struct SC_DLLPUBLIC ScQueryParam +-{ +- SCCOL nCol1; +- SCROW nRow1; +- SCCOL nCol2; +- SCROW nRow2; +- SCTAB nTab; +- BOOL bHasHeader; +- BOOL bByRow; +- BOOL bInplace; +- BOOL bCaseSens; +- BOOL bRegExp; +- BOOL bMixedComparison; // whether numbers are smaller than strings +- BOOL bDuplicate; +- BOOL bDestPers; // nicht gespeichert +- SCTAB nDestTab; +- SCCOL nDestCol; +- SCROW nDestRow; +- +-private: +- SCSIZE nEntryCount; +- ScQueryEntry* pEntries; +- +-public: +- ScQueryParam(); +- ScQueryParam( const ScQueryParam& r ); +- ~ScQueryParam(); +- +- SCSIZE GetEntryCount() const { return nEntryCount; } +- ScQueryEntry& GetEntry(SCSIZE n) const { return pEntries[n]; } +- void Resize(SCSIZE nNew); +- +- ScQueryParam& operator= ( const ScQueryParam& r ); +- BOOL operator== ( const ScQueryParam& rOther ) const; +- void Clear (); +- void DeleteQuery( SCSIZE nPos ); +- +- void MoveToDest(); +- void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex); +-}; +- + // ----------------------------------------------------------------------- + + struct SC_DLLPUBLIC ScSubTotalParam +diff --git sc/inc/queryparam.hxx sc/inc/queryparam.hxx +new file mode 100644 +index 0000000..bc50237 +--- /dev/null ++++ sc/inc/queryparam.hxx +@@ -0,0 +1,142 @@ ++/************************************************************************* ++ * ++ * 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: interpre.hxx,v $ ++ * $Revision: 1.35.44.2 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_QUERYPARAM_HXX ++#define SC_QUERYPARAM_HXX ++ ++#include "global.hxx" ++#include "scmatrix.hxx" ++ ++#include ++ ++struct ScDBQueryParamInternal; ++ ++struct ScQueryParamBase ++{ ++ bool bHasHeader; ++ bool bByRow; ++ bool bInplace; ++ bool bCaseSens; ++ bool bRegExp; ++ bool bDuplicate; ++ bool bMixedComparison; // whether numbers are smaller than strings ++ ++ virtual ~ScQueryParamBase(); ++ ++ SC_DLLPUBLIC SCSIZE GetEntryCount() const; ++ SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n) const; ++ void Resize(SCSIZE nNew); ++ SC_DLLPUBLIC void DeleteQuery( SCSIZE nPos ); ++ void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex); ++ ++protected: ++ ScQueryParamBase(); ++ ScQueryParamBase(const ScQueryParamBase& r); ++ ++ mutable ::std::vector maEntries; ++}; ++ ++// ============================================================================ ++ ++struct ScQueryParamTable ++{ ++ SCCOL nCol1; ++ SCROW nRow1; ++ SCCOL nCol2; ++ SCROW nRow2; ++ SCTAB nTab; ++ ++ ScQueryParamTable(); ++ ScQueryParamTable(const ScQueryParamTable& r); ++ virtual ~ScQueryParamTable(); ++}; ++ ++// ============================================================================ ++ ++struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable ++{ ++ BOOL bDestPers; // nicht gespeichert ++ SCTAB nDestTab; ++ SCCOL nDestCol; ++ SCROW nDestRow; ++ ++ ScQueryParam(); ++ ScQueryParam( const ScQueryParam& r ); ++ ScQueryParam( const ScDBQueryParamInternal& r ); ++ virtual ~ScQueryParam(); ++ ++ ScQueryParam& operator= ( const ScQueryParam& r ); ++ BOOL operator== ( const ScQueryParam& rOther ) const; ++ void Clear(); ++ void ClearDestParams(); ++ void MoveToDest(); ++}; ++ ++// ============================================================================ ++ ++struct ScDBQueryParamBase : public ScQueryParamBase ++{ ++ enum DataType { INTERNAL, MATRIX }; ++ ++ SCCOL mnField; /// the field in which the values are processed during iteration. ++ bool mbSkipString; ++ ++ DataType GetType() const; ++ ++ virtual ~ScDBQueryParamBase(); ++ ++protected: ++ ScDBQueryParamBase(DataType eType); ++ ++private: ++ ScDBQueryParamBase(); ++ ++ DataType meType; ++}; ++ ++// ============================================================================ ++ ++struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTable ++{ ++ ScDBQueryParamInternal(); ++ virtual ~ScDBQueryParamInternal(); ++}; ++ ++// ============================================================================ ++ ++struct ScDBQueryParamMatrix : public ScDBQueryParamBase ++{ ++ ScMatrixRef mpMatrix; ++ ++ ScDBQueryParamMatrix(); ++ virtual ~ScDBQueryParamMatrix(); ++}; ++ ++#endif +diff --git sc/inc/reftokenhelper.hxx sc/inc/reftokenhelper.hxx +index d7b335f..99a5998 100644 +--- sc/inc/reftokenhelper.hxx ++++ sc/inc/reftokenhelper.hxx +@@ -70,12 +70,12 @@ public: + + static void getTokensFromRangeList(::std::vector& pTokens, const ScRangeList& rRanges); + +- static bool isRef(const ScSharedTokenRef& pToken); +- static bool isExternalRef(const ScSharedTokenRef& pToken); ++ static bool SC_DLLPUBLIC isRef(const ScSharedTokenRef& pToken); ++ static bool SC_DLLPUBLIC isExternalRef(const ScSharedTokenRef& pToken); + +- static bool intersects(const ::std::vector& rTokens, const ScSharedTokenRef& pToken); ++ static bool SC_DLLPUBLIC intersects(const ::std::vector& rTokens, const ScSharedTokenRef& pToken); + +- static void join(::std::vector& rTokens, const ScSharedTokenRef& pToken); ++ static void SC_DLLPUBLIC join(::std::vector& rTokens, const ScSharedTokenRef& pToken); + + static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScSharedTokenRef& pToken); + }; +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 8194e25..589d73f 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -161,7 +161,7 @@ private: + friend class ScDocument; // fuer FillInfo + friend class ScDocumentIterator; + friend class ScValueIterator; +-friend class ScQueryValueIterator; ++friend class ScDBQueryDataIterator; + friend class ScCellIterator; + friend class ScQueryCellIterator; + friend class ScHorizontalCellIterator; +diff --git sc/source/core/data/autonamecache.cxx sc/source/core/data/autonamecache.cxx +index ea41e3e..329e7f4 100644 +--- sc/source/core/data/autonamecache.cxx ++++ sc/source/core/data/autonamecache.cxx +@@ -40,6 +40,7 @@ + #include "autonamecache.hxx" + #include "dociter.hxx" + #include "cell.hxx" ++#include "queryparam.hxx" + + // ----------------------------------------------------------------------- + +diff --git sc/source/core/data/cell.cxx sc/source/core/data/cell.cxx +index 2ae9972..09da3d6 100644 +--- sc/source/core/data/cell.cxx ++++ sc/source/core/data/cell.cxx +@@ -1851,8 +1851,7 @@ void ScFormulaCell::SetDirty() + + void ScFormulaCell::SetDirtyAfterLoad() + { +- bDirty = TRUE; +- if ( !pDocument->GetHardRecalcState() ) ++ if ( bDirty && !pDocument->GetHardRecalcState() ) + pDocument->PutInFormulaTree( this ); + } + +diff --git sc/source/core/data/dociter.cxx sc/source/core/data/dociter.cxx +index f7f836e..031b70a 100644 +--- sc/source/core/data/dociter.cxx ++++ sc/source/core/data/dociter.cxx +@@ -47,9 +47,23 @@ + #include "docoptio.hxx" + #include "cellform.hxx" + ++#include ++ ++using ::rtl::math::approxEqual; ++using ::std::vector; ++using ::rtl::OUString; + + // STATIC DATA ----------------------------------------------------------- + ++namespace { ++ ++void lcl_toUpper(OUString& rStr) ++{ ++ rStr = ScGlobal::pCharClass->toUpper(rStr.trim(), 0, rStr.getLength()); ++} ++ ++} ++ + ScDocumentIterator::ScDocumentIterator( ScDocument* pDocument, + SCTAB nStartTable, SCTAB nEndTable ) : + pDoc( pDocument ), +@@ -482,83 +496,85 @@ BOOL ScValueIterator::GetNext(double& rValue, USHORT& rErr) + } + */ + +-//------------------------------------------------------------------------ +-//------------------------------------------------------------------------ ++// ============================================================================ + +-ScQueryValueIterator::ScQueryValueIterator(ScDocument* pDocument, SCTAB nTable, const ScQueryParam& rParam) : +- aParam (rParam), +- pDoc( pDocument ), +- nNumFmtIndex(0), +- nTab( nTable), +- nNumFmtType( NUMBERFORMAT_UNDEFINED ), +- bCalcAsShown( pDocument->GetDocOptions().IsCalcAsShown() ) ++ScDBQueryDataIterator::DataAccess::DataAccess(const ScDBQueryDataIterator* pParent) : ++ mpParent(pParent) + { +- nCol = aParam.nCol1; +- nRow = aParam.nRow1; ++} ++ ++ScDBQueryDataIterator::DataAccess::~DataAccess() ++{ ++} ++ ++// ---------------------------------------------------------------------------- ++ ++ScDBQueryDataIterator::DataAccessInternal::DataAccessInternal(const ScDBQueryDataIterator* pParent, ScDBQueryParamInternal* pParam, ScDocument* pDoc) : ++ DataAccess(pParent), ++ mpParam(pParam), ++ mpDoc(pDoc) ++{ ++ nCol = mpParam->mnField; ++ nRow = mpParam->nRow1; ++ nTab = mpParam->nTab; ++ + nColRow = 0; // wird bei GetFirst initialisiert + SCSIZE i; +- SCSIZE nCount = aParam.GetEntryCount(); +- for (i=0; (iGetEntryCount(); ++ for (i=0; (iGetEntry(i).bDoQuery); i++) + { +- ScQueryEntry& rEntry = aParam.GetEntry(i); ++ ScQueryEntry& rEntry = mpParam->GetEntry(i); + sal_uInt32 nIndex = 0; + rEntry.bQueryByString = +- !(pDoc->GetFormatTable()->IsNumberFormat(*rEntry.pStr, nIndex, rEntry.nVal)); ++ !(mpDoc->GetFormatTable()->IsNumberFormat(*rEntry.pStr, nIndex, rEntry.nVal)); + } + nNumFormat = 0; // werden bei GetNumberFormat initialisiert + pAttrArray = 0; + nAttrEndRow = 0; + } + +-BOOL ScQueryValueIterator::GetThis(double& rValue, USHORT& rErr) ++ScDBQueryDataIterator::DataAccessInternal::~DataAccessInternal() + { +- ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol]; +- SCCOLROW nFirstQueryField = aParam.GetEntry(0).nField; ++} ++ ++bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) ++{ ++ ScColumn* pCol = &(mpDoc->pTab[nTab])->aCol[nCol]; ++ SCCOLROW nFirstQueryField = mpParam->GetEntry(0).nField; + for ( ;; ) + { +- if ( nRow > aParam.nRow2 ) ++ if (nRow > mpParam->nRow2) + { +- nRow = aParam.nRow1; +- if (aParam.bHasHeader) +- nRow++; +- do +- { +- nCol++; +- if ( nCol > aParam.nCol2 ) +- { +- // rValue = 0.0; // do not change caller's value! +- rErr = 0; +- return FALSE; // Ende und Aus +- } +- pCol = &(pDoc->pTab[nTab])->aCol[nCol]; +- } while ( pCol->nCount == 0 ); +- pCol->Search( nRow, nColRow ); ++ // Bottom of the range reached. Bail out. ++ rValue.mnError = 0; ++ return false; + } + + while ( (nColRow < pCol->nCount) && (pCol->pItems[nColRow].nRow < nRow) ) + nColRow++; + +- if ( nColRow < pCol->nCount && pCol->pItems[nColRow].nRow <= aParam.nRow2 ) ++ if ( nColRow < pCol->nCount && pCol->pItems[nColRow].nRow <= mpParam->nRow2 ) + { + nRow = pCol->pItems[nColRow].nRow; + ScBaseCell* pCell = pCol->pItems[nColRow].pCell; +- if ( (pDoc->pTab[nTab])->ValidQuery( nRow, aParam, NULL, ++ if ( (mpDoc->pTab[nTab])->ValidQuery( nRow, *mpParam, NULL, + (nCol == static_cast(nFirstQueryField) ? pCell : NULL) ) ) + { + switch (pCell->GetCellType()) + { + case CELLTYPE_VALUE: + { +- rValue = ((ScValueCell*)pCell)->GetValue(); ++ rValue.mfValue = ((ScValueCell*)pCell)->GetValue(); ++ rValue.mbIsNumber = true; + if ( bCalcAsShown ) + { + lcl_IterGetNumberFormat( nNumFormat, pAttrArray, +- nAttrEndRow, pCol->pAttrArray, nRow, pDoc ); +- rValue = pDoc->RoundValueAsShown( rValue, nNumFormat ); ++ nAttrEndRow, pCol->pAttrArray, nRow, mpDoc ); ++ rValue.mfValue = mpDoc->RoundValueAsShown( rValue.mfValue, nNumFormat ); + } + nNumFmtType = NUMBERFORMAT_NUMBER; + nNumFmtIndex = 0; +- rErr = 0; ++ rValue.mnError = 0; + return TRUE; // gefunden + } + // break; +@@ -566,17 +582,31 @@ BOOL ScQueryValueIterator::GetThis(double& rValue, USHORT& rErr) + { + if (((ScFormulaCell*)pCell)->IsValue()) + { +- rValue = ((ScFormulaCell*)pCell)->GetValue(); +- pDoc->GetNumberFormatInfo( nNumFmtType, ++ rValue.mfValue = ((ScFormulaCell*)pCell)->GetValue(); ++ rValue.mbIsNumber = true; ++ mpDoc->GetNumberFormatInfo( nNumFmtType, + nNumFmtIndex, ScAddress( nCol, nRow, nTab ), + pCell ); +- rErr = ((ScFormulaCell*)pCell)->GetErrCode(); ++ rValue.mnError = ((ScFormulaCell*)pCell)->GetErrCode(); + return TRUE; // gefunden + } + else + nRow++; + } + break; ++ case CELLTYPE_STRING: ++ case CELLTYPE_EDIT: ++ if (mpParam->mbSkipString) ++ ++nRow; ++ else ++ { ++ rValue.maString = pCell->GetStringData(); ++ rValue.mfValue = 0.0; ++ rValue.mnError = 0; ++ rValue.mbIsNumber = false; ++ return true; ++ } ++ break; + default: + nRow++; + break; +@@ -586,30 +616,309 @@ BOOL ScQueryValueIterator::GetThis(double& rValue, USHORT& rErr) + nRow++; + } + else +- nRow = aParam.nRow2 + 1; // Naechste Spalte ++ nRow = mpParam->nRow2 + 1; // Naechste Spalte + } +-// return FALSE; ++ return false; + } + +-BOOL ScQueryValueIterator::GetFirst(double& rValue, USHORT& rErr) ++bool ScDBQueryDataIterator::DataAccessInternal::getFirst(Value& rValue) + { +- nCol = aParam.nCol1; +- nRow = aParam.nRow1; +- if (aParam.bHasHeader) ++ if (mpParam->bHasHeader) + nRow++; +-// nColRow = 0; +- ScColumn* pCol = &(pDoc->pTab[nTab])->aCol[nCol]; ++// nColRow = 0; ++ ScColumn* pCol = &(mpDoc->pTab[nTab])->aCol[nCol]; + pCol->Search( nRow, nColRow ); +- return GetThis(rValue, rErr); ++ return getCurrent(rValue); + } + +-BOOL ScQueryValueIterator::GetNext(double& rValue, USHORT& rErr) ++bool ScDBQueryDataIterator::DataAccessInternal::getNext(Value& rValue) + { + ++nRow; +- return GetThis(rValue, rErr); ++ return getCurrent(rValue); + } + +-//------------------------------------------------------------------------------- ++// ---------------------------------------------------------------------------- ++ ++ScDBQueryDataIterator::DataAccessMatrix::DataAccessMatrix(const ScDBQueryDataIterator* pParent, ScDBQueryParamMatrix* pParam) : ++ DataAccess(pParent), ++ mpParam(pParam) ++{ ++ SCSIZE nC, nR; ++ mpParam->mpMatrix->GetDimensions(nC, nR); ++ mnRows = static_cast(nR); ++ mnCols = static_cast(nC); ++} ++ ++ScDBQueryDataIterator::DataAccessMatrix::~DataAccessMatrix() ++{ ++} ++ ++bool ScDBQueryDataIterator::DataAccessMatrix::getCurrent(Value& rValue) ++{ ++ // Starting from row == mnCurRow, get the first row that satisfies all the ++ // query parameters. ++ for ( ;mnCurRow < mnRows; ++mnCurRow) ++ { ++ const ScMatrix& rMat = *mpParam->mpMatrix; ++ if (rMat.IsEmpty(mpParam->mnField, mnCurRow)) ++ // Don't take empty values into account. ++ continue; ++ ++ bool bIsStrVal = rMat.IsString(mpParam->mnField, mnCurRow); ++ if (bIsStrVal && mpParam->mbSkipString) ++ continue; ++ ++ if (isValidQuery(mnCurRow, rMat)) ++ { ++ rValue.maString = rMat.GetString(mpParam->mnField, mnCurRow); ++ rValue.mfValue = rMat.GetDouble(mpParam->mnField, mnCurRow); ++ rValue.mbIsNumber = !bIsStrVal; ++ rValue.mnError = 0; ++ return true; ++ } ++ } ++ return false; ++} ++ ++bool ScDBQueryDataIterator::DataAccessMatrix::getFirst(Value& rValue) ++{ ++ mnCurRow = mpParam->bHasHeader ? 1 : 0; ++ return getCurrent(rValue); ++} ++ ++bool ScDBQueryDataIterator::DataAccessMatrix::getNext(Value& rValue) ++{ ++ ++mnCurRow; ++ return getCurrent(rValue); ++} ++ ++namespace { ++ ++bool lcl_isQueryByValue(const ScQueryEntry& rEntry, const ScMatrix& rMat, SCSIZE nCol, SCSIZE nRow) ++{ ++ if (rEntry.bQueryByString) ++ return false; ++ ++ if (!rMat.IsValueOrEmpty(nCol, nRow)) ++ return false; ++ ++ return true; ++} ++ ++bool lcl_isQueryByString(const ScQueryEntry& rEntry, const ScMatrix& rMat, SCSIZE nCol, SCSIZE nRow) ++{ ++ switch (rEntry.eOp) ++ { ++ case SC_EQUAL: ++ case SC_NOT_EQUAL: ++ case SC_CONTAINS: ++ case SC_DOES_NOT_CONTAIN: ++ case SC_BEGINS_WITH: ++ case SC_ENDS_WITH: ++ case SC_DOES_NOT_BEGIN_WITH: ++ case SC_DOES_NOT_END_WITH: ++ return true; ++ default: ++ ; ++ } ++ ++ if (rEntry.bQueryByString && rMat.IsString(nCol, nRow)) ++ return true; ++ ++ return false; ++} ++ ++} ++ ++bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScMatrix& rMat) const ++{ ++ SCSIZE nEntryCount = mpParam->GetEntryCount(); ++ vector aResults; ++ aResults.reserve(nEntryCount); ++ ++ const CollatorWrapper& rCollator = ++ mpParam->bCaseSens ? *ScGlobal::GetCaseCollator() : *ScGlobal::GetCollator(); ++ ++ for (SCSIZE i = 0; i < nEntryCount; ++i) ++ { ++ const ScQueryEntry& rEntry = mpParam->GetEntry(i); ++ if (!rEntry.bDoQuery) ++ continue; ++ ++ switch (rEntry.eOp) ++ { ++ case SC_EQUAL: ++ case SC_LESS: ++ case SC_GREATER: ++ case SC_LESS_EQUAL: ++ case SC_GREATER_EQUAL: ++ case SC_NOT_EQUAL: ++ break; ++ default: ++ // Only the above operators are supported. ++ continue; ++ } ++ ++ bool bValid = false; ++ ++ SCSIZE nField = static_cast(rEntry.nField); ++ if (lcl_isQueryByValue(rEntry, rMat, nField, nRow)) ++ { ++ // By value ++ double fMatVal = rMat.GetDouble(nField, nRow); ++ bool bEqual = approxEqual(fMatVal, rEntry.nVal); ++ switch (rEntry.eOp) ++ { ++ case SC_EQUAL: ++ bValid = bEqual; ++ break; ++ case SC_LESS: ++ bValid = (fMatVal < rEntry.nVal) && !bEqual; ++ break; ++ case SC_GREATER: ++ bValid = (fMatVal > rEntry.nVal) && !bEqual; ++ break; ++ case SC_LESS_EQUAL: ++ bValid = (fMatVal < rEntry.nVal) || bEqual; ++ break; ++ case SC_GREATER_EQUAL: ++ bValid = (fMatVal > rEntry.nVal) || bEqual; ++ break; ++ case SC_NOT_EQUAL: ++ bValid = !bEqual; ++ break; ++ default: ++ ; ++ } ++ } ++ else if (lcl_isQueryByString(rEntry, rMat, nField, nRow)) ++ { ++ // By string ++ do ++ { ++ if (!rEntry.pStr) ++ break; ++ ++ // Equality check first. ++ ++ OUString aMatStr = rMat.GetString(nField, nRow); ++ lcl_toUpper(aMatStr); ++ OUString aQueryStr = *rEntry.pStr; ++ lcl_toUpper(aQueryStr); ++ bool bDone = false; ++ switch (rEntry.eOp) ++ { ++ case SC_EQUAL: ++ bValid = aMatStr.equals(aQueryStr); ++ bDone = true; ++ break; ++ case SC_NOT_EQUAL: ++ bValid = !aMatStr.equals(aQueryStr); ++ bDone = true; ++ break; ++ default: ++ ; ++ } ++ ++ if (bDone) ++ break; ++ ++ // Unequality check using collator. ++ ++ sal_Int32 nCompare = rCollator.compareString(aMatStr, aQueryStr); ++ switch (rEntry.eOp) ++ { ++ case SC_LESS : ++ bValid = (nCompare < 0); ++ break; ++ case SC_GREATER : ++ bValid = (nCompare > 0); ++ break; ++ case SC_LESS_EQUAL : ++ bValid = (nCompare <= 0); ++ break; ++ case SC_GREATER_EQUAL : ++ bValid = (nCompare >= 0); ++ break; ++ default: ++ ; ++ } ++ } ++ while (false); ++ } ++ else if (mpParam->bMixedComparison) ++ { ++ // Not used at the moment. ++ } ++ ++ if (aResults.empty()) ++ // First query entry. ++ aResults.push_back(bValid); ++ else if (rEntry.eConnect == SC_AND) ++ { ++ // For AND op, tuck the result into the last result value. ++ size_t n = aResults.size(); ++ aResults[n-1] = aResults[n-1] && bValid; ++ } ++ else ++ // For OR op, store its own result. ++ aResults.push_back(bValid); ++ } ++ ++ // Row is valid as long as there is at least one result being true. ++ vector::const_iterator itr = aResults.begin(), itrEnd = aResults.end(); ++ for (; itr != itrEnd; ++itr) ++ if (*itr) ++ return true; ++ ++ return false; ++} ++ ++// ---------------------------------------------------------------------------- ++ ++ScDBQueryDataIterator::Value::Value() : ++ mnError(0), mbIsNumber(true) ++{ ++ ::rtl::math::setNan(&mfValue); ++} ++ ++// ---------------------------------------------------------------------------- ++ ++ScDBQueryDataIterator::ScDBQueryDataIterator(ScDocument* pDocument, ScDBQueryParamBase* pParam) : ++ mpParam (pParam) ++{ ++ switch (mpParam->GetType()) ++ { ++ case ScDBQueryParamBase::INTERNAL: ++ { ++ ScDBQueryParamInternal* p = static_cast(pParam); ++ mpData.reset(new DataAccessInternal(this, p, pDocument)); ++ } ++ break; ++ case ScDBQueryParamBase::MATRIX: ++ { ++ ScDBQueryParamMatrix* p = static_cast(pParam); ++ mpData.reset(new DataAccessMatrix(this, p)); ++ } ++ } ++} ++ ++bool ScDBQueryDataIterator::GetThis(Value& rValue) ++{ ++ return mpData->getCurrent(rValue); ++} ++ ++bool ScDBQueryDataIterator::GetFirst(Value& rValue) ++{ ++ return mpData->getFirst(rValue); ++} ++ ++bool ScDBQueryDataIterator::GetNext(Value& rValue) ++{ ++ return mpData->getNext(rValue); ++} ++ ++// ============================================================================ + + ScCellIterator::ScCellIterator( ScDocument* pDocument, + SCCOL nSCol, SCROW nSRow, SCTAB nSTab, +diff --git sc/source/core/data/dpcachetable.cxx sc/source/core/data/dpcachetable.cxx +index 015c651..fd81c26 100644 +--- sc/source/core/data/dpcachetable.cxx ++++ sc/source/core/data/dpcachetable.cxx +@@ -38,6 +38,7 @@ + #include "dptabdat.hxx" + #include "dptabsrc.hxx" + #include "dpobject.hxx" ++#include "queryparam.hxx" + + #include + #include +diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx +index f71b842..181c634 100644 +--- sc/source/core/data/global2.cxx ++++ sc/source/core/data/global2.cxx +@@ -243,238 +243,6 @@ utl::TextSearch* ScQueryEntry::GetSearchTextPtr( BOOL bCaseSens ) + } + + //------------------------------------------------------------------------ +- +-ScQueryParam::ScQueryParam() +-{ +- nEntryCount = 0; +- Clear(); +-} +- +-//------------------------------------------------------------------------ +- +-ScQueryParam::ScQueryParam( const ScQueryParam& r ) : +- nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),nTab(r.nTab), +- bHasHeader(r.bHasHeader), bByRow(r.bByRow), bInplace(r.bInplace), bCaseSens(r.bCaseSens), +- bRegExp(r.bRegExp), bMixedComparison(r.bMixedComparison), +- bDuplicate(r.bDuplicate), bDestPers(r.bDestPers), +- nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow) +-{ +- nEntryCount = 0; +- +- Resize( r.nEntryCount ); +- for (USHORT i=0; i( nCol1 + nDifX ); +- nRow1 = sal::static_int_cast( nRow1 + nDifY ); +- nCol2 = sal::static_int_cast( nCol2 + nDifX ); +- nRow2 = sal::static_int_cast( nRow2 + nDifY ); +- nTab = sal::static_int_cast( nTab + nDifZ ); +- for (USHORT i=0; i 0) +- { +- if ( nIndex >= nEntryCount ) +- Resize( nIndex+1 ); +- +- ScQueryEntry& rEntry = pEntries[nIndex]; +- +- rEntry.bDoQuery = TRUE; +- // Operatoren herausfiltern +- if (aCellStr.GetChar(0) == '<') +- { +- if (aCellStr.GetChar(1) == '>') +- { +- *rEntry.pStr = aCellStr.Copy(2); +- rEntry.eOp = SC_NOT_EQUAL; +- } +- else if (aCellStr.GetChar(1) == '=') +- { +- *rEntry.pStr = aCellStr.Copy(2); +- rEntry.eOp = SC_LESS_EQUAL; +- } +- else +- { +- *rEntry.pStr = aCellStr.Copy(1); +- rEntry.eOp = SC_LESS; +- } +- } +- else if (aCellStr.GetChar(0) == '>') +- { +- if (aCellStr.GetChar(1) == '=') +- { +- *rEntry.pStr = aCellStr.Copy(2); +- rEntry.eOp = SC_GREATER_EQUAL; +- } +- else +- { +- *rEntry.pStr = aCellStr.Copy(1); +- rEntry.eOp = SC_GREATER; +- } +- } +- else +- { +- if (aCellStr.GetChar(0) == '=') +- *rEntry.pStr = aCellStr.Copy(1); +- else +- *rEntry.pStr = aCellStr; +- rEntry.eOp = SC_EQUAL; +- } +- } +-} +- +-//------------------------------------------------------------------------ + // struct ScSubTotalParam: + + ScSubTotalParam::ScSubTotalParam() +diff --git sc/source/core/data/sortparam.cxx sc/source/core/data/sortparam.cxx +index 9531c71..dfab465 100644 +--- sc/source/core/data/sortparam.cxx ++++ sc/source/core/data/sortparam.cxx +@@ -36,6 +36,7 @@ + #include "sortparam.hxx" + #include "global.hxx" + #include "address.hxx" ++#include "queryparam.hxx" + #include + + +diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx +index ca196ea..2d8f0d3 100644 +--- sc/source/core/data/table3.cxx ++++ sc/source/core/data/table3.cxx +@@ -60,6 +60,7 @@ + #include "progress.hxx" + #include "cellform.hxx" + #include "postit.hxx" ++#include "queryparam.hxx" + + #include + +diff --git sc/source/core/inc/doubleref.hxx sc/source/core/inc/doubleref.hxx +new file mode 100644 +index 0000000..0aa577b +--- /dev/null ++++ sc/source/core/inc/doubleref.hxx +@@ -0,0 +1,194 @@ ++/************************************************************************* ++ * ++ * 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: interpre.hxx,v $ ++ * $Revision: 1.35.44.2 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_DOUBLEREF_HXX ++#define SC_DOUBLEREF_HXX ++ ++#include "address.hxx" ++#include "scmatrix.hxx" ++ ++class ScDocument; ++class ScBaseCell; ++class ScDBQueryParamBase; ++class ScQueryParamBase; ++ ++// ============================================================================ ++ ++/** ++ * Base class for abstracting range data backends for database functions. ++ */ ++class ScDBRangeBase ++{ ++public: ++ enum RefType { INTERNAL, EXTERNAL }; ++ ++ virtual ~ScDBRangeBase() = 0; ++ ++ RefType getType() const; ++ bool fillQueryEntries(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef) const; ++ ++ virtual SCCOL getColSize() const = 0; ++ virtual SCROW getRowSize() const = 0; ++ virtual SCSIZE getVisibleDataCellCount() const = 0; ++ ++ /** ++ * Get a string value of a specified cell position. Note that the ++ * position of the upper left cell of the range is always (0, 0) even if ++ * the reference type is of internal range. ++ * ++ * @param nCol column position (0 to column size-1) ++ * @param nRow row position (0 to row size-1) ++ */ ++ virtual ::rtl::OUString getString(SCCOL nCol, SCROW nRow) const = 0; ++ ++ virtual SCCOL getFirstFieldColumn() const = 0; ++ ++ /** ++ * Get a 0-based column index that corresponds with the passed field ++ * index. Note that the field index passed as the 1st parameter is ++ * 1-based. ++ * ++ * @param nIndex 1-based field index. ++ * ++ * @return 0-based column index ++ */ ++ virtual SCCOL findFieldColumn(SCCOL nIndex) const = 0; ++ virtual SCCOL findFieldColumn(const ::rtl::OUString& rStr, sal_uInt16* pErr = NULL) const = 0; ++ virtual ScDBQueryParamBase* createQueryParam(const ScDBRangeBase* pQueryRef) const = 0; ++ virtual bool isRangeEqual(const ScRange& rRange) const = 0; ++ ++protected: ++ ScDBRangeBase(ScDocument* pDoc, RefType eType); ++ ScDocument* getDoc() const; ++ ++ /** ++ * Populate query options that are always the same for all database ++ * queries. ++ */ ++ static void fillQueryOptions(ScQueryParamBase* pParam); ++ ++private: ++ ScDBRangeBase(); // disabled ++ ++ ScDocument* mpDoc; ++ RefType meType; ++}; ++ ++// ============================================================================ ++ ++class ScDBInternalRange : public ScDBRangeBase ++{ ++public: ++ explicit ScDBInternalRange(ScDocument* pDoc, const ScRange& rRange); ++ virtual ~ScDBInternalRange(); ++ ++ const ScRange& getRange() const; ++ ++ virtual SCCOL getColSize() const; ++ virtual SCROW getRowSize() const; ++ virtual SCSIZE getVisibleDataCellCount() const; ++ ++ /** ++ * Get a string value of a specified cell position. Note that the ++ * position of the upper left cell of the range is always (0, 0) even if ++ * the reference type is of internal range. ++ * ++ * @param nCol column position (0 to column size-1) ++ * @param nRow row position (0 to row size-1) ++ */ ++ virtual ::rtl::OUString getString(SCCOL nCol, SCROW nRow) const; ++ ++ virtual SCCOL getFirstFieldColumn() const; ++ /** ++ * Get a 0-based column index that corresponds with the passed field ++ * index. Note that the field index passed as the 1st parameter is ++ * 1-based. ++ * ++ * @param nIndex 1-based field index. ++ * ++ * @return 0-based column index ++ */ ++ virtual SCCOL findFieldColumn(SCCOL nIndex) const; ++ virtual SCCOL findFieldColumn(const ::rtl::OUString& rStr, sal_uInt16* pErr = NULL) const; ++ virtual ScDBQueryParamBase* createQueryParam(const ScDBRangeBase* pQueryRef) const; ++ virtual bool isRangeEqual(const ScRange& rRange) const; ++ ++private: ++ sal_uInt16 getCellString(::rtl::OUString& rStr, ScBaseCell* pCell) const; ++ ++private: ++ ScRange maRange; ++}; ++ ++// ============================================================================ ++ ++class ScDBExternalRange : public ScDBRangeBase ++{ ++public: ++ explicit ScDBExternalRange(ScDocument* pDoc, const ScMatrixRef& pMat); ++ virtual ~ScDBExternalRange(); ++ ++ virtual SCCOL getColSize() const; ++ virtual SCROW getRowSize() const; ++ virtual SCSIZE getVisibleDataCellCount() const; ++ ++ /** ++ * Get a string value of a specified cell position. Note that the ++ * position of the upper left cell of the range is always (0, 0) even if ++ * the reference type is of internal range. ++ * ++ * @param nCol column position (0 to column size-1) ++ * @param nRow row position (0 to row size-1) ++ */ ++ virtual ::rtl::OUString getString(SCCOL nCol, SCROW nRow) const; ++ ++ virtual SCCOL getFirstFieldColumn() const; ++ ++ /** ++ * Get a 0-based column index that corresponds with the passed field ++ * index. Note that the field index passed as the 1st parameter is ++ * 1-based. ++ * ++ * @param nIndex 1-based field index. ++ * ++ * @return 0-based column index ++ */ ++ virtual SCCOL findFieldColumn(SCCOL nIndex) const; ++ virtual SCCOL findFieldColumn(const ::rtl::OUString& rStr, sal_uInt16* pErr = NULL) const; ++ virtual ScDBQueryParamBase* createQueryParam(const ScDBRangeBase* pQueryRef) const; ++ virtual bool isRangeEqual(const ScRange& rRange) const; ++ ++private: ++ const ScMatrixRef mpMatrix; ++ SCCOL mnCols; ++ SCROW mnRows; ++}; ++ ++#endif +diff --git sc/source/core/inc/interpre.hxx sc/source/core/inc/interpre.hxx +index ca21e19..e385a9c 100644 +--- sc/source/core/inc/interpre.hxx ++++ sc/source/core/inc/interpre.hxx +@@ -53,7 +53,10 @@ class SbxVariable; + class ScBaseCell; + class ScFormulaCell; + class SvNumberFormatter; ++class ScDBRangeBase; + struct MatrixDoubleOp; ++struct ScQueryParam; ++struct ScDBQueryParamBase; + + struct ScCompare + { +@@ -301,6 +304,7 @@ void DoubleRefToVars( const ScToken* p, + SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, + SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2, + BOOL bDontCheckForTableOp = FALSE ); ++ScDBRangeBase* PopDoubleRef(); + void PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, + SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2, + BOOL bDontCheckForTableOp = FALSE ); +@@ -488,7 +492,7 @@ void ScSubTotal(); + // compatibility). If this was the case then rMissingField is set to TRUE upon + // return. If rMissingField==FALSE upon call all "missing cases" are considered + // to be an error. +-BOOL GetDBParams( SCTAB& rTab, ScQueryParam& rParam, BOOL& rMissingField ); ++ScDBQueryParamBase* GetDBParams( BOOL& rMissingField ); + + void DBIterator( ScIterFunc ); + void ScDBSum(); +diff --git sc/source/core/tool/dbcolect.cxx sc/source/core/tool/dbcolect.cxx +index e1e3870..a47a669 100644 +--- sc/source/core/tool/dbcolect.cxx ++++ sc/source/core/tool/dbcolect.cxx +@@ -40,6 +40,7 @@ + #include "refupdat.hxx" + #include "rechead.hxx" + #include "document.hxx" ++#include "queryparam.hxx" + #include "globstr.hrc" + + +diff --git sc/source/core/tool/doubleref.cxx sc/source/core/tool/doubleref.cxx +new file mode 100644 +index 0000000..bb67aad +--- /dev/null ++++ sc/source/core/tool/doubleref.cxx +@@ -0,0 +1,568 @@ ++/************************************************************************* ++ * ++ * 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: interpre.hxx,v $ ++ * $Revision: 1.35.44.2 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++// INCLUDE --------------------------------------------------------------- ++ ++#include "doubleref.hxx" ++#include "cell.hxx" ++#include "global.hxx" ++#include "document.hxx" ++#include "queryparam.hxx" ++#include "globstr.hrc" ++ ++#include ++#include ++ ++using ::rtl::OUString; ++using ::std::auto_ptr; ++using ::std::vector; ++ ++namespace { ++ ++void lcl_toUpper(OUString& rStr) ++{ ++ rStr = ScGlobal::pCharClass->toUpper(rStr.trim(), 0, rStr.getLength()); ++} ++ ++bool lcl_createStarQuery(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef, const ScDBRangeBase* pQueryRef) ++{ ++ // A valid StarQuery must be at least 4 columns wide. To be precise it ++ // should be exactly 4 columns ... ++ // Additionally, if this wasn't checked, a formula pointing to a valid 1-3 ++ // column Excel style query range immediately left to itself would result ++ // in a circular reference when the field name or operator or value (first ++ // to third query range column) is obtained (#i58354#). Furthermore, if the ++ // range wasn't sufficiently specified data changes wouldn't flag formula ++ // cells for recalculation. ++ ++ if (pQueryRef->getColSize() < 4) ++ return false; ++ ++ BOOL bValid; ++ BOOL bFound; ++ OUString aCellStr; ++ SCSIZE nIndex = 0; ++ SCROW nRow = 0; ++ SCROW nRows = pDBRef->getRowSize(); ++ SCSIZE nNewEntries = static_cast(nRows); ++ pParam->Resize(nNewEntries); ++ ++ do ++ { ++ ScQueryEntry& rEntry = pParam->GetEntry(nIndex); ++ ++ bValid = FALSE; ++ ++ if (nIndex > 0) ++ { ++ // For all entries after the first one, check the and/or connector in the first column. ++ aCellStr = pQueryRef->getString(0, nRow); ++ lcl_toUpper(aCellStr); ++ if ( aCellStr.equals(ScGlobal::GetRscString(STR_TABLE_UND)) ) ++ { ++ rEntry.eConnect = SC_AND; ++ bValid = TRUE; ++ } ++ else if ( aCellStr.equals(ScGlobal::GetRscString(STR_TABLE_ODER)) ) ++ { ++ rEntry.eConnect = SC_OR; ++ bValid = TRUE; ++ } ++ } ++ ++ if ((nIndex < 1) || bValid) ++ { ++ // field name in the 2nd column. ++ bFound = FALSE; ++ aCellStr = pQueryRef->getString(1, nRow); ++ SCCOL nField = pDBRef->findFieldColumn(aCellStr); // TODO: must be case insensitive comparison. ++ if (ValidCol(nField)) ++ { ++ rEntry.nField = nField; ++ bValid = true; ++ } ++ else ++ bValid = false; ++ } ++ ++ if (bValid) ++ { ++ // equality, non-equality operator in the 3rd column. ++ bFound = FALSE; ++ aCellStr = pQueryRef->getString(2, nRow); ++ lcl_toUpper(aCellStr); ++ const sal_Unicode* p = aCellStr.getStr(); ++ if (p[0] == sal_Unicode('<')) ++ { ++ if (p[1] == sal_Unicode('>')) ++ rEntry.eOp = SC_NOT_EQUAL; ++ else if (p[1] == sal_Unicode('=')) ++ rEntry.eOp = SC_LESS_EQUAL; ++ else ++ rEntry.eOp = SC_LESS; ++ } ++ else if (p[0] == sal_Unicode('>')) ++ { ++ if (p[1] == sal_Unicode('=')) ++ rEntry.eOp = SC_GREATER_EQUAL; ++ else ++ rEntry.eOp = SC_GREATER; ++ } ++ else if (p[0] == sal_Unicode('=')) ++ rEntry.eOp = SC_EQUAL; ++ ++ } ++ ++ if (bValid) ++ { ++ // Finally, the right-hand-side value in the 4th column. ++ *rEntry.pStr = pQueryRef->getString(3, nRow); ++ rEntry.bDoQuery = TRUE; ++ } ++ nIndex++; ++ nRow++; ++ } ++ while (bValid && (nRow < nRows) /* && (nIndex < MAXQUERY) */ ); ++ return bValid; ++} ++ ++bool lcl_createExcelQuery( ++ ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef, const ScDBRangeBase* pQueryRef) ++{ ++ bool bValid = true; ++ SCCOL nCols = pQueryRef->getColSize(); ++ SCROW nRows = pQueryRef->getRowSize(); ++ vector aFields(nCols); ++ SCCOL nCol = 0; ++ while (bValid && (nCol < nCols)) ++ { ++ OUString aQueryStr = pQueryRef->getString(nCol, 0); ++ SCCOL nField = pDBRef->findFieldColumn(aQueryStr); ++ if (ValidCol(nField)) ++ aFields[nCol] = nField; ++ else ++ bValid = false; ++ ++nCol; ++ } ++ ++ if (bValid) ++ { ++// ULONG nVisible = 0; ++// for ( nCol=nCol1; nCol<=nCol2; nCol++ ) ++// nVisible += aCol[nCol].VisibleCount( nRow1+1, nRow2 ); ++ ++ // Count the number of visible cells (excluding the header row). Each ++ // visible cell corresponds with a single query. ++ SCSIZE nVisible = pQueryRef->getVisibleDataCellCount(); ++ if ( nVisible > SCSIZE_MAX / sizeof(void*) ) ++ { ++ DBG_ERROR("zu viele Filterkritierien"); ++ nVisible = 0; ++ } ++ ++ SCSIZE nNewEntries = nVisible; ++ pParam->Resize( nNewEntries ); ++ ++ SCSIZE nIndex = 0; ++ SCROW nRow = 1; ++ String aCellStr; ++ while (nRow < nRows) ++ { ++ nCol = 0; ++ while (nCol < nCols) ++ { ++ aCellStr = pQueryRef->getString(nCol, nRow); ++ ScGlobal::pCharClass->toUpper( aCellStr ); ++ if (aCellStr.Len() > 0) ++ { ++ if (nIndex < nNewEntries) ++ { ++ pParam->GetEntry(nIndex).nField = aFields[nCol]; ++ pParam->FillInExcelSyntax(aCellStr, nIndex); ++ nIndex++; ++ if (nIndex < nNewEntries) ++ pParam->GetEntry(nIndex).eConnect = SC_AND; ++ } ++ else ++ bValid = FALSE; ++ } ++ nCol++; ++ } ++ nRow++; ++ if (nIndex < nNewEntries) ++ pParam->GetEntry(nIndex).eConnect = SC_OR; ++ } ++ } ++ return bValid; ++} ++ ++bool lcl_fillQueryEntries( ++ ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef, const ScDBRangeBase* pQueryRef) ++{ ++ SCSIZE nCount = pParam->GetEntryCount(); ++ for (SCSIZE i = 0; i < nCount; ++i) ++ pParam->GetEntry(i).Clear(); ++ ++ // Standard QueryTabelle ++ bool bValid = lcl_createStarQuery(pParam, pDBRef, pQueryRef); ++ // Excel QueryTabelle ++ if (!bValid) ++ bValid = lcl_createExcelQuery(pParam, pDBRef, pQueryRef); ++ ++ nCount = pParam->GetEntryCount(); ++ if (bValid) ++ { ++ // bQueryByString muss gesetzt sein ++ for (SCSIZE i = 0; i < nCount; ++i) ++ pParam->GetEntry(i).bQueryByString = true; ++ } ++ else ++ { ++ // nix ++ for (SCSIZE i = 0; i < nCount; ++i) ++ pParam->GetEntry(i).Clear(); ++ } ++ return bValid; ++} ++ ++} ++ ++// ============================================================================ ++ ++ScDBRangeBase::ScDBRangeBase(ScDocument* pDoc, RefType eType) : ++ mpDoc(pDoc), meType(eType) ++{ ++} ++ ++ScDBRangeBase::~ScDBRangeBase() ++{ ++} ++ ++ScDBRangeBase::RefType ScDBRangeBase::getType() const ++{ ++ return meType; ++} ++ ++bool ScDBRangeBase::fillQueryEntries(ScQueryParamBase* pParam, const ScDBRangeBase* pDBRef) const ++{ ++ if (!pDBRef) ++ return false; ++ ++ return lcl_fillQueryEntries(pParam, pDBRef, this); ++} ++ ++void ScDBRangeBase::fillQueryOptions(ScQueryParamBase* pParam) ++{ ++ pParam->bHasHeader = true; ++ pParam->bByRow = true; ++ pParam->bInplace = true; ++ pParam->bCaseSens = false; ++ pParam->bRegExp = false; ++ pParam->bDuplicate = true; ++ pParam->bMixedComparison = false; ++} ++ ++ScDocument* ScDBRangeBase::getDoc() const ++{ ++ return mpDoc; ++} ++ ++// ============================================================================ ++ ++ScDBInternalRange::ScDBInternalRange(ScDocument* pDoc, const ScRange& rRange) : ++ ScDBRangeBase(pDoc, INTERNAL), maRange(rRange) ++{ ++} ++ ++ScDBInternalRange::~ScDBInternalRange() ++{ ++} ++ ++const ScRange& ScDBInternalRange::getRange() const ++{ ++ return maRange; ++} ++ ++SCCOL ScDBInternalRange::getColSize() const ++{ ++ return maRange.aEnd.Col() - maRange.aStart.Col() + 1; ++} ++ ++SCROW ScDBInternalRange::getRowSize() const ++{ ++ return maRange.aEnd.Row() - maRange.aStart.Row() + 1; ++} ++ ++SCSIZE ScDBInternalRange::getVisibleDataCellCount() const ++{ ++ SCCOL nCols = getColSize(); ++ SCROW nRows = getRowSize(); ++ if (nRows <= 1) ++ return 0; ++ ++ return (nRows-1)*nCols; ++} ++ ++OUString ScDBInternalRange::getString(SCCOL nCol, SCROW nRow) const ++{ ++ String aStr; ++ const ScAddress& s = maRange.aStart; ++ getDoc()->GetString(s.Col() + nCol, s.Row() + nRow, maRange.aStart.Tab(), aStr); ++ return aStr; ++} ++ ++SCCOL ScDBInternalRange::getFirstFieldColumn() const ++{ ++ return getRange().aStart.Col(); ++} ++ ++SCCOL ScDBInternalRange::findFieldColumn(SCCOL nIndex) const ++{ ++ const ScRange& rRange = getRange(); ++ const ScAddress& s = rRange.aStart; ++ const ScAddress& e = rRange.aEnd; ++ ++ SCCOL nDBCol1 = s.Col(); ++ SCCOL nDBCol2 = e.Col(); ++ ++ if ( nIndex <= 0 || nIndex > (nDBCol2 - nDBCol1 + 1) ) ++ return nDBCol1; ++ ++ return Min(nDBCol2, static_cast(nDBCol1 + nIndex - 1)); ++} ++ ++sal_uInt16 ScDBInternalRange::getCellString(OUString& rStr, ScBaseCell* pCell) const ++{ ++ sal_uInt16 nErr = 0; ++ String aStr; ++ if (pCell) ++ { ++ SvNumberFormatter* pFormatter = getDoc()->GetFormatTable(); ++ switch (pCell->GetCellType()) ++ { ++ case CELLTYPE_STRING: ++ ((ScStringCell*) pCell)->GetString(aStr); ++ break; ++ case CELLTYPE_EDIT: ++ ((ScEditCell*) pCell)->GetString(aStr); ++ break; ++ case CELLTYPE_FORMULA: ++ { ++ ScFormulaCell* pFCell = (ScFormulaCell*) pCell; ++ nErr = pFCell->GetErrCode(); ++ if (pFCell->IsValue()) ++ { ++ double fVal = pFCell->GetValue(); ++ ULONG nIndex = pFormatter->GetStandardFormat( ++ NUMBERFORMAT_NUMBER, ++ ScGlobal::eLnge); ++ pFormatter->GetInputLineString(fVal, nIndex, aStr); ++ } ++ else ++ pFCell->GetString(aStr); ++ } ++ break; ++ case CELLTYPE_VALUE: ++ { ++ double fVal = ((ScValueCell*) pCell)->GetValue(); ++ ULONG nIndex = pFormatter->GetStandardFormat( ++ NUMBERFORMAT_NUMBER, ++ ScGlobal::eLnge); ++ pFormatter->GetInputLineString(fVal, nIndex, aStr); ++ } ++ break; ++ default: ++ ; ++ } ++ } ++ rStr = aStr; ++ return nErr; ++} ++ ++SCCOL ScDBInternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr) const ++{ ++ const ScAddress& s = maRange.aStart; ++ const ScAddress& e = maRange.aEnd; ++ OUString aUpper = rStr; ++ lcl_toUpper(aUpper); ++ ++ SCCOL nDBCol1 = s.Col(); ++ SCROW nDBRow1 = s.Row(); ++ SCTAB nDBTab1 = s.Tab(); ++ SCCOL nDBCol2 = e.Col(); ++ ++ SCCOL nField = nDBCol1; ++ BOOL bFound = TRUE; ++ ++ bFound = FALSE; ++ OUString aCellStr; ++ ScAddress aLook( nDBCol1, nDBRow1, nDBTab1 ); ++ while (!bFound && (aLook.Col() <= nDBCol2)) ++ { ++ ScBaseCell* pCell = getDoc()->GetCell( aLook ); ++ sal_uInt16 nErr = getCellString( aCellStr, pCell ); ++ if (pErr) ++ *pErr = nErr; ++ lcl_toUpper(aCellStr); ++ bFound = ScGlobal::GetpTransliteration()->isEqual(aCellStr, aUpper); ++ if (!bFound) ++ aLook.IncCol(); ++ } ++ nField = aLook.Col(); ++ ++ return bFound ? nField : -1; ++} ++ ++ScDBQueryParamBase* ScDBInternalRange::createQueryParam(const ScDBRangeBase* pQueryRef) const ++{ ++ auto_ptr pParam(new ScDBQueryParamInternal); ++ ++ // Set the database range first. ++ const ScAddress& s = maRange.aStart; ++ const ScAddress& e = maRange.aEnd; ++ pParam->nCol1 = s.Col(); ++ pParam->nRow1 = s.Row(); ++ pParam->nCol2 = e.Col(); ++ pParam->nRow2 = e.Row(); ++ pParam->nTab = s.Tab(); ++ ++ fillQueryOptions(pParam.get()); ++ ++ // Now construct the query entries from the query range. ++ if (!pQueryRef->fillQueryEntries(pParam.get(), this)) ++ return NULL; ++ ++ return pParam.release(); ++} ++ ++bool ScDBInternalRange::isRangeEqual(const ScRange& rRange) const ++{ ++ return maRange == rRange; ++} ++ ++// ============================================================================ ++ ++ScDBExternalRange::ScDBExternalRange(ScDocument* pDoc, const ScMatrixRef& pMat) : ++ ScDBRangeBase(pDoc, EXTERNAL), mpMatrix(pMat) ++{ ++ SCSIZE nC, nR; ++ mpMatrix->GetDimensions(nC, nR); ++ mnCols = nC; ++ mnRows = nR; ++} ++ ++ScDBExternalRange::~ScDBExternalRange() ++{ ++} ++ ++SCCOL ScDBExternalRange::getColSize() const ++{ ++ return mnCols; ++} ++ ++SCROW ScDBExternalRange::getRowSize() const ++{ ++ return mnRows; ++} ++ ++SCSIZE ScDBExternalRange::getVisibleDataCellCount() const ++{ ++ SCCOL nCols = getColSize(); ++ SCROW nRows = getRowSize(); ++ if (nRows <= 1) ++ return 0; ++ ++ return (nRows-1)*nCols; ++} ++ ++OUString ScDBExternalRange::getString(SCCOL nCol, SCROW nRow) const ++{ ++ if (nCol >= mnCols || nRow >= mnRows) ++ return OUString(); ++ ++ return mpMatrix->GetString(nCol, nRow); ++} ++ ++SCCOL ScDBExternalRange::getFirstFieldColumn() const ++{ ++ return 0; ++} ++ ++SCCOL ScDBExternalRange::findFieldColumn(SCCOL nIndex) const ++{ ++ if (nIndex < 1) ++ // 1st field ++ return 0; ++ ++ if (nIndex > mnCols) ++ // last field ++ return mnCols - 1; ++ ++ return nIndex - 1; ++} ++ ++SCCOL ScDBExternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr) const ++{ ++ if (pErr) ++ pErr = 0; ++ ++ OUString aUpper = rStr; ++ lcl_toUpper(aUpper); ++ for (SCCOL i = 0; i < mnCols; ++i) ++ { ++ OUString aUpperVal = mpMatrix->GetString(i, 0); ++ lcl_toUpper(aUpperVal); ++ if (aUpper.equals(aUpperVal)) ++ return i; ++ } ++ return -1; ++} ++ ++ScDBQueryParamBase* ScDBExternalRange::createQueryParam(const ScDBRangeBase* pQueryRef) const ++{ ++ auto_ptr pParam(new ScDBQueryParamMatrix); ++ pParam->mpMatrix = mpMatrix; ++ fillQueryOptions(pParam.get()); ++ ++ // Now construct the query entries from the query range. ++ if (!pQueryRef->fillQueryEntries(pParam.get(), this)) ++ return NULL; ++ ++ return pParam.release(); ++} ++ ++bool ScDBExternalRange::isRangeEqual(const ScRange& /*rRange*/) const ++{ ++ return false; ++} ++ +diff --git sc/source/core/tool/interpr1.cxx sc/source/core/tool/interpr1.cxx +index 29a6884..eff5ea3 100644 +--- sc/source/core/tool/interpr1.cxx ++++ sc/source/core/tool/interpr1.cxx +@@ -67,11 +67,14 @@ + #include + #include + #include ++#include + #include "cellkeytranslator.hxx" + #include "lookupcache.hxx" + #include "rangenam.hxx" + #include "compiler.hxx" + #include "externalrefmgr.hxx" ++#include "doubleref.hxx" ++#include "queryparam.hxx" + + #define SC_DOUBLE_MAXVALUE 1.7e307 + +@@ -82,6 +85,8 @@ ScTokenStack* ScInterpreter::pGlobalStack = NULL; + BOOL ScInterpreter::bGlobalStackInUse = FALSE; + + using namespace formula; ++using ::std::auto_ptr; ++ + //----------------------------------------------------------------------------- + // Funktionen + //----------------------------------------------------------------------------- +@@ -5619,11 +5624,9 @@ void ScInterpreter::ScSubTotal() + #endif + + +-BOOL ScInterpreter::GetDBParams(SCTAB& rTab, ScQueryParam& rParam, +- BOOL& rMissingField ) ++ScDBQueryParamBase* ScInterpreter::GetDBParams( BOOL& rMissingField ) + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "Eike.Rathke@sun.com", "ScInterpreter::GetDBParams" ); +- BOOL bRet = FALSE; + BOOL bAllowMissingField = FALSE; + if ( rMissingField ) + { +@@ -5632,14 +5635,10 @@ BOOL ScInterpreter::GetDBParams(SCTAB& rTab, ScQueryParam& rParam, + } + if ( GetByte() == 3 ) + { +- +- SCCOL nQCol1; +- SCROW nQRow1; +- SCTAB nQTab1; +- SCCOL nQCol2; +- SCROW nQRow2; +- SCTAB nQTab2; +- PopDoubleRef(nQCol1, nQRow1, nQTab1, nQCol2, nQRow2, nQTab2); ++ // First, get the query criteria range. ++ ::std::auto_ptr pQueryRef( PopDoubleRef() ); ++ if (!pQueryRef.get()) ++ return NULL; + + BOOL bByVal = TRUE; + double nVal = 0.0; +@@ -5695,116 +5694,85 @@ BOOL ScInterpreter::GetDBParams(SCTAB& rTab, ScQueryParam& rParam, + SetError( errIllegalParameter ); + } + +- SCCOL nDBCol1; +- SCROW nDBRow1; +- SCTAB nDBTab1; +- SCCOL nDBCol2; +- SCROW nDBRow2; +- SCTAB nDBTab2; +- PopDoubleRef(nDBCol1, nDBRow1, nDBTab1, nDBCol2, nDBRow2, nDBTab2); ++ auto_ptr pDBRef( PopDoubleRef() ); + +- if ( nGlobalError == 0 && bRangeFake ) ++ if (nGlobalError || !pDBRef.get()) ++ return NULL; ++ ++ if ( bRangeFake ) + { + // range parameter must match entire database range +- if ( aMissingRange == ScRange( nDBCol1, nDBRow1, nDBTab1, nDBCol2, +- nDBRow2, nDBTab2) ) ++ if (pDBRef->isRangeEqual(aMissingRange)) + rMissingField = TRUE; + else + SetError( errIllegalParameter ); + } +- +- if (nGlobalError == 0) ++ ++ if (nGlobalError) ++ return NULL; ++ ++ SCCOL nField = pDBRef->getFirstFieldColumn(); ++ if (rMissingField) ++ ; // special case ++ else if (bByVal) ++ nField = pDBRef->findFieldColumn(static_cast(nVal)); ++ else + { +- SCCOL nField = nDBCol1; +- BOOL bFound = TRUE; ++ sal_uInt16 nErr = 0; ++ nField = pDBRef->findFieldColumn(aStr, &nErr); ++ SetError(nErr); ++ } ++ ++ if (!ValidCol(nField)) ++ return NULL; ++ ++ auto_ptr pParam( pDBRef->createQueryParam(pQueryRef.get()) ); ++ ++ if (pParam.get()) ++ { ++ // An allowed missing field parameter sets the result field ++ // to any of the query fields, just to be able to return ++ // some cell from the iterator. + if ( rMissingField ) +- ; // special case +- else if ( bByVal ) +- { +- if ( nVal <= 0 || nVal > (nDBCol2 - nDBCol1 + 1) ) +- bFound = FALSE; +- else +- nField = Min(nDBCol2, (SCCOL)(nDBCol1 + (SCCOL)nVal - 1)); +- } +- else ++ nField = static_cast(pParam->GetEntry(0).nField); ++ pParam->mnField = nField; ++ ++ SCSIZE nCount = pParam->GetEntryCount(); ++ for ( SCSIZE i=0; i < nCount; i++ ) + { +- bFound = FALSE; +- String aCellStr; +- ScAddress aLook( nDBCol1, nDBRow1, nDBTab1 ); +- while (!bFound && (aLook.Col() <= nDBCol2)) +- { +- ScBaseCell* pCell = GetCell( aLook ); +- GetCellString( aCellStr, pCell ); +- bFound = ScGlobal::GetpTransliteration()->isEqual( aCellStr, aStr ); +- if (!bFound) +- aLook.IncCol(); +- } +- nField = aLook.Col(); +- } +- if (bFound) +- { +- rParam.nCol1 = nDBCol1; +- rParam.nRow1 = nDBRow1; +- rParam.nCol2 = nDBCol2; +- rParam.nRow2 = nDBRow2; +- rParam.nTab = nDBTab1; +- rParam.bHasHeader = TRUE; +- rParam.bByRow = TRUE; +- rParam.bInplace = TRUE; +- rParam.bCaseSens = FALSE; +- rParam.bRegExp = FALSE; +- rParam.bDuplicate = TRUE; +- if (pDok->CreateQueryParam(nQCol1, nQRow1, nQCol2, nQRow2, nQTab1, rParam)) +- { +- // An allowed missing field parameter sets the result field +- // to any of the query fields, just to be able to return +- // some cell from the iterator. +- if ( rMissingField ) +- nField = static_cast(rParam.GetEntry(0).nField); +- +- rParam.nCol1 = nField; +- rParam.nCol2 = nField; +- rTab = nDBTab1; +- bRet = TRUE; +- SCSIZE nCount = rParam.GetEntryCount(); +- for ( SCSIZE i=0; i < nCount; i++ ) +- { +- ScQueryEntry& rEntry = rParam.GetEntry(i); +- if ( rEntry.bDoQuery ) +- { +- sal_uInt32 nIndex = 0; +- rEntry.bQueryByString = !pFormatter->IsNumberFormat( +- *rEntry.pStr, nIndex, rEntry.nVal ); +- if ( rEntry.bQueryByString && !rParam.bRegExp ) +- rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok ); +- } +- else +- break; // for +- } ++ ScQueryEntry& rEntry = pParam->GetEntry(i); ++ if ( rEntry.bDoQuery ) ++ { ++ sal_uInt32 nIndex = 0; ++ rEntry.bQueryByString = !pFormatter->IsNumberFormat( ++ *rEntry.pStr, nIndex, rEntry.nVal ); ++ if ( rEntry.bQueryByString && !pParam->bRegExp ) ++ pParam->bRegExp = MayBeRegExp( *rEntry.pStr, pDok ); + } ++ else ++ break; // for + } ++ return pParam.release(); + } + } +- return bRet; ++ return false; + } + + + void ScInterpreter::DBIterator( ScIterFunc eFunc ) + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "Eike.Rathke@sun.com", "ScInterpreter::DBIterator" ); +- SCTAB nTab1; + double nErg = 0.0; + double fMem = 0.0; + BOOL bNull = TRUE; + ULONG nCount = 0; +- ScQueryParam aQueryParam; + BOOL bMissingField = FALSE; +- if ( GetDBParams( nTab1, aQueryParam, bMissingField) ) ++ auto_ptr pQueryParam( GetDBParams(bMissingField) ); ++ if (pQueryParam.get()) + { +- double nVal; +- USHORT nErr; +- ScQueryValueIterator aValIter(pDok, nTab1, aQueryParam); +- if ( aValIter.GetFirst(nVal, nErr) && !nErr ) ++ ScDBQueryDataIterator aValIter(pDok, pQueryParam.release()); ++ ScDBQueryDataIterator::Value aValue; ++ if ( aValIter.GetFirst(aValue) && !aValue.mnError ) + { + switch( eFunc ) + { +@@ -5820,24 +5788,24 @@ void ScInterpreter::DBIterator( ScIterFunc eFunc ) + { + case ifAVERAGE: + case ifSUM: +- if ( bNull && nVal != 0.0 ) ++ if ( bNull && aValue.mfValue != 0.0 ) + { + bNull = FALSE; +- fMem = nVal; ++ fMem = aValue.mfValue; + } + else +- nErg += nVal; ++ nErg += aValue.mfValue; + break; +- case ifSUMSQ: nErg += nVal * nVal; break; +- case ifPRODUCT: nErg *= nVal; break; +- case ifMAX: if( nVal > nErg ) nErg = nVal; break; +- case ifMIN: if( nVal < nErg ) nErg = nVal; break; ++ case ifSUMSQ: nErg += aValue.mfValue * aValue.mfValue; break; ++ case ifPRODUCT: nErg *= aValue.mfValue; break; ++ case ifMAX: if( aValue.mfValue > nErg ) nErg = aValue.mfValue; break; ++ case ifMIN: if( aValue.mfValue < nErg ) nErg = aValue.mfValue; break; + default: ; // nothing + } + } +- while ( aValIter.GetNext(nVal, nErr) && !nErr ); ++ while ( aValIter.GetNext(aValue) && !aValue.mnError ); + } +- SetError(nErr); ++ SetError(aValue.mnError); + } + else + SetError( errIllegalParameter); +@@ -5862,13 +5830,12 @@ void ScInterpreter::ScDBSum() + void ScInterpreter::ScDBCount() + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "Eike.Rathke@sun.com", "ScInterpreter::ScDBCount" ); +- SCTAB nTab; +- ScQueryParam aQueryParam; + BOOL bMissingField = TRUE; +- if ( GetDBParams( nTab, aQueryParam, bMissingField) ) ++ auto_ptr pQueryParam( GetDBParams(bMissingField) ); ++ if (pQueryParam.get()) + { + ULONG nCount = 0; +- if ( bMissingField ) ++ if ( bMissingField && pQueryParam->GetType() == ScDBQueryParamBase::INTERNAL ) + { // count all matching records + // TODO: currently the QueryIterators only return cell pointers of + // existing cells, so if a query matches an empty cell there's +@@ -5878,7 +5845,9 @@ void ScInterpreter::ScDBCount() + // have to live with it until we reimplement the iterators to also + // return empty cells, which would mean to adapt all callers of + // iterators. +- ScQueryCellIterator aCellIter( pDok, nTab, aQueryParam); ++ ScDBQueryParamInternal* p = static_cast(pQueryParam.get()); ++ SCTAB nTab = p->nTab; ++ ScQueryCellIterator aCellIter( pDok, nTab, *p); + if ( aCellIter.GetFirst() ) + { + do +@@ -5889,17 +5858,17 @@ void ScInterpreter::ScDBCount() + } + else + { // count only matching records with a value in the "result" field +- double nVal; +- USHORT nErr = 0; +- ScQueryValueIterator aValIter( pDok, nTab, aQueryParam); +- if ( aValIter.GetFirst( nVal, nErr) && !nErr ) ++ ScDBQueryDataIterator aValIter( pDok, pQueryParam.release()); ++ ScDBQueryDataIterator::Value aValue; ++ if ( aValIter.GetFirst(aValue) && !aValue.mnError ) + { + do + { + nCount++; +- } while ( aValIter.GetNext( nVal, nErr) && !nErr ); ++ } ++ while ( aValIter.GetNext(aValue) && !aValue.mnError ); + } +- SetError( nErr ); ++ SetError(aValue.mnError); + } + PushDouble( nCount ); + } +@@ -5911,21 +5880,24 @@ void ScInterpreter::ScDBCount() + void ScInterpreter::ScDBCount2() + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "Eike.Rathke@sun.com", "ScInterpreter::ScDBCount2" ); +- SCTAB nTab; +- ScQueryParam aQueryParam; + BOOL bMissingField = TRUE; +- if (GetDBParams( nTab, aQueryParam, bMissingField)) ++ auto_ptr pQueryParam( GetDBParams(bMissingField) ); ++ if (pQueryParam.get()) + { + ULONG nCount = 0; +- ScQueryCellIterator aCellIter(pDok, nTab, aQueryParam); +- if ( aCellIter.GetFirst() ) ++ pQueryParam->mbSkipString = false; ++ ScDBQueryDataIterator aValIter( pDok, pQueryParam.release()); ++ ScDBQueryDataIterator::Value aValue; ++ if ( aValIter.GetFirst(aValue) && !aValue.mnError ) + { + do + { + nCount++; +- } while ( aCellIter.GetNext() ); ++ } ++ while ( aValIter.GetNext(aValue) && !aValue.mnError ); + } +- PushDouble(nCount); ++ SetError(aValue.mnError); ++ PushDouble( nCount ); + } + else + PushIllegalParameter(); +@@ -5969,25 +5941,23 @@ void ScInterpreter::GetDBStVarParams( double& rVal, double& rValCount ) + + rValCount = 0.0; + double fSum = 0.0; +- SCTAB nTab; +- ScQueryParam aQueryParam; + BOOL bMissingField = FALSE; +- if (GetDBParams( nTab, aQueryParam, bMissingField)) ++ auto_ptr pQueryParam( GetDBParams(bMissingField) ); ++ if (pQueryParam.get()) + { +- double fVal; +- USHORT nErr; +- ScQueryValueIterator aValIter(pDok, nTab, aQueryParam); +- if (aValIter.GetFirst(fVal, nErr) && !nErr) ++ ScDBQueryDataIterator aValIter(pDok, pQueryParam.release()); ++ ScDBQueryDataIterator::Value aValue; ++ if (aValIter.GetFirst(aValue) && !aValue.mnError) + { + do + { + rValCount++; +- values.push_back(fVal); +- fSum += fVal; ++ values.push_back(aValue.mfValue); ++ fSum += aValue.mfValue; + } +- while ((nErr == 0) && aValIter.GetNext(fVal, nErr)); ++ while ((aValue.mnError == 0) && aValIter.GetNext(aValue)); + } +- SetError(nErr); ++ SetError(aValue.mnError); + } + else + SetError( errIllegalParameter); +diff --git sc/source/core/tool/interpr4.cxx sc/source/core/tool/interpr4.cxx +index cf8dc7e..a301200 100644 +--- sc/source/core/tool/interpr4.cxx ++++ sc/source/core/tool/interpr4.cxx +@@ -68,15 +68,18 @@ + #include "jumpmatrix.hxx" + #include "parclass.hxx" + #include "externalrefmgr.hxx" ++#include "doubleref.hxx" + + #include + #include + #include + #include + #include ++#include + + using namespace com::sun::star; + using namespace formula; ++using ::std::auto_ptr; + + #define ADDIN_MAXSTRLEN 256 + +@@ -1021,6 +1024,44 @@ void ScInterpreter::DoubleRefToVars( const ScToken* p, + } + } + ++ScDBRangeBase* ScInterpreter::PopDoubleRef() ++{ ++ if (!sp) ++ { ++ SetError(errUnknownStackVariable); ++ return NULL; ++ } ++ ++ --sp; ++ FormulaToken* p = pStack[sp]; ++ switch (p->GetType()) ++ { ++ case svError: ++ nGlobalError = p->GetError(); ++ break; ++ case svDoubleRef: ++ { ++ SCCOL nCol1, nCol2; ++ SCROW nRow1, nRow2; ++ SCTAB nTab1, nTab2; ++ DoubleRefToVars(static_cast(p), ++ nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, false); ++ ++ return new ScDBInternalRange(pDok, ++ ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2)); ++ } ++ break; ++ case svMatrix: ++ { ++ ScMatrixRef pMat = static_cast(p)->GetMatrix(); ++ return new ScDBExternalRange(pDok, pMat); ++ } ++ break; ++ default: ++ SetError( errIllegalParameter); ++ } ++ return NULL; ++} + + void ScInterpreter::PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1, + SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2, +@@ -1860,78 +1901,37 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble, + void ScInterpreter::ScDBGet() + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "Eike.Rathke@sun.com", "ScInterpreter::ScDBGet" ); +- SCTAB nTab; +- ScQueryParam aQueryParam; + BOOL bMissingField = FALSE; +- if (GetDBParams( nTab, aQueryParam, bMissingField)) ++ auto_ptr pQueryParam( GetDBParams(bMissingField) ); ++ if (!pQueryParam.get()) + { +- ScBaseCell* pCell; +- ScQueryCellIterator aCellIter(pDok, nTab, aQueryParam); +- if ( (pCell = aCellIter.GetFirst()) != NULL ) +- { +- if (aCellIter.GetNext()) +- PushIllegalArgument(); +- else +- { +- switch (pCell->GetCellType()) +- { +- case CELLTYPE_VALUE: +- { +- double rValue = ((ScValueCell*)pCell)->GetValue(); +- if ( bCalcAsShown ) +- { +- ULONG nFormat; +- nFormat = aCellIter.GetNumberFormat(); +- rValue = pDok->RoundValueAsShown( rValue, nFormat ); +- } +- PushDouble(rValue); +- } +- break; +- case CELLTYPE_STRING: +- { +- String rString; +- ((ScStringCell*)pCell)->GetString(rString); +- PushString(rString); +- } +- break; +- case CELLTYPE_EDIT: +- { +- String rString; +- ((ScEditCell*)pCell)->GetString(rString); +- PushString(rString); +- } +- break; +- case CELLTYPE_FORMULA: +- { +- USHORT rErr = ((ScFormulaCell*)pCell)->GetErrCode(); +- if (rErr) +- PushError(rErr); +- else if (((ScFormulaCell*)pCell)->IsValue()) +- { +- double rValue = ((ScFormulaCell*)pCell)->GetValue(); +- PushDouble(rValue); +- } +- else +- { +- String rString; +- ((ScFormulaCell*)pCell)->GetString(rString); +- PushString(rString); +- } +- } +- break; +- case CELLTYPE_NONE: +- case CELLTYPE_NOTE: +- default: +- PushIllegalArgument(); +- break; +- } +- } +- } +- else +- PushNoValue(); ++ // Failed to create query param. ++ PushIllegalParameter(); ++ return; ++ } ++ ++ pQueryParam->mbSkipString = false; ++ ScDBQueryDataIterator aValIter(pDok, pQueryParam.release()); ++ ScDBQueryDataIterator::Value aValue; ++ if (!aValIter.GetFirst(aValue) || aValue.mnError) ++ { ++ // No match found. ++ PushNoValue(); ++ return; ++ } ++ ++ ScDBQueryDataIterator::Value aValNext; ++ if (aValIter.GetNext(aValNext) && !aValNext.mnError) ++ { ++ // There should be only one unique match. ++ PushIllegalArgument(); ++ return; + } ++ ++ if (aValue.mbIsNumber) ++ PushDouble(aValue.mfValue); + else +- PushIllegalParameter(); ++ PushString(aValue.maString); + } + + +diff --git sc/source/core/tool/makefile.mk sc/source/core/tool/makefile.mk +index b0f8f03..041d2c8 100644 +--- sc/source/core/tool/makefile.mk ++++ sc/source/core/tool/makefile.mk +@@ -76,6 +76,7 @@ SLOFILES = \ + $(SLO)$/detdata.obj \ + $(SLO)$/detfunc.obj \ + $(SLO)$/docoptio.obj \ ++ $(SLO)$/doubleref.obj \ + $(SLO)$/editutil.obj \ + $(SLO)$/filtopt.obj \ + $(SLO)$/formulaparserpool.obj \ +@@ -95,6 +96,7 @@ SLOFILES = \ + $(SLO)$/printopt.obj \ + $(SLO)$/prnsave.obj \ + $(SLO)$/progress.obj \ ++ $(SLO)$/queryparam.obj \ + $(SLO)$/rangelst.obj \ + $(SLO)$/rangenam.obj \ + $(SLO)$/rangeseq.obj \ +@@ -123,6 +125,7 @@ EXCEPTIONSFILES= \ + $(SLO)$/chartlock.obj \ + $(SLO)$/chgtrack.obj \ + $(SLO)$/compiler.obj \ ++ $(SLO)$/doubleref.obj \ + $(SLO)$/formulaparserpool.obj \ + $(SLO)$/interpr1.obj \ + $(SLO)$/interpr2.obj \ +@@ -131,6 +134,7 @@ EXCEPTIONSFILES= \ + $(SLO)$/interpr5.obj \ + $(SLO)$/lookupcache.obj \ + $(SLO)$/prnsave.obj \ ++ $(SLO)$/queryparam.obj \ + $(SLO)$/reftokenhelper.obj \ + $(SLO)$/stringutil.obj \ + $(SLO)$/token.obj +diff --git sc/source/core/tool/queryparam.cxx sc/source/core/tool/queryparam.cxx +new file mode 100644 +index 0000000..d9d477d +--- /dev/null ++++ sc/source/core/tool/queryparam.cxx +@@ -0,0 +1,361 @@ ++/************************************************************************* ++ * ++ * 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: interpr4.cxx,v $ ++ * $Revision: 1.57.92.5 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++// INCLUDE --------------------------------------------------------------- ++ ++#include "queryparam.hxx" ++ ++using ::std::vector; ++ ++// ============================================================================ ++ ++ScQueryParamBase::ScQueryParamBase() ++{ ++ Resize( MAXQUERY ); ++ for (USHORT i=0; i aNewEntries(nNew); ++ SCSIZE nCopy = ::std::min(maEntries.size(), nNew); ++ for (SCSIZE i=0; i= maEntries.size()) ++ return; ++ ++ size_t n = maEntries.size(); ++ vector aNewEntries; ++ aNewEntries.reserve(n-1); ++ for (size_t i = 0; i < n; ++i) ++ if (i != nPos) ++ aNewEntries.push_back(maEntries[i]); ++ ++ maEntries.swap(aNewEntries); ++} ++ ++void ScQueryParamBase::FillInExcelSyntax(String& aCellStr, SCSIZE nIndex) ++{ ++ if (aCellStr.Len() > 0) ++ { ++ if ( nIndex >= maEntries.size() ) ++ Resize( nIndex+1 ); ++ ++ ScQueryEntry& rEntry = GetEntry(nIndex); ++ ++ rEntry.bDoQuery = TRUE; ++ // Operatoren herausfiltern ++ if (aCellStr.GetChar(0) == '<') ++ { ++ if (aCellStr.GetChar(1) == '>') ++ { ++ *rEntry.pStr = aCellStr.Copy(2); ++ rEntry.eOp = SC_NOT_EQUAL; ++ } ++ else if (aCellStr.GetChar(1) == '=') ++ { ++ *rEntry.pStr = aCellStr.Copy(2); ++ rEntry.eOp = SC_LESS_EQUAL; ++ } ++ else ++ { ++ *rEntry.pStr = aCellStr.Copy(1); ++ rEntry.eOp = SC_LESS; ++ } ++ } ++ else if (aCellStr.GetChar(0) == '>') ++ { ++ if (aCellStr.GetChar(1) == '=') ++ { ++ *rEntry.pStr = aCellStr.Copy(2); ++ rEntry.eOp = SC_GREATER_EQUAL; ++ } ++ else ++ { ++ *rEntry.pStr = aCellStr.Copy(1); ++ rEntry.eOp = SC_GREATER; ++ } ++ } ++ else ++ { ++ if (aCellStr.GetChar(0) == '=') ++ *rEntry.pStr = aCellStr.Copy(1); ++ else ++ *rEntry.pStr = aCellStr; ++ rEntry.eOp = SC_EQUAL; ++ } ++ } ++} ++ ++// ============================================================================ ++ ++ScQueryParamTable::ScQueryParamTable() ++{ ++} ++ ++ScQueryParamTable::ScQueryParamTable(const ScQueryParamTable& r) : ++ nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),nTab(r.nTab) ++{ ++} ++ ++ScQueryParamTable::~ScQueryParamTable() ++{ ++} ++ ++// ============================================================================ ++ ++ScQueryParam::ScQueryParam() : ++ ScQueryParamBase(), ++ ScQueryParamTable() ++{ ++ Clear(); ++} ++ ++//------------------------------------------------------------------------ ++ ++ScQueryParam::ScQueryParam( const ScQueryParam& r ) : ++ ScQueryParamBase(r), ++ ScQueryParamTable(r), ++ bDestPers(r.bDestPers), nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow) ++{ ++} ++ ++ScQueryParam::ScQueryParam( const ScDBQueryParamInternal& r ) : ++ ScQueryParamBase(r), ++ ScQueryParamTable(r), ++ bDestPers(true), ++ nDestTab(0), ++ nDestCol(0), ++ nDestRow(0) ++{ ++} ++ ++ ++//------------------------------------------------------------------------ ++ ++ScQueryParam::~ScQueryParam() ++{ ++} ++ ++//------------------------------------------------------------------------ ++ ++void ScQueryParam::Clear() ++{ ++ nCol1=nCol2 = 0; ++ nRow1=nRow2 = 0; ++ nTab = SCTAB_MAX; ++ bHasHeader = bCaseSens = bRegExp = bMixedComparison = FALSE; ++ bInplace = bByRow = bDuplicate = TRUE; ++ ++ Resize( MAXQUERY ); ++ for (USHORT i=0; i( nCol1 + nDifX ); ++ nRow1 = sal::static_int_cast( nRow1 + nDifY ); ++ nCol2 = sal::static_int_cast( nCol2 + nDifX ); ++ nRow2 = sal::static_int_cast( nRow2 + nDifY ); ++ nTab = sal::static_int_cast( nTab + nDifZ ); ++ size_t n = maEntries.size(); ++ for (size_t i=0; i ++#include + + #include + #include +@@ -72,6 +73,8 @@ + #include "tokenarray.hxx" + #include "token.hxx" + #include "compiler.hxx" ++#include "reftokenhelper.hxx" ++#include "chartlis.hxx" + #include "fprogressbar.hxx" + #include "xltracer.hxx" + #include "xistream.hxx" +@@ -123,6 +126,8 @@ using ::com::sun::star::chart2::data::XDataSequence; + using ::formula::FormulaToken; + using ::formula::StackVar; + ++using ::std::vector; ++ + // Helpers ==================================================================== + + namespace { +@@ -791,6 +796,22 @@ Sequence< Reference< XFormattedString > > XclImpChSourceLink::CreateStringSequen + return ScfApiHelper::VectorToSequence( aStringVec ); + } + ++void XclImpChSourceLink::FillSourceLink(vector& rTokens) const ++{ ++ if (!mxTokenArray.is()) ++ // no links to fill. ++ return; ++ ++ mxTokenArray->Reset(); ++ for (FormulaToken* p = mxTokenArray->First(); p; p = mxTokenArray->Next()) ++ { ++ ScSharedTokenRef pToken(static_cast(p->Clone())); ++ if (ScRefTokenHelper::isRef(pToken)) ++ // This is a reference token. Store it. ++ ScRefTokenHelper::join(rTokens, pToken); ++ } ++} ++ + // Text ======================================================================= + + XclImpChFontBase::~XclImpChFontBase() +@@ -1837,6 +1858,14 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const + return xDataSeries; + } + ++void XclImpChSeries::FillAllSourceLinks(vector& rTokens) const ++{ ++ mxValueLink->FillSourceLink(rTokens); ++ mxCategLink->FillSourceLink(rTokens); ++ mxTitleLink->FillSourceLink(rTokens); ++ mxBubbleLink->FillSourceLink(rTokens); ++} ++ + void XclImpChSeries::ReadChSourceLink( XclImpStream& rStrm ) + { + XclImpChSourceLinkRef xSrcLink( new XclImpChSourceLink( GetChRoot() ) ); +@@ -3481,7 +3510,7 @@ XclImpChTextRef XclImpChChart::GetDefaultText( XclChTextType eTextType ) const + return maDefTexts.get( nDefTextId ); + } + +-void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressBar& rProgress ) const ++void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressBar& rProgress, const OUString& rObjName ) const + { + // initialize conversion (locks the model to suppress any internal updates) + InitConversion( xChartDoc ); +@@ -3524,6 +3553,28 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressB + + // unlock the model + FinishConversion( rProgress ); ++ ++ ScDocument* pDoc = &GetRoot().GetDoc(); ++ ScChartListenerCollection* pChartCollection = pDoc->GetChartListenerCollection(); ++ if (pChartCollection) ++ { ++ // Now, start listening to this chart. ++ ::std::auto_ptr< vector > pRefTokens(new vector); ++ for (XclImpChSeriesVec::const_iterator itr = maSeries.begin(), itrEnd = maSeries.end(); itr != itrEnd; ++itr) ++ { ++ const XclImpChSeriesRef& rSeries = *itr; ++ rSeries->FillAllSourceLinks(*pRefTokens); ++ } ++ if (!pRefTokens->empty()) ++ { ++ ::std::auto_ptr pListener( ++ new ScChartListener(rObjName, pDoc, pRefTokens.release())); ++ pListener->SetDirty(true); ++ pListener->StartListeningTo(); ++ pChartCollection->Insert(pListener.release()); ++ ++ } ++ } + } + + void XclImpChChart::ReadChSeries( XclImpStream& rStrm ) +@@ -3749,11 +3800,11 @@ sal_Size XclImpChart::GetProgressSize() const + return mxChartData.is() ? mxChartData->GetProgressSize() : 0; + } + +-void XclImpChart::Convert( Reference< XModel > xModel, ScfProgressBar& rProgress ) const ++void XclImpChart::Convert( Reference< XModel > xModel, ScfProgressBar& rProgress, const OUString& rObjName ) const + { + Reference< XChartDocument > xChartDoc( xModel, UNO_QUERY ); + if( mxChartData.is() && xChartDoc.is() ) +- mxChartData->Convert( xChartDoc, rProgress ); ++ mxChartData->Convert( xChartDoc, rProgress, rObjName ); + } + + void XclImpChart::ReadChChart( XclImpStream& rStrm ) +diff --git sc/source/filter/excel/xiescher.cxx sc/source/filter/excel/xiescher.cxx +index 599b33f..48406eb 100644 +--- sc/source/filter/excel/xiescher.cxx ++++ sc/source/filter/excel/xiescher.cxx +@@ -1579,7 +1579,7 @@ SdrObject* XclImpChartObj::DoCreateSdrObj( const Rectangle& rAnchorRect, ScfProg + if( svt::EmbeddedObjectRef::TryRunningState( xEmbObj ) ) + { + Reference< XModel > xModel( xEmbObj->getComponent(), UNO_QUERY ); +- mxChart->Convert( xModel, rProgress ); ++ mxChart->Convert( xModel, rProgress, aEmbObjName ); + + Reference< XEmbedPersist > xPers( xEmbObj, UNO_QUERY ); + if( xPers.is() ) +diff --git sc/source/filter/inc/excimp8.hxx sc/source/filter/inc/excimp8.hxx +index fadad41..43e630d 100644 +--- sc/source/filter/inc/excimp8.hxx ++++ sc/source/filter/inc/excimp8.hxx +@@ -37,6 +37,7 @@ + #include "excscen.hxx" + #include "excdefs.hxx" + #include "ftools.hxx" ++#include "queryparam.hxx" + + class SotStorage; + +diff --git sc/source/filter/inc/xichart.hxx sc/source/filter/inc/xichart.hxx +index 1798242..e923ee1 100644 +--- sc/source/filter/inc/xichart.hxx ++++ sc/source/filter/inc/xichart.hxx +@@ -39,6 +39,7 @@ + #include + + #include "rangelst.hxx" ++#include "token.hxx" + #include "xlchart.hxx" + #include "xlstyle.hxx" + #include "xistring.hxx" +@@ -403,6 +404,8 @@ public: + XFormattedStringSeq CreateStringSequence( const XclImpChRoot& rRoot, + sal_uInt16 nLeadFontIdx, const Color& rLeadFontColor ) const; + ++ void FillSourceLink(::std::vector& rTokens) const; ++ + private: + XclChSourceLink maData; /// Contents of the CHSOURCELINK record. + XclImpStringRef mxString; /// Text data (CHSTRING record). +@@ -811,6 +814,8 @@ public: + /** Creates a data series object with initialized source links. */ + XDataSeriesRef CreateDataSeries() const; + ++ void FillAllSourceLinks(::std::vector& rTokens) const; ++ + private: + /** Reads a CHSOURCELINK record. */ + void ReadChSourceLink( XclImpStream& rStrm ); +@@ -1353,7 +1358,7 @@ public: + inline sal_Size GetProgressSize() const { return 2 * EXC_CHART_PROGRESS_SIZE; } + + /** Converts and writes all properties to the passed chart. */ +- void Convert( XChartDocRef xChartDoc, ScfProgressBar& rProgress ) const; ++ void Convert( XChartDocRef xChartDoc, ScfProgressBar& rProgress, const ::rtl::OUString& rObjName ) const; + + private: + /** Reads a CHSERIES group (data series source and formatting). */ +@@ -1421,7 +1426,7 @@ public: + inline bool IsPivotChart() const { return mbIsPivotChart; } + + /** Creates the chart object in the passed component. */ +- void Convert( XModelRef xModel, ScfProgressBar& rProgress ) const; ++ void Convert( XModelRef xModel, ScfProgressBar& rProgress, const ::rtl::OUString& rObjName ) const; + + private: + /** Reads the CHCHART group (entire chart data). */ +diff --git sc/source/filter/xml/XMLExportDataPilot.hxx sc/source/filter/xml/XMLExportDataPilot.hxx +index a3f6cf8..46a2bb0 100644 +--- sc/source/filter/xml/XMLExportDataPilot.hxx ++++ sc/source/filter/xml/XMLExportDataPilot.hxx +@@ -44,6 +44,7 @@ class ScDPDimensionSaveData; + class ScDPSaveGroupDimension; + class ScDPSaveNumGroupDimension; + struct ScDPNumGroupInfo; ++struct ScQueryParam; + + class ScXMLExportDataPilot + { +diff --git sc/source/filter/xml/xmldpimp.hxx sc/source/filter/xml/xmldpimp.hxx +index b4df6b1..705dbac 100644 +--- sc/source/filter/xml/xmldpimp.hxx ++++ sc/source/filter/xml/xmldpimp.hxx +@@ -40,6 +40,7 @@ + #include "global.hxx" + #include "dpobject.hxx" + #include "dpsave.hxx" ++#include "queryparam.hxx" + + #include + +diff --git sc/source/ui/dbgui/foptmgr.cxx sc/source/ui/dbgui/foptmgr.cxx +index ee5f039..a425836 100644 +--- sc/source/ui/dbgui/foptmgr.cxx ++++ sc/source/ui/dbgui/foptmgr.cxx +@@ -45,6 +45,7 @@ + #include "dbcolect.hxx" + #include "viewdata.hxx" + #include "document.hxx" ++#include "queryparam.hxx" + + #define _FOPTMGR_CXX + #include "foptmgr.hxx" +diff --git sc/source/ui/docshell/externalrefmgr.cxx sc/source/ui/docshell/externalrefmgr.cxx +index 1f77d2c..f1587bc 100644 +--- sc/source/ui/docshell/externalrefmgr.cxx ++++ sc/source/ui/docshell/externalrefmgr.cxx +@@ -1045,8 +1045,11 @@ void ScExternalRefLink::DataChanged(const String& /*rMimeType*/, const Any& /*rV + else + { + // The source document has changed. ++ ScDocShell* pDocShell = ScDocShell::GetViewData()->GetDocShell(); ++ ScDocShellModificator aMod(*pDocShell); + pMgr->switchSrcFile(mnFileId, aFile); + maFilterName = aFilter; ++ aMod.SetDocumentModified(); + } + } + +diff --git sc/source/ui/inc/pfiltdlg.hxx sc/source/ui/inc/pfiltdlg.hxx +index a9ba0d1..b383173 100644 +--- sc/source/ui/inc/pfiltdlg.hxx ++++ sc/source/ui/inc/pfiltdlg.hxx +@@ -53,8 +53,8 @@ + #ifndef _COMBOBOX_HXX //autogen + #include + #endif +-#include "global.hxx" // -> ScQueryParam + #include "address.hxx" ++#include "queryparam.hxx" + + //------------------------------------------------------------------ + +diff --git sc/source/ui/inc/uiitems.hxx sc/source/ui/inc/uiitems.hxx +index 6581436..4cd4e58 100644 +--- sc/source/ui/inc/uiitems.hxx ++++ sc/source/ui/inc/uiitems.hxx +@@ -34,6 +34,7 @@ + #include "scdllapi.h" + #include "conditio.hxx" + #include "sortparam.hxx" ++#include "queryparam.hxx" + #include "paramisc.hxx" + #include + +diff --git sc/source/ui/inc/undodat.hxx sc/source/ui/inc/undodat.hxx +index fb42d81..ad46cb7 100644 +--- sc/source/ui/inc/undodat.hxx ++++ sc/source/ui/inc/undodat.hxx +@@ -36,6 +36,7 @@ + #include "rangelst.hxx" // ScRangeListRef + #include "markdata.hxx" + #include "sortparam.hxx" ++#include "queryparam.hxx" + #include "pivot.hxx" + + class ScDocShell; +diff --git sc/source/ui/undo/undobase.cxx sc/source/ui/undo/undobase.cxx +index f20abdb..8b59f80 100644 +--- sc/source/ui/undo/undobase.cxx ++++ sc/source/ui/undo/undobase.cxx +@@ -45,6 +45,7 @@ + #include "undodraw.hxx" + #include "dbcolect.hxx" + #include "attrib.hxx" ++#include "queryparam.hxx" + #include "globstr.hrc" + + // STATIC DATA ----------------------------------------------------------- +diff --git sc/source/ui/unoobj/chart2uno.cxx sc/source/ui/unoobj/chart2uno.cxx +index 6e8ae0a..877e244 100644 +--- sc/source/ui/unoobj/chart2uno.cxx ++++ sc/source/ui/unoobj/chart2uno.cxx +@@ -2919,6 +2919,9 @@ void ScChart2DataSequence::BuildDataCache() + ::std::list::const_iterator itr = aHiddenValues.begin(), itrEnd = aHiddenValues.end(); + for (;itr != itrEnd; ++itr, ++pArr) + *pArr = *itr; ++ ++ // Clear the data series cache when the array is re-built. ++ m_aMixedDataCache.realloc(0); + } + + void ScChart2DataSequence::RebuildDataCache() +@@ -3111,7 +3114,6 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint + if ( m_bGotDataChangedHint && m_pDocument ) + { + m_aDataArray.clear(); +- m_aDataArray.clear(); + lang::EventObject aEvent; + aEvent.Source.set((cppu::OWeakObject*)this); + +@@ -3286,19 +3288,24 @@ uno::Sequence< uno::Any> SAL_CALL ScChart2DataSequence::getData() + throw uno::RuntimeException(); + + BuildDataCache(); +- sal_Int32 nCount = m_aDataArray.size(); +- uno::Sequence aSeq(nCount); +- uno::Any* pArr = aSeq.getArray(); +- ::std::list::const_iterator itr = m_aDataArray.begin(), itrEnd = m_aDataArray.end(); +- for (; itr != itrEnd; ++itr, ++pArr) ++ ++ if (!m_aMixedDataCache.getLength()) + { +- if (itr->mbIsValue) +- *pArr <<= itr->mfValue; +- else +- *pArr <<= itr->maString; +- } ++ // Build a cache for the 1st time... + +- return aSeq; ++ sal_Int32 nCount = m_aDataArray.size(); ++ m_aMixedDataCache.realloc(nCount); ++ uno::Any* pArr = m_aMixedDataCache.getArray(); ++ ::std::list::const_iterator itr = m_aDataArray.begin(), itrEnd = m_aDataArray.end(); ++ for (; itr != itrEnd; ++itr, ++pArr) ++ { ++ if (itr->mbIsValue) ++ *pArr <<= itr->mfValue; ++ else ++ *pArr <<= itr->maString; ++ } ++ } ++ return m_aMixedDataCache; + } + + // XNumericalDataSequence -------------------------------------------------- +diff --git sc/source/ui/view/gridwin4.cxx sc/source/ui/view/gridwin4.cxx +index 1cd54a2..5428aa1 100644 +--- sc/source/ui/view/gridwin4.cxx ++++ sc/source/ui/view/gridwin4.cxx +@@ -74,6 +74,7 @@ + #include "inputopt.hxx" + #include "fillinfo.hxx" + #include "dpcontrol.hxx" ++#include "queryparam.hxx" + #include "sc.hrc" + #include + diff --git a/applied_patches/0014-cws-calctabcolor-filter.diff b/applied_patches/0014-cws-calctabcolor-filter.diff new file mode 100644 index 000000000..f4f31eb40 --- /dev/null +++ b/applied_patches/0014-cws-calctabcolor-filter.diff @@ -0,0 +1,470 @@ +diff --git filter/source/xslt/export/spreadsheetml/formular.xsl filter/source/xslt/export/spreadsheetml/formular.xsl +index 859ef29..a6fe96a 100644 +--- filter/source/xslt/export/spreadsheetml/formular.xsl ++++ filter/source/xslt/export/spreadsheetml/formular.xsl +@@ -381,7 +381,7 @@ + + + +- ++ + + + +@@ -405,8 +405,8 @@ + + + +- +- ++ ++ + + + +diff --git filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl +index e91fff2..c63600c 100644 +--- filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl ++++ filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl +@@ -145,6 +145,17 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -175,6 +186,160 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -187,8 +352,11 @@ + + + +- ++ + ++ ++ ++ + + + +@@ -204,6 +372,16 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +diff --git filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl +index a1576db..6fcae4a 100644 +--- filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl ++++ filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl +@@ -385,6 +385,16 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -4641,6 +4651,211 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + diff --git a/applied_patches/0014-sc-dataform-sc.diff b/applied_patches/0014-sc-dataform-sc.diff deleted file mode 100644 index b904b1c1f..000000000 --- a/applied_patches/0014-sc-dataform-sc.diff +++ /dev/null @@ -1,1389 +0,0 @@ ---- sc/inc/document.hxx -+++ sc/inc/document.hxx -@@ -880,7 +880,7 @@ public: - SCROW nStartRow, SCSIZE nSize, - ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL, - const ScMarkData* pTabMark = NULL ); -- void DeleteRow( const ScRange& rRange, -+ SC_DLLPUBLIC void DeleteRow( const ScRange& rRange, - ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL ); - BOOL InsertCol( SCROW nStartRow, SCTAB nStartTab, - SCROW nEndRow, SCTAB nEndTab, -diff --git sc/inc/sc.hrc sc/inc/sc.hrc -index 3bcc4f3..7c62d8d 100644 ---- sc/inc/sc.hrc -+++ sc/inc/sc.hrc -@@ -1647,6 +1647,11 @@ - - #define SC_OOO_BUILD_START (SC_DIALOGS_END) - -+// Data Form -+#define SID_DATAFORM_NEW (SC_OOO_BUILD_START + 1) // message -+#define SID_DATA_FORM (SC_OOO_BUILD_START + 2) // menu (in Data menu) -+#define RID_SCDLG_DATAFORM (SC_OOO_BUILD_START + 3) // dialog -+ - #endif - - -diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx -index 3403c2d..dfdf0ba 100644 ---- sc/inc/scabstdlg.hxx -+++ sc/inc/scabstdlg.hxx -@@ -42,6 +42,8 @@ - #include "global.hxx" - #include "pivot.hxx" - -+#include -+ - class ScAsciiOptions; - class ScAutoFormat; - class ScAutoFormatData; -@@ -111,6 +113,12 @@ public: - virtual DelCellCmd GetDelCellCmd() const = 0; - }; - -+//for dataform -+class AbstractScDataFormDlg : public VclAbstractDialog //add for ScDeleteCellDlg -+{ -+ -+}; -+ - class AbstractScDeleteContentsDlg: public VclAbstractDialog //add for ScDeleteContentsDlg - { - public: -@@ -324,6 +332,9 @@ public: - - virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, BOOL bDisallowCellMove = FALSE ) = 0 ; //add for ScDeleteCellDlg - -+ //for dataform -+ virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell ) = 0 ; //add for ScDataFormDlg -+ - virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg - USHORT nCheckDefaults = 0 ) = 0; - virtual AbstractScFillSeriesDlg * CreateScFillSeriesDlg( Window* pParent, //add for ScFillSeriesDlg -diff --git sc/sdi/cellsh.sdi sc/sdi/cellsh.sdi -index 5e99223..baec475 100644 ---- sc/sdi/cellsh.sdi -+++ sc/sdi/cellsh.sdi -@@ -60,6 +60,7 @@ interface CellSelection - SID_SBA_BRW_INSERT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] - SID_SELECT_DB [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] - SID_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] -+ SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] - FID_FILTER_OK [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] - SID_AUTO_FILTER [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] - SID_AUTOFILTER_HIDE [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] -diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi -index 2ff50a0..ecc0921 100644 ---- sc/sdi/scalc.sdi -+++ sc/sdi/scalc.sdi -@@ -1601,6 +1601,31 @@ SfxVoidItem DataSort SID_SORT - ] - - //-------------------------------------------------------------------------- -+SfxVoidItem DataForm SID_DATA_FORM -+() -+[ -+ /* flags: */ -+ AutoUpdate = FALSE, -+ Cachable = Cachable, -+ FastCall = FALSE, -+ HasCoreId = FALSE, -+ HasDialog = TRUE, -+ ReadOnlyDoc = TRUE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ -+ /* config: */ -+ AccelConfig = TRUE, -+ MenuConfig = TRUE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_DATA; -+] -+ -+//-------------------------------------------------------------------------- - SfxVoidItem DataSubTotals SID_SUBTOTALS - () - [ -diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx -index aeb4786..de9b284 100644 ---- sc/source/ui/attrdlg/scdlgfact.cxx -+++ sc/source/ui/attrdlg/scdlgfact.cxx -@@ -76,6 +76,8 @@ - #include "tpstat.hxx" //add for ScDocStatPage - #include "tpusrlst.hxx" //add for ScTpUserLists - #include "tpview.hxx" //add for ScTpContentOptions -+//for dataform -+#include "datafdlg.hxx" //add for ScDataFormDlg - - // ause - #include "editutil.hxx" -@@ -88,6 +90,8 @@ IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); //add for ScDataPilotDat - IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); //add for ScDataPilotSourceTypeDlg - IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); //add for ScDataPilotServiceDlg - IMPL_ABSTDLG_BASE(AbstractScDeleteCellDlg_Impl); //add for ScDeleteCellDlg -+//for dataform -+IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl); //add for ScDataFormDlg - IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl); //add for ScDeleteContentsDlg - IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl); //add for ScFillSeriesDlg - IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl); //add for ScGroupDlg -@@ -761,6 +765,26 @@ AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg( Wi - - //add for ScDeleteCellDlg end - -+//add for ScDataFormDlg begin -+AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell ) -+{ -+ ScDataFormDlg * pDlg=NULL; -+ switch ( nId ) -+ { -+ case RID_SCDLG_DATAFORM : -+ pDlg = new ScDataFormDlg( pParent, pTabViewShell); -+ break; -+ default: -+ break; -+ } -+ -+ if ( pDlg ) -+ return new AbstractScDataFormDlg_Impl( pDlg ); -+ return 0; -+} -+ -+//add for ScDataFormDlg end -+ - //add for ScDeleteContentsDlg begin - AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg - USHORT nCheckDefaults ) -diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx -index 463898c..526a1ec 100644 ---- sc/source/ui/attrdlg/scdlgfact.hxx -+++ sc/source/ui/attrdlg/scdlgfact.hxx -@@ -40,6 +40,7 @@ class ScDataPilotDatabaseDlg; - class ScDataPilotSourceTypeDlg; - class ScDataPilotServiceDlg; - class ScDeleteCellDlg; -+class ScDataFormDlg; - class ScDeleteContentsDlg; - class ScFillSeriesDlg; - class ScGroupDlg; -@@ -163,6 +164,12 @@ class AbstractScDeleteCellDlg_Impl : public AbstractScDeleteCellDlg //add for S - virtual DelCellCmd GetDelCellCmd() const; - }; - -+//for dataform -+class AbstractScDataFormDlg_Impl : public AbstractScDataFormDlg //add for ScDataFormDlg -+{ -+ DECL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl,ScDataFormDlg); -+}; -+ - class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg //add for ScDeleteContentsDlg - { - DECL_ABSTDLG_BASE( AbstractScDeleteContentsDlg_Impl,ScDeleteContentsDlg) -@@ -391,6 +398,9 @@ public: - virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, - BOOL bDisallowCellMove = FALSE ); //add for ScDeleteCellDlg - -+ //for dataform -+ virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell); //add for ScDeleteCellDlg -+ - virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg - USHORT nCheckDefaults = 0 ); - -diff --git sc/source/ui/inc/datafdlg.hrc sc/source/ui/inc/datafdlg.hrc -new file mode 100644 -index 0000000..8fa8999 ---- /dev/null -+++ sc/source/ui/inc/datafdlg.hrc -@@ -0,0 +1,49 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile: datafdlg.hrc,v $ -+ * -+ * $Revision: 1.00 $ -+ * -+ * last change: $Author: rt $ $Date: 2005/09/08 21:37:12 $ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+ -+#include "sc.hrc" // -> RID_SCDLG_DATAFORM -+ -+//dataform -+#define BTN_DATAFORM_NEW 1001 -+#define BTN_DATAFORM_DELETE 1002 -+#define BTN_DATAFORM_RESTORE 1003 -+#define BTN_DATAFORM_LAST 1004 -+#define BTN_DATAFORM_NEXT 1005 -+#define BTN_DATAFORM_CLOSE 1007 -+#define WND_DATAFORM_SCROLLBAR 1008 -+#define LAB_DATAFORM_RECORDNO 1009 -+ -+#define FT_DATAFORM_FIXEDTEXT1 2001 -+#define ED_DATAFORM_EDIT1 2002 -\ No newline at end of file -diff --git sc/source/ui/inc/datafdlg.hxx sc/source/ui/inc/datafdlg.hxx -new file mode 100644 -index 0000000..3e6d8e3 ---- /dev/null -+++ sc/source/ui/inc/datafdlg.hxx -@@ -0,0 +1,121 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile: datafdlg.hxx,v $ -+ * -+ * $Revision: 1.00 $ -+ * -+ * last change: $Author: rt $ $Date: 2005/09/08 21:20:35 $ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+ -+#ifndef SC_DATAFDLG_HXX -+#define SC_DATAFDLG_HXX -+ -+ -+#ifndef _SV_DIALOG_HXX //autogen -+#include -+#endif -+ -+#ifndef _SV_BUTTON_HXX //autogen -+#include -+#endif -+ -+#ifndef _SV_FIXED_HXX //autogen -+#include -+#endif -+ -+ -+#include "global.hxx" -+ -+#include -+#include -+#include -+ -+#define MAX_DATAFORM_COLS 256 -+#define MAX_DATAFORM_ROWS 32000 -+#define CTRL_HEIGHT 22 -+#define FIXED_WIDTH 60 -+#define EDIT_WIDTH 140 -+#define FIXED_LEFT 12 -+#define EDIT_LEFT 78 -+#define LINE_HEIGHT 30 -+ -+//zhangyun -+class ScDataFormDlg : public ModalDialog -+{ -+private: -+ -+ PushButton aBtnNew; -+ PushButton aBtnDelete; -+ PushButton aBtnRestore; -+ PushButton aBtnLast; -+ PushButton aBtnNext; -+ PushButton aBtnClose; -+ ScrollBar aSlider; -+ FixedText aFixedText; -+ //FixedText aFixedText1; -+ //Edit aEdit1; -+ -+ ScTabViewShell* pTabViewShell; -+ ScDocument* pDoc; -+ sal_uInt16 aColLength; -+ SCROW aCurrentRow; -+ SCCOL nStartCol; -+ SCCOL nEndCol; -+ SCROW nStartRow; -+ SCROW nEndRow; -+ SCTAB nTab; -+ BOOL bNoSelection; -+ -+ FixedText** pFixedTexts; -+ Edit** pEdits; -+ -+public: -+ ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShell); -+ ~ScDataFormDlg(); -+ -+ void FillCtrls(SCROW nCurrentRow); -+private: -+ -+ void SetButtonState(); -+ -+ // Handler: -+ DECL_LINK( Impl_NewHdl, PushButton* ); -+ DECL_LINK( Impl_LastHdl, PushButton* ); -+ DECL_LINK( Impl_NextHdl, PushButton* ); -+ -+ DECL_LINK( Impl_RestoreHdl, PushButton* ); -+ DECL_LINK( Impl_DeleteHdl, PushButton* ); -+ DECL_LINK( Impl_CloseHdl, PushButton* ); -+ -+ DECL_LINK( Impl_ScrollHdl, ScrollBar* ); -+ DECL_LINK( Impl_DataModifyHdl, Edit* ); -+}; -+#endif // SC_DATAFDLG_HXX -+ -+ -diff --git sc/source/ui/inc/undodat.hxx sc/source/ui/inc/undodat.hxx -index 3b65ba1..3487442 100644 ---- sc/source/ui/inc/undodat.hxx -+++ sc/source/ui/inc/undodat.hxx -@@ -530,7 +530,43 @@ private: - void Init(); - }; - -+// amelia -+class ScUndoDataForm: public ScBlockUndo -+{ -+public: -+ TYPEINFO(); -+ ScUndoDataForm( ScDocShell* pNewDocShell, -+ SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, -+ SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, -+ const ScMarkData& rMark, -+ ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, -+ USHORT nNewFlags, -+ ScRefUndoData* pRefData, void* pFill1, void* pFill2, void* pFill3, -+ BOOL bRedoIsFilled = TRUE -+ ); -+ virtual ~ScUndoDataForm(); -+ -+ virtual void Undo(); -+ virtual void Redo(); -+ virtual void Repeat(SfxRepeatTarget& rTarget); -+ virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const; -+ -+ virtual String GetComment() const; - -+private: -+ ScMarkData aMarkData; -+ ScDocument* pUndoDoc; -+ ScDocument* pRedoDoc; -+ USHORT nFlags; -+ ScRefUndoData* pRefUndoData; -+ ScRefUndoData* pRefRedoData; -+ ULONG nStartChangeAction; -+ ULONG nEndChangeAction; -+ BOOL bRedoFilled; -+ -+ void DoChange( const BOOL bUndo ); -+ void SetChangeTrack(); -+}; - - - #endif -diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx -index acaea7e..0c1fa9e 100644 ---- sc/source/ui/inc/viewfunc.hxx -+++ sc/source/ui/inc/viewfunc.hxx -@@ -328,6 +328,13 @@ public: - void ForgetFormatArea() { bFormatValid = FALSE; } - BOOL SelectionEditable( BOOL* pOnlyNotBecauseOfMatrix = NULL ); - -+ // Amelia Wang -+ SC_DLLPUBLIC void DataFormPutData( SCROW nCurrentRow , -+ SCROW nStartRow , SCCOL nStartCol , -+ SCROW nEndRow , SCCOL nEndCol , -+ Edit** pEdits , -+ sal_uInt16 aColLength ); -+ - // interne Hilfsfunktionen - protected: - void UpdateLineAttrs( SvxBorderLine& rLine, -diff --git sc/source/ui/miscdlgs/datafdlg.cxx sc/source/ui/miscdlgs/datafdlg.cxx -new file mode 100644 -index 0000000..2249c57 ---- /dev/null -+++ sc/source/ui/miscdlgs/datafdlg.cxx -@@ -0,0 +1,422 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile: datafdlg.cxx,v $ -+ * -+ * $Revision: 1.00 $ -+ * -+ * last change: $Author: kz $ $Date: 2006/07/21 14:04:33 $ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+#include "precompiled_sc.hxx" -+ -+#undef SC_DLLIMPLEMENTATION -+ -+//------------------------------------------------------------------ -+ -+#include "datafdlg.hxx" -+#include "scresid.hxx" -+#include "datafdlg.hrc" -+#include "viewdata.hxx" -+//#include "document.hxx" -+#include "docsh.hxx" -+#include "refundo.hxx" -+#include "undodat.hxx" -+ -+#define HDL(hdl) LINK( this, ScDataFormDlg, hdl ) -+ -+//zhangyun -+ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShellOri) : -+ ModalDialog ( pParent, ScResId( RID_SCDLG_DATAFORM ) ), -+ // -+ aBtnNew ( this, ScResId( BTN_DATAFORM_NEW ) ), -+ aBtnDelete ( this, ScResId( BTN_DATAFORM_DELETE ) ), -+ aBtnRestore ( this, ScResId( BTN_DATAFORM_RESTORE ) ), -+ aBtnLast ( this, ScResId( BTN_DATAFORM_LAST ) ), -+ aBtnNext ( this, ScResId( BTN_DATAFORM_NEXT ) ), -+ aBtnClose ( this, ScResId( BTN_DATAFORM_CLOSE ) ), -+ aSlider ( this, ScResId( WND_DATAFORM_SCROLLBAR ) ), -+ aFixedText ( this, ScResId( LAB_DATAFORM_RECORDNO ) ) -+{ -+ pTabViewShell = pTabViewShellOri; -+ FreeResource(); -+ //read header form current document, and add new controls -+ DBG_ASSERT( pTabViewShell, "pTabViewShell is NULL! :-/" ); -+ ScViewData* pViewData = pTabViewShell->GetViewData(); -+ -+ pDoc = pViewData->GetDocument(); -+ if (pDoc) -+ { -+ ScRange aRange; -+ pViewData->GetSimpleArea( aRange ); -+ ScAddress aStart = aRange.aStart; -+ ScAddress aEnd = aRange.aEnd; -+ -+ nStartCol = aStart.Col(); -+ nEndCol = aEnd.Col(); -+ nStartRow = aStart.Row(); -+ nEndRow = aEnd.Row(); -+ -+ nTab = pViewData->GetTabNo(); -+ //if there is no selection -+ if ((nStartCol == nEndCol) && (nStartRow == nEndRow)) -+ bNoSelection = TRUE; -+ -+ if (bNoSelection) -+ { -+ //find last not blank cell in row -+ for (int i=1;i<=MAX_DATAFORM_COLS;i++) -+ { -+ String aColName; -+ nEndCol++; -+ pDoc->GetString( nEndCol, nStartRow, nTab, aColName ); -+ int nColWidth = pDoc->GetColWidth( nEndCol, nTab ); -+ if ( aColName.Len() == 0 && nColWidth) -+ { -+ nEndCol--; -+ break; -+ } -+ } -+ -+ //find first not blank cell in row -+ for (int i=1;i<=MAX_DATAFORM_COLS;i++) -+ { -+ String aColName; -+ if (nStartCol <= 0) -+ break; -+ nStartCol--; -+ -+ pDoc->GetString( nStartCol, nStartRow, nTab, aColName ); -+ int nColWidth = pDoc->GetColWidth( nEndCol, nTab ); -+ if ( aColName.Len() == 0 && nColWidth) -+ { -+ nStartCol++; -+ break; -+ } -+ } -+ -+ //skip leading hide column -+ for (int i=1;i<=MAX_DATAFORM_COLS;i++) -+ { -+ String aColName; -+ int nColWidth = pDoc->GetColWidth( nStartCol, nTab ); -+ if (nColWidth) -+ break; -+ nStartCol++; -+ } -+ -+ if (nEndCol < nStartCol) -+ nEndCol = nStartCol; -+ -+ //find last not blank cell in row -+ for (int i=1;i<=MAX_DATAFORM_ROWS;i++) -+ { -+ String aColName; -+ nEndRow++; -+ pDoc->GetString( nStartCol, nEndRow, nTab, aColName ); -+ if ( aColName.Len() == 0 ) -+ { -+ nEndRow--; -+ break; -+ } -+ } -+ -+ //find first not blank cell in row -+ for (int i=1;i<=MAX_DATAFORM_ROWS;i++) -+ { -+ String aColName; -+ if (nStartRow <= 0) -+ break; -+ nStartRow--; -+ -+ pDoc->GetString( nStartCol, nStartRow, nTab, aColName ); -+ if ( aColName.Len() == 0 ) -+ { -+ nStartRow++; -+ break; -+ } -+ } -+ -+ if (nEndRow < nStartRow) -+ nEndRow = nStartRow; -+ } -+ -+ aCurrentRow = nStartRow + 1; -+ -+ String aFieldName; -+ -+ int nTop = 12; -+ -+ Size nFixedSize(FIXED_WIDTH, CTRL_HEIGHT ); -+ Size nEditSize(EDIT_WIDTH, CTRL_HEIGHT ); -+ -+ //pFtArray = new FixedText(this); -+ aColLength = nEndCol - nStartCol + 1; -+ -+ //new the controls -+ pFixedTexts = new FixedText*[aColLength]; -+ pEdits = new Edit*[aColLength]; -+ -+ for(sal_uInt16 nIndex = 0; nIndex < aColLength; nIndex++) -+ { -+ pDoc->GetString( nIndex + nStartCol, nStartRow, nTab, aFieldName ); -+ int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab ); -+ if (nColWidth) -+ { -+ pFixedTexts[nIndex] = new FixedText(this); -+ pEdits[nIndex] = new Edit(this, WB_BORDER); -+ -+ pFixedTexts[nIndex]->SetSizePixel(nFixedSize); -+ pEdits[nIndex]->SetSizePixel(nEditSize); -+ pFixedTexts[nIndex]->SetPosPixel(Point(FIXED_LEFT, nTop)); -+ pEdits[nIndex]->SetPosPixel(Point(EDIT_LEFT, nTop)); -+ //pFixedTexts[nIndex]->SetText(String::CreateFromAscii("W4W-Filter Nr. ")); -+ pFixedTexts[nIndex]->SetText(aFieldName); -+ pFixedTexts[nIndex]->Show(); -+ pEdits[nIndex]->Show(); -+ -+ nTop += LINE_HEIGHT; -+ } -+ else -+ { -+ pFixedTexts[nIndex] = NULL; -+ pEdits[nIndex] = NULL; -+ } -+ pEdits[nIndex]->SetModifyHdl( HDL(Impl_DataModifyHdl) ); -+ } -+ -+ Size nDialogSize = this->GetSizePixel(); -+ if (nTop > nDialogSize.Height()) -+ { -+ nDialogSize.setHeight(nTop); -+ this->SetSizePixel(nDialogSize); -+ } -+ Size nScrollSize = aSlider.GetSizePixel(); -+ nScrollSize.setHeight(nDialogSize.Height()-20); -+ aSlider.SetSizePixel(nScrollSize); -+ } -+ -+ FillCtrls(aCurrentRow); -+ -+ aSlider.SetPageSize( 10 ); -+ aSlider.SetVisibleSize( 1 ); -+ aSlider.SetLineSize( 1 ); -+ aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) ); -+ aSlider.Show(); -+ -+ aBtnNew.SetClickHdl ( HDL(Impl_NewHdl) ); -+ aBtnLast.SetClickHdl ( HDL(Impl_LastHdl) ); -+ aBtnNext.SetClickHdl ( HDL(Impl_NextHdl) ); -+ -+ aBtnRestore.SetClickHdl ( HDL(Impl_RestoreHdl) ); -+ aBtnDelete.SetClickHdl ( HDL(Impl_DeleteHdl) ); -+ aBtnClose.SetClickHdl ( HDL(Impl_CloseHdl) ); -+ -+ aSlider.SetEndScrollHdl( HDL( Impl_ScrollHdl ) ); -+ -+ SetButtonState(); -+ -+ //end -+ //FreeResource(); -+} -+ -+ScDataFormDlg::~ScDataFormDlg() -+{ -+ for(sal_uInt16 i = 0; i < aColLength; i++) -+ { -+ if (pEdits[i]) -+ delete pEdits[i]; -+ if (pFixedTexts[i]) -+ delete pFixedTexts[i]; -+ } -+ if (pEdits) -+ delete pEdits; -+ if (pFixedTexts) -+ delete pFixedTexts; -+} -+ -+void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/) -+{ -+ //ScViewData* pViewData = pTabViewShell->GetViewData(); -+ -+ //pDoc = pViewData->GetDocument(); -+ String aFieldName; -+ int nRecordNum = nEndRow - nStartRow; -+ for(sal_uInt16 i = 0; i < aColLength; i++) -+ { -+ if (pEdits[i]) -+ { -+ if (aCurrentRow<=nEndRow) -+ { -+ pDoc->GetString( i + nStartCol, aCurrentRow, nTab, aFieldName ); -+ pEdits[i]->SetText(aFieldName); -+ } -+ else -+ pEdits[i]->SetText(String()); -+ } -+ } -+ char sRecordStr[256]; -+ if (aCurrentRow<=nEndRow) -+ aFixedText.SetText(String::CreateFromAscii(sRecordStr)); -+ else -+ aFixedText.SetText(String::CreateFromAscii("New Record")); -+ -+ aSlider.SetThumbPos(aCurrentRow-nStartRow-1); -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit) -+{ -+ if ( pEdit->IsModified() ) -+ aBtnRestore.Enable( TRUE ); -+ return 0; -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG ) -+{ -+ ScViewData* pViewData = pTabViewShell->GetViewData(); -+ ScDocShell* pDocSh = pViewData->GetDocShell(); -+ if ( pDoc ) -+ { -+ sal_Bool bHasData = sal_False; -+ for(sal_uInt16 i = 0; i < aColLength; i++) -+ if (pEdits[i]) -+ if ( pEdits[i]->GetText().Len() != 0 ) -+ { -+ bHasData = sal_True; -+ break; -+ } -+ -+ if ( bHasData ) -+ { -+ pTabViewShell->DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , pEdits , aColLength ); -+ aCurrentRow++; -+ if (aCurrentRow >= nEndRow + 2) -+ { -+ nEndRow ++ ; -+ aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) ); -+ } -+ SetButtonState(); -+ FillCtrls(aCurrentRow); -+ pDocSh->SetDocumentModified(); -+ pDocSh->PostPaintGridAll(); -+ } -+ } -+ return 0; -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_LastHdl, PushButton*, EMPTYARG ) -+{ -+ if (pDoc) -+ { -+ if ( aCurrentRow > nStartRow +1 ) -+ aCurrentRow--; -+ -+ SetButtonState(); -+ FillCtrls(aCurrentRow); -+ } -+ return 0; -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_NextHdl, PushButton*, EMPTYARG ) -+{ -+ if (pDoc) -+ { -+ if ( aCurrentRow <= nEndRow) -+ aCurrentRow++; -+ -+ SetButtonState(); -+ FillCtrls(aCurrentRow); -+ } -+ return 0; -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_RestoreHdl, PushButton*, EMPTYARG ) -+{ -+ if (pDoc) -+ { -+ FillCtrls(aCurrentRow); -+ } -+ return 0; -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_DeleteHdl, PushButton*, EMPTYARG ) -+{ -+ ScViewData* pViewData = pTabViewShell->GetViewData(); -+ ScDocShell* pDocSh = pViewData->GetDocShell(); -+ if (pDoc) -+ { -+ ScRange aRange(nStartCol, aCurrentRow, nTab, nEndCol, aCurrentRow, nTab); -+ pDoc->DeleteRow(aRange); -+ nEndRow--; -+ -+ SetButtonState(); -+ pDocSh->GetUndoManager()->Clear(); -+ -+ FillCtrls(aCurrentRow); -+ pDocSh->SetDocumentModified(); -+ pDocSh->PostPaintGridAll(); -+ } -+ return 0; -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_CloseHdl, PushButton*, EMPTYARG ) -+{ -+ EndDialog( ); -+ return 0; -+} -+ -+IMPL_LINK( ScDataFormDlg, Impl_ScrollHdl, ScrollBar*, EMPTYARG ) -+{ -+ long nOffset = aSlider.GetThumbPos(); -+ aCurrentRow = nStartRow + nOffset + 1; -+ SetButtonState(); -+ FillCtrls(aCurrentRow); -+ return 0; -+} -+ -+void ScDataFormDlg::SetButtonState() -+{ -+ if ( aCurrentRow > nEndRow ) -+ { -+ aBtnDelete.Enable( FALSE ); -+ aBtnLast.Enable( TRUE ); -+ aBtnNext.Enable( FALSE ); -+ } -+ else -+ { -+ aBtnDelete.Enable( TRUE ); -+ aBtnNext.Enable( TRUE ); -+ } -+ if ( 1 == aCurrentRow ) -+ aBtnLast.Enable( FALSE ); -+ -+ aBtnRestore.Enable( FALSE ); -+ if ( pEdits ) -+ pEdits[0]->GrabFocus(); -+} -diff --git sc/source/ui/miscdlgs/makefile.mk sc/source/ui/miscdlgs/makefile.mk -index 90f3afe..3569ccf 100644 ---- sc/source/ui/miscdlgs/makefile.mk -+++ sc/source/ui/miscdlgs/makefile.mk -@@ -45,6 +45,7 @@ LIBTARGET=no - # --- Files -------------------------------------------------------- - - SLOFILES = \ -+ $(SLO)$/datafdlg.obj \ - $(SLO)$/delcldlg.obj \ - $(SLO)$/inscldlg.obj \ - $(SLO)$/delcodlg.obj \ -diff --git sc/source/ui/src/datafdlg.src sc/source/ui/src/datafdlg.src -new file mode 100644 -index 0000000..535ec66 ---- /dev/null -+++ sc/source/ui/src/datafdlg.src -@@ -0,0 +1,108 @@ -+/************************************************************************* -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile: datafdlg.src,v $ -+ * -+ * $Revision: 1.00 $ -+ * -+ * last change: $Author: hr $ $Date: 2005/09/23 15:07:30 $ -+ * -+ * The Contents of this file are made available subject to -+ * the terms of GNU Lesser General Public License Version 2.1. -+ * -+ * -+ * GNU Lesser General Public License Version 2.1 -+ * ============================================= -+ * Copyright 2005 by Sun Microsystems, Inc. -+ * 901 San Antonio Road, Palo Alto, CA 94303, USA -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License version 2.1, as published by the Free Software Foundation. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ * -+ ************************************************************************/ -+ -+#include "datafdlg.hrc" -+ -+//zhangyun, dataform -+ModalDialog RID_SCDLG_DATAFORM -+{ -+ OutputSize = TRUE ; -+ SVLook = TRUE ; -+ Size = MAP_APPFONT ( 191 , 180 ) ; -+ Text [ en-US ] = "Data Form" ; -+ Moveable = TRUE ; -+ Closeable = TRUE ; -+ FixedText LAB_DATAFORM_RECORDNO -+ { -+ Pos = MAP_APPFONT ( 136 , 6 ) ; -+ Size = MAP_APPFONT ( 50 , 12 ) ; -+ Text [ en-US ] = "/" ; -+ }; -+ PushButton BTN_DATAFORM_NEW -+ { -+ Pos = MAP_APPFONT ( 135 , 23 ) ; -+ Size = MAP_APPFONT ( 50 , 14 ) ; -+ TabStop = TRUE ; -+ DefButton = TRUE ; -+ Text [ en-US ] = "New" ; -+ }; -+ PushButton BTN_DATAFORM_DELETE -+ { -+ Pos = MAP_APPFONT ( 135 , 40 ) ; -+ Size = MAP_APPFONT ( 50 , 14 ) ; -+ TabStop = TRUE ; -+ Text [ en-US ] = "Delete" ; -+ }; -+ PushButton BTN_DATAFORM_RESTORE -+ { -+ Pos = MAP_APPFONT ( 135 , 57 ) ; -+ Size = MAP_APPFONT ( 50 , 14 ) ; -+ TabStop = TRUE ; -+ Text [ en-US ] = "Restore" ; -+ }; -+ PushButton BTN_DATAFORM_LAST -+ { -+ Pos = MAP_APPFONT ( 135 , 82 ) ; -+ Size = MAP_APPFONT ( 50 , 14 ) ; -+ TabStop = TRUE ; -+ Text [ en-US ] = "Last Record" ; -+ }; -+ PushButton BTN_DATAFORM_NEXT -+ { -+ Pos = MAP_APPFONT ( 135 , 99 ) ; -+ Size = MAP_APPFONT ( 50 , 14 ) ; -+ TabStop = TRUE ; -+ Text [ en-US ] = "Next Record" ; -+ }; -+ PushButton BTN_DATAFORM_CLOSE -+ { -+ Pos = MAP_APPFONT ( 135 , 116 ) ; -+ Size = MAP_APPFONT ( 50 , 14 ) ; -+ TabStop = TRUE ; -+ Text [ en-US ] = "Close" ; -+ }; -+ ScrollBar WND_DATAFORM_SCROLLBAR -+ { -+ Pos = MAP_APPFONT ( 124 , 6 ) ; -+ Size = MAP_APPFONT ( 8 , 135 ) ; -+ HScroll = FALSE ; -+ TabStop = FALSE ; -+ }; -+}; -+//end -+ -+ -+ -+ -diff --git sc/source/ui/src/makefile.mk sc/source/ui/src/makefile.mk -index af0e906..8f33ac9 100644 ---- sc/source/ui/src/makefile.mk -+++ sc/source/ui/src/makefile.mk -@@ -57,6 +57,7 @@ SRC1FILES = \ - dbnamdlg.src \ - subtdlg.src \ - miscdlgs.src \ -+ datafdlg.src \ - autofmt.src \ - solvrdlg.src \ - optsolver.src \ -diff --git sc/source/ui/undo/undodat.cxx sc/source/ui/undo/undodat.cxx -index 4ea4a0a..9aea0eb 100644 ---- sc/source/ui/undo/undodat.cxx -+++ sc/source/ui/undo/undodat.cxx -@@ -58,6 +58,8 @@ - #include "dpobject.hxx" - #include "attrib.hxx" - #include "sc.hrc" -+#include "chgtrack.hxx" // Amelia Wang -+#include "refundo.hxx" // Amelia Wang - - // ----------------------------------------------------------------------- - -@@ -74,6 +74,7 @@ TYPEINIT1(ScUndoRepeatDB, ScSi - TYPEINIT1(ScUndoDataPilot, ScSimpleUndo); - TYPEINIT1(ScUndoConsolidate, ScSimpleUndo); - TYPEINIT1(ScUndoChartData, ScSimpleUndo); -+TYPEINIT1(ScUndoDataForm, SfxUndoAction); // amelia - - // ----------------------------------------------------------------------- - -@@ -2182,8 +2185,210 @@ BOOL __EXPORT ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const - return FALSE; - } - -+// Amelia Wang -+ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell, -+ SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, -+ SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, -+ const ScMarkData& rMark, -+ ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, -+ USHORT nNewFlags, -+ ScRefUndoData* pRefData, -+ void* /*pFill1*/, void* /*pFill2*/, void* /*pFill3*/, -+ BOOL bRedoIsFilled ) : -+ ScBlockUndo( pNewDocShell, ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), SC_UNDO_SIMPLE ), -+ aMarkData( rMark ), -+ pUndoDoc( pNewUndoDoc ), -+ pRedoDoc( pNewRedoDoc ), -+ nFlags( nNewFlags ), -+ pRefUndoData( pRefData ), -+ pRefRedoData( NULL ), -+ bRedoFilled( bRedoIsFilled ) -+{ -+ // pFill1,pFill2,pFill3 are there so the ctor calls for simple paste (without cutting) -+ // don't have to be changed and branched for 641. -+ // They can be removed later. -+ -+ if ( !aMarkData.IsMarked() ) // no cell marked: -+ aMarkData.SetMarkArea( aBlockRange ); // mark paste block - -+ if ( pRefUndoData ) -+ pRefUndoData->DeleteUnchanged( pDocShell->GetDocument() ); - -+ SetChangeTrack(); -+} - -+ScUndoDataForm::~ScUndoDataForm() -+{ -+ delete pUndoDoc; -+ delete pRedoDoc; -+ delete pRefUndoData; -+ delete pRefRedoData; -+} - -+String ScUndoDataForm::GetComment() const -+{ -+ return ScGlobal::GetRscString( STR_UNDO_PASTE ); -+} -+ -+void ScUndoDataForm::SetChangeTrack() -+{ -+ ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack(); -+ if ( pChangeTrack && (nFlags & IDF_CONTENTS) ) -+ pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc, -+ nStartChangeAction, nEndChangeAction, SC_CACM_PASTE ); -+ else -+ nStartChangeAction = nEndChangeAction = 0; -+} -+ -+ -+void ScUndoDataForm::Undo() -+{ -+ BeginUndo(); -+ DoChange( TRUE ); -+ ShowTable( aBlockRange ); -+ EndUndo(); -+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); -+} -+ -+void ScUndoDataForm::Redo() -+{ -+ BeginRedo(); -+ ScDocument* pDoc = pDocShell->GetDocument(); -+ EnableDrawAdjust( pDoc, FALSE ); //! include in ScBlockUndo? -+ DoChange( FALSE ); -+ EnableDrawAdjust( pDoc, TRUE ); //! include in ScBlockUndo? -+ EndRedo(); -+ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); -+} -+ -+void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/) -+{ -+} - -+BOOL ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const -+{ -+ return (rTarget.ISA(ScTabViewTarget)); -+} -+ -+void ScUndoDataForm::DoChange( const BOOL bUndo ) -+{ -+ ScDocument* pDoc = pDocShell->GetDocument(); -+ -+ // RefUndoData for redo is created before first undo -+ // (with DeleteUnchanged after the DoUndo call) -+ BOOL bCreateRedoData = ( bUndo && pRefUndoData && !pRefRedoData ); -+ if ( bCreateRedoData ) -+ pRefRedoData = new ScRefUndoData( pDoc ); -+ -+ ScRefUndoData* pWorkRefData = bUndo ? pRefUndoData : pRefRedoData; -+ -+ // fuer Undo immer alle oder keine Inhalte sichern -+ USHORT nUndoFlags = IDF_NONE; -+ if (nFlags & IDF_CONTENTS) -+ nUndoFlags |= IDF_CONTENTS; -+ if (nFlags & IDF_ATTRIB) -+ nUndoFlags |= IDF_ATTRIB; -+ -+ BOOL bPaintAll = FALSE; -+ -+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); -+ -+ // marking is in ScBlockUndo... -+ //ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockRange ); -+ -+ SCTAB nTabCount = pDoc->GetTableCount(); -+ if ( bUndo && !bRedoFilled ) -+ { -+ if (!pRedoDoc) -+ { -+ BOOL bColInfo = ( aBlockRange.aStart.Row()==0 && aBlockRange.aEnd.Row()==MAXROW ); -+ BOOL bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==MAXCOL ); -+ -+ pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); -+ pRedoDoc->InitUndoSelected( pDoc, aMarkData, bColInfo, bRowInfo ); -+ } -+ // read "redo" data from the document in the first undo -+ // all sheets - CopyToDocument skips those that don't exist in pRedoDoc -+ ScRange aCopyRange = aBlockRange; -+ aCopyRange.aStart.SetTab(0); -+ aCopyRange.aEnd.SetTab(nTabCount-1); -+ pDoc->CopyToDocument( aCopyRange, 1, FALSE, pRedoDoc ); -+ bRedoFilled = TRUE; -+ } -+ -+ USHORT nExtFlags = 0; -+ pDocShell->UpdatePaintExt( nExtFlags, aBlockRange ); -+ -+ for ( sal_uInt16 i=0; i <= ( aBlockRange.aEnd.Col() - aBlockRange.aStart.Col() ); i++ ) -+ { -+ String aOldString; -+ pUndoDoc->GetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString ); -+ pDoc->SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString ); -+ } -+ -+ //ScRange aTabSelectRange = aBlockRange; -+ -+ if (pWorkRefData) -+ { -+ pWorkRefData->DoUndo( pDoc, TRUE ); // TRUE = bSetChartRangeLists for SetChartListenerCollection -+ if ( pDoc->RefreshAutoFilter( 0,0, MAXCOL,MAXROW, aBlockRange.aStart.Tab() ) ) -+ bPaintAll = TRUE; -+ } -+ -+ if ( bCreateRedoData && pRefRedoData ) -+ pRefRedoData->DeleteUnchanged( pDoc ); -+ -+ if ( bUndo ) -+ { -+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); -+ if ( pChangeTrack ) -+ pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); -+ } -+ else -+ SetChangeTrack(); -+ -+ ScRange aDrawRange( aBlockRange ); -+ pDoc->ExtendMerge( aDrawRange, TRUE ); // only needed for single sheet (text/rtf etc.) -+ USHORT nPaint = PAINT_GRID; -+ if (bPaintAll) -+ { -+ aDrawRange.aStart.SetCol(0); -+ aDrawRange.aStart.SetRow(0); -+ aDrawRange.aEnd.SetCol(MAXCOL); -+ aDrawRange.aEnd.SetRow(MAXROW); -+ nPaint |= PAINT_TOP | PAINT_LEFT; -+/*A*/ if (pViewShell) -+ pViewShell->AdjustBlockHeight(FALSE); -+ } -+ else -+ { -+ if ( aBlockRange.aStart.Row() == 0 && aBlockRange.aEnd.Row() == MAXROW ) // ganze Spalte -+ { -+ nPaint |= PAINT_TOP; -+ aDrawRange.aEnd.SetCol(MAXCOL); -+ } -+ if ( aBlockRange.aStart.Col() == 0 && aBlockRange.aEnd.Col() == MAXCOL ) // ganze Zeile -+ { -+ nPaint |= PAINT_LEFT; -+ aDrawRange.aEnd.SetRow(MAXROW); -+ } -+/*A*/ if ((pViewShell) && pViewShell->AdjustBlockHeight(FALSE)) -+ { -+ aDrawRange.aStart.SetCol(0); -+ aDrawRange.aStart.SetRow(0); -+ aDrawRange.aEnd.SetCol(MAXCOL); -+ aDrawRange.aEnd.SetRow(MAXROW); -+ nPaint |= PAINT_LEFT; -+ } -+ pDocShell->UpdatePaintExt( nExtFlags, aDrawRange ); -+ } -+ -+ if ( !bUndo ) // draw redo after updating row heights -+ RedoSdrUndoAction( pDrawUndo ); //! include in ScBlockUndo? -+ -+ pDocShell->PostPaint( aDrawRange, nPaint, nExtFlags ); -+ -+ pDocShell->PostDataChanged(); -+ if (pViewShell) -+ pViewShell->CellContentChanged(); -+} -diff --git sc/source/ui/view/cellsh2.cxx sc/source/ui/view/cellsh2.cxx -index 7dee7cc..231e71e 100644 ---- sc/source/ui/view/cellsh2.cxx -+++ sc/source/ui/view/cellsh2.cxx -@@ -265,6 +265,20 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) - } - break; - -+ case SID_DATA_FORM: -+ { -+ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); -+ DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001 -+ -+ AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg( pTabViewShell->GetDialogParent(),RID_SCDLG_DATAFORM, pTabViewShell); -+ DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001 -+ -+ pDlg->Execute(); -+ -+ rReq.Done(); -+ } -+ break; -+ - case SID_SUBTOTALS: - { - const SfxItemSet* pArgs = rReq.GetArgs(); -diff --git sc/source/ui/view/viewfun3.cxx sc/source/ui/view/viewfun3.cxx -index 1cb5400..9c2ef97 100644 ---- sc/source/ui/view/viewfun3.cxx -+++ sc/source/ui/view/viewfun3.cxx -@@ -208,6 +208,7 @@ - #include "transobj.hxx" - #include "drwtrans.hxx" - #include "docuno.hxx" -+#include "undodat.hxx" // Amelia Wang - - using namespace com::sun::star; - -@@ -1414,6 +1415,85 @@ BOOL ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, B - return TRUE; - } - -+void ScViewFunc::DataFormPutData( SCROW nCurrentRow , -+ SCROW nStartRow , SCCOL nStartCol , -+ SCROW nEndRow , SCCOL nEndCol , -+ Edit** pEdits , -+ sal_uInt16 aColLength ) -+{ -+ ScDocument* pDoc = GetViewData()->GetDocument(); -+ ScDocShell* pDocSh = GetViewData()->GetDocShell(); -+ ScMarkData& rMark = GetViewData()->GetMarkData(); -+ ScDocShellModificator aModificator( *pDocSh ); -+ SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager(); -+ if ( pDoc ) -+ { -+ const BOOL bRecord( pDoc->IsUndoEnabled()); -+ ScDocument* pUndoDoc = NULL; -+ ScDocument* pRedoDoc = NULL; -+ ScDocument* pRefUndoDoc = NULL; -+ ScRefUndoData* pUndoData = NULL; -+ SCTAB nTab = GetViewData()->GetTabNo(); -+ SCTAB nStartTab = nTab; -+ SCTAB nEndTab = nTab; -+ -+ { -+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); -+ if ( pChangeTrack ) -+ pChangeTrack->ResetLastCut(); // kein CutMode mehr -+ } -+ ScRange aUserRange( nStartCol, nCurrentRow, nStartTab, nEndCol, nCurrentRow, nEndTab ); -+ BOOL bColInfo = ( nStartRow==0 && nEndRow==MAXROW ); -+ BOOL bRowInfo = ( nStartCol==0 && nEndCol==MAXCOL ); -+ SCCOL nUndoEndCol = nStartCol+aColLength-1; -+ SCROW nUndoEndRow = nCurrentRow; -+ USHORT nUndoFlags = IDF_NONE; -+ -+ if ( bRecord ) -+ { -+ pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); -+ pUndoDoc->InitUndoSelected( pDoc , rMark , bColInfo , bRowInfo ); -+ pDoc->CopyToDocument( aUserRange , 1 , FALSE , pUndoDoc ); -+ } -+ USHORT nExtFlags = 0; -+ pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nStartRow, nStartTab , nEndCol, nEndRow, nEndTab ); // content before the change -+ //rMark.SetMarkArea( aUserRange ); -+ pDoc->BeginDrawUndo(); -+ -+ for(sal_uInt16 i = 0; i < aColLength; i++) -+ { -+ if (pEdits[i]) -+ { -+ String aFieldName=pEdits[i]->GetText(); -+ pDoc->SetString( nStartCol + i, nCurrentRow, nTab, aFieldName ); -+ } -+ } -+ //pDoc->ExtendMergeSel( nStartCol, nStartRow, nEndCol, nEndRow, rMark, TRUE ); // Refresh -+ pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nCurrentRow, nStartTab, nEndCol, nCurrentRow, nEndTab ); // content after the change -+ SfxUndoAction* pUndo = new ScUndoDataForm( pDocSh, -+ nStartCol, nCurrentRow, nStartTab, -+ nUndoEndCol, nUndoEndRow, nEndTab, rMark, -+ pUndoDoc, pRedoDoc, nUndoFlags, -+ pUndoData, NULL, NULL, NULL, -+ FALSE ); // FALSE = Redo data not yet copied -+ pUndoMgr->AddUndoAction( new ScUndoWrapper( pUndo ), TRUE ); -+ -+ USHORT nPaint = PAINT_GRID; -+ if (bColInfo) -+ { -+ nPaint |= PAINT_TOP; -+ nUndoEndCol = MAXCOL; // nur zum Zeichnen ! -+ } -+ if (bRowInfo) -+ { -+ nPaint |= PAINT_LEFT; -+ nUndoEndRow = MAXROW; // nur zum Zeichnen ! -+ } - -+ pDocSh->PostPaint( nStartCol, nCurrentRow, nStartTab, -+ nUndoEndCol, nUndoEndRow, nEndTab, nPaint, nExtFlags ); -+ pDocSh->UpdateOle(GetViewData()); -+ } -+} - - -diff --git sc/uiconfig/scalc/menubar/menubar.xml sc/uiconfig/scalc/menubar/menubar.xml -index 938f00b..06dfc6f 100644 ---- sc/uiconfig/scalc/menubar/menubar.xml -+++ sc/uiconfig/scalc/menubar/menubar.xml -@@ -391,6 +391,7 @@ - - - -+ - - - -diff --git sc/util/makefile.mk sc/util/makefile.mk -index a051bb8..9d2706a 100644 ---- sc/util/makefile.mk -+++ sc/util/makefile.mk -@@ -273,6 +273,7 @@ LIB8OBJFILES = \ - $(SLO)$/filldlg.obj \ - $(SLO)$/delcodlg.obj \ - $(SLO)$/delcldlg.obj \ -+ $(SLO)$/datafdlg.obj \ - $(SLO)$/dapitype.obj \ - $(SLO)$/dapidata.obj \ - $(SLO)$/crdlg.obj \ diff --git a/applied_patches/0015-cws-calctabcolor-officecfg.diff b/applied_patches/0015-cws-calctabcolor-officecfg.diff new file mode 100644 index 000000000..e080188c8 --- /dev/null +++ b/applied_patches/0015-cws-calctabcolor-officecfg.diff @@ -0,0 +1,33 @@ +diff --git officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +index 991ea9a..3ae5ca8 100644 +--- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu ++++ officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +@@ -1243,12 +1243,25 @@ + + + +- Rename Sheet ++ Rename Sheet ++ ++ ++ ++ ++ ~Tab Color... ++ ++ ++ ~Tab Color... + + +- ++ + +- ~Move/Copy Sheet... ++ Tab Color ++ ++ ++ ++ ++ ~Move/Copy Sheet... + + + ~Move/Copy... diff --git a/applied_patches/0015-sc-dataform-officecfg.diff b/applied_patches/0015-sc-dataform-officecfg.diff deleted file mode 100644 index 5871b409a..000000000 --- a/applied_patches/0015-sc-dataform-officecfg.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu -index 653fa4a..52242f3 100644 ---- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu -+++ officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu -@@ -1184,6 +1184,12 @@ - ~Remove Filter - - -+ -+ -+ D~atenForm... -+ D~ataForm... -+ -+ - - - Sub~totals... diff --git a/applied_patches/0016-cws-calctabcolor-oox.diff b/applied_patches/0016-cws-calctabcolor-oox.diff new file mode 100644 index 000000000..9e37e2187 --- /dev/null +++ b/applied_patches/0016-cws-calctabcolor-oox.diff @@ -0,0 +1,75 @@ +diff --git oox/inc/oox/xls/viewsettings.hxx oox/inc/oox/xls/viewsettings.hxx +index fceb1bc..f1160a1 100644 +--- oox/inc/oox/xls/viewsettings.hxx ++++ oox/inc/oox/xls/viewsettings.hxx +@@ -83,6 +83,7 @@ struct SheetViewModel + bool mbShowZeros; /// True = show zero value zells. + bool mbShowOutline; /// True = show outlines. + bool mbZoomToFit; /// True = zoom chart sheet to fit window. ++ Color maTabColor; /// Sheet tab color. (TODO: Move to sheet settings later.) + + explicit SheetViewModel(); + +@@ -112,6 +113,8 @@ public: + + /** Imports the sheetView element containing sheet view settings. */ + void importSheetView( const AttributeList& rAttribs ); ++ /** Imports the tabcolor element containing tab color settings. */ ++ void importTabColor( const AttributeList& rAttribs ); + /** Imports the pane element containing sheet pane settings. */ + void importPane( const AttributeList& rAttribs ); + /** Imports the selection element containing selection settings for a pane. */ +diff --git oox/source/token/properties.txt oox/source/token/properties.txt +index 958a9ac..89a65cd 100644 +--- oox/source/token/properties.txt ++++ oox/source/token/properties.txt +@@ -355,6 +355,7 @@ Suffix + SwapXAndYAxis + Symbol + SymbolColor ++TabColor + TableBorder + TableLayout + TableSelected +diff --git oox/source/xls/viewsettings.cxx oox/source/xls/viewsettings.cxx +index caeacaf..ce8c009 100644 +--- oox/source/xls/viewsettings.cxx ++++ oox/source/xls/viewsettings.cxx +@@ -245,6 +245,12 @@ void SheetViewSettings::importSheetView( const AttributeList& rAttribs ) + rModel.mbShowOutline = rAttribs.getBool( XML_showOutlineSymbols, true ); + } + ++void SheetViewSettings::importTabColor( const AttributeList& rAttribs ) ++{ ++ SheetViewModel& rModel = maSheetViews.empty() ? *createSheetView() : *maSheetViews.back(); ++ rModel.maTabColor.importColor( rAttribs ); ++} ++ + void SheetViewSettings::importPane( const AttributeList& rAttribs ) + { + OSL_ENSURE( !maSheetViews.empty(), "SheetViewSettings::importPane - missing sheet view model" ); +@@ -589,6 +595,9 @@ void SheetViewSettings::finalizeImport() + aPropMap[ PROP_ShowZeroValues ] <<= xModel->mbShowZeros; + aPropMap[ PROP_IsOutlineSymbolsSet ] <<= xModel->mbShowOutline; + ++ if (!xModel->maTabColor.isAuto()) ++ aPropMap[ PROP_TabColor ] <<= static_cast< sal_Int32 >(xModel->maTabColor.getColor(*this)); ++ + // store sheet view settings in global view settings object + getViewSettings().setSheetViewSettings( getSheetIndex(), xModel, Any( aPropMap.makePropertyValueSequence() ) ); + } +diff --git oox/source/xls/worksheetfragment.cxx oox/source/xls/worksheetfragment.cxx +index 4b75411..d2bed72 100644 +--- oox/source/xls/worksheetfragment.cxx ++++ oox/source/xls/worksheetfragment.cxx +@@ -297,7 +297,9 @@ ContextHandlerRef OoxWorksheetFragment::onCreateContext( sal_Int32 nElement, con + case XLS_TOKEN( sheetPr ): + switch( nElement ) + { +- case XLS_TOKEN( tabColor ): getWorksheetSettings().importTabColor( rAttribs ); break; ++// TODO: Treat tab color as a sheet setting later. ++// case XLS_TOKEN( tabColor ): getWorksheetSettings().importTabColor( rAttribs ); break; ++ case XLS_TOKEN( tabColor ): getSheetViewSettings().importTabColor( rAttribs ); break; + case XLS_TOKEN( outlinePr ): getWorksheetSettings().importOutlinePr( rAttribs ); break; + case XLS_TOKEN( pageSetUpPr ): importPageSetUpPr( rAttribs ); break; + } diff --git a/applied_patches/0016-sc-dataform-suppor-vba.diff b/applied_patches/0016-sc-dataform-suppor-vba.diff deleted file mode 100644 index 9a5f2fa69..000000000 --- a/applied_patches/0016-sc-dataform-suppor-vba.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx ---- sc/inc/scabstdlg.hxx 2007-09-18 15:45:23.000000000 +0800 -+++ sc/inc/scabstdlg.hxx 2007-09-18 15:43:57.000000000 +0800 -@@ -310,7 +310,7 @@ - class ScAbstractDialogFactory - { - public: -- static ScAbstractDialogFactory* Create(); -+ SC_DLLPUBLIC static ScAbstractDialogFactory* Create(); - - virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, String aDatName, //add for ScImportAsciiDlg - SvStream* pInStream, int nId, diff --git a/applied_patches/0017-cws-calctabcolor-sc.diff b/applied_patches/0017-cws-calctabcolor-sc.diff new file mode 100644 index 000000000..11c4a2f8c --- /dev/null +++ b/applied_patches/0017-cws-calctabcolor-sc.diff @@ -0,0 +1,1881 @@ +diff --git sc/inc/ViewSettingsSequenceDefines.hxx sc/inc/ViewSettingsSequenceDefines.hxx +index 63671c5..c720413 100644 +--- sc/inc/ViewSettingsSequenceDefines.hxx ++++ sc/inc/ViewSettingsSequenceDefines.hxx +@@ -64,7 +64,7 @@ + // this are the defines for the position of the settings in the + // TableViewSettingsSequence + +-#define SC_TABLE_VIEWSETTINGS_COUNT 14 ++#define SC_TABLE_VIEWSETTINGS_COUNT 15 + + #define SC_CURSOR_X 0 + #define SC_CURSOR_Y 1 +@@ -80,6 +80,7 @@ + #define SC_TABLE_ZOOM_TYPE 11 + #define SC_TABLE_ZOOM_VALUE 12 + #define SC_TABLE_PAGE_VIEW_ZOOM_VALUE 13 ++#define SC_TABLE_TAB_BG_COLOR 14 + + #define SC_CURSORPOSITIONX "CursorPositionX" + #define SC_CURSORPOSITIONY "CursorPositionY" +diff --git sc/inc/globstr.hrc sc/inc/globstr.hrc +index 1db4648..5c0f48e 100644 +--- sc/inc/globstr.hrc ++++ sc/inc/globstr.hrc +@@ -573,7 +573,10 @@ + #define STR_STYLE_FAMILY_CELL 433 + #define STR_STYLE_FAMILY_PAGE 434 + +-#define STR_COUNT 435 ++#define STR_UNDO_SET_TAB_BG_COLOR 435 ++#define STR_UNDO_SET_MULTI_TAB_BG_COLOR 436 ++ ++#define STR_COUNT 437 + + #endif + +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index c9bd929..76f0343 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -833,8 +833,10 @@ + #define FID_TAB_INDEX (TAB_POPUP_START+6) + #define FID_TAB_RTL (TAB_POPUP_START+7) + #define FID_TAB_DESELECTALL (TAB_POPUP_START+8) ++#define FID_TAB_MENU_SET_TAB_BG_COLOR (TAB_POPUP_START + 9) ++#define FID_TAB_SET_TAB_BG_COLOR (TAB_POPUP_START + 10) + +-#define TAB_POPUP_END (DATA_MENU_END + 20) ++#define TAB_POPUP_END (TAB_POPUP_START + 20) + + #define OBJBAR_FORMAT_START (TAB_POPUP_END) + #define SID_ALIGNLEFT (OBJBAR_FORMAT_START+6) +@@ -1430,7 +1432,10 @@ + + #define RID_SCSTR_ONCLICK (STR_START + 402) + +-#define STR_END RID_SCSTR_ONCLICK ++#define SCSTR_SET_TAB_BG_COLOR (STR_START + 403) ++#define SCSTR_NO_TAB_BG_COLOR (STR_START + 404) ++ ++#define STR_END (SCSTR_NO_TAB_BG_COLOR) + + #define BMP_START (STR_END) + +@@ -1639,8 +1644,9 @@ + #define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) + #define RID_POPUP_FILTER (SC_DIALOGS_START + 152) + #define RID_SCDLG_TEXT_IMPORT_OPTIONS (SC_DIALOGS_START + 153) ++#define RID_SCDLG_TAB_BG_COLOR (SC_DIALOGS_START + 154) + +-#define SC_DIALOGS_END (SC_DIALOGS_START + 154) ++#define SC_DIALOGS_END (SC_DIALOGS_START + 155) + + #ifndef STD_MASKCOLOR + #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } +diff --git sc/inc/scabstdlg.hxx sc/inc/scabstdlg.hxx +index 1de5302..81f190b 100644 +--- sc/inc/scabstdlg.hxx ++++ sc/inc/scabstdlg.hxx +@@ -285,6 +285,12 @@ public: + virtual void GetInputString( String& rString ) const = 0; + }; + ++class AbstractScTabBgColorDlg : public VclAbstractDialog //add for ScTabBgColorDlg ++{ ++public: ++ virtual void GetSelectedColor( Color& rColor ) const = 0; ++}; ++ + class AbstractScImportOptionsDlg : public VclAbstractDialog //add for ScImportOptionsDlg + { + public: +@@ -434,6 +440,14 @@ public: + const String& rDefault, + ULONG nHelpId , + int nId ) = 0; ++ ++ virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg ( Window* pParent, //add for ScTabBgColorDlg ++ const String& rTitle, //Dialog Title ++ const String& rTabBgColorNoColorText, //Label for no tab color ++ const Color& rDefaultColor, //Currently selected Color ++ ULONG nHelpId , ++ int nId ) = 0; ++ + virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent, //add for ScImportOptionsDlg + int nId, + BOOL bAscii = TRUE, +diff --git sc/inc/scextopt.hxx sc/inc/scextopt.hxx +index d9e654e..0e3866e 100644 +--- sc/inc/scextopt.hxx ++++ sc/inc/scextopt.hxx +@@ -80,6 +80,8 @@ struct ScExtTabSettings + bool mbSelected; /// true = Sheet is selected. + bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits. + bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode. ++ Color maTabBgColor; /// Tab Bg Color ++ bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; + + explicit ScExtTabSettings(); + }; +diff --git sc/inc/tabbgcolor.hxx sc/inc/tabbgcolor.hxx +new file mode 100644 +index 0000000..83b694a +--- /dev/null ++++ sc/inc/tabbgcolor.hxx +@@ -0,0 +1,46 @@ ++/************************************************************************* ++ * ++ * 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: tabbgcolor.hxx,v $ ++ * $Revision: 1.00 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++#ifndef SC_TABBGCOLOR_HXX ++#define SC_TABBGCOLOR_HXX ++ ++#include ++#include ++ ++struct ScUndoSetTabBgColorInfo ++{ ++public: ++ SCTAB nTabId; ++ Color aOldTabBgColor; ++ Color aNewTabBgColor; ++ BOOL IsDefaultOldTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;}; ++ BOOL IsDefaultNewTabBgColor() const {return aOldTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;}; ++}; ++DECLARE_LIST( ScUndoSetTabBgColorInfoList, ScUndoSetTabBgColorInfo* ) ++#endif +diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx +index faa463f..589fa37 100644 +--- sc/inc/unonames.hxx ++++ sc/inc/unonames.hxx +@@ -529,6 +529,8 @@ + #define SC_UNO_ZOOMTYPE "ZoomType" + #define SC_UNO_ZOOMVALUE "ZoomValue" + #define SC_UNO_UPDTEMPL "UpdateFromTemplate" ++#define SC_UNO_TABCOLOR "TabColor" ++ + /*Stampit enable/disable print cancel */ + #define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel" + +diff --git sc/sdi/docsh.sdi sc/sdi/docsh.sdi +index 67803b5..4a773ab 100644 +--- sc/sdi/docsh.sdi ++++ sc/sdi/docsh.sdi +@@ -63,6 +63,7 @@ interface TableSelection + FID_DELETE_TABLE [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + FID_TAB_RENAME [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + FID_TAB_RTL [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] ++ FID_TAB_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + + SID_TABLE_ACTIVATE [ ExecMethod = Execute; ] + } +diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi +index 9a1678d..2d0e476 100644 +--- sc/sdi/scalc.sdi ++++ sc/sdi/scalc.sdi +@@ -7824,3 +7824,56 @@ SfxVoidItem ShareDocument SID_SHARE_DOC + ToolBoxConfig = FALSE, + GroupId = GID_OPTIONS; + ] ++ ++//-------------------------------------------------------------------------- ++SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR ++ ++[ ++ // flags: ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = TRUE, ++ ReadOnlyDoc = TRUE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ Readonly = FALSE, ++ ++ // config: ++ AccelConfig = TRUE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = FALSE, ++ GroupId = GID_FORMAT; ++] ++ ++//-------------------------------------------------------------------------- ++SfxVoidItem SetTabBgColor FID_TAB_MENU_SET_TAB_BG_COLOR ++(SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR) ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = TRUE, ++ ReadOnlyDoc = TRUE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = TRUE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = FALSE, ++ GroupId = GID_FORMAT; ++] ++ +diff --git sc/sdi/tabvwsh.sdi sc/sdi/tabvwsh.sdi +index 624cb09..44855a2 100644 +--- sc/sdi/tabvwsh.sdi ++++ sc/sdi/tabvwsh.sdi +@@ -61,6 +61,7 @@ interface Tables + FID_TABLE_HIDE [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + FID_TABLE_SHOW [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + SID_SELECT_TABLES [ ExecMethod = Execute; StateMethod = GetState; ] ++ FID_TAB_MENU_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + } + + // =========================================================================== +diff --git sc/source/filter/excel/read.cxx sc/source/filter/excel/read.cxx +index a93f993..e8c2d89 100644 +--- sc/source/filter/excel/read.cxx ++++ sc/source/filter/excel/read.cxx +@@ -1152,6 +1152,9 @@ FltError ImportExcel8::Read( void ) + case EXC_ID_SXVDEX: rPTableMgr.ReadSxvdex( maStrm ); break; + case EXC_ID_SXEX: rPTableMgr.ReadSxex( maStrm ); break; + case EXC_ID_SXVIEWEX9: rPTableMgr.ReadSxViewEx9( maStrm ); break; ++ ++ // 0x0862 (SHEETEXT) ++ case EXC_ID_SHEETEXT: rTabViewSett.ReadTabBgColor( maStrm, rPal ); break; + } + } + break; +diff --git sc/source/filter/excel/xestyle.cxx sc/source/filter/excel/xestyle.cxx +index d93eec3..de32a64 100644 +--- sc/source/filter/excel/xestyle.cxx ++++ sc/source/filter/excel/xestyle.cxx +@@ -77,6 +77,7 @@ sal_uInt32 lclGetWeighting( XclExpColorType eType ) + case EXC_COLOR_CELLTEXT: + case EXC_COLOR_CHARTTEXT: + case EXC_COLOR_CTRLTEXT: return 10; ++ case EXC_COLOR_TABBG: + case EXC_COLOR_CELLAREA: return 20; + case EXC_COLOR_GRID: return 50; + default: DBG_ERRORFILE( "lclGetWeighting - unknown color type" ); +diff --git sc/source/filter/excel/xeview.cxx sc/source/filter/excel/xeview.cxx +index da4af8c..81c5b9a 100644 +--- sc/source/filter/excel/xeview.cxx ++++ sc/source/filter/excel/xeview.cxx +@@ -259,6 +259,35 @@ void XclExpSelection::WriteBody( XclExpStream& rStrm ) + maSelData.maXclSelection.Write( rStrm, false ); + } + ++// ---------------------------------------------------------------------------- ++ ++XclExpTabBgColor::XclExpTabBgColor( const XclTabViewData& rTabViewData ) : ++ XclExpRecord( EXC_ID_SHEETEXT, 18 ), ++ mrTabViewData( rTabViewData ) ++{ ++} ++//TODO Fix savexml... ++/*void XclExpTabBgColor::SaveXml( XclExpXmlStream& rStrm ) ++{ ++}*/ ++ ++void XclExpTabBgColor::WriteBody( XclExpStream& rStrm ) ++{ ++ if ( mrTabViewData.IsDefaultTabBgColor() ) ++ return; ++ sal_uInt16 rt = 0x0862; //rt ++ sal_uInt16 grbitFrt = 0x0000; //grbit must be set to 0 ++ sal_uInt32 unused = 0x00000000; //Use twice... ++ sal_uInt32 cb = 0x00000014; // Record Size, may be larger in future... ++ sal_uInt16 reserved = 0x0000; //trailing bits are 0 ++ sal_uInt16 TabBgColorIndex; ++ XclExpPalette& rPal = rStrm.GetRoot().GetPalette(); ++ TabBgColorIndex = rPal.GetColorIndex(mrTabViewData.mnTabBgColorId); ++ if (TabBgColorIndex < 8 || TabBgColorIndex > 63 ) // only numbers 8 - 63 are valid numbers ++ TabBgColorIndex = 127; //Excel specs: 127 makes excel ignore tab color information. ++ rStrm << rt << grbitFrt << unused << unused << cb << TabBgColorIndex << reserved; ++} ++ + // Sheet view settings ======================================================== + + namespace { +@@ -368,6 +397,14 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc + maData.mnNormalZoom = lclGetXclZoom( rTabSett.mnNormalZoom, EXC_WIN2_NORMALZOOM_DEF ); + maData.mnPageZoom = lclGetXclZoom( rTabSett.mnPageZoom, EXC_WIN2_PAGEZOOM_DEF ); + maData.mnCurrentZoom = maData.mbPageMode ? maData.mnPageZoom : maData.mnNormalZoom; ++ ++ // Tab Bg Color ++ if ( GetBiff() == EXC_BIFF8 && !rTabSett.IsDefaultTabBgColor() ) ++ { ++ XclExpPalette& rPal = GetPalette(); ++ maData.maTabBgColor = rTabSett.maTabBgColor; ++ maData.mnTabBgColorId = rPal.InsertColor(maData.maTabBgColor, EXC_COLOR_TABBG, EXC_COLOR_NOTABBG ); ++ } + } + } + +@@ -380,6 +417,7 @@ void XclExpTabViewSettings::Save( XclExpStream& rStrm ) + WriteSelection( rStrm, EXC_PANE_TOPRIGHT ); + WriteSelection( rStrm, EXC_PANE_BOTTOMLEFT ); + WriteSelection( rStrm, EXC_PANE_BOTTOMRIGHT ); ++ WriteTabBgColor( rStrm ); + } + + static void lcl_WriteSelection( XclExpXmlStream& rStrm, const XclTabViewData& rData, sal_uInt8 nPane ) +@@ -494,5 +532,10 @@ void XclExpTabViewSettings::WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane + XclExpSelection( maData, nPane ).Save( rStrm ); + } + ++void XclExpTabViewSettings::WriteTabBgColor( XclExpStream& rStrm ) const ++{ ++ if ( !maData.IsDefaultTabBgColor() ) ++ XclExpTabBgColor( maData ).Save( rStrm ); ++} + // ============================================================================ + +diff --git sc/source/filter/excel/xichart.cxx sc/source/filter/excel/xichart.cxx +index 69ead7f..41ec801 100644 +--- sc/source/filter/excel/xichart.cxx ++++ sc/source/filter/excel/xichart.cxx +@@ -3765,6 +3765,12 @@ void XclImpChart::ReadChartSubStream( XclImpStream& rStrm ) + + case EXC_ID_WINDOW2: rTabViewSett.ReadWindow2( rStrm, true );break; + case EXC_ID_SCL: rTabViewSett.ReadScl( rStrm ); break; ++ case EXC_ID_SHEETEXT: //0x0862 ++ { ++ XclImpPalette& rPal = GetPalette(); ++ rTabViewSett.ReadTabBgColor( rStrm, rPal); ++ } ++ break; + } + + switch( rStrm.GetRecId() ) +diff --git sc/source/filter/excel/xiview.cxx sc/source/filter/excel/xiview.cxx +index a871bdd..fbd72d0 100644 +--- sc/source/filter/excel/xiview.cxx ++++ sc/source/filter/excel/xiview.cxx +@@ -109,6 +109,24 @@ void XclImpTabViewSettings::Initialize() + maData.SetDefaults(); + } + ++void XclImpTabViewSettings::ReadTabBgColor( XclImpStream& rStrm, XclImpPalette& rPal ) ++{ ++ DBG_ASSERT_BIFF( GetBiff() >= EXC_BIFF8 ); ++ if( GetBiff() < EXC_BIFF8 ) ++ return; ++ ++ sal_uInt8 ColorIndex; ++ Color TabBgColor; ++ ++ rStrm.Ignore( 16 ); ++ ColorIndex = rStrm.ReaduInt8() & EXC_SHEETEXT_TABCOLOR; //0x7F ++ if ( ColorIndex >= 8 && ColorIndex <= 63 ) //only accept valid index values ++ { ++ TabBgColor = rPal.GetColor( ColorIndex ); ++ maData.maTabBgColor = TabBgColor; ++ } ++} ++ + void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart ) + { + if( GetBiff() == EXC_BIFF2 ) +@@ -279,6 +297,10 @@ void XclImpTabViewSettings::Finalize() + aViewOpt.SetOption( VOPT_OUTLINER, maData.mbShowOutline ); + rDoc.SetViewOptions( aViewOpt ); + } ++ ++ // *** set tab bg color ++ if ( !maData.IsDefaultTabBgColor() ) ++ rTabSett.maTabBgColor = maData.maTabBgColor; + } + + // ============================================================================ +diff --git sc/source/filter/excel/xlview.cxx sc/source/filter/excel/xlview.cxx +index 080075b..8580d7a 100644 +--- sc/source/filter/excel/xlview.cxx ++++ sc/source/filter/excel/xlview.cxx +@@ -79,6 +79,7 @@ void XclTabViewData::SetDefaults() + mbDefGridColor = true; + mbShowFormulas = false; + mbShowGrid = mbShowHeadings = mbShowZeros = mbShowOutline = true; ++ maTabBgColor.SetColor( COL_AUTO ); + } + + bool XclTabViewData::IsSplit() const +diff --git sc/source/filter/inc/xestyle.hxx sc/source/filter/inc/xestyle.hxx +index 8485bb1..9508c8b 100644 +--- sc/source/filter/inc/xestyle.hxx ++++ sc/source/filter/inc/xestyle.hxx +@@ -61,7 +61,8 @@ enum XclExpColorType + EXC_COLOR_CHARTLINE, /// Line in a chart. + EXC_COLOR_CHARTAREA, /// Area in a chart. + EXC_COLOR_CTRLTEXT, /// Text color in a form control. +- EXC_COLOR_GRID /// Spreadsheet grid color. ++ EXC_COLOR_GRID, /// Spreadsheet grid color. ++ EXC_COLOR_TABBG /// Spreadsheet tab bg color. + }; + + // ---------------------------------------------------------------------------- +diff --git sc/source/filter/inc/xeview.hxx sc/source/filter/inc/xeview.hxx +index 4d8b10d..5c54ecd 100644 +--- sc/source/filter/inc/xeview.hxx ++++ sc/source/filter/inc/xeview.hxx +@@ -134,6 +134,20 @@ private: + sal_uInt8 mnPane; /// Pane identifier of this selection. + }; + ++class XclExpTabBgColor : public XclExpRecord ++{ ++public: ++ explicit XclExpTabBgColor( const XclTabViewData& rTabViewData ); ++ ++ /* virtual void SaveXml( XclExpXmlStream& rStrm ); TODO Fix XML Saving Stream */ ++private: ++ /** Writes the contents of the SHEETEXT record. */ ++ virtual void WriteBody( XclExpStream& rStrm ); ++ ++private: ++ const XclTabViewData& mrTabViewData; /// view settings data of current sheet. ++}; ++ + // View settings ============================================================== + + /** Contains all view settings records for a single sheet. */ +@@ -156,6 +170,7 @@ private: + void WriteScl( XclExpStream& rStrm ) const; + void WritePane( XclExpStream& rStrm ) const; + void WriteSelection( XclExpStream& rStrm, sal_uInt8 nPane ) const; ++ void WriteTabBgColor( XclExpStream& rStrm ) const; + + private: + XclTabViewData maData; /// All view settings for a sheet. +diff --git sc/source/filter/inc/xiview.hxx sc/source/filter/inc/xiview.hxx +index f0b393e..a54c67b 100644 +--- sc/source/filter/inc/xiview.hxx ++++ sc/source/filter/inc/xiview.hxx +@@ -83,7 +83,8 @@ public: + void ReadPane( XclImpStream& rStrm ); + /** Reads a SELECTION record. */ + void ReadSelection( XclImpStream& rStrm ); +- ++ /** Reads a SHEETEXT record (Tab Color). */ ++ void ReadTabBgColor( XclImpStream& rStrm, XclImpPalette& rPal ); + /** Sets the view settings at the current sheet or the extended sheet options object. */ + void Finalize(); + +diff --git sc/source/filter/inc/xlview.hxx sc/source/filter/inc/xlview.hxx +index 4a3798e..3070c28 100644 +--- sc/source/filter/inc/xlview.hxx ++++ sc/source/filter/inc/xlview.hxx +@@ -89,6 +89,11 @@ const sal_uInt8 EXC_PANE_TOPLEFT = 3; /// Single, top, left, o + + const sal_uInt16 EXC_ID_SCL = 0x00A0; + ++// (0x0862) SHEETEXT ---------------------------------------------------------- ++ ++const sal_uInt16 EXC_ID_SHEETEXT = 0x0862; /// header id for sheetext ++const sal_uInt8 EXC_SHEETEXT_TABCOLOR = 0x7F; /// mask for tab color ++const sal_uInt16 EXC_COLOR_NOTABBG = 0x7F; /// Excel ignores Tab color when set to this value... + // Structs ==================================================================== + + /** Contains all view settings for the entire document. */ +@@ -149,6 +154,9 @@ struct XclTabViewData + bool mbShowHeadings; /// true = Show column/row headings. + bool mbShowZeros; /// true = Show zero value zells. + bool mbShowOutline; /// true = Show outlines. ++ Color maTabBgColor; /// Tab Color default = (COL_AUTO ) ++ bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; ++ sal_uInt32 mnTabBgColorId; /// pallette color id + + explicit XclTabViewData(); + ~XclTabViewData(); +diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx +index 7cf83db..c896365 100644 +--- sc/source/ui/attrdlg/scdlgfact.cxx ++++ sc/source/ui/attrdlg/scdlgfact.cxx +@@ -65,6 +65,7 @@ + #include "scendlg.hxx" //add for ScNewScenarioDlg + #include "shtabdlg.hxx" //add for ScShowTabDlg + #include "strindlg.hxx" //add for ScStringInputDlg ++#include "tabbgcolordlg.hxx"//add for ScTabBgColorDlg + #include "scuiimoptdlg.hxx" //add for ScImportOptionsDlg + #include "attrdlg.hxx" //add for ScAttrDlg + #include "hfedtdlg.hxx" //add for ScHFEditDlg +@@ -115,6 +116,7 @@ IMPL_ABSTDLG_BASE(AbstractScDPShowDetailDlg_Impl); //add for ScDPShowDetailDlg + IMPL_ABSTDLG_BASE(AbstractScNewScenarioDlg_Impl); //add for ScNewScenarioDlg + IMPL_ABSTDLG_BASE(AbstractScShowTabDlg_Impl); //add for ScShowTabDlg + IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); //add for ScStringInputDlg ++IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); //add for ScTabBgColorDlg + IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); //add for ScImportOptionsDlg + IMPL_ABSTDLG_BASE(AbstractScTextImportOptionsDlg_Impl); + IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg +@@ -616,6 +618,14 @@ void AbstractScStringInputDlg_Impl::GetInputString( String& rString ) const //a + } + //add for AbstractScStringInputDlg_Impl end + ++//add for AbstractScTabBgColorDlg_Impl begin ++void AbstractScTabBgColorDlg_Impl::GetSelectedColor( Color& rColor ) const //add for ScTabBgColorDlg ++{ ++ pDlg->GetSelectedColor( rColor ); ++} ++//add for AbstractScTabBgColorDlg_Impl end ++ ++ + //add for AbstractScImportOptionsDlg_Impl begin + void AbstractScImportOptionsDlg_Impl::GetImportOptions( ScImportOptions& rOptions ) const //add for ScImportOptionsDlg + { +@@ -1291,6 +1301,31 @@ AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg ( Window + } + //add for ScStringInputDlg end + ++//add for ScTabBgColorDlg begin ++AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg ( ++ Window* pParent, ++ const String& rTitle, ++ const String& rTabBgColorNoColorText, ++ const Color& rDefaultColor, ++ ULONG nHelpId , ++ int nId ) ++{ ++ScTabBgColorDlg * pDlg=NULL; ++switch ( nId ) ++{ ++ case RID_SCDLG_TAB_BG_COLOR : ++ pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, nHelpId ); ++ break; ++ default: ++ break; ++} ++ ++if ( pDlg ) ++ return new AbstractScTabBgColorDlg_Impl( pDlg ); ++return 0; ++} ++//add for ScTabBgColorDlg end ++ + //add for ScImportOptionsDlg begin + AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window* pParent, + int nId, +diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx +index 6fef61d..059cc8e 100644 +--- sc/source/ui/attrdlg/scdlgfact.hxx ++++ sc/source/ui/attrdlg/scdlgfact.hxx +@@ -61,6 +61,7 @@ class ScDPShowDetailDlg; + class ScNewScenarioDlg; + class ScShowTabDlg; + class ScStringInputDlg; ++class ScTabBgColorDlg; + class ScImportOptionsDlg; + class SfxTabDialog; + class ScSortWarningDlg; +@@ -338,6 +339,12 @@ class AbstractScStringInputDlg_Impl : public AbstractScStringInputDlg //add fo + virtual void GetInputString( String& rString ) const; + }; + ++class AbstractScTabBgColorDlg_Impl : public AbstractScTabBgColorDlg //add for ScTabBgColorDlg ++{ ++ DECL_ABSTDLG_BASE( AbstractScTabBgColorDlg_Impl, ScTabBgColorDlg ) ++ virtual void GetSelectedColor( Color& rColor ) const; ++}; ++ + class AbstractScImportOptionsDlg_Impl : public AbstractScImportOptionsDlg //add for ScImportOptionsDlg + { + DECL_ABSTDLG_BASE( AbstractScImportOptionsDlg_Impl, ScImportOptionsDlg) +@@ -521,6 +528,14 @@ public: + const String& rDefault, + ULONG nHelpId , + int nId ); ++ ++ virtual AbstractScTabBgColorDlg * CreateScTabBgColorDlg ( Window* pParent, //add for ScStringInputDlg ++ const String& rTitle, //Dialog Title ++ const String& rTabBgColorNoColorText, //Label for no tab color ++ const Color& rDefaultColor, //Currently selected Color ++ ULONG nHelpId , ++ int nId ); ++ + virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent, //add for ScImportOptionsDlg + int nId, + BOOL bAscii = TRUE, +diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx +index 9b8b4f7..0467a11 100644 +--- sc/source/ui/docshell/docfunc.cxx ++++ sc/source/ui/docshell/docfunc.cxx +@@ -2855,6 +2855,104 @@ BOOL ScDocFunc::RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL + return bSuccess; + } + ++BOOL ScDocFunc::SetTabBgColor( SCTAB nTab, const Color& rColor, BOOL bRecord, BOOL bApi ) ++{ ++ ++ ScDocument* pDoc = rDocShell.GetDocument(); ++ if (bRecord && !pDoc->IsUndoEnabled()) ++ bRecord = FALSE; ++ if ( !pDoc->IsDocEditable() || pDoc->IsTabProtected(nTab) ) ++ { ++ if (!bApi) ++ rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Check to see what this string is... ++ return FALSE; ++ } ++ ++ ScViewData* pViewData = rDocShell.GetViewData(); ++ ++ Color aOldTabBgColor; ++ aOldTabBgColor = pViewData->GetTabBgColor(nTab); ++ ++ BOOL bSuccess = FALSE; ++ pViewData->SetTabBgColor(rColor, nTab); ++ if ( pViewData->GetTabBgColor( nTab ) == rColor) ++ bSuccess = TRUE; ++ if (bSuccess) ++ { ++ if (bRecord) ++ { ++ rDocShell.GetUndoManager()->AddUndoAction( ++ new ScUndoSetTabBgColor( &rDocShell, nTab, aOldTabBgColor, rColor)); ++ } ++ rDocShell.PostPaintExtras(); ++ ScDocShellModificator aModificator( rDocShell ); ++ aModificator.SetDocumentModified(); ++ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); ++ ++ bSuccess = TRUE; ++ } ++ return bSuccess; ++} ++ ++BOOL ScDocFunc::SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList, BOOL bRecord, BOOL bApi ) ++{ ++ ScDocument* pDoc = rDocShell.GetDocument(); ++ if (bRecord && !pDoc->IsUndoEnabled()) ++ bRecord = FALSE; ++ if ( !pDoc->IsDocEditable() ) ++ { ++ if (!bApi) ++ rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Get a better String Error... ++ return FALSE; ++ } ++ ++ ScViewData* pViewData = rDocShell.GetViewData(); ++ USHORT nTab; ++ Color aNewTabBgColor; ++ ScUndoSetTabBgColorInfo* rUndoSetTabBgColorInfo; ++ BOOL bSuccess = TRUE; ++ USHORT nTabProtectCount = 0; ++ for ( USHORT i=0; i < rUndoSetTabBgColorInfoList->Count(); i++ ) ++ { ++ rUndoSetTabBgColorInfo = rUndoSetTabBgColorInfoList->GetObject(i); ++ nTab = rUndoSetTabBgColorInfo->nTabId; ++ if ( !pDoc->IsTabProtected(nTab) ) ++ { ++ aNewTabBgColor = rUndoSetTabBgColorInfo->aNewTabBgColor; ++ rUndoSetTabBgColorInfo->aOldTabBgColor = pViewData->GetTabBgColor(nTab); ++ pViewData->SetTabBgColor(aNewTabBgColor, nTab); ++ if ( pViewData->GetTabBgColor( nTab ) != aNewTabBgColor) ++ { ++ bSuccess = FALSE; ++ break; ++ } ++ } ++ else ++ { ++ nTabProtectCount++; ++ } ++ } ++ if ( nTabProtectCount == rUndoSetTabBgColorInfoList->Count() ) ++ { ++ if (!bApi) ++ rDocShell.ErrorMessage(STR_PROTECTIONERR); //TODO Get a better String Error... ++ return FALSE; ++ } ++ if (bSuccess) ++ { ++ if (bRecord) ++ { ++ rDocShell.GetUndoManager()->AddUndoAction( ++ new ScUndoSetTabBgColor( &rDocShell, rUndoSetTabBgColorInfoList)); ++ } ++ rDocShell.PostPaintExtras(); ++ ScDocShellModificator aModificator( rDocShell ); ++ aModificator.SetDocumentModified(); ++ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); ++ } ++ return bSuccess; ++} ++ + //------------------------------------------------------------------------ + + //! SetWidthOrHeight - noch doppelt zu ViewFunc !!!!!! +diff --git sc/source/ui/inc/docfunc.hxx sc/source/ui/inc/docfunc.hxx +index b02cf98..49a242a 100644 +--- sc/source/ui/inc/docfunc.hxx ++++ sc/source/ui/inc/docfunc.hxx +@@ -34,6 +34,7 @@ + #include + #include "global.hxx" + #include "formula/grammar.hxx" ++#include "tabbgcolor.hxx" + + class ScEditEngineDefaulter; + class SdrUndoAction; +@@ -120,6 +121,10 @@ public: + BOOL RenameTable( SCTAB nTab, const String& rName, BOOL bRecord, BOOL bApi ); + BOOL DeleteTable( SCTAB nTab, BOOL bRecord, BOOL bApi ); + ++ BOOL SetTabBgColor( SCTAB nTab, const Color& rColor, BOOL bRecord, BOOL bApi ); ++ BOOL SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList, ++ BOOL bRecord, BOOL bApi ); ++ + BOOL SetTableVisible( SCTAB nTab, BOOL bVisible, BOOL bApi ); + + BOOL SetLayoutRTL( SCTAB nTab, BOOL bRTL, BOOL bApi ); +diff --git sc/source/ui/inc/miscdlgs.hrc sc/source/ui/inc/miscdlgs.hrc +index 154d310..97cd0ca 100644 +--- sc/source/ui/inc/miscdlgs.hrc ++++ sc/source/ui/inc/miscdlgs.hrc +@@ -184,3 +184,9 @@ + #define BTN_GROUP_ROWS 3 + #define STR_GROUP 1 + #define STR_UNGROUP 2 ++ ++// Tab Bg Color ++#define TAB_BG_COLOR_CT_BORDER 1 ++#define TAB_BG_COLOR_SET_BGDCOLOR 2 ++#define TAB_BG_COLOR_GB_BGDCOLOR 3 ++ +diff --git sc/source/ui/inc/tabbgcolordlg.hxx sc/source/ui/inc/tabbgcolordlg.hxx +new file mode 100644 +index 0000000..235a06e +--- /dev/null ++++ sc/source/ui/inc/tabbgcolordlg.hxx +@@ -0,0 +1,80 @@ ++/************************************************************************* ++ * ++ * 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: tabbgcolordlg.hxx,v $ ++ * $Revision: 1.0 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_TABBGCOLORDLG_HXX ++#define SC_TABBGCOLORDLG_HXX ++ ++#include ++#include ++#include ++#include ++ ++//------------------------------------------------------------------------ ++ ++class ScTabBgColorDlg : public ModalDialog ++{ ++public: ++ ScTabBgColorDlg( Window* pParent, ++ const String& rTitle, ++ const String& rTabBgColorNoColorText, ++ const Color& rDefaultColor, ++ ULONG nHelpId ); ++ ~ScTabBgColorDlg(); ++ ++ void GetSelectedColor( Color& rColor ) const; ++ //void SelectColor( const Color& rColor2 ) const; ++private: ++ class ScTabBgColorValueSet : public ValueSet ++ { ++ ++ public: ++ ScTabBgColorValueSet(Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg); ++ ++ virtual void KeyInput( const KeyEvent& rKEvt ); ++ private: ++ ScTabBgColorDlg* aTabBgColorDlg; ++ }; ++ Control aBorderWin; ++ ScTabBgColorValueSet aTabBgColorSet; ++ FixedLine aTabBgColorBox; ++ OKButton aBtnOk; ++ CancelButton aBtnCancel; ++ HelpButton aBtnHelp; ++ Color aTabBgColor; ++ const String aTabBgColorNoColorText; ++ ULONG aHelpId; ++ ++ void FillColorValueSets_Impl(); ++ ++ DECL_LINK( TabBgColorDblClickHdl_Impl, ValueSet* ); ++ DECL_LINK( TabBgColorOKHdl_Impl, OKButton* pBtn ); ++}; ++ ++#endif // SC_TABBGCOLORDLG_HXX +diff --git sc/source/ui/inc/undotab.hxx sc/source/ui/inc/undotab.hxx +index 7f18fdb..a0e954b 100644 +--- sc/source/ui/inc/undotab.hxx ++++ sc/source/ui/inc/undotab.hxx +@@ -35,6 +35,7 @@ + #include "markdata.hxx" + #include "formula/grammar.hxx" + #include ++#include "tabbgcolor.hxx" + + #ifndef _SVSTDARR_SHORTS + +@@ -226,6 +227,37 @@ private: + void DoChange() const; + }; + ++class ScUndoSetTabBgColor: public ScSimpleUndo ++{ ++public: ++ TYPEINFO(); ++ ScUndoSetTabBgColor( ++ ScDocShell* pNewDocShell, ++ SCTAB nT, ++ const Color& aOTabBgColor, ++ const Color& aNTabBgColor); ++ ScUndoSetTabBgColor( ++ ScDocShell* pNewDocShell, ++ ScUndoSetTabBgColorInfoList* pUndoSetTabBgColorInfoList); ++ virtual ~ScUndoSetTabBgColor(); ++ ++ virtual void Undo(); ++ virtual void Redo(); ++ virtual void Repeat(SfxRepeatTarget& rTarget); ++ virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const; ++ ++virtual String GetComment() const; ++ ++private: ++ SCTAB nTab; ++ Color aOldTabBgColor; ++ Color aNewTabBgColor; ++ ScUndoSetTabBgColorInfoList* aUndoSetTabBgColorInfoList; ++ BOOL bIsMultipleUndo; ++ ++ void DoChange( SCTAB nTab, const Color& rTabBgColor ) const; ++ void DoChange( BOOL bUndoType ) const; ++}; + + class ScUndoMakeScenario: public ScSimpleUndo + { +diff --git sc/source/ui/inc/viewdata.hxx sc/source/ui/inc/viewdata.hxx +index 024eac3..72fa6e5 100644 +--- sc/source/ui/inc/viewdata.hxx ++++ sc/source/ui/inc/viewdata.hxx +@@ -144,6 +144,9 @@ private: + + BOOL bOldCurValid; // "virtuelle" Cursorpos. bei zusammengefassten + ++ Color aTabBgColor; ++ BOOL IsDefaultTabBgColor() const {return aTabBgColor == Color( COL_AUTO ) ? TRUE : FALSE ;}; ++ + ScViewDataTable(); + ~ScViewDataTable(); + +@@ -276,6 +279,10 @@ public: + void CopyTab( SCTAB nSrcTab, SCTAB nDestTab ); + void MoveTab( SCTAB nSrcTab, SCTAB nDestTab ); + ++ void SetTabBgColor( Color rTabBgColor, SCTAB nTab ); ++ BOOL IsDefaultTabBgColor( SCTAB nTab ) const; ++ Color GetTabBgColor( SCTAB nTab ) const; ++ + SCTAB GetRefTabNo() const { return nRefTabNo; } + void SetRefTabNo( SCTAB nNewTab ) { nRefTabNo = nNewTab; } + +diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx +index 3d703da..8e41aea 100644 +--- sc/source/ui/inc/viewfunc.hxx ++++ sc/source/ui/inc/viewfunc.hxx +@@ -32,6 +32,8 @@ + + #include "tabview.hxx" + ++#include "tabbgcolor.hxx" ++ + #ifndef _SVSTDARR_SHORTS + #define _SVSTDARR_SHORTS + #include +@@ -276,6 +278,9 @@ public: + SCTAB nCount, const SCTAB* pSrcTabs, + BOOL bLink,SCTAB nTab); + ++ BOOL SetTabBgColor( const Color& rColor, SCTAB nTabNr ); ++ BOOL SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList ); ++ + void InsertTableLink( const String& rFile, + const String& rFilter, const String& rOptions, + const String& rTabName ); +diff --git sc/source/ui/miscdlgs/makefile.mk sc/source/ui/miscdlgs/makefile.mk +index 66e1f33..a1ad212 100644 +--- sc/source/ui/miscdlgs/makefile.mk ++++ sc/source/ui/miscdlgs/makefile.mk +@@ -50,6 +50,7 @@ SLOFILES = \ + $(SLO)$/delcodlg.obj \ + $(SLO)$/inscodlg.obj \ + $(SLO)$/strindlg.obj \ ++ $(SLO)$/tabbgcolordlg.obj \ + $(SLO)$/mtrindlg.obj \ + $(SLO)$/lbseldlg.obj \ + $(SLO)$/filldlg.obj \ +diff --git sc/source/ui/miscdlgs/tabbgcolordlg.cxx sc/source/ui/miscdlgs/tabbgcolordlg.cxx +new file mode 100644 +index 0000000..8e9987e +--- /dev/null ++++ sc/source/ui/miscdlgs/tabbgcolordlg.cxx +@@ -0,0 +1,197 @@ ++/************************************************************************* ++ * ++ * 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: tabbgcolordlg.cxx,v $ ++ * $Revision: 1.0 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++#undef SC_DLLIMPLEMENTATION ++ ++//------------------------------------------------------------------ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "tabbgcolordlg.hxx" ++#include "scresid.hxx" ++#include "miscdlgs.hrc" ++#include ++ ++//================================================================== ++ ++#define HDL(hdl) LINK(this,ScTabBgColorDlg,hdl) ++ ++__EXPORT ScTabBgColorDlg::ScTabBgColorDlg( Window* pParent, ++ const String& rTitle, ++ const String& rTabBgColorNoColorText, ++ const Color& rDefaultColor, ++ ULONG nHelpId ) : ++ ModalDialog ( pParent, ScResId( RID_SCDLG_TAB_BG_COLOR ) ), ++ aBorderWin ( this, ScResId( TAB_BG_COLOR_CT_BORDER ) ), ++ aTabBgColorSet ( &aBorderWin, ScResId( TAB_BG_COLOR_SET_BGDCOLOR ), this ), ++ aTabBgColorBox ( this, ScResId( TAB_BG_COLOR_GB_BGDCOLOR ) ), ++ aBtnOk ( this, ScResId( BTN_OK ) ), ++ aBtnCancel ( this, ScResId( BTN_CANCEL ) ), ++ aBtnHelp ( this, ScResId( BTN_HELP ) ), ++ aTabBgColorNoColorText ( rTabBgColorNoColorText ), ++ aTabBgColor ( rDefaultColor ), ++ aHelpId ( nHelpId ) ++ ++{ ++ SetHelpId( nHelpId ); ++ this->SetText( rTitle ); ++ this->SetStyle(GetStyle() | WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK | WB_DIALOGCONTROL | WB_SYSTEMWINDOW | WB_STANDALONE | WB_HIDE); ++ //TODO: Assign Help ID's to all controls... ++ aTabBgColorBox.SetText(rTitle); ++ FillColorValueSets_Impl(); ++ aTabBgColorSet.SetDoubleClickHdl( HDL(TabBgColorDblClickHdl_Impl) ); ++ aBtnOk.SetClickHdl( HDL(TabBgColorOKHdl_Impl) ); ++ FreeResource(); ++} ++ ++//------------------------------------------------------------------------ ++ ++void ScTabBgColorDlg::GetSelectedColor( Color& rColor ) const ++{ ++ rColor = this->aTabBgColor; ++} ++ ++__EXPORT ScTabBgColorDlg::~ScTabBgColorDlg() ++{ ++} ++ ++void ScTabBgColorDlg::FillColorValueSets_Impl() ++{ ++ SfxObjectShell* pDocSh = SfxObjectShell::Current(); ++ const SfxPoolItem* pItem = NULL; ++ XColorTable* pColorTable = NULL; ++ const Size aSize15x15 = Size( 15, 15 ); ++ const Size aSize10x10 = Size( 10, 10 ); ++ const Size aSize5x5 = Size( 5, 5 ); ++ USHORT nSelectedItem = 0; ++ FASTBOOL bOwn = FALSE; ++ ++ DBG_ASSERT( pDocSh, "DocShell not found!" ); ++ ++ if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) ) ++ pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); ++ if ( !pColorTable ) ++ { ++ bOwn = TRUE; ++ pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() ); ++ } ++ if ( pColorTable ) ++ { ++ short i = 0; ++ long nCount = pColorTable->Count(); ++ XColorEntry* pEntry = NULL; ++ Color aColWhite( COL_WHITE ); ++ String aStrWhite( ScResId( RID_SVXITEMS_COLOR_WHITE ) ); ++ WinBits nBits = ( aTabBgColorSet.GetStyle() | WB_NAMEFIELD | WB_ITEMBORDER | WB_NONEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_NOPOINTERFOCUS); ++ aTabBgColorSet.SetText( aTabBgColorNoColorText ); ++ aTabBgColorSet.SetStyle( nBits ); ++ for ( i = 0; i < nCount; i++ ) ++ { ++ pEntry = pColorTable->GetColor(i); ++ aTabBgColorSet.InsertItem( i + 1, pEntry->GetColor(), pEntry->GetName() ); ++ if (pEntry->GetColor() == aTabBgColor) ++ nSelectedItem = (i + 1); ++ } ++ ++ while ( i < 80 ) ++ { ++ aTabBgColorSet.InsertItem( i + 1, aColWhite, aStrWhite ); ++ i++; ++ } ++ ++ if ( nCount > 80 ) ++ { ++ aTabBgColorSet.SetStyle( nBits | WB_VSCROLL ); ++ } ++ } ++ aTabBgColorSet.SetColCount( 10 ); ++ aTabBgColorSet.SetLineCount( 10 ); ++ aTabBgColorSet.CalcWindowSizePixel( aSize15x15 ); ++ aTabBgColorSet.Format(); ++ aTabBgColorSet.SelectItem(nSelectedItem); ++ aTabBgColorSet.Resize(); ++ if ( bOwn ) ++ delete pColorTable; ++} ++ ++IMPL_LINK( ScTabBgColorDlg, TabBgColorDblClickHdl_Impl, ValueSet*, EMPTYARG ) ++/* ++ Handler, called when color selection is changed ++*/ ++{ ++ USHORT nItemId = aTabBgColorSet.GetSelectItemId(); ++ Color aColor = nItemId ? ( aTabBgColorSet.GetItemColor( nItemId ) ) : Color( COL_AUTO ); ++ aTabBgColor = aColor; ++ EndDialog( TRUE ); ++ return 0; ++} ++ ++IMPL_LINK( ScTabBgColorDlg, TabBgColorOKHdl_Impl, OKButton*, EMPTYARG ) ++{ ++ ++// Handler, called when the OK button is pushed ++ ++ USHORT nItemId = aTabBgColorSet.GetSelectItemId(); ++ Color aColor = nItemId ? ( aTabBgColorSet.GetItemColor( nItemId ) ) : Color( COL_AUTO ); ++ aTabBgColor = aColor; ++ EndDialog( TRUE ); ++ return 0; ++} ++ ++__EXPORT ScTabBgColorDlg::ScTabBgColorValueSet::ScTabBgColorValueSet( Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg ) : ++ ValueSet(pParent, rResId) ++{ ++ aTabBgColorDlg = pTabBgColorDlg; ++} ++ ++void ScTabBgColorDlg::ScTabBgColorValueSet::KeyInput( const KeyEvent& rKEvt ) ++{ ++ switch ( rKEvt.GetKeyCode().GetCode() ) ++ { ++ case KEY_SPACE: ++ case KEY_RETURN: ++ { ++ USHORT nItemId = GetSelectItemId(); ++ const Color& aColor = nItemId ? ( GetItemColor( nItemId ) ) : Color( COL_AUTO ); ++ aTabBgColorDlg->aTabBgColor = aColor; ++ aTabBgColorDlg->EndDialog(TRUE); ++ } ++ break; ++ } ++ ValueSet::KeyInput(rKEvt); ++} +diff --git sc/source/ui/src/globstr.src sc/source/ui/src/globstr.src +index c5b8cfd..2ae00ca 100644 +--- sc/source/ui/src/globstr.src ++++ sc/source/ui/src/globstr.src +@@ -1130,6 +1130,14 @@ Resource RID_GLOBSTR + { + Text [ en-US ] = "Rename Sheet" ; + }; ++ String STR_UNDO_SET_TAB_BG_COLOR ++ { ++ Text [ en-US ] = "Color Tab" ; ++ }; ++ String STR_UNDO_SET_MULTI_TAB_BG_COLOR ++ { ++ Text [ en-US ] = "Color Tabs" ; ++ }; + String STR_UNDO_MOVE_TAB + { + Text [ en-US ] = "Move Sheets" ; +diff --git sc/source/ui/src/miscdlgs.src sc/source/ui/src/miscdlgs.src +index da8cb03..ef2a8ac 100644 +--- sc/source/ui/src/miscdlgs.src ++++ sc/source/ui/src/miscdlgs.src +@@ -546,6 +546,96 @@ ModalDialog RID_SCDLG_STRINPUT + Size = MAP_APPFONT ( 110 , 8 ) ; + }; + }; ++ModalDialog RID_SCDLG_TAB_BG_COLOR ++{ ++ OutputSize = TRUE ; ++ SVLook = TRUE ; ++ Size = MAP_APPFONT ( 118 , 167 ) ; ++ Moveable = TRUE ; ++ Closeable = TRUE ; ++ Control TAB_BG_COLOR_CT_BORDER ++ { ++ Border = TRUE ; ++ Pos = MAP_APPFONT ( 1 , 1 ) ; //12, 32 ++ Size = MAP_APPFONT ( 116+2 , 145+2 ) ; ++ DialogControl = TRUE; ++ }; ++ Control TAB_BG_COLOR_SET_BGDCOLOR ++ { ++ // * HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ; ++ Hide = FALSE ; ++ Pos = MAP_APPFONT ( 0 , 0 ) ; ++ Size = MAP_APPFONT ( 116 , 145 ) ; ++ TabStop = TRUE ; ++ }; ++ CancelButton BTN_CANCEL ++ { ++ Pos = MAP_APPFONT ( 82 , 151 ) ; ++ Size = MAP_APPFONT ( 35 , 14 ) ; ++ TabStop = TRUE ; ++ DefButton = FALSE ; ++ }; ++ OKButton BTN_OK ++ { ++ Pos = MAP_APPFONT ( 45 , 151 ) ; ++ Size = MAP_APPFONT ( 35 , 14 ) ; ++ TabStop = TRUE ; ++ DefButton = TRUE ; ++ }; ++ HelpButton BTN_HELP ++ { ++ Pos = MAP_APPFONT ( 2 , 151 ) ; ++ Size = MAP_APPFONT ( 35 , 14 ) ; ++ TabStop = TRUE ; ++ DefButton = FALSE ; ++ }; ++}; ++/* ++ModalDialog RID_SCDLG_TAB_BG_COLOR ++{ ++ OutputSize = TRUE ; ++ SVLook = TRUE ; ++ Size = MAP_APPFONT ( 180 , 150 ) ; ++ Moveable = TRUE ; ++ Closeable = TRUE ; ++ Control TAB_BG_COLOR_CT_BORDER ++ { ++ Border = TRUE ; ++ Pos = MAP_APPFONT ( 1 , 1 ) ; //12, 32 ++ Size = MAP_APPFONT ( 116+2 , 145+2 ) ; ++ DialogControl = TRUE; ++ }; ++ Control TAB_BG_COLOR_SET_BGDCOLOR ++ { ++ // * HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ; ++ Hide = FALSE ; ++ Pos = MAP_APPFONT ( 0 , 0 ) ; ++ Size = MAP_APPFONT ( 116 , 145 ) ; ++ TabStop = TRUE ; ++ }; ++ OKButton BTN_OK ++ { ++ Pos = MAP_APPFONT ( 125 , 50 ) ; ++ Size = MAP_APPFONT ( 50 , 14 ) ; ++ TabStop = TRUE ; ++ DefButton = TRUE ; ++ }; ++ CancelButton BTN_CANCEL ++ { ++ Pos = MAP_APPFONT ( 125 , 67 ) ; ++ Size = MAP_APPFONT ( 50 , 14 ) ; ++ TabStop = TRUE ; ++ DefButton = FALSE ; ++ }; ++ HelpButton BTN_HELP ++ { ++ Pos = MAP_APPFONT ( 125 , 84 ) ; ++ Size = MAP_APPFONT ( 50 , 14 ) ; ++ TabStop = TRUE ; ++ DefButton = FALSE ; ++ }; ++}; ++*/ + /* + ModalDialog RID_SCDLG_MTRINPUT + { +diff --git sc/source/ui/src/popup.src sc/source/ui/src/popup.src +index 05d10b9..5f19299 100644 +--- sc/source/ui/src/popup.src ++++ sc/source/ui/src/popup.src +@@ -193,6 +193,15 @@ Menu RID_POPUP_TAB + HelpId = FID_TAB_RTL ; + Text [ en-US ] = "S~heet Right-To-Left" ; + }; ++ //------------------------------ ++ MenuItem { Separator = TRUE ; }; ++ //------------------------------ ++ MenuItem ++ { ++ Identifier = FID_TAB_MENU_SET_TAB_BG_COLOR ; ++ HelpId = FID_TAB_MENU_SET_TAB_BG_COLOR ; ++ Text [ en-US ] = "~Tab Color..." ; ++ }; + }; + }; + +diff --git sc/source/ui/src/scstring.src sc/source/ui/src/scstring.src +index c50a304..6fb17a3 100644 +--- sc/source/ui/src/scstring.src ++++ sc/source/ui/src/scstring.src +@@ -283,6 +283,14 @@ String SCSTR_RENAMETAB + { + Text [ en-US ] = "Rename Sheet" ; + }; ++String SCSTR_SET_TAB_BG_COLOR ++{ ++ Text [ en-US ] = "Tab Color" ; ++}; ++String SCSTR_NO_TAB_BG_COLOR ++{ ++ Text [ en-US ] = "Default" ; ++}; + String SCSTR_RENAMEOBJECT + { + Text [ en-US ] = "Name Object"; +diff --git sc/source/ui/undo/undotab.cxx sc/source/ui/undo/undotab.cxx +index 5650376..0e56405 100644 +--- sc/source/ui/undo/undotab.cxx ++++ sc/source/ui/undo/undotab.cxx +@@ -70,6 +70,9 @@ + #include "drwlayer.hxx" + #include "scresid.hxx" + ++// for set tab bg color ++#include "viewdata.hxx" ++ + extern BOOL bDrawIsInUndo; //! irgendwo als Member !!! + + using namespace com::sun::star; +@@ -93,6 +96,7 @@ TYPEINIT1(ScUndoScenarioFlags, SfxUndoAction); + TYPEINIT1(ScUndoRenameObject, SfxUndoAction); + TYPEINIT1(ScUndoLayoutRTL, SfxUndoAction); + //UNUSED2009-05 TYPEINIT1(ScUndoSetGrammar, SfxUndoAction); ++TYPEINIT1(ScUndoSetTabBgColor, SfxUndoAction); + + + // ----------------------------------------------------------------------- +@@ -779,6 +783,113 @@ BOOL ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const + return FALSE; + } + ++//--------------------------------------------------------------------------------- ++// ++// Tab Bg Color ++// ++ ++ScUndoSetTabBgColor::ScUndoSetTabBgColor( ScDocShell* pNewDocShell, ++ SCTAB nT, ++ const Color& aOTabBgColor, ++ const Color& aNTabBgColor) : ++ ScSimpleUndo( pNewDocShell ), ++ nTab ( nT ), ++ bIsMultipleUndo ( FALSE ), ++ aUndoSetTabBgColorInfoList ( NULL ) ++{ ++ aOldTabBgColor = aOTabBgColor; ++ aNewTabBgColor = aNTabBgColor; ++} ++ ++ScUndoSetTabBgColor::ScUndoSetTabBgColor( ScDocShell* pNewDocShell, ++ ScUndoSetTabBgColorInfoList* pUndoSetTabBgColorInfoList) : ++ ScSimpleUndo( pNewDocShell ), ++ bIsMultipleUndo ( TRUE ) ++{ ++ aUndoSetTabBgColorInfoList = pUndoSetTabBgColorInfoList; ++} ++ ++__EXPORT ScUndoSetTabBgColor::~ScUndoSetTabBgColor() ++{ ++} ++ ++String __EXPORT ScUndoSetTabBgColor::GetComment() const ++{ ++ if (bIsMultipleUndo && aUndoSetTabBgColorInfoList && aUndoSetTabBgColorInfoList->Count() > 1) ++ return ScGlobal::GetRscString( STR_UNDO_SET_MULTI_TAB_BG_COLOR ); ++ return ScGlobal::GetRscString( STR_UNDO_SET_TAB_BG_COLOR ); ++} ++ ++void ScUndoSetTabBgColor::DoChange( SCTAB nTabP, const Color& rTabBgColor ) const ++{ ++ if (bIsMultipleUndo) ++ return; ++ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); ++ if (pViewShell) ++ { ++ ScViewData* pViewData = pViewShell->GetViewData(); ++ if (pViewData) ++ { ++ pViewData->SetTabBgColor( rTabBgColor, nTabP ); ++ pDocShell->PostPaintExtras(); ++ pDocShell->PostDataChanged(); ++ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); ++ pViewShell->UpdateInputHandler(); ++ } ++ } ++} ++ ++void ScUndoSetTabBgColor::DoChange(BOOL bUndoType) const ++{ ++ if (!bIsMultipleUndo) ++ return; ++ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); ++ if (pViewShell) ++ { ++ ScViewData* pViewData = pViewShell->GetViewData(); ++ if (pViewData) ++ { ++ ScUndoSetTabBgColorInfo* aUndoSetTabBgColorInfo=NULL; ++ for (USHORT i=0; i < aUndoSetTabBgColorInfoList->Count(); i++) ++ { ++ aUndoSetTabBgColorInfo = aUndoSetTabBgColorInfoList->GetObject(i); ++ pViewData->SetTabBgColor( ++ bUndoType ? aUndoSetTabBgColorInfo->aOldTabBgColor : aUndoSetTabBgColorInfo->aNewTabBgColor, ++ aUndoSetTabBgColorInfo->nTabId); ++ } ++ pDocShell->PostPaintExtras(); ++ pDocShell->PostDataChanged(); ++ SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); ++ pViewShell->UpdateInputHandler(); ++ } ++ } ++} ++ ++void __EXPORT ScUndoSetTabBgColor::Undo() ++{ ++ if ( bIsMultipleUndo ) ++ DoChange(TRUE); ++ else ++ DoChange(nTab, aOldTabBgColor); ++} ++ ++void __EXPORT ScUndoSetTabBgColor::Redo() ++{ ++ if ( bIsMultipleUndo ) ++ DoChange(FALSE); ++ else ++ DoChange(nTab, aNewTabBgColor); ++} ++ ++void __EXPORT ScUndoSetTabBgColor::Repeat(SfxRepeatTarget& /* rTarget */) ++{ ++ // No Repeat ++} ++ ++BOOL __EXPORT ScUndoSetTabBgColor::CanRepeat(SfxRepeatTarget& /* rTarget */) const ++{ ++ return FALSE; ++} + + // ----------------------------------------------------------------------- + // +diff --git sc/source/ui/view/scextopt.cxx sc/source/ui/view/scextopt.cxx +index 586f934..fd28d95 100644 +--- sc/source/ui/view/scextopt.cxx ++++ sc/source/ui/view/scextopt.cxx +@@ -61,7 +61,8 @@ ScExtTabSettings::ScExtTabSettings() : + mnPageZoom( 0 ), + mbSelected( false ), + mbFrozenPanes( false ), +- mbPageMode( false ) ++ mbPageMode( false ), ++ maTabBgColor( COL_AUTO) + { + } + +diff --git sc/source/ui/view/tabcont.cxx sc/source/ui/view/tabcont.cxx +index 1040c10..ec447b1 100644 +--- sc/source/ui/view/tabcont.cxx ++++ sc/source/ui/view/tabcont.cxx +@@ -69,6 +69,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) : + ScDocument* pDoc = pViewData->GetDocument(); + + String aString; ++ Color aTabBgColor; + SCTAB nCount = pDoc->GetTableCount(); + for (SCTAB i=0; i(i)+1, aString, TPB_SPECIAL ); + else + InsertPage( static_cast(i)+1, aString ); ++ if ( !pViewData->IsDefaultTabBgColor(i) ) ++ { ++ aTabBgColor = pViewData->GetTabBgColor(i); ++ /*SetTabBgColor(static_cast(i)+1, aTabBgColor, pViewData->IsDefaultTabBgColor(i) );*/ ++ SetTabBgColor( static_cast(i)+1, aTabBgColor ); ++ } + } + } + } +@@ -265,6 +272,7 @@ void ScTabControl::Select() + rBind.Invalidate( FID_DELETE_TABLE ); + rBind.Invalidate( FID_TABLE_SHOW ); + rBind.Invalidate( FID_TABLE_HIDE ); ++ rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR ); + + // SetReference nur wenn der Konsolidieren-Dialog offen ist + // (fuer Referenzen ueber mehrere Tabellen) +@@ -291,16 +299,22 @@ void ScTabControl::UpdateStatus() + SCTAB i; + String aString; + SCTAB nMaxCnt = Max( nCount, static_cast(GetMaxId()) ); ++ Color aTabBgColor; + + BOOL bModified = FALSE; // Tabellen-Namen + for (i=0; iIsVisible(i)) ++ { + pDoc->GetName(i,aString); ++ aTabBgColor = pViewData->GetTabBgColor(i); ++ } + else ++ { + aString.Erase(); ++ } + +- if (GetPageText(static_cast(i)+1) != aString) ++ if ( (GetPageText(static_cast(i)+1) != aString) || (GetTabBgColor(static_cast(i)+1) != aTabBgColor) ) + bModified = TRUE; + } + +@@ -317,6 +331,11 @@ void ScTabControl::UpdateStatus() + InsertPage( static_cast(i)+1, aString, TPB_SPECIAL ); + else + InsertPage( static_cast(i)+1, aString ); ++ if ( !pViewData->IsDefaultTabBgColor(i) ) ++ { ++ aTabBgColor = pViewData->GetTabBgColor(i); ++ SetTabBgColor( static_cast(i)+1, aTabBgColor ); ++ } + } + } + } +diff --git sc/source/ui/view/tabvwshf.cxx sc/source/ui/view/tabvwshf.cxx +index ee49744..c65b62a 100644 +--- sc/source/ui/view/tabvwshf.cxx ++++ sc/source/ui/view/tabvwshf.cxx +@@ -58,6 +58,10 @@ + + #include "scabstdlg.hxx" //CHINA001 + ++#include "tabbgcolor.hxx" //DBW ++#include "tabbgcolordlg.hxx" //DBW ++#include //DBW ++ + #define IS_AVAILABLE(WhichId,ppItem) \ + (pReqArgs->GetItemState((WhichId), TRUE, ppItem ) == SFX_ITEM_SET) + +@@ -686,6 +690,120 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) + } + break; + ++ case FID_TAB_SET_TAB_BG_COLOR: ++ case FID_TAB_MENU_SET_TAB_BG_COLOR: ++ { ++ if ( nSlot == FID_TAB_MENU_SET_TAB_BG_COLOR ) ++ nSlot = FID_TAB_SET_TAB_BG_COLOR; ++ ++ SCTAB nTabNr = pViewData->GetTabNo(); ++ ScMarkData& rMark = pViewData->GetMarkData(); ++ SCTAB nTabSelCount = rMark.GetSelectCount(); ++ ++ ScUndoSetTabBgColorInfo* aTabBgColorUndoInfo=NULL; ++ ScUndoSetTabBgColorInfoList* aTabBgColorUndoInfoList =NULL; ++ ++ if ( !pDoc->IsDocEditable() ) ++ break; ++ ++ if ( pDoc->IsTabProtected( nTabNr ) ) // ||nTabSelCount > 1 ++ break; ++ ++ if( pReqArgs != NULL ) ++ { ++ BOOL bDone = FALSE; ++ const SfxPoolItem* pItem; ++ Color aColor; ++ if( IS_AVAILABLE( FN_PARAM_1, &pItem ) ) ++ nTabNr = ((const SfxUInt16Item*)pItem)->GetValue(); ++ ++ if( IS_AVAILABLE( nSlot, &pItem ) ) ++ aColor = ((const SvxColorItem*)pItem)->GetValue(); ++ ++ if ( nTabSelCount > 1 ) ++ { ++ aTabBgColorUndoInfoList = new ScUndoSetTabBgColorInfoList(); ++ for (SCTAB nTab=0; nTabIsTabProtected(nTab) ) ++ { ++ aTabBgColorUndoInfo = new ScUndoSetTabBgColorInfo(); ++ aTabBgColorUndoInfo->nTabId = nTab; ++ aTabBgColorUndoInfo->aNewTabBgColor = aColor; ++ aTabBgColorUndoInfoList->Insert(aTabBgColorUndoInfo); ++ } ++ } ++ bDone = SetTabBgColor( aTabBgColorUndoInfoList ); ++ } ++ else ++ { ++ bDone = SetTabBgColor( aColor, nCurrentTab ); //ScViewFunc.SetTabBgColor ++ } ++ if( bDone ) ++ { ++ rReq.Done( *pReqArgs ); ++ } ++ } ++ else ++ { ++ USHORT nRet = RET_OK; /// temp ++ BOOL bDone = FALSE; /// temp ++ Color aTabBgColor; ++ Color aNewTabBgColor; ++ ++ aTabBgColor = pViewData->GetTabBgColor( nCurrentTab ); ++ ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ++ DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); ++ AbstractScTabBgColorDlg* pDlg = pFact->CreateScTabBgColorDlg( ++ GetDialogParent(), ++ String(ScResId(SCSTR_SET_TAB_BG_COLOR)), ++ String(ScResId(SCSTR_NO_TAB_BG_COLOR)), ++ aTabBgColor, ++ nSlot,RID_SCDLG_TAB_BG_COLOR); ++ while ( !bDone && nRet == RET_OK ) ++ { ++ nRet = pDlg->Execute(); ++ if( nRet == RET_OK ) ++ { ++ Color aSelectedColor; ++ pDlg->GetSelectedColor(aSelectedColor); ++ aTabBgColorUndoInfoList = new ScUndoSetTabBgColorInfoList(); ++ if ( nTabSelCount > 1 ) ++ { ++ for (SCTAB nTab=0; nTabIsTabProtected(nTab) ) ++ { ++ aTabBgColorUndoInfo = new ScUndoSetTabBgColorInfo(); ++ aTabBgColorUndoInfo->nTabId = nTab; ++ aTabBgColorUndoInfo->aNewTabBgColor = aSelectedColor; ++ aTabBgColorUndoInfoList->Insert(aTabBgColorUndoInfo); ++ } ++ } ++ bDone = SetTabBgColor( aTabBgColorUndoInfoList ); ++ } ++ else ++ { ++ bDone = SetTabBgColor( aSelectedColor, nCurrentTab ); //ScViewFunc.SetTabBgColor ++ } ++ if ( bDone ) ++ { ++ rReq.AppendItem( SvxColorItem( aTabBgColor, nSlot ) ); ++ rReq.Done(); ++ } ++ else ++ { ++ if( rReq.IsAPI() ) ++ { ++ StarBASIC::Error( SbERR_SETPROP_FAILED ); ++ } ++ } ++ } ++ } ++ delete( pDlg ); ++ } ++ } ++ break; + default: + DBG_ERROR("Unbekannte Message bei ViewShell"); + break; +@@ -804,6 +922,23 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet ) + rSet.Put( SfxBoolItem( nWhich, pDoc->IsLayoutRTL( nTab ) ) ); + } + break; ++ ++ case FID_TAB_MENU_SET_TAB_BG_COLOR: ++ { ++ if ( !pDoc->IsDocEditable() ++ || ( pDocShell && pDocShell->IsDocShared() ) ++ || pDoc->IsTabProtected(nTab) ) ++ rSet.DisableItem( nWhich ); ++ } ++ break; ++ ++ case FID_TAB_SET_TAB_BG_COLOR: ++ { ++ Color aColor; ++ aColor = pViewData->GetTabBgColor( nTab ); ++ rSet.Put( SvxColorItem( aColor, nWhich ) ); ++ } ++ break; + } + nWhich = aIter.NextWhich(); + } +diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx +index fbb1306..d10a48d 100644 +--- sc/source/ui/view/viewdata.cxx ++++ sc/source/ui/view/viewdata.cxx +@@ -104,7 +104,8 @@ ScViewDataTable::ScViewDataTable() : + nFixPosY( 0 ), + nCurX( 0 ), + nCurY( 0 ), +- bOldCurValid( FALSE ) ++ bOldCurValid( FALSE ), ++ aTabBgColor( Color(COL_AUTO) ) + { + nPosX[0]=nPosX[1]=0; + nPosY[0]=nPosY[1]=0; +@@ -164,6 +165,11 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence + pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_PAGEVIEWZOOMVALUE)); + pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue; + ++ if ( !IsDefaultTabBgColor() ) ++ { ++ pSettings[SC_TABLE_TAB_BG_COLOR].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_TABCOLOR)); ++ pSettings[SC_TABLE_TAB_BG_COLOR].Value <<= static_cast(aTabBgColor.GetColor()); ++ } + // pSettings[SC_TABLE_SELECTED].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_TABLESELECTED)); + // pSettings[SC_TABLE_SELECTED].Value <<= bool(rViewData.GetMarkData().GetTableSelect( nTab )); + } +@@ -276,6 +282,13 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence >= bSelected; + rViewData.GetMarkData().SelectTable( nTab, bSelected ); + } ++ else if (sName.compareToAscii(SC_UNO_TABCOLOR) == 0) ++ { ++ sal_Int32 nColor = COL_AUTO; ++ aSettings[i].Value >>= nColor; ++ if (nColor != COL_AUTO) ++ aTabBgColor.SetColor(static_cast(nColor)); ++ } + } + if (eHSplitMode == SC_SPLIT_FIX) + nFixPosX = SanitizeCol( static_cast( bHasHSplitInTwips ? nTempPosHTw : nTempPosH )); +@@ -579,6 +592,36 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab ) + aMarkData.InsertTab( nInsTab ); // ggf. angepasst + } + ++void ScViewData::SetTabBgColor( Color rTabBgColor, SCTAB nTab ) ++{ ++ if ( rTabBgColor != Color(COL_AUTO) ) ++ { ++ if ( !pTabData[nTab] ) ++ CreateTabData( nTab ); ++ pTabData[nTab]->aTabBgColor = rTabBgColor; ++ } ++ else ++ { ++ if ( pTabData[nTab] ) ++ pTabData[nTab]->aTabBgColor = Color( COL_AUTO ); ++ } ++} ++ ++Color ScViewData::GetTabBgColor( SCTAB nTab ) const ++{ ++ if ( !pTabData[nTab] ) ++ return Color(COL_AUTO); ++ return pTabData[nTab]->aTabBgColor; ++} ++ ++BOOL ScViewData::IsDefaultTabBgColor( SCTAB nTab ) const ++{ ++ if ( !pTabData[nTab] ) ++ return true; ++ BOOL bResult = pTabData[nTab]->aTabBgColor==Color( COL_AUTO ) ? TRUE : FALSE; ++ return bResult; ++} ++ + //UNUSED2008-05 void ScViewData::UpdateOle( ScSplitPos /* eWhich */ ) + //UNUSED2008-05 { + //UNUSED2008-05 GetDocShell()->UpdateOle(this); +@@ -2444,6 +2487,9 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const + rTabSett.mbPageMode = bPagebreak; + rTabSett.mnNormalZoom = static_cast< long >( pViewTab->aZoomY * Fraction( 100.0 ) ); + rTabSett.mnPageZoom = static_cast< long >( pViewTab->aPageZoomY * Fraction( 100.0 ) ); ++ ++ // Tab Bg Color ++ rTabSett.maTabBgColor = pViewTab->aTabBgColor; + } + } + } +@@ -2598,6 +2644,10 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt ) + update map modes that are needed to draw text correctly. */ + SetPagebreakMode( rTabSett.mbPageMode ); + } ++ ++ // Tab Bg Color ++ if( !rTabSett.IsDefaultTabBgColor() ) ++ rViewTab.aTabBgColor = rTabSett.maTabBgColor; + } + } + +diff --git sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx +index 681f51c..14d58f7 100644 +--- sc/source/ui/view/viewfun2.cxx ++++ sc/source/ui/view/viewfun2.cxx +@@ -89,6 +89,7 @@ + #include "funcdesc.hxx" + #include "docuno.hxx" + ++#include "tabbgcolor.hxx" //DBW + + // STATIC DATA --------------------------------------------------------------- + +@@ -2276,6 +2277,28 @@ BOOL ScViewFunc::RenameTable( const String& rName, SCTAB nTab ) + + //---------------------------------------------------------------------------- + ++BOOL ScViewFunc::SetTabBgColor( const Color& rColor, SCTAB nTab ) ++{ ++ BOOL bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( nTab, rColor, TRUE, FALSE ); ++ if (bSuccess) ++ { ++ GetViewData()->GetViewShell()->UpdateInputHandler(); ++ } ++ return bSuccess; ++} ++ ++BOOL ScViewFunc::SetTabBgColor( ScUndoSetTabBgColorInfoList* rUndoSetTabBgColorInfoList ) ++{ ++ BOOL bSuccess = GetViewData()->GetDocShell()->GetDocFunc().SetTabBgColor( rUndoSetTabBgColorInfoList, TRUE, FALSE ); ++ if (bSuccess) ++ { ++ GetViewData()->GetViewShell()->UpdateInputHandler(); ++ } ++ return bSuccess; ++} ++ ++//---------------------------------------------------------------------------- ++ + void ScViewFunc::InsertAreaLink( const String& rFile, + const String& rFilter, const String& rOptions, + const String& rSource, ULONG nRefresh ) +diff --git sc/uiconfig/scalc/menubar/menubar.xml sc/uiconfig/scalc/menubar/menubar.xml +index ab3f121..eed3a97 100644 +--- sc/uiconfig/scalc/menubar/menubar.xml ++++ sc/uiconfig/scalc/menubar/menubar.xml +@@ -214,6 +214,8 @@ + + + ++ ++ + + + +diff --git sc/util/makefile.mk sc/util/makefile.mk +index db377e5..f4e7973 100644 +--- sc/util/makefile.mk ++++ sc/util/makefile.mk +@@ -260,6 +260,7 @@ LIB8OBJFILES = \ + $(SLO)$/attrdlg.obj \ + $(SLO)$/scuiimoptdlg.obj \ + $(SLO)$/strindlg.obj \ ++ $(SLO)$/tabbgcolordlg.obj \ + $(SLO)$/shtabdlg.obj \ + $(SLO)$/scendlg.obj \ + $(SLO)$/pvfundlg.obj \ diff --git a/applied_patches/0018-cws-calctabcolor-svtools.diff b/applied_patches/0018-cws-calctabcolor-svtools.diff new file mode 100644 index 000000000..19fd0210d --- /dev/null +++ b/applied_patches/0018-cws-calctabcolor-svtools.diff @@ -0,0 +1,214 @@ +diff --git svtools/inc/tabbar.hxx svtools/inc/tabbar.hxx +index eed845a..6e0a51c 100644 +--- svtools/inc/tabbar.hxx ++++ svtools/inc/tabbar.hxx +@@ -430,6 +430,11 @@ public: + USHORT nPos = TABBAR_APPEND ); + void RemovePage( USHORT nPageId ); + void MovePage( USHORT nPageId, USHORT nNewPos ); ++ ++ Color GetTabBgColor( USHORT nPageId ) const; ++ void SetTabBgColor( USHORT nPageId, const Color& aTabBgColor ); ++ BOOL IsDefaultTabBgColor( USHORT nPageId ); ++ + void Clear(); + + void EnablePage( USHORT nPageId, BOOL bEnable = TRUE ); +diff --git svtools/source/control/tabbar.cxx svtools/source/control/tabbar.cxx +index ed1abbe..bfa6825 100644 +--- svtools/source/control/tabbar.cxx ++++ svtools/source/control/tabbar.cxx +@@ -65,6 +65,10 @@ struct ImplTabBarItem + BOOL mbShort; + BOOL mbSelect; + BOOL mbEnable; ++ Color maTabBgColor; ++ bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; ++ Color maTabTextColor; ++ bool IsDefaultTabTextColor() const { return maTabTextColor == Color(COL_AUTO) ? TRUE : FALSE; }; + + ImplTabBarItem( USHORT nItemId, const XubString& rText, + TabBarPageBits nPageBits ) : +@@ -77,6 +81,8 @@ struct ImplTabBarItem + mbShort = FALSE; + mbSelect = FALSE; + mbEnable = TRUE; ++ maTabBgColor = Color( COL_AUTO ); ++ maTabTextColor = Color( COL_AUTO ); + } + }; + +@@ -1049,7 +1055,8 @@ void TabBar::Paint( const Rectangle& ) + // Font selektieren + Font aFont = GetFont(); + Font aLightFont = aFont; +- aLightFont.SetWeight( WEIGHT_LIGHT ); ++ //aLightFont.SetWeight( WEIGHT_LIGHT ); //TODO Make font weight light on custom color only? ++ aLightFont.SetWeight( WEIGHT_NORMAL ); + + // #i36013# exclude push buttons from painting area + Rectangle aClipRect( Point( mnOffX, 0 ), Point( mnLastOffX, GetOutputHeightPixel() - 1 ) ); +@@ -1123,15 +1130,23 @@ void TabBar::Paint( const Rectangle& ) + SetFont( aLightFont ); + + // Je nach Status die richtige FillInBrush setzen ++ // Set the correct FillInBrush depending upon status + if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) + { ++ // Currently selected Tab + SetFillColor( aSelectColor ); + SetTextColor( aSelectTextColor ); + } + else + { +- SetFillColor( aFaceColor ); +- SetTextColor( aFaceTextColor ); ++ if ( !pItem->IsDefaultTabBgColor() ) ++ { ++ SetFillColor( pItem->maTabBgColor ); ++ SetTextColor( pItem->maTabTextColor ); ++ } else { ++ SetFillColor( aFaceColor ); ++ SetTextColor( aFaceTextColor ); ++ } + } + + // Muss Font Kursiv geschaltet werden +@@ -1163,21 +1178,38 @@ void TabBar::Paint( const Rectangle& ) + long nTextHeight = GetTextHeight(); + Point aTxtPos( aRect.Left()+(aRectSize.Width()-nTextWidth)/2, + (aRectSize.Height()-nTextHeight)/2 ); +- if ( !pItem->mbEnable ) +- DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); +- else +- DrawText( aTxtPos, aText ); +- ++ if ( pItem->IsDefaultTabBgColor() || (!pItem->mbSelect) ) ++ { ++ if ( !pItem->mbEnable ) ++ DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); ++ else ++ DrawText( aTxtPos, aText ); ++ } + // Jetzt im Inhalt den 3D-Effekt ausgeben + aPos0.X()++; + aPos1.X()++; + aPos2.X()--; + aPos3.X()--; +- SetLineColor( rStyleSettings.GetLightColor() ); ++ ++ // If this is the current tab, draw the left inner shadow the default color, ++ // otherwise make it the same as the custom background color ++ if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { ++ SetLineColor( rStyleSettings.GetLightColor() ); ++ } else { ++ if ( !pItem->IsDefaultTabBgColor() ) ++ { ++ SetLineColor( pItem->maTabBgColor ); ++ } else { ++ SetLineColor( rStyleSettings.GetLightColor() ); ++ } ++ } ++ // Draw the left side of the tab + DrawLine( aPos0, aPos1 ); + + if ( !pItem->mbSelect && (pItem->mnId != mnCurPageId) ) + { ++ // Draw the top inner shadow ++ // ToDo: Change from this static color to tab custom bg color + DrawLine( Point( aPos0.X(), aPos0.Y()+1 ), + Point( aPos3.X(), aPos3.Y()+1 ) ); + } +@@ -1187,8 +1219,27 @@ void TabBar::Paint( const Rectangle& ) + aPos1.X()--; + aPos1.Y()--; + aPos2.Y()--; ++ if ( !pItem->IsDefaultTabBgColor() && ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) ) ++ { ++ SetLineColor( pItem->maTabBgColor ); ++ DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) ); ++ } + DrawLine( aPos1, aPos2 ); + ++ // draw a small 2px sliver of the original background color at the bottom of the selected tab ++ ++ if ( !pItem->IsDefaultTabBgColor() ) ++ { ++ if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { ++ SetLineColor( pItem->maTabBgColor ); ++ DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) ); ++ if ( !pItem->mbEnable ) ++ DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); ++ else ++ DrawText( aTxtPos, aText ); ++ } ++ } ++ + // Da etwas uebermalt werden konnte, muessen wir die Polygon- + // umrandung nocheinmal ausgeben + SetLineColor( rStyleSettings.GetDarkShadowColor() ); +@@ -1565,6 +1616,42 @@ void TabBar::InsertPage( USHORT nPageId, const XubString& rText, + + // ----------------------------------------------------------------------- + ++Color TabBar::GetTabBgColor( USHORT nPageId ) const ++{ ++ USHORT nPos = GetPagePos( nPageId ); ++ ++ if ( nPos != TABBAR_PAGE_NOTFOUND ) ++ return mpItemList->GetObject( nPos )->maTabBgColor; ++ else ++ return Color( COL_AUTO ); ++} ++ ++void TabBar::SetTabBgColor( USHORT nPageId, const Color& aTabBgColor ) ++{ ++ USHORT nPos = GetPagePos( nPageId ); ++ ImplTabBarItem* pItem; ++ if ( nPos != TABBAR_PAGE_NOTFOUND ) ++ { ++ pItem = mpItemList->GetObject( nPos ); ++ // TODO: Need to take the text color specification out of this code! ++ if ( aTabBgColor != Color( COL_AUTO ) ) ++ { ++ pItem->maTabBgColor = aTabBgColor; ++ if ( aTabBgColor.GetLuminance() <= 128 ) //Do not use aTabBgColor.IsDark(), because that threshold is way too low... ++ pItem->maTabTextColor = Color( COL_WHITE ); ++ else ++ pItem->maTabTextColor = Color( COL_BLACK ); ++ } ++ else ++ { ++ pItem->maTabBgColor = Color( COL_AUTO ); ++ pItem->maTabTextColor = Color( COL_AUTO ); ++ } ++ } ++} ++ ++// ----------------------------------------------------------------------- ++ + void TabBar::RemovePage( USHORT nPageId ) + { + USHORT nPos = GetPagePos( nPageId ); +@@ -2486,9 +2573,12 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) + nX--; + else + nX++; ++ if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect) ++ SetLineColor( pItem->maTabTextColor ); + DrawLine( Point( nX, nY ), Point( nX, nY ) ); + DrawLine( Point( nX+1, nY-1 ), Point( nX+1, nY+1 ) ); + DrawLine( Point( nX+2, nY-2 ), Point( nX+2, nY+2 ) ); ++ SetLineColor( aBlackColor ); + } + if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) ) + { +@@ -2496,6 +2586,8 @@ USHORT TabBar::ShowDropPos( const Point& rPos ) + nX = pItem->maRect.Right()-TABBAR_OFFSET_X; + if ( mnDropPos == nCurPos ) + nX++; ++ if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect) ++ SetLineColor( pItem->maTabTextColor ); + DrawLine( Point( nX, nY ), Point( nX, nY ) ); + DrawLine( Point( nX-1, nY-1 ), Point( nX-1, nY+1 ) ); + DrawLine( Point( nX-2, nY-2 ), Point( nX-2, nY+2 ) ); diff --git a/applied_patches/0004-speed-configmgr.diff b/applied_patches/0019-speed-configmgr.diff similarity index 100% rename from applied_patches/0004-speed-configmgr.diff rename to applied_patches/0019-speed-configmgr.diff diff --git a/applied_patches/0005-ok-cancel-btn-add-accel.diff b/applied_patches/0020-ok-cancel-btn-add-accel.diff similarity index 100% rename from applied_patches/0005-ok-cancel-btn-add-accel.diff rename to applied_patches/0020-ok-cancel-btn-add-accel.diff diff --git a/applied_patches/0006-makefile-idl-build.diff b/applied_patches/0021-makefile-idl-build.diff similarity index 100% rename from applied_patches/0006-makefile-idl-build.diff rename to applied_patches/0021-makefile-idl-build.diff diff --git a/applied_patches/0007-speed-pagein.diff b/applied_patches/0022-speed-pagein.diff similarity index 100% rename from applied_patches/0007-speed-pagein.diff rename to applied_patches/0022-speed-pagein.diff diff --git a/applied_patches/0008-testtool-more-defaults.diff b/applied_patches/0023-testtool-more-defaults.diff similarity index 100% rename from applied_patches/0008-testtool-more-defaults.diff rename to applied_patches/0023-testtool-more-defaults.diff diff --git a/applied_patches/0009-plus-minus-sw-navigator.diff b/applied_patches/0024-plus-minus-sw-navigator.diff similarity index 100% rename from applied_patches/0009-plus-minus-sw-navigator.diff rename to applied_patches/0024-plus-minus-sw-navigator.diff diff --git a/applied_patches/0010-plus-minus-sw-navigator2.diff b/applied_patches/0025-plus-minus-sw-navigator2.diff similarity index 100% rename from applied_patches/0010-plus-minus-sw-navigator2.diff rename to applied_patches/0025-plus-minus-sw-navigator2.diff diff --git a/applied_patches/0025-quiet-build.diff b/applied_patches/0025-quiet-build.diff deleted file mode 100644 index 3e58715cf..000000000 --- a/applied_patches/0025-quiet-build.diff +++ /dev/null @@ -1,5110 +0,0 @@ -Collected build silencing/build logging patches - -From: Thorsten Behrens - - ---- - - solenv/bin/build.pl | 18 +- - solenv/inc/_tg_app.mk | 40 ++-- - solenv/inc/_tg_def.mk | 80 +++++-- - solenv/inc/_tg_lib.mk | 60 ++++- - solenv/inc/_tg_rslb.mk | 140 +++++++----- - solenv/inc/_tg_scp.mk | 40 +++- - solenv/inc/_tg_sdi.mk | 80 +++++-- - solenv/inc/_tg_shl.mk | 440 ++++++++++++++++++++++++--------------- - solenv/inc/_tg_srs.mk | 450 +++++++++++++++++++++++++++++----------- - solenv/inc/_tg_zip.mk | 40 +++- - solenv/inc/ant.mk | 2 - solenv/inc/pstrules.mk | 10 - - solenv/inc/rules.mk | 242 +++++++++++++--------- - solenv/inc/settings.mk | 6 + - solenv/inc/target.mk | 41 +++- - solenv/inc/tg_app.mk | 4 - solenv/inc/tg_def.mk | 8 + - solenv/inc/tg_dep.mk | 6 + - solenv/inc/tg_java.mk | 4 - solenv/inc/tg_lib.mk | 6 - - solenv/inc/tg_obj.mk | 12 + - solenv/inc/tg_res.mk | 4 - solenv/inc/tg_rslb.mk | 14 + - solenv/inc/tg_scp.mk | 4 - solenv/inc/tg_sdi.mk | 8 + - solenv/inc/tg_shl.mk | 42 ++-- - solenv/inc/tg_slo.mk | 12 + - solenv/inc/tg_srs.mk | 45 +++- - solenv/inc/tg_yxx.mk | 8 + - solenv/inc/tg_zip.mk | 4 - vcl/source/window/makefile.mk | 6 - - vcl/unx/source/gdi/makefile.mk | 6 - - 32 files changed, 1259 insertions(+), 623 deletions(-) - - -diff --git solenv/bin/build.pl solenv/bin/build.pl -index 58a4065..d21bd62 100755 ---- solenv/bin/build.pl -+++ solenv/bin/build.pl -@@ -54,6 +54,10 @@ - require GenInfoParser; import GenInfoParser; - require IO::Handle; import IO::Handle; - }; -+ my $verbose_mode = 0; -+ if (defined $ENV{verbose} || defined $ENV{VERBOSE}) { -+ $verbose_mode = ($ENV{verbose} =~ /^t\S*$/i); -+ } - my $enable_multiprocessing = 1; - my $cygwin = 0; - $cygwin++ if ($^O eq 'cygwin'); -@@ -494,7 +498,7 @@ sub dmake_dir { - print "$dmake\n"; - print $check_error_string; - } else { -- print "$BuildDir\n"; -+ print "\nEntering $BuildDir\n"; - }; - RemoveFromDependencies($BuildDir, \%LocalDepsHash) if (!$child); - return if ($cmd_file || $show); -@@ -1354,6 +1358,9 @@ sub get_options { - # Default build modes(for OpenOffice.org) - $ENV{BUILD_TYPE} = 'OOo EXT' if (!defined $ENV{BUILD_TYPE}); - @ARGV = @dmake_args; -+ foreach $arg (@dmake_args) { -+ $arg =~ /^verbose=(\S+)$/i and $verbose_mode = ($1 =~ /^t\S*$/i); -+ } - }; - - sub get_dmake_args { -@@ -1522,7 +1530,7 @@ sub clear_from_child { - $running_children{$folders_hashes{$child_nick}}--; - delete $processes_hash{$pid}; - $only_dependent = 0; -- print 'Running processes: ' . children_number() . "\n"; -+ $verbose_mode && print 'Running processes: ' . children_number() . "\n"; - }; - - # -@@ -1628,7 +1636,7 @@ sub start_child { - select $oldfh; - $processes_hash{$pid} = $job_dir; - $children_running = children_number(); -- print 'Running processes: ', $children_running, "\n"; -+ $verbose_mode && print 'Running processes: ', $children_running, "\n"; - $maximal_processes = $children_running if ($children_running > $maximal_processes); - $folders_hashes{$job_dir} = $dependencies_hash; - $running_children{$dependencies_hash}++; -@@ -3097,7 +3105,7 @@ sub run_server { - delete $clients_times{$pid}; - clear_from_child($pid); - delete $clients_jobs{$pid}; -- print 'Running processes: ', children_number(), "\n"; -+ $verbose_mode && print 'Running processes: ', children_number(), "\n"; - # Actually, next 3 strings are only for even distribution - # of clients if there are more than one build server running - print $new_socket_obj 'No job'; -@@ -3122,7 +3130,7 @@ sub run_server { - $clients_jobs{$pid} = $job_string; - $clients_times{$pid} = time; - $children_running = children_number(); -- print 'Running processes: ', $children_running, "\n"; -+ $verbose_mode && print 'Running processes: ', $children_running, "\n"; - $maximal_processes = $children_running if ($children_running > $maximal_processes); - } else { - print $new_socket_obj 'No job'; -diff --git solenv/inc/_tg_app.mk solenv/inc/_tg_app.mk -index f2008dc..aec72bb 100644 ---- solenv/inc/_tg_app.mk -+++ solenv/inc/_tg_app.mk -@@ -86,7 +86,7 @@ $(APP1TARGETN): $(APP1OBJS) $(APP1LIBS) \ - $(APP1IMP_ORD) \ - $(APP1ICON) $(APP1DEPN) $(USE_APP1DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -110,7 +110,7 @@ $(APP1TARGETN): $(APP1OBJS) $(APP1LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP1RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -370,7 +370,7 @@ $(APP2TARGETN): $(APP2OBJS) $(APP2LIBS) \ - $(APP2IMP_ORD) \ - $(APP2ICON) $(APP2DEPN) $(USE_APP2DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -394,7 +394,7 @@ $(APP2TARGETN): $(APP2OBJS) $(APP2LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP2RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -654,7 +654,7 @@ $(APP3TARGETN): $(APP3OBJS) $(APP3LIBS) \ - $(APP3IMP_ORD) \ - $(APP3ICON) $(APP3DEPN) $(USE_APP3DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -678,7 +678,7 @@ $(APP3TARGETN): $(APP3OBJS) $(APP3LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP3RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -938,7 +938,7 @@ $(APP4TARGETN): $(APP4OBJS) $(APP4LIBS) \ - $(APP4IMP_ORD) \ - $(APP4ICON) $(APP4DEPN) $(USE_APP4DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -962,7 +962,7 @@ $(APP4TARGETN): $(APP4OBJS) $(APP4LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP4RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -1222,7 +1222,7 @@ $(APP5TARGETN): $(APP5OBJS) $(APP5LIBS) \ - $(APP5IMP_ORD) \ - $(APP5ICON) $(APP5DEPN) $(USE_APP5DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -1246,7 +1246,7 @@ $(APP5TARGETN): $(APP5OBJS) $(APP5LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP5RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -1506,7 +1506,7 @@ $(APP6TARGETN): $(APP6OBJS) $(APP6LIBS) \ - $(APP6IMP_ORD) \ - $(APP6ICON) $(APP6DEPN) $(USE_APP6DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -1530,7 +1530,7 @@ $(APP6TARGETN): $(APP6OBJS) $(APP6LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP6RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -1790,7 +1790,7 @@ $(APP7TARGETN): $(APP7OBJS) $(APP7LIBS) \ - $(APP7IMP_ORD) \ - $(APP7ICON) $(APP7DEPN) $(USE_APP7DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -1814,7 +1814,7 @@ $(APP7TARGETN): $(APP7OBJS) $(APP7LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP7RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -2074,7 +2074,7 @@ $(APP8TARGETN): $(APP8OBJS) $(APP8LIBS) \ - $(APP8IMP_ORD) \ - $(APP8ICON) $(APP8DEPN) $(USE_APP8DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -2098,7 +2098,7 @@ $(APP8TARGETN): $(APP8OBJS) $(APP8LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP8RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -2358,7 +2358,7 @@ $(APP9TARGETN): $(APP9OBJS) $(APP9LIBS) \ - $(APP9IMP_ORD) \ - $(APP9ICON) $(APP9DEPN) $(USE_APP9DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -2382,7 +2382,7 @@ $(APP9TARGETN): $(APP9OBJS) $(APP9LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP9RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -@@ -2642,7 +2642,7 @@ $(APP10TARGETN): $(APP10OBJS) $(APP10LIBS) \ - $(APP10IMP_ORD) \ - $(APP10ICON) $(APP10DEPN) $(USE_APP10DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -2666,7 +2666,7 @@ $(APP10TARGETN): $(APP10OBJS) $(APP10LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP10RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -diff --git solenv/inc/_tg_def.mk solenv/inc/_tg_def.mk -index 7f2e0f2..9d8416b 100644 ---- solenv/inc/_tg_def.mk -+++ solenv/inc/_tg_def.mk -@@ -68,8 +68,10 @@ $(DEF1TARGETN) : \ - $(DEF1TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL1TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -184,8 +186,10 @@ $(DEF1TARGETN) : \ - $(DEF1TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL1TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF1DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -352,8 +356,10 @@ $(DEF2TARGETN) : \ - $(DEF2TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL2TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -468,8 +474,10 @@ $(DEF2TARGETN) : \ - $(DEF2TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL2TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF2DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -636,8 +644,10 @@ $(DEF3TARGETN) : \ - $(DEF3TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL3TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -752,8 +762,10 @@ $(DEF3TARGETN) : \ - $(DEF3TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL3TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF3DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -920,8 +932,10 @@ $(DEF4TARGETN) : \ - $(DEF4TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL4TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -1036,8 +1050,10 @@ $(DEF4TARGETN) : \ - $(DEF4TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL4TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF4DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -1204,8 +1220,10 @@ $(DEF5TARGETN) : \ - $(DEF5TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL5TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -1320,8 +1338,10 @@ $(DEF5TARGETN) : \ - $(DEF5TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL5TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF5DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -1488,8 +1508,10 @@ $(DEF6TARGETN) : \ - $(DEF6TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL6TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -1604,8 +1626,10 @@ $(DEF6TARGETN) : \ - $(DEF6TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL6TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF6DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -1772,8 +1796,10 @@ $(DEF7TARGETN) : \ - $(DEF7TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL7TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -1888,8 +1914,10 @@ $(DEF7TARGETN) : \ - $(DEF7TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL7TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF7DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -2056,8 +2084,10 @@ $(DEF8TARGETN) : \ - $(DEF8TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL8TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -2172,8 +2202,10 @@ $(DEF8TARGETN) : \ - $(DEF8TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL8TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF8DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -2340,8 +2372,10 @@ $(DEF9TARGETN) : \ - $(DEF9TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL9TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -2456,8 +2490,10 @@ $(DEF9TARGETN) : \ - $(DEF9TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL9TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF9DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -@@ -2624,8 +2660,10 @@ $(DEF10TARGETN) : \ - $(DEF10TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL10TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -2740,8 +2778,10 @@ $(DEF10TARGETN) : \ - $(DEF10TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL10TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF10DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -diff --git solenv/inc/_tg_lib.mk solenv/inc/_tg_lib.mk -index b481a6d..103e283 100644 ---- solenv/inc/_tg_lib.mk -+++ solenv/inc/_tg_lib.mk -@@ -4,7 +4,7 @@ - .IF "$(LIB1ARCHIV)" != "" - - $(LIB1ARCHIV) : $(LIB1TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB1ARCHIV:b).cmd -@@ -40,10 +40,12 @@ $(LIB1ARCHIV) : $(LIB1TARGET) - $(LIB1TARGET) : $(LIB1FILES) \ - $(LIB1OBJFILES) \ - $(LIB1DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB1FILES) - @echo using: $(LIB1TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB1OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -97,7 +99,7 @@ $(LIB1TARGET) : $(LIB1FILES) \ - .IF "$(LIB2ARCHIV)" != "" - - $(LIB2ARCHIV) : $(LIB2TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB2ARCHIV:b).cmd -@@ -133,10 +135,12 @@ $(LIB2ARCHIV) : $(LIB2TARGET) - $(LIB2TARGET) : $(LIB2FILES) \ - $(LIB2OBJFILES) \ - $(LIB2DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB2FILES) - @echo using: $(LIB2TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB2OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -190,7 +194,7 @@ $(LIB2TARGET) : $(LIB2FILES) \ - .IF "$(LIB3ARCHIV)" != "" - - $(LIB3ARCHIV) : $(LIB3TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB3ARCHIV:b).cmd -@@ -226,10 +230,12 @@ $(LIB3ARCHIV) : $(LIB3TARGET) - $(LIB3TARGET) : $(LIB3FILES) \ - $(LIB3OBJFILES) \ - $(LIB3DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB3FILES) - @echo using: $(LIB3TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB3OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -283,7 +289,7 @@ $(LIB3TARGET) : $(LIB3FILES) \ - .IF "$(LIB4ARCHIV)" != "" - - $(LIB4ARCHIV) : $(LIB4TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB4ARCHIV:b).cmd -@@ -319,10 +325,12 @@ $(LIB4ARCHIV) : $(LIB4TARGET) - $(LIB4TARGET) : $(LIB4FILES) \ - $(LIB4OBJFILES) \ - $(LIB4DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB4FILES) - @echo using: $(LIB4TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB4OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -376,7 +384,7 @@ $(LIB4TARGET) : $(LIB4FILES) \ - .IF "$(LIB5ARCHIV)" != "" - - $(LIB5ARCHIV) : $(LIB5TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB5ARCHIV:b).cmd -@@ -412,10 +420,12 @@ $(LIB5ARCHIV) : $(LIB5TARGET) - $(LIB5TARGET) : $(LIB5FILES) \ - $(LIB5OBJFILES) \ - $(LIB5DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB5FILES) - @echo using: $(LIB5TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB5OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -469,7 +479,7 @@ $(LIB5TARGET) : $(LIB5FILES) \ - .IF "$(LIB6ARCHIV)" != "" - - $(LIB6ARCHIV) : $(LIB6TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB6ARCHIV:b).cmd -@@ -505,10 +515,12 @@ $(LIB6ARCHIV) : $(LIB6TARGET) - $(LIB6TARGET) : $(LIB6FILES) \ - $(LIB6OBJFILES) \ - $(LIB6DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB6FILES) - @echo using: $(LIB6TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB6OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -562,7 +574,7 @@ $(LIB6TARGET) : $(LIB6FILES) \ - .IF "$(LIB7ARCHIV)" != "" - - $(LIB7ARCHIV) : $(LIB7TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB7ARCHIV:b).cmd -@@ -598,10 +610,12 @@ $(LIB7ARCHIV) : $(LIB7TARGET) - $(LIB7TARGET) : $(LIB7FILES) \ - $(LIB7OBJFILES) \ - $(LIB7DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB7FILES) - @echo using: $(LIB7TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB7OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -655,7 +669,7 @@ $(LIB7TARGET) : $(LIB7FILES) \ - .IF "$(LIB8ARCHIV)" != "" - - $(LIB8ARCHIV) : $(LIB8TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB8ARCHIV:b).cmd -@@ -691,10 +705,12 @@ $(LIB8ARCHIV) : $(LIB8TARGET) - $(LIB8TARGET) : $(LIB8FILES) \ - $(LIB8OBJFILES) \ - $(LIB8DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB8FILES) - @echo using: $(LIB8TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB8OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -748,7 +764,7 @@ $(LIB8TARGET) : $(LIB8FILES) \ - .IF "$(LIB9ARCHIV)" != "" - - $(LIB9ARCHIV) : $(LIB9TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB9ARCHIV:b).cmd -@@ -784,10 +800,12 @@ $(LIB9ARCHIV) : $(LIB9TARGET) - $(LIB9TARGET) : $(LIB9FILES) \ - $(LIB9OBJFILES) \ - $(LIB9DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB9FILES) - @echo using: $(LIB9TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB9OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -@@ -841,7 +859,7 @@ $(LIB9TARGET) : $(LIB9FILES) \ - .IF "$(LIB10ARCHIV)" != "" - - $(LIB10ARCHIV) : $(LIB10TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB10ARCHIV:b).cmd -@@ -877,10 +895,12 @@ $(LIB10ARCHIV) : $(LIB10TARGET) - $(LIB10TARGET) : $(LIB10FILES) \ - $(LIB10OBJFILES) \ - $(LIB10DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB10FILES) - @echo using: $(LIB10TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB10OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -diff --git solenv/inc/_tg_rslb.mk solenv/inc/_tg_rslb.mk -index 9f92278..4719f90 100644 ---- solenv/inc/_tg_rslb.mk -+++ solenv/inc/_tg_rslb.mk -@@ -8,11 +8,13 @@ HIDRES1PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB1NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB1HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB1SRSFILES))) - $(HIDRES1PARTICLE): $(RESLIB1HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB1HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB1HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES1PARTICLE) -@@ -25,7 +27,7 @@ $(RSC_MULTI1) : \ - $(RESLIB1BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -40,7 +42,7 @@ $(RSC_MULTI1) : \ - $(RSC1HEADER) $(RESLIB1SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -59,7 +61,7 @@ $(RSC_MULTI1) : \ - $(RESLIB1TARGETN): \ - $(RESLIB1SRSFILES) \ - $(RESLIB1BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI1) -@@ -86,11 +88,13 @@ HIDRES2PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB2NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB2HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB2SRSFILES))) - $(HIDRES2PARTICLE): $(RESLIB2HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB2HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB2HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES2PARTICLE) -@@ -103,7 +107,7 @@ $(RSC_MULTI2) : \ - $(RESLIB2BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -118,7 +122,7 @@ $(RSC_MULTI2) : \ - $(RSC2HEADER) $(RESLIB2SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -137,7 +141,7 @@ $(RSC_MULTI2) : \ - $(RESLIB2TARGETN): \ - $(RESLIB2SRSFILES) \ - $(RESLIB2BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI2) -@@ -164,11 +168,13 @@ HIDRES3PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB3NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB3HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB3SRSFILES))) - $(HIDRES3PARTICLE): $(RESLIB3HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB3HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB3HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES3PARTICLE) -@@ -181,7 +187,7 @@ $(RSC_MULTI3) : \ - $(RESLIB3BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -196,7 +202,7 @@ $(RSC_MULTI3) : \ - $(RSC3HEADER) $(RESLIB3SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -215,7 +221,7 @@ $(RSC_MULTI3) : \ - $(RESLIB3TARGETN): \ - $(RESLIB3SRSFILES) \ - $(RESLIB3BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI3) -@@ -242,11 +248,13 @@ HIDRES4PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB4NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB4HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB4SRSFILES))) - $(HIDRES4PARTICLE): $(RESLIB4HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB4HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB4HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES4PARTICLE) -@@ -259,7 +267,7 @@ $(RSC_MULTI4) : \ - $(RESLIB4BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -274,7 +282,7 @@ $(RSC_MULTI4) : \ - $(RSC4HEADER) $(RESLIB4SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -293,7 +301,7 @@ $(RSC_MULTI4) : \ - $(RESLIB4TARGETN): \ - $(RESLIB4SRSFILES) \ - $(RESLIB4BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI4) -@@ -320,11 +328,13 @@ HIDRES5PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB5NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB5HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB5SRSFILES))) - $(HIDRES5PARTICLE): $(RESLIB5HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB5HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB5HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES5PARTICLE) -@@ -337,7 +347,7 @@ $(RSC_MULTI5) : \ - $(RESLIB5BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -352,7 +362,7 @@ $(RSC_MULTI5) : \ - $(RSC5HEADER) $(RESLIB5SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -371,7 +381,7 @@ $(RSC_MULTI5) : \ - $(RESLIB5TARGETN): \ - $(RESLIB5SRSFILES) \ - $(RESLIB5BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI5) -@@ -398,11 +408,13 @@ HIDRES6PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB6NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB6HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB6SRSFILES))) - $(HIDRES6PARTICLE): $(RESLIB6HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB6HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB6HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES6PARTICLE) -@@ -415,7 +427,7 @@ $(RSC_MULTI6) : \ - $(RESLIB6BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -430,7 +442,7 @@ $(RSC_MULTI6) : \ - $(RSC6HEADER) $(RESLIB6SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -449,7 +461,7 @@ $(RSC_MULTI6) : \ - $(RESLIB6TARGETN): \ - $(RESLIB6SRSFILES) \ - $(RESLIB6BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI6) -@@ -476,11 +488,13 @@ HIDRES7PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB7NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB7HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB7SRSFILES))) - $(HIDRES7PARTICLE): $(RESLIB7HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB7HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB7HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES7PARTICLE) -@@ -493,7 +507,7 @@ $(RSC_MULTI7) : \ - $(RESLIB7BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -508,7 +522,7 @@ $(RSC_MULTI7) : \ - $(RSC7HEADER) $(RESLIB7SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -527,7 +541,7 @@ $(RSC_MULTI7) : \ - $(RESLIB7TARGETN): \ - $(RESLIB7SRSFILES) \ - $(RESLIB7BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI7) -@@ -554,11 +568,13 @@ HIDRES8PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB8NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB8HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB8SRSFILES))) - $(HIDRES8PARTICLE): $(RESLIB8HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB8HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB8HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES8PARTICLE) -@@ -571,7 +587,7 @@ $(RSC_MULTI8) : \ - $(RESLIB8BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -586,7 +602,7 @@ $(RSC_MULTI8) : \ - $(RSC8HEADER) $(RESLIB8SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -605,7 +621,7 @@ $(RSC_MULTI8) : \ - $(RESLIB8TARGETN): \ - $(RESLIB8SRSFILES) \ - $(RESLIB8BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI8) -@@ -632,11 +648,13 @@ HIDRES9PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB9NAME)_res - #HACK cut off the dirty srs files which are included from solver - RESLIB9HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB9SRSFILES))) - $(HIDRES9PARTICLE): $(RESLIB9HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB9HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB9HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES9PARTICLE) -@@ -649,7 +667,7 @@ $(RSC_MULTI9) : \ - $(RESLIB9BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -664,7 +682,7 @@ $(RSC_MULTI9) : \ - $(RSC9HEADER) $(RESLIB9SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -683,7 +701,7 @@ $(RSC_MULTI9) : \ - $(RESLIB9TARGETN): \ - $(RESLIB9SRSFILES) \ - $(RESLIB9BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI9) -@@ -710,11 +728,13 @@ HIDRES10PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB10NAME)_r - #HACK cut off the dirty srs files which are included from solver - RESLIB10HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB10SRSFILES))) - $(HIDRES10PARTICLE): $(RESLIB10HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB10HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB10HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES10PARTICLE) -@@ -727,7 +747,7 @@ $(RSC_MULTI10) : \ - $(RESLIB10BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -742,7 +762,7 @@ $(RSC_MULTI10) : \ - $(RSC10HEADER) $(RESLIB10SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -761,7 +781,7 @@ $(RSC_MULTI10) : \ - $(RESLIB10TARGETN): \ - $(RESLIB10SRSFILES) \ - $(RESLIB10BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI10) -diff --git solenv/inc/_tg_scp.mk solenv/inc/_tg_scp.mk -index 55dec30..eecbb8a 100644 ---- solenv/inc/_tg_scp.mk -+++ solenv/inc/_tg_scp.mk -@@ -10,8 +10,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP1FILES=$(foreach,i,$(SCP1FILES) $(foreach,j,$(SCP1LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP1TARGETN): $(LOCALSCP1FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP1LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP1FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -29,8 +31,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP2FILES=$(foreach,i,$(SCP2FILES) $(foreach,j,$(SCP2LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP2TARGETN): $(LOCALSCP2FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP2LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP2FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -48,8 +52,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP3FILES=$(foreach,i,$(SCP3FILES) $(foreach,j,$(SCP3LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP3TARGETN): $(LOCALSCP3FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP3LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP3FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -67,8 +73,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP4FILES=$(foreach,i,$(SCP4FILES) $(foreach,j,$(SCP4LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP4TARGETN): $(LOCALSCP4FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP4LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP4FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -86,8 +94,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP5FILES=$(foreach,i,$(SCP5FILES) $(foreach,j,$(SCP5LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP5TARGETN): $(LOCALSCP5FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP5LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP5FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -105,8 +115,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP6FILES=$(foreach,i,$(SCP6FILES) $(foreach,j,$(SCP6LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP6TARGETN): $(LOCALSCP6FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP6LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP6FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -124,8 +136,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP7FILES=$(foreach,i,$(SCP7FILES) $(foreach,j,$(SCP7LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP7TARGETN): $(LOCALSCP7FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP7LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP7FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -143,8 +157,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP8FILES=$(foreach,i,$(SCP8FILES) $(foreach,j,$(SCP8LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP8TARGETN): $(LOCALSCP8FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP8LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP8FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -162,8 +178,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP9FILES=$(foreach,i,$(SCP9FILES) $(foreach,j,$(SCP9LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP9TARGETN): $(LOCALSCP9FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP9LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP9FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -@@ -181,8 +199,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP10FILES=$(foreach,i,$(SCP10FILES) $(foreach,j,$(SCP10LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP10TARGETN): $(LOCALSCP10FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP10LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP10FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -diff --git solenv/inc/_tg_sdi.mk solenv/inc/_tg_sdi.mk -index 238dc76..7eb1323 100644 ---- solenv/inc/_tg_sdi.mk -+++ solenv/inc/_tg_sdi.mk -@@ -2,8 +2,10 @@ - - .IF "$(HIDSID1PARTICLE)"!="" - $(HIDSID1PARTICLE): $(SDI1TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI1NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -16,8 +18,10 @@ $(HIDSID1PARTICLE): $(SDI1TARGET) - - .IF "$(SDI1TARGET)"!="" - $(SDI1TARGET): $(SVSDI1DEPEND) $(SDI1NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI1NAME).hxx \ -@@ -34,8 +38,10 @@ $(SDI1TARGET): $(SVSDI1DEPEND) $(SDI1NAME).sdi - - .IF "$(HIDSID2PARTICLE)"!="" - $(HIDSID2PARTICLE): $(SDI2TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI2NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -48,8 +54,10 @@ $(HIDSID2PARTICLE): $(SDI2TARGET) - - .IF "$(SDI2TARGET)"!="" - $(SDI2TARGET): $(SVSDI2DEPEND) $(SDI2NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI2NAME).hxx \ -@@ -66,8 +74,10 @@ $(SDI2TARGET): $(SVSDI2DEPEND) $(SDI2NAME).sdi - - .IF "$(HIDSID3PARTICLE)"!="" - $(HIDSID3PARTICLE): $(SDI3TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI3NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -80,8 +90,10 @@ $(HIDSID3PARTICLE): $(SDI3TARGET) - - .IF "$(SDI3TARGET)"!="" - $(SDI3TARGET): $(SVSDI3DEPEND) $(SDI3NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI3NAME).hxx \ -@@ -98,8 +110,10 @@ $(SDI3TARGET): $(SVSDI3DEPEND) $(SDI3NAME).sdi - - .IF "$(HIDSID4PARTICLE)"!="" - $(HIDSID4PARTICLE): $(SDI4TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI4NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -112,8 +126,10 @@ $(HIDSID4PARTICLE): $(SDI4TARGET) - - .IF "$(SDI4TARGET)"!="" - $(SDI4TARGET): $(SVSDI4DEPEND) $(SDI4NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI4NAME).hxx \ -@@ -130,8 +146,10 @@ $(SDI4TARGET): $(SVSDI4DEPEND) $(SDI4NAME).sdi - - .IF "$(HIDSID5PARTICLE)"!="" - $(HIDSID5PARTICLE): $(SDI5TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI5NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -144,8 +162,10 @@ $(HIDSID5PARTICLE): $(SDI5TARGET) - - .IF "$(SDI5TARGET)"!="" - $(SDI5TARGET): $(SVSDI5DEPEND) $(SDI5NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI5NAME).hxx \ -@@ -162,8 +182,10 @@ $(SDI5TARGET): $(SVSDI5DEPEND) $(SDI5NAME).sdi - - .IF "$(HIDSID6PARTICLE)"!="" - $(HIDSID6PARTICLE): $(SDI6TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI6NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -176,8 +198,10 @@ $(HIDSID6PARTICLE): $(SDI6TARGET) - - .IF "$(SDI6TARGET)"!="" - $(SDI6TARGET): $(SVSDI6DEPEND) $(SDI6NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI6NAME).hxx \ -@@ -194,8 +218,10 @@ $(SDI6TARGET): $(SVSDI6DEPEND) $(SDI6NAME).sdi - - .IF "$(HIDSID7PARTICLE)"!="" - $(HIDSID7PARTICLE): $(SDI7TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI7NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -208,8 +234,10 @@ $(HIDSID7PARTICLE): $(SDI7TARGET) - - .IF "$(SDI7TARGET)"!="" - $(SDI7TARGET): $(SVSDI7DEPEND) $(SDI7NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI7NAME).hxx \ -@@ -226,8 +254,10 @@ $(SDI7TARGET): $(SVSDI7DEPEND) $(SDI7NAME).sdi - - .IF "$(HIDSID8PARTICLE)"!="" - $(HIDSID8PARTICLE): $(SDI8TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI8NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -240,8 +270,10 @@ $(HIDSID8PARTICLE): $(SDI8TARGET) - - .IF "$(SDI8TARGET)"!="" - $(SDI8TARGET): $(SVSDI8DEPEND) $(SDI8NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI8NAME).hxx \ -@@ -258,8 +290,10 @@ $(SDI8TARGET): $(SVSDI8DEPEND) $(SDI8NAME).sdi - - .IF "$(HIDSID9PARTICLE)"!="" - $(HIDSID9PARTICLE): $(SDI9TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI9NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -272,8 +306,10 @@ $(HIDSID9PARTICLE): $(SDI9TARGET) - - .IF "$(SDI9TARGET)"!="" - $(SDI9TARGET): $(SVSDI9DEPEND) $(SDI9NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI9NAME).hxx \ -@@ -290,8 +326,10 @@ $(SDI9TARGET): $(SVSDI9DEPEND) $(SDI9NAME).sdi - - .IF "$(HIDSID10PARTICLE)"!="" - $(HIDSID10PARTICLE): $(SDI10TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI10NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -304,8 +342,10 @@ $(HIDSID10PARTICLE): $(SDI10TARGET) - - .IF "$(SDI10TARGET)"!="" - $(SDI10TARGET): $(SVSDI10DEPEND) $(SDI10NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI10NAME).hxx \ -diff --git solenv/inc/_tg_shl.mk solenv/inc/_tg_shl.mk -index fbab56a..a9f08dc 100644 ---- solenv/inc/_tg_shl.mk -+++ solenv/inc/_tg_shl.mk -@@ -46,7 +46,7 @@ SHL1VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL1TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL1VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL1VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL1VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL1VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL1VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -108,16 +108,20 @@ $(USE_SHL1VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL1OBJS)!"="" - @$(TYPE) /dev/null $(SHL1LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL1INTERFACE) -f $(SHL1FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL1INTERFACE) -f $(SHL1FILTERFILE) -m $@ - - .ELSE # "$(SHL1FILTERFILE)"!="" - USE_SHL1VERSIONMAP=$(MISC)$/$(SHL1TARGET).vmap - $(USE_SHL1VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL1FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL1FILTERFILE)"!="" - .ELSE # "$(USE_SHL1VERSIONMAP)"!="" -@@ -144,11 +148,11 @@ $(USE_SHL1VERSIONMAP): $(SHL1VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL1VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL1VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL1VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL1VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL1VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL1VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -254,8 +258,10 @@ $(SHL1TARGETN) : \ - $(SHL1DEPN) \ - $(SHL1IMP_ORD) \ - $(SHL1LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL1TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL1DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL1DEFAULTRES:b).rc -@@ -432,7 +438,7 @@ $(SHL1TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_1.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL1RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL1NOCHECK)"=="" -@@ -442,22 +448,24 @@ $(SHL1TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_1.cmd - @echo $(SHL1LINKER) $(SHL1LINKFLAGS) $(SHL1SONAME) $(LINKFLAGSSHL) $(SHL1VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL1OBJS:s/.obj/.o/) \ -- $(SHL1VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL1LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL1STDLIBS) $(SHL1ARCHIVES) $(SHL1STDSHL) $(STDSHL1) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_1.cmd -+ $(SHL1VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL1LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL1STDLIBS) $(SHL1ARCHIVES) $(SHL1STDSHL) $(STDSHL1) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_1.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_1.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_1.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL1NOCHECK)"=="" -- -$(RM) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -- $(RENAME) $(SHL1TARGETN) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL1TARGETN) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) - .ENDIF # "$(SHL1NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL1TARGETN:b) -- cd $(LB) && ln -s $(SHL1TARGETN:f) $(SHL1TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL1TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL1TARGETN:f) $(SHL1TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -586,7 +594,7 @@ SHL2VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL2TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL2VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL2VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL2VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL2VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL2VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -648,16 +656,20 @@ $(USE_SHL2VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL2OBJS)!"="" - @$(TYPE) /dev/null $(SHL2LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL2INTERFACE) -f $(SHL2FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL2INTERFACE) -f $(SHL2FILTERFILE) -m $@ - - .ELSE # "$(SHL2FILTERFILE)"!="" - USE_SHL2VERSIONMAP=$(MISC)$/$(SHL2TARGET).vmap - $(USE_SHL2VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL2FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL2FILTERFILE)"!="" - .ELSE # "$(USE_SHL2VERSIONMAP)"!="" -@@ -684,11 +696,11 @@ $(USE_SHL2VERSIONMAP): $(SHL2VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL2VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL2VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL2VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL2VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL2VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL2VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -794,8 +806,10 @@ $(SHL2TARGETN) : \ - $(SHL2DEPN) \ - $(SHL2IMP_ORD) \ - $(SHL2LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL2TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL2DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL2DEFAULTRES:b).rc -@@ -972,7 +986,7 @@ $(SHL2TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_2.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL2RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL2NOCHECK)"=="" -@@ -982,22 +996,24 @@ $(SHL2TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_2.cmd - @echo $(SHL2LINKER) $(SHL2LINKFLAGS) $(SHL2SONAME) $(LINKFLAGSSHL) $(SHL2VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL2OBJS:s/.obj/.o/) \ -- $(SHL2VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL2LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL2STDLIBS) $(SHL2ARCHIVES) $(SHL2STDSHL) $(STDSHL2) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_2.cmd -+ $(SHL2VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL2LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL2STDLIBS) $(SHL2ARCHIVES) $(SHL2STDSHL) $(STDSHL2) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_2.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_2.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_2.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL2NOCHECK)"=="" -- -$(RM) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -- $(RENAME) $(SHL2TARGETN) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL2TARGETN) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) - .ENDIF # "$(SHL2NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL2TARGETN:b) -- cd $(LB) && ln -s $(SHL2TARGETN:f) $(SHL2TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL2TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL2TARGETN:f) $(SHL2TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -1126,7 +1142,7 @@ SHL3VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL3TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL3VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL3VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL3VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL3VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL3VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -1188,16 +1204,20 @@ $(USE_SHL3VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL3OBJS)!"="" - @$(TYPE) /dev/null $(SHL3LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL3INTERFACE) -f $(SHL3FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL3INTERFACE) -f $(SHL3FILTERFILE) -m $@ - - .ELSE # "$(SHL3FILTERFILE)"!="" - USE_SHL3VERSIONMAP=$(MISC)$/$(SHL3TARGET).vmap - $(USE_SHL3VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL3FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL3FILTERFILE)"!="" - .ELSE # "$(USE_SHL3VERSIONMAP)"!="" -@@ -1224,11 +1244,11 @@ $(USE_SHL3VERSIONMAP): $(SHL3VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL3VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL3VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL3VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL3VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL3VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL3VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -1334,8 +1354,10 @@ $(SHL3TARGETN) : \ - $(SHL3DEPN) \ - $(SHL3IMP_ORD) \ - $(SHL3LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL3TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL3DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL3DEFAULTRES:b).rc -@@ -1512,7 +1534,7 @@ $(SHL3TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_3.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL3RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL3NOCHECK)"=="" -@@ -1522,22 +1544,24 @@ $(SHL3TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_3.cmd - @echo $(SHL3LINKER) $(SHL3LINKFLAGS) $(SHL3SONAME) $(LINKFLAGSSHL) $(SHL3VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL3OBJS:s/.obj/.o/) \ -- $(SHL3VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL3LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL3STDLIBS) $(SHL3ARCHIVES) $(SHL3STDSHL) $(STDSHL3) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_3.cmd -+ $(SHL3VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL3LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL3STDLIBS) $(SHL3ARCHIVES) $(SHL3STDSHL) $(STDSHL3) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_3.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_3.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_3.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL3NOCHECK)"=="" -- -$(RM) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -- $(RENAME) $(SHL3TARGETN) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL3TARGETN) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) - .ENDIF # "$(SHL3NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL3TARGETN:b) -- cd $(LB) && ln -s $(SHL3TARGETN:f) $(SHL3TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL3TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL3TARGETN:f) $(SHL3TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -1666,7 +1690,7 @@ SHL4VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL4TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL4VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL4VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL4VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL4VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL4VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -1728,16 +1752,20 @@ $(USE_SHL4VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL4OBJS)!"="" - @$(TYPE) /dev/null $(SHL4LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL4INTERFACE) -f $(SHL4FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL4INTERFACE) -f $(SHL4FILTERFILE) -m $@ - - .ELSE # "$(SHL4FILTERFILE)"!="" - USE_SHL4VERSIONMAP=$(MISC)$/$(SHL4TARGET).vmap - $(USE_SHL4VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL4FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL4FILTERFILE)"!="" - .ELSE # "$(USE_SHL4VERSIONMAP)"!="" -@@ -1764,11 +1792,11 @@ $(USE_SHL4VERSIONMAP): $(SHL4VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL4VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL4VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL4VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL4VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL4VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL4VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -1874,8 +1902,10 @@ $(SHL4TARGETN) : \ - $(SHL4DEPN) \ - $(SHL4IMP_ORD) \ - $(SHL4LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL4TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL4DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL4DEFAULTRES:b).rc -@@ -2052,7 +2082,7 @@ $(SHL4TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_4.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL4RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL4NOCHECK)"=="" -@@ -2062,22 +2092,24 @@ $(SHL4TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_4.cmd - @echo $(SHL4LINKER) $(SHL4LINKFLAGS) $(SHL4SONAME) $(LINKFLAGSSHL) $(SHL4VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL4OBJS:s/.obj/.o/) \ -- $(SHL4VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL4LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL4STDLIBS) $(SHL4ARCHIVES) $(SHL4STDSHL) $(STDSHL4) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_4.cmd -+ $(SHL4VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL4LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL4STDLIBS) $(SHL4ARCHIVES) $(SHL4STDSHL) $(STDSHL4) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_4.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_4.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_4.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL4NOCHECK)"=="" -- -$(RM) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -- $(RENAME) $(SHL4TARGETN) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL4TARGETN) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) - .ENDIF # "$(SHL4NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL4TARGETN:b) -- cd $(LB) && ln -s $(SHL4TARGETN:f) $(SHL4TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL4TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL4TARGETN:f) $(SHL4TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -2206,7 +2238,7 @@ SHL5VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL5TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL5VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL5VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL5VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL5VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL5VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -2268,16 +2300,20 @@ $(USE_SHL5VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL5OBJS)!"="" - @$(TYPE) /dev/null $(SHL5LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL5INTERFACE) -f $(SHL5FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL5INTERFACE) -f $(SHL5FILTERFILE) -m $@ - - .ELSE # "$(SHL5FILTERFILE)"!="" - USE_SHL5VERSIONMAP=$(MISC)$/$(SHL5TARGET).vmap - $(USE_SHL5VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL5FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL5FILTERFILE)"!="" - .ELSE # "$(USE_SHL5VERSIONMAP)"!="" -@@ -2304,11 +2340,11 @@ $(USE_SHL5VERSIONMAP): $(SHL5VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL5VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL5VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL5VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL5VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL5VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL5VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -2414,8 +2450,10 @@ $(SHL5TARGETN) : \ - $(SHL5DEPN) \ - $(SHL5IMP_ORD) \ - $(SHL5LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL5TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL5DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL5DEFAULTRES:b).rc -@@ -2592,7 +2630,7 @@ $(SHL5TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_5.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL5RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL5NOCHECK)"=="" -@@ -2602,22 +2640,24 @@ $(SHL5TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_5.cmd - @echo $(SHL5LINKER) $(SHL5LINKFLAGS) $(SHL5SONAME) $(LINKFLAGSSHL) $(SHL5VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL5OBJS:s/.obj/.o/) \ -- $(SHL5VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL5LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL5STDLIBS) $(SHL5ARCHIVES) $(SHL5STDSHL) $(STDSHL5) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_5.cmd -+ $(SHL5VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL5LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL5STDLIBS) $(SHL5ARCHIVES) $(SHL5STDSHL) $(STDSHL5) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_5.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_5.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_5.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL5NOCHECK)"=="" -- -$(RM) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -- $(RENAME) $(SHL5TARGETN) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL5TARGETN) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) - .ENDIF # "$(SHL5NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL5TARGETN:b) -- cd $(LB) && ln -s $(SHL5TARGETN:f) $(SHL5TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL5TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL5TARGETN:f) $(SHL5TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -2746,7 +2786,7 @@ SHL6VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL6TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL6VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL6VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL6VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL6VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL6VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -2808,16 +2848,20 @@ $(USE_SHL6VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL6OBJS)!"="" - @$(TYPE) /dev/null $(SHL6LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL6INTERFACE) -f $(SHL6FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL6INTERFACE) -f $(SHL6FILTERFILE) -m $@ - - .ELSE # "$(SHL6FILTERFILE)"!="" - USE_SHL6VERSIONMAP=$(MISC)$/$(SHL6TARGET).vmap - $(USE_SHL6VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL6FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL6FILTERFILE)"!="" - .ELSE # "$(USE_SHL6VERSIONMAP)"!="" -@@ -2844,11 +2888,11 @@ $(USE_SHL6VERSIONMAP): $(SHL6VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL6VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL6VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL6VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL6VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL6VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL6VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -2954,8 +2998,10 @@ $(SHL6TARGETN) : \ - $(SHL6DEPN) \ - $(SHL6IMP_ORD) \ - $(SHL6LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL6TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL6DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL6DEFAULTRES:b).rc -@@ -3132,7 +3178,7 @@ $(SHL6TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_6.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL6RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL6NOCHECK)"=="" -@@ -3142,22 +3188,24 @@ $(SHL6TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_6.cmd - @echo $(SHL6LINKER) $(SHL6LINKFLAGS) $(SHL6SONAME) $(LINKFLAGSSHL) $(SHL6VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL6OBJS:s/.obj/.o/) \ -- $(SHL6VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL6LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL6STDLIBS) $(SHL6ARCHIVES) $(SHL6STDSHL) $(STDSHL6) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_6.cmd -+ $(SHL6VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL6LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL6STDLIBS) $(SHL6ARCHIVES) $(SHL6STDSHL) $(STDSHL6) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_6.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_6.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_6.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL6NOCHECK)"=="" -- -$(RM) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -- $(RENAME) $(SHL6TARGETN) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL6TARGETN) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) - .ENDIF # "$(SHL6NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL6TARGETN:b) -- cd $(LB) && ln -s $(SHL6TARGETN:f) $(SHL6TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL6TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL6TARGETN:f) $(SHL6TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -3286,7 +3334,7 @@ SHL7VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL7TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL7VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL7VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL7VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL7VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL7VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -3348,16 +3396,20 @@ $(USE_SHL7VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL7OBJS)!"="" - @$(TYPE) /dev/null $(SHL7LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL7INTERFACE) -f $(SHL7FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL7INTERFACE) -f $(SHL7FILTERFILE) -m $@ - - .ELSE # "$(SHL7FILTERFILE)"!="" - USE_SHL7VERSIONMAP=$(MISC)$/$(SHL7TARGET).vmap - $(USE_SHL7VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL7FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL7FILTERFILE)"!="" - .ELSE # "$(USE_SHL7VERSIONMAP)"!="" -@@ -3384,11 +3436,11 @@ $(USE_SHL7VERSIONMAP): $(SHL7VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL7VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL7VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL7VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL7VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL7VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL7VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -3494,8 +3546,10 @@ $(SHL7TARGETN) : \ - $(SHL7DEPN) \ - $(SHL7IMP_ORD) \ - $(SHL7LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL7TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL7DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL7DEFAULTRES:b).rc -@@ -3672,7 +3726,7 @@ $(SHL7TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_7.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL7RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL7NOCHECK)"=="" -@@ -3682,22 +3736,24 @@ $(SHL7TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_7.cmd - @echo $(SHL7LINKER) $(SHL7LINKFLAGS) $(SHL7SONAME) $(LINKFLAGSSHL) $(SHL7VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL7OBJS:s/.obj/.o/) \ -- $(SHL7VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL7LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL7STDLIBS) $(SHL7ARCHIVES) $(SHL7STDSHL) $(STDSHL7) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_7.cmd -+ $(SHL7VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL7LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL7STDLIBS) $(SHL7ARCHIVES) $(SHL7STDSHL) $(STDSHL7) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_7.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_7.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_7.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL7NOCHECK)"=="" -- -$(RM) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -- $(RENAME) $(SHL7TARGETN) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL7TARGETN) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) - .ENDIF # "$(SHL7NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL7TARGETN:b) -- cd $(LB) && ln -s $(SHL7TARGETN:f) $(SHL7TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL7TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL7TARGETN:f) $(SHL7TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -3826,7 +3882,7 @@ SHL8VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL8TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL8VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL8VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL8VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL8VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL8VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -3888,16 +3944,20 @@ $(USE_SHL8VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL8OBJS)!"="" - @$(TYPE) /dev/null $(SHL8LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL8INTERFACE) -f $(SHL8FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL8INTERFACE) -f $(SHL8FILTERFILE) -m $@ - - .ELSE # "$(SHL8FILTERFILE)"!="" - USE_SHL8VERSIONMAP=$(MISC)$/$(SHL8TARGET).vmap - $(USE_SHL8VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL8FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL8FILTERFILE)"!="" - .ELSE # "$(USE_SHL8VERSIONMAP)"!="" -@@ -3924,11 +3984,11 @@ $(USE_SHL8VERSIONMAP): $(SHL8VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL8VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL8VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL8VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL8VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL8VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL8VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -4034,8 +4094,10 @@ $(SHL8TARGETN) : \ - $(SHL8DEPN) \ - $(SHL8IMP_ORD) \ - $(SHL8LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL8TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL8DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL8DEFAULTRES:b).rc -@@ -4212,7 +4274,7 @@ $(SHL8TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_8.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL8RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL8NOCHECK)"=="" -@@ -4222,22 +4284,24 @@ $(SHL8TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_8.cmd - @echo $(SHL8LINKER) $(SHL8LINKFLAGS) $(SHL8SONAME) $(LINKFLAGSSHL) $(SHL8VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL8OBJS:s/.obj/.o/) \ -- $(SHL8VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL8LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL8STDLIBS) $(SHL8ARCHIVES) $(SHL8STDSHL) $(STDSHL8) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_8.cmd -+ $(SHL8VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL8LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL8STDLIBS) $(SHL8ARCHIVES) $(SHL8STDSHL) $(STDSHL8) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_8.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_8.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_8.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL8NOCHECK)"=="" -- -$(RM) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -- $(RENAME) $(SHL8TARGETN) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL8TARGETN) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) - .ENDIF # "$(SHL8NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL8TARGETN:b) -- cd $(LB) && ln -s $(SHL8TARGETN:f) $(SHL8TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL8TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL8TARGETN:f) $(SHL8TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -4366,7 +4430,7 @@ SHL9VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL9TARGET))}$( - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL9VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL9VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL9VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL9VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL9VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -4428,16 +4492,20 @@ $(USE_SHL9VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL9OBJS)!"="" - @$(TYPE) /dev/null $(SHL9LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL9INTERFACE) -f $(SHL9FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL9INTERFACE) -f $(SHL9FILTERFILE) -m $@ - - .ELSE # "$(SHL9FILTERFILE)"!="" - USE_SHL9VERSIONMAP=$(MISC)$/$(SHL9TARGET).vmap - $(USE_SHL9VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL9FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL9FILTERFILE)"!="" - .ELSE # "$(USE_SHL9VERSIONMAP)"!="" -@@ -4464,11 +4532,11 @@ $(USE_SHL9VERSIONMAP): $(SHL9VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL9VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL9VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL9VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL9VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL9VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL9VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -4574,8 +4642,10 @@ $(SHL9TARGETN) : \ - $(SHL9DEPN) \ - $(SHL9IMP_ORD) \ - $(SHL9LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL9TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL9DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL9DEFAULTRES:b).rc -@@ -4752,7 +4822,7 @@ $(SHL9TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_9.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL9RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL9NOCHECK)"=="" -@@ -4762,22 +4832,24 @@ $(SHL9TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_9.cmd - @echo $(SHL9LINKER) $(SHL9LINKFLAGS) $(SHL9SONAME) $(LINKFLAGSSHL) $(SHL9VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL9OBJS:s/.obj/.o/) \ -- $(SHL9VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL9LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL9STDLIBS) $(SHL9ARCHIVES) $(SHL9STDSHL) $(STDSHL9) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_9.cmd -+ $(SHL9VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL9LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL9STDLIBS) $(SHL9ARCHIVES) $(SHL9STDSHL) $(STDSHL9) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_9.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_9.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_9.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL9NOCHECK)"=="" -- -$(RM) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -- $(RENAME) $(SHL9TARGETN) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL9TARGETN) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) - .ENDIF # "$(SHL9NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL9TARGETN:b) -- cd $(LB) && ln -s $(SHL9TARGETN:f) $(SHL9TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL9TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL9TARGETN:f) $(SHL9TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -4906,7 +4978,7 @@ SHL10VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL10TARGET))} - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL10VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL10VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL10VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL10VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL10VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -4968,16 +5040,20 @@ $(USE_SHL10VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL10OBJS)!"="" - @$(TYPE) /dev/null $(SHL10LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL10INTERFACE) -f $(SHL10FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL10INTERFACE) -f $(SHL10FILTERFILE) -m $@ - - .ELSE # "$(SHL10FILTERFILE)"!="" - USE_SHL10VERSIONMAP=$(MISC)$/$(SHL10TARGET).vmap - $(USE_SHL10VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL10FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL10FILTERFILE)"!="" - .ELSE # "$(USE_SHL10VERSIONMAP)"!="" -@@ -5004,11 +5080,11 @@ $(USE_SHL10VERSIONMAP): $(SHL10VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL10VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL10VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL10VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL10VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL10VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL10VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -5114,8 +5190,10 @@ $(SHL10TARGETN) : \ - $(SHL10DEPN) \ - $(SHL10IMP_ORD) \ - $(SHL10LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL10TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL10DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL10DEFAULTRES:b).rc -@@ -5292,7 +5370,7 @@ $(SHL10TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_10.cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL10RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL10NOCHECK)"=="" -@@ -5302,22 +5380,24 @@ $(SHL10TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_10.cmd - @echo $(SHL10LINKER) $(SHL10LINKFLAGS) $(SHL10SONAME) $(LINKFLAGSSHL) $(SHL10VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL10OBJS:s/.obj/.o/) \ -- $(SHL10VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL10LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL10STDLIBS) $(SHL10ARCHIVES) $(SHL10STDSHL) $(STDSHL10) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_10.cmd -+ $(SHL10VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL10LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL10STDLIBS) $(SHL10ARCHIVES) $(SHL10STDSHL) $(STDSHL10) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_10.cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_10.cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_10.cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL10NOCHECK)"=="" -- -$(RM) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -- $(RENAME) $(SHL10TARGETN) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL10TARGETN) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) - .ENDIF # "$(SHL10NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL10TARGETN:b) -- cd $(LB) && ln -s $(SHL10TARGETN:f) $(SHL10TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL10TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL10TARGETN:f) $(SHL10TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -5421,8 +5501,10 @@ $(SHL1IMPLIBN): \ - $(SHL1IMPLIBN): \ - $(SHL1LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL1IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5476,8 +5558,10 @@ $(SHL2IMPLIBN): \ - $(SHL2IMPLIBN): \ - $(SHL2LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL2IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5531,8 +5615,10 @@ $(SHL3IMPLIBN): \ - $(SHL3IMPLIBN): \ - $(SHL3LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL3IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5586,8 +5672,10 @@ $(SHL4IMPLIBN): \ - $(SHL4IMPLIBN): \ - $(SHL4LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL4IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5641,8 +5729,10 @@ $(SHL5IMPLIBN): \ - $(SHL5IMPLIBN): \ - $(SHL5LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL5IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5696,8 +5786,10 @@ $(SHL6IMPLIBN): \ - $(SHL6IMPLIBN): \ - $(SHL6LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL6IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5751,8 +5843,10 @@ $(SHL7IMPLIBN): \ - $(SHL7IMPLIBN): \ - $(SHL7LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL7IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5806,8 +5900,10 @@ $(SHL8IMPLIBN): \ - $(SHL8IMPLIBN): \ - $(SHL8LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL8IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5861,8 +5957,10 @@ $(SHL9IMPLIBN): \ - $(SHL9IMPLIBN): \ - $(SHL9LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL9IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -@@ -5916,8 +6014,10 @@ $(SHL10IMPLIBN): \ - $(SHL10IMPLIBN): \ - $(SHL10LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL10IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -diff --git solenv/inc/_tg_srs.mk solenv/inc/_tg_srs.mk -index 756d3b7..acccc72 100644 ---- solenv/inc/_tg_srs.mk -+++ solenv/inc/_tg_srs.mk -@@ -5,10 +5,12 @@ - HID1FILES=$(foreach,i,$(SRC1FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS1PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS1NAME)_srs.hid - $(HIDSRS1PARTICLE) : $(HID1FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID1FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID1FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS1PARTICLE) -@@ -16,38 +18,57 @@ ALLTAR : $(HIDSRS1PARTICLE) - $(MISC)$/$(TARGET).$(SRS1NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS1NAME).dprr: $(SRC1FILES) $(HIDSRS1PARTICLE) $(HID1FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS1NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS1NAME).srs} -fo=$@ -p=$(TARGET) $(SRC1FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS1NAME).srs} -fo=$@ -p=$(TARGET) $(SRC1FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC1FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS1NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS1NAME).srs: $(foreach,i,$(SRC1FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS1NAME).srs: $(SRC1FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS1NAME)"!="" - -@@ -54,10 +75,12 @@ $(SRS)$/$(SRS1NAME).srs: $(SRC1FILES) - HID2FILES=$(foreach,i,$(SRC2FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS2PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS2NAME)_srs.hid - $(HIDSRS2PARTICLE) : $(HID2FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID2FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID2FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS2PARTICLE) -@@ -65,38 +88,57 @@ ALLTAR : $(HIDSRS2PARTICLE) - $(MISC)$/$(TARGET).$(SRS2NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS2NAME).dprr: $(SRC2FILES) $(HIDSRS2PARTICLE) $(HID2FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS2NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS2NAME).srs} -fo=$@ -p=$(TARGET) $(SRC2FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS2NAME).srs} -fo=$@ -p=$(TARGET) $(SRC2FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC2FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS2NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS2NAME).srs: $(foreach,i,$(SRC2FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS2NAME).srs: $(SRC2FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS2NAME)"!="" - -@@ -103,10 +145,12 @@ $(SRS)$/$(SRS2NAME).srs: $(SRC2FILES) - HID3FILES=$(foreach,i,$(SRC3FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS3PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS3NAME)_srs.hid - $(HIDSRS3PARTICLE) : $(HID3FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID3FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID3FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS3PARTICLE) -@@ -114,38 +158,57 @@ ALLTAR : $(HIDSRS3PARTICLE) - $(MISC)$/$(TARGET).$(SRS3NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS3NAME).dprr: $(SRC3FILES) $(HIDSRS3PARTICLE) $(HID3FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS3NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS3NAME).srs} -fo=$@ -p=$(TARGET) $(SRC3FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS3NAME).srs} -fo=$@ -p=$(TARGET) $(SRC3FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC3FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS3NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS3NAME).srs: $(foreach,i,$(SRC3FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS3NAME).srs: $(SRC3FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS3NAME)"!="" - -@@ -152,10 +215,12 @@ $(SRS)$/$(SRS3NAME).srs: $(SRC3FILES) - HID4FILES=$(foreach,i,$(SRC4FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS4PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS4NAME)_srs.hid - $(HIDSRS4PARTICLE) : $(HID4FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID4FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID4FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS4PARTICLE) -@@ -163,38 +228,57 @@ ALLTAR : $(HIDSRS4PARTICLE) - $(MISC)$/$(TARGET).$(SRS4NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS4NAME).dprr: $(SRC4FILES) $(HIDSRS4PARTICLE) $(HID4FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS4NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS4NAME).srs} -fo=$@ -p=$(TARGET) $(SRC4FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS4NAME).srs} -fo=$@ -p=$(TARGET) $(SRC4FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC4FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m localize.sdf -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS4NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS4NAME).srs: $(foreach,i,$(SRC4FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS4NAME).srs: $(SRC4FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS4NAME)"!="" - -@@ -201,10 +285,12 @@ $(SRS)$/$(SRS4NAME).srs: $(SRC4FILES) - HID5FILES=$(foreach,i,$(SRC5FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS5PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS5NAME)_srs.hid - $(HIDSRS5PARTICLE) : $(HID5FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID5FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID5FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS5PARTICLE) -@@ -212,38 +298,57 @@ ALLTAR : $(HIDSRS5PARTICLE) - $(MISC)$/$(TARGET).$(SRS5NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS5NAME).dprr: $(SRC5FILES) $(HIDSRS5PARTICLE) $(HID5FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS5NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS5NAME).srs} -fo=$@ -p=$(TARGET) $(SRC5FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS5NAME).srs} -fo=$@ -p=$(TARGET) $(SRC5FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC5FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS5NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS5NAME).srs: $(foreach,i,$(SRC5FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS5NAME).srs: $(SRC5FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS5NAME)"!="" - -@@ -250,10 +355,12 @@ $(SRS)$/$(SRS5NAME).srs: $(SRC5FILES) - HID6FILES=$(foreach,i,$(SRC6FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS6PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS6NAME)_srs.hid - $(HIDSRS6PARTICLE) : $(HID6FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID6FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID6FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS6PARTICLE) -@@ -261,38 +368,57 @@ ALLTAR : $(HIDSRS6PARTICLE) - $(MISC)$/$(TARGET).$(SRS6NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS6NAME).dprr: $(SRC6FILES) $(HIDSRS6PARTICLE) $(HID6FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS6NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS6NAME).srs} -fo=$@ -p=$(TARGET) $(SRC6FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS6NAME).srs} -fo=$@ -p=$(TARGET) $(SRC6FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC6FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS6NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS6NAME).srs: $(foreach,i,$(SRC6FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS6NAME).srs: $(SRC6FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS6NAME)"!="" - -@@ -299,10 +425,12 @@ $(SRS)$/$(SRS6NAME).srs: $(SRC6FILES) - HID7FILES=$(foreach,i,$(SRC7FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS7PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS7NAME)_srs.hid - $(HIDSRS7PARTICLE) : $(HID7FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID7FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID7FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS7PARTICLE) -@@ -310,38 +438,57 @@ ALLTAR : $(HIDSRS7PARTICLE) - $(MISC)$/$(TARGET).$(SRS7NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS7NAME).dprr: $(SRC7FILES) $(HIDSRS7PARTICLE) $(HID7FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS7NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS7NAME).srs} -fo=$@ -p=$(TARGET) $(SRC7FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS7NAME).srs} -fo=$@ -p=$(TARGET) $(SRC7FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC7FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS7NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS7NAME).srs: $(foreach,i,$(SRC7FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS7NAME).srs: $(SRC7FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS7NAME)"!="" - -@@ -348,10 +495,12 @@ $(SRS)$/$(SRS7NAME).srs: $(SRC7FILES) - HID8FILES=$(foreach,i,$(SRC8FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS8PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS8NAME)_srs.hid - $(HIDSRS8PARTICLE) : $(HID8FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID8FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID8FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS8PARTICLE) -@@ -359,38 +508,57 @@ ALLTAR : $(HIDSRS8PARTICLE) - $(MISC)$/$(TARGET).$(SRS8NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS8NAME).dprr: $(SRC8FILES) $(HIDSRS8PARTICLE) $(HID8FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS8NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS8NAME).srs} -fo=$@ -p=$(TARGET) $(SRC8FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS8NAME).srs} -fo=$@ -p=$(TARGET) $(SRC8FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC8FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS8NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS8NAME).srs: $(foreach,i,$(SRC8FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS8NAME).srs: $(SRC8FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS8NAME)"!="" - -@@ -397,10 +565,12 @@ $(SRS)$/$(SRS8NAME).srs: $(SRC8FILES) - HID9FILES=$(foreach,i,$(SRC9FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS9PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS9NAME)_srs.hid - $(HIDSRS9PARTICLE) : $(HID9FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID9FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID9FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS9PARTICLE) -@@ -408,38 +578,57 @@ ALLTAR : $(HIDSRS9PARTICLE) - $(MISC)$/$(TARGET).$(SRS9NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS9NAME).dprr: $(SRC9FILES) $(HIDSRS9PARTICLE) $(HID9FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS9NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS9NAME).srs} -fo=$@ -p=$(TARGET) $(SRC9FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS9NAME).srs} -fo=$@ -p=$(TARGET) $(SRC9FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC9FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS9NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS9NAME).srs: $(foreach,i,$(SRC9FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS9NAME).srs: $(SRC9FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS9NAME)"!="" - -@@ -446,10 +635,12 @@ $(SRS)$/$(SRS9NAME).srs: $(SRC9FILES) - HID10FILES=$(foreach,i,$(SRC10FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS10PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS10NAME)_srs.hid - $(HIDSRS10PARTICLE) : $(HID10FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID10FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID10FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS10PARTICLE) -@@ -457,38 +648,57 @@ ALLTAR : $(HIDSRS10PARTICLE) - $(MISC)$/$(TARGET).$(SRS10NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS10NAME).dprr: $(SRC10FILES) $(HIDSRS10PARTICLE) $(HID10FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS10NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS10NAME).srs} -fo=$@ -p=$(TARGET) $(SRC10FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS10NAME).srs} -fo=$@ -p=$(TARGET) $(SRC10FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC10FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS10NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS10NAME).srs: $(foreach,i,$(SRC10FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS10NAME).srs: $(SRC10FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS10NAME)"!="" - -diff --git solenv/inc/_tg_zip.mk solenv/inc/_tg_zip.mk -index 7b9a2d9..624ca95 100644 ---- solenv/inc/_tg_zip.mk -+++ solenv/inc/_tg_zip.mk -@@ -86,8 +86,10 @@ $(ZIP1DEPFILE) : - - - $(ZIP1TARGETN) : delzip $(ZIP1DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -206,8 +208,10 @@ $(ZIP2DEPFILE) : - - - $(ZIP2TARGETN) : delzip $(ZIP2DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -326,8 +330,10 @@ $(ZIP3DEPFILE) : - - - $(ZIP3TARGETN) : delzip $(ZIP3DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -446,8 +452,10 @@ $(ZIP4DEPFILE) : - - - $(ZIP4TARGETN) : delzip $(ZIP4DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -566,8 +574,10 @@ $(ZIP5DEPFILE) : - - - $(ZIP5TARGETN) : delzip $(ZIP5DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -686,8 +696,10 @@ $(ZIP6DEPFILE) : - - - $(ZIP6TARGETN) : delzip $(ZIP6DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -806,8 +818,10 @@ $(ZIP7DEPFILE) : - - - $(ZIP7TARGETN) : delzip $(ZIP7DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -926,8 +940,10 @@ $(ZIP8DEPFILE) : - - - $(ZIP8TARGETN) : delzip $(ZIP8DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -1046,8 +1062,10 @@ $(ZIP9DEPFILE) : - - - $(ZIP9TARGETN) : delzip $(ZIP9DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -@@ -1166,8 +1184,10 @@ $(ZIP10DEPFILE) : - - - $(ZIP10TARGETN) : delzip $(ZIP10DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -diff --git solenv/inc/ant.mk solenv/inc/ant.mk -index 901dd5e..6bd4db8 100644 ---- solenv/inc/ant.mk -+++ solenv/inc/ant.mk -@@ -58,7 +58,7 @@ CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(ANT_CLASSPATH)$(PATH_SEPERATOR)$(JAVA - # --- TARGETS ----------------------------------------------------- - - $(CLASSDIR)$/solar.properties : $(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT)$/minormkchanged.flg $(SOLARENV)$/inc/ant.properties -- @echo Making: $@ -+ @echo "Making: " $@ - @echo solar.build=$(BUILD) > $@ - @echo solar.rscversion=$(USQ)$(RSCVERSION)$(USQ) >> $@ - @echo solar.rscrevision=$(USQ)$(RSCREVISION)$(USQ) >> $@ -diff --git solenv/inc/pstrules.mk solenv/inc/pstrules.mk -index cb1d370..bae70ea 100644 ---- solenv/inc/pstrules.mk -+++ solenv/inc/pstrules.mk -@@ -38,7 +38,7 @@ - - $(OBJ)$/$(SECOND_BUILD)_%.obj : %.cxx - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $@ - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) - $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$(SECOND_BUILD)_$*.o $(CFLAGSINCXX)$(PWD)$/$*.cxx -@@ -53,7 +53,7 @@ $(OBJ)$/$(SECOND_BUILD)_%.obj : %.cxx - - $(OBJ)$/$(SECOND_BUILD)_%.obj : %.c - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $@ - .IF "$(GUI)"=="UNX" - .IF "$(TEST)"!="" - $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$(SECOND_BUILD)_$*.o $*.c -@@ -82,7 +82,7 @@ $(OBJ)$/$(SECOND_BUILD)_%.obj : %.c - - $(SLO)$/$(SECOND_BUILD)_%.obj : %.cxx - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $@ - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) - $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$(SECOND_BUILD)_$*.o $(CFLAGSINCXX)$(PWD)$/$*.cxx -@@ -101,7 +101,7 @@ $(SLO)$/$(SECOND_BUILD)_%.obj : %.cxx - - $(SLO)$/$(SECOND_BUILD)_%.obj : %.c - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $@ - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) - $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$(SECOND_BUILD)_$*.o $*.c -@@ -141,7 +141,7 @@ LANGFILEEXT=jlf - - $(PAR)$/%.par : - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $@ - @@-$(MKDIR) $(MISC)$/{$(subst,$(@:d:d:d), $(@:d:d))} - .IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2" - $(CPPLCC) -+ -P $(INCLUDE) $(CDEFS) $(SCPDEFS) -DDLLPOSTFIX=$(DLLPOSTFIX) $(*:b).scp > $(MISC)$/{$(subst,$(@:d:d:d), $(@:d:d))}$/$(*:b).pre -diff --git solenv/inc/rules.mk solenv/inc/rules.mk -index 26ebe9f..5a385f3 100644 ---- solenv/inc/rules.mk -+++ solenv/inc/rules.mk -@@ -32,17 +32,19 @@ - MKFILENAME:=RULES.MK - - $(OBJ)$/%.obj : %.cxx -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -+.ENDIF - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cxx -+ $(QUIET_BUILD) $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cxx - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - .IF "$(noadjust)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(noadjust)"=="" - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE - @@-$(RM) $@ - .IF "$(COM)"=="GCC" -@@ -52,20 +54,22 @@ $(OBJ)$/%.obj : %.cxx - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(OBJ)$/%.obj : %.cpp -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -+.ENDIF - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cpp -+ $(QUIET_BUILD) $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cpp - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE - @@-$(RM) $@ - .IF "$(COM)"=="GCC" -@@ -75,20 +79,22 @@ $(OBJ)$/%.obj : %.cpp - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(OBJ)$/%.obj : %.cc -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -+.ENDIF - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cc -+ $(QUIET_BUILD) $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cc - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- +$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) +$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE - @@$(RM) $@ - .IF "$(COM)"=="GCC" -@@ -162,7 +168,9 @@ $(SLO)$/precompiled_ex.% .PHONY: - .ENDIF # "$(ENABLE_PCH)"!="" - - $(SLO)$/%.obj : %.cxx -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -+.ENDIF - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(ENABLE_PCH)"!="" && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" ) - # just a helper var -@@ -181,11 +189,11 @@ $(SLO)$/%.obj : %.cxx - $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) -E $(CFLAGSINCXX)$(PWD)$/$*.cxx - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(CAPTURE_COMMAND) $(CXX) $(ACT_PCH_SWITCHES) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cxx $(CAPTURE_OUTPUT) -+ $(QUIET_BUILD) $(CAPTURE_COMMAND) $(CXX) $(ACT_PCH_SWITCHES) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cxx $(CAPTURE_OUTPUT) - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" && "$(CAPTURE_COMMAND)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .ELSE # "$(GUI)"=="UNX" - @@-$(RM) $@ -@@ -197,23 +205,25 @@ $(SLO)$/%.obj : %.cxx - .ENDIF # "$(GUI)"=="UNX" - .IF "$(nodep)"=="" - # fixme: write to file -- $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(SLO)$/%.obj : %.cpp -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(GUI)"=="UNX" - .IF "$(TEST)"!="" - $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(PWD)$/$*.cpp - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cpp -+ $(QUIET_BUILD) $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(PWD)$/$*.cpp - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .ELSE - @@-$(RM) $@ -@@ -224,23 +234,25 @@ $(SLO)$/%.obj : %.cpp - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(SLO)$/%.obj : $(MISC)$/%.cxx -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(GUI)"=="UNX" - .IF "$(TEST)"!="" - $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)$/$*.cxx - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(MISC)$/$*.cxx -+ $(QUIET_BUILD) $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(MISC)$/$*.cxx - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .ELSE - .IF "$(COM)"=="GCC" -@@ -250,41 +262,45 @@ $(SLO)$/%.obj : $(MISC)$/%.cxx - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $@ ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $@ ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(SLO)$/%.obj : $(MISC)$/%.cc -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(GUI)"=="UNX" - .IF "$(TEST)"!="" - $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)$/$*.cc - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(MISC)$/$*.cc -+ $(QUIET_BUILD) $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(CFLAGSINCXX)$(MISC)$/$*.cc - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- +$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) +$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .ELSE - $(CXX) @$(mktmp $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)$/$*.obj $(CFLAGSINCXX)$(MISC)$/$*.cc ) - .ENDIF - - $(OBJ)$/%.obj : $(MISC)$/%.cxx -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(GUI)"=="UNX" - .IF "$(TEST)"!="" - $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)$/$*.cxx - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(MISC)$/$*.cxx -+ $(QUIET_BUILD) $(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(CFLAGSINCXX)$(MISC)$/$*.cxx - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .ELSE - .IF "$(COM)"=="GCC" -@@ -294,25 +310,27 @@ $(OBJ)$/%.obj : $(MISC)$/%.cxx - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(OBJ)$/%.obj : %.c -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(GUI)"=="UNX" - .IF "$(TEST)"!="" - $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.c - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.c -+ $(QUIET_BUILD) $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.c - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - .IF "$(noadjust)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(noadjust)"=="" - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .ELSE - .IF "$(COM)"=="GCC" -@@ -323,20 +341,22 @@ $(OBJ)$/%.obj : %.c - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(OBJ)$/%.obj : $(MISC)$/%.c -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(MISC)$/$*.c -+ $(QUIET_BUILD) $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(MISC)$/$*.c - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE - @@-$(RM) $@ - .IF "$(COM)"=="GCC" -@@ -346,20 +366,22 @@ $(OBJ)$/%.obj : $(MISC)$/%.c - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - $(SLO)$/%.obj : $(MISC)$/%.c -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(MISC)$/$*.c -+ $(QUIET_BUILD) $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(MISC)$/$*.c - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE - @@-$(RM) $@ - .IF "$(COM)"=="GCC" -@@ -369,22 +391,26 @@ $(SLO)$/%.obj : $(MISC)$/%.c - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(TYPE) $(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) -- $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) -+.IF "$(QUIET_BUILD)"=="" -+ $(QUIET_BUILD) $(TYPE) $(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) -+.ENDIF -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) - # avoid _version objects (see tg_shl.mk) - quite hacky... - @noop $(!eq,$@,$(@:s/_version.obj/.obj/) $(NULL) $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/))) - .ENDIF # "$(nodep)"=="" - - $(SLO)$/%.obj : %.c -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(GUI)"=="UNX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $*.c -+ $(QUIET_BUILD) $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $*.c - .IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" - $(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/) - .ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE - @@-$(RM) $@ - .IF "$(COM)"=="GCC" -@@ -394,21 +420,23 @@ $(SLO)$/%.obj : %.c - .ENDIF - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - - # Objective-C files - $(OBJ)$/%.obj : %.m -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(OS)"=="MACOSX" - .IF "$(TEST)"!="" - $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.m - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.m -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.m -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .ELSE # "$(OS)"=="MACOSX" - @echo "No recipe for compiling Objective-C files is available for this platform" -@@ -416,36 +444,42 @@ $(OBJ)$/%.obj : %.m - - # Objective-C files - $(OBJ)$/%.obj : $(MISC)$/%.m -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(OS)"=="MACOSX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(MISC)$/$*.m -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(MISC)$/$*.m -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE # "$(OS)"=="MACOSX" - @echo "No recipe for compiling Objective-C files is available for this platform" - .ENDIF "$(OS)"=="MACOSX" - - # Objective-C files - $(SLO)$/%.obj : $(MISC)$/%.m -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(OS)"=="MACOSX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(MISC)$/$*.m -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(MISC)$/$*.m -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE # "$(OS)"=="MACOSX" - @echo "No recipe for compiling Objective-C files is available for this platform" - .ENDIF "$(OS)"=="MACOSX" - - # Objective-C files - $(SLO)$/%.obj : %.m -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(OS)"=="MACOSX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $*.m -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $*.m -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ELSE # "$(OS)"=="MACOSX" - @echo "No recipe for compiling Objective-C files is available for this platform" - .ENDIF "$(OS)"=="MACOSX" -@@ -457,18 +491,20 @@ not_existing$/o_%.dpcc : %.c;@noop $(assign all_local_obj+:=$<) - - # Objective-C++ files - $(OBJ)$/%.obj : %.mm -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(OS)"=="MACOSX" - .IF "$(TEST)"!="" - $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.mm - .ELSE - @$(RM) $@ $(@:s/.obj/.o/) -- $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.mm -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $*.mm -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .ENDIF - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - .ELSE # "$(OS)"=="MACOSX" -@@ -477,14 +513,16 @@ $(OBJ)$/%.obj : %.mm - - # Objective-C++ files - $(OBJ)$/%.obj : $(MISC)$/%.mm -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(OS)"=="MACOSX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(MISC)$/$*.mm -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)$/$*.o $(MISC)$/$*.mm -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)$/o_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - .ELSE # "$(OS)"=="MACOSX" -@@ -493,14 +531,16 @@ $(OBJ)$/%.obj : $(MISC)$/%.mm - - # Objective-C++ files - $(SLO)$/%.obj : $(MISC)$/%.mm -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) - .IF "$(OS)"=="MACOSX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(MISC)$/$*.mm -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $(MISC)$/$*.mm -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - .ELSE # "$(OS)"=="MACOSX" -@@ -509,14 +549,16 @@ $(SLO)$/%.obj : $(MISC)$/%.mm - - # Objective-C++ files - $(SLO)$/%.obj : %.mm -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(OS)"=="MACOSX" - @$(RM) $@ $(@:s/.obj/.o/) -- $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $*.mm -- $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) -+ $(QUIET_BUILD) $(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)$/$*.o $*.mm -+ $(QUIET_BUILD) $(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI) - .IF "$(nodep)"=="" -- $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) -+ $(QUIET_BUILD) $(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)$/s_$(@:f:s/.obj/.dpcc/) - @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/)) - .ENDIF # "$(nodep)"=="" - .ELSE # "$(OS)"=="MACOSX" -@@ -524,7 +566,7 @@ $(SLO)$/%.obj : %.mm - .ENDIF # "$(OS)"=="MACOSX" - - $(MISC)$/%.dpslo : -- @echo making .dpslo -+ @echo "Making: library dependencies for" $(TARGET).lib - @@$(RM) $@ - @@-$(CDD) $(MISC) && $(!null,$(all_local_slo) $(TYPE:s/+//) echo #) $(foreach,i,$(all_local_slo:b:+".dpcc") s_$(i)) > $(@:f) - @@-$(CDD) $(MISC) && $(!null,$(all_misc_slo) $(TYPE:s/+//) echo #) $(foreach,i,$(all_misc_slo:b:+".dpcc") s_$(i)) >> $(@:f) -@@ -532,7 +574,7 @@ $(MISC)$/%.dpslo : - @$(TYPE) $(mktmp $(TARGET)_known_dpcc+=$(all_local_slo:b:+".dpcc":^"s_") $(all_misc_slo:b:+".dpcc":^"s_")) >> $@ - - $(MISC)$/%.dpobj : -- @echo making .dpobj -+ @echo "Making: library dependencies for" $(TARGET).lib - @@$(RM) $@ - @@-$(CDD) $(MISC) && $(!null,$(all_local_obj) $(TYPE:s/+//) echo #) $(foreach,i,$(all_local_obj:b:+".dpcc") o_$(i)) > $(@:f) - @@-$(CDD) $(MISC) && $(!null,$(all_misc_obj) $(TYPE:s/+//) echo #) $(foreach,i,$(all_misc_obj:b:+".dpcc") o_$(i)) >> $(@:f) -@@ -619,34 +661,42 @@ $(MISC)$/%.dprc : - @echo $@ : $(RES)$/$(*:b).res >> $@ - - $(MISC)$/%.dpr : -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -+.ELSE -+ @echo > /dev/null -+.ENDIF - .IF "$(nodep)"=="" -- @echo Making: $@ -+ @echo "Making: resource file dependencies for" $(DEPSRSFILES) - @@-$(RM) $@ -- dmake $(MFLAGS) $(MAKEFILE) $(CALLMACROS) NO_HIDS=true make_srs_deps=true $(DEPSRSFILES) -- -$(TYPE) $(MISC)$/$(TARGET).*.dprr >> $@ -+ $(QUIET_BUILD) dmake $(MFLAGS) $(MAKEFILE) $(CALLMACROS) NO_HIDS=true make_srs_deps=true $(DEPSRSFILES) -+ @-$(TYPE) $(MISC)$/$(TARGET).*.dprr >> $@ - .ENDIF # "$(nodep)"=="" - - $(MISC)$/%.dpz : -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -+.ELSE -+ @echo > /dev/null -+.ENDIF - .IF "$(nodep)"=="" -- @echo Making: $@ -+ @echo "Making: zip file dependencies for" $(ZIPDEPFILES) - @@-$(RM) $@ - # line too long on 4nt - .IF "$(USE_SHELL)"!="4nt" || "$(GUI)"=="OS2" - dmake $(MFLAGS) $(MAKEFILE) $(CALLMACROS) make_zip_deps=true $(ZIPDEPFILES) - .ELSE # "$(USE_SHELL)"!="4nt" -- $(TYPE) $(mktmp $(ZIPDEPFILES:s/\/\\/)) | $(XARGS) dmake $(MFLAGS) $(MAKEFILE) $(CALLMACROS) make_zip_deps=true -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(ZIPDEPFILES:s/\/\\/)) | $(XARGS) dmake $(MFLAGS) $(MAKEFILE) $(CALLMACROS) make_zip_deps=true - .ENDIF # "$(USE_SHELL)"!="4nt" -- $(TYPE) $(ZIPDEPFILES) $(mktmp $(NULL)) | grep -v "CVS" | grep -v "\.svn" >> $@ -- echo zipdep_langs=$(alllangiso) >> $@ -+ @$(TYPE) $(ZIPDEPFILES) $(mktmp $(NULL)) | grep -v "CVS" | grep -v "\.svn" >> $@ -+ @echo zipdep_langs=$(alllangiso) >> $@ - @@-$(RM) $(ZIPDEPFILES) - .ENDIF # "$(nodep)"=="" - - # Dependencies fuer java - Files - - $(MISC)$/%.dpj : -- @echo Making dpj... -+ @echo "Making: java dependencies for" $(JAVACLASSFILES) - .IF "$(nodep)"!="" - .IF "$(GUI)"=="UNX" - @echo > $@ -@@ -663,15 +713,17 @@ $(MISC)$/%.dpj : - .ENDIF # "$(nodep)"=="" - - $(SLO)$/%.obj : %.asm -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(COM)"=="GCC" - .IF "$(ASM)"=="ml" -- $(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)$/$*.obj $*.asm -+ $(QUIET_BUILD) $(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)$/$*.obj $*.asm - @@-$(RM) $*.err - .ELSE # "$(ASM)"=="ml" - @@-$(RM) $@ -- $(ASM) $(AFLAGS) $*.asm,$(SLO)$/$*.obj; -+ $(QUIET_BUILD) $(ASM) $(AFLAGS) $*.asm,$(SLO)$/$*.obj; - .ENDIF # "$(ASM)"=="ml" - .ELSE - .IF "$(COM)"=="WTC" -@@ -691,15 +743,17 @@ $(SLO)$/%.obj : %.asm - .ENDIF - - $(OBJ)$/%.obj : %.asm -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< - .IF "$(COM)"=="GCC" - .IF "$(ASM)"=="ml" -- $(ASM) $(AFLAGS) -D$(COM) /Fo$(OBJ)$/$*.obj $*.asm -+ $(QUIET_BUILD) $(ASM) $(AFLAGS) -D$(COM) /Fo$(OBJ)$/$*.obj $*.asm - @@-$(RM) $*.err - .ELSE # "$(ASM)"=="ml" - @@-$(RM) $@ -- $(ASM) $(AFLAGS) $*.asm,$(OBJ)$/$*.obj; -+ $(QUIET_BUILD) $(ASM) $(AFLAGS) $*.asm,$(OBJ)$/$*.obj; - .ENDIF # "$(ASM)"=="ml" - .ELSE - .IF "$(COM)"=="MSC" -@@ -721,9 +775,11 @@ $(OUT)$/ucrdoc$/$(IDLPACKAGE)$/%.urd : %.idl - - # generate hid files - $(SRS)$/%.hid : %.src -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making hid $@ -- $(AUGMENT_LIBRARY_PATH) $(PERL) $(SOLARENV)$/bin$/mhids.pl $*.src $(SRS) $(PRJNAME) $(CDEFS) $(INCLUDE) -+.ENDIF -+ @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(*:f).src -+ $(QUIET_BUILD) $(AUGMENT_LIBRARY_PATH) $(PERL) $(SOLARENV)$/bin$/mhids.pl $*.src $(SRS) $(PRJNAME) $(CDEFS) $(INCLUDE) - - # make *.xml descriptions available in $(MISC) - $(MISC)$/%$($(WINVERSIONNAMES)_MAJOR).xml : %.xml -diff --git solenv/inc/settings.mk solenv/inc/settings.mk -index 5daf506..50e38a0 100644 ---- solenv/inc/settings.mk -+++ solenv/inc/settings.mk -@@ -311,6 +311,12 @@ PROFILE= - DBGUTIL= - dbgutil= - -+.IF "$(VERBOSE)"=="" && "$(verbose)"=="" -+QUIET_BUILD*=@ -+.ELSE -+QUIET_BUILD*= -+.ENDIF -+ - # =========================================================================== - # unter NT werden Variablennamen an untergeordnete makefiles UPPERCASE - # weitergereicht, aber case significant ausgewertet! -diff --git solenv/inc/target.mk solenv/inc/target.mk -index 01633b7..635da62 100644 ---- solenv/inc/target.mk -+++ solenv/inc/target.mk -@@ -1292,7 +1292,7 @@ $(UNOUCRTARGET) : $(UNOUCRHEADER) - # keep that one to rebuild single misses - $(UNOUCRHEADER): - @noop -- -+ - $(UNOUCRTARGET) : $(UNOUCRDEP) - .IF "$(XML2MK_FILES)"!="" - @@-$(RM) $(foreach,i,$(XML2MK_FILES) $(MISC)$/$(i).mk) -@@ -1382,7 +1382,7 @@ $(HXXCOPYTARGET): $(HXXCOPYFILES) - - .IF "$(UNIXTEXT)"!="" - $(UNIXTEXT) : $(UNIXTEXT:f) -- @echo Making $@ -+ @echo "Making: " $@ - @@-$(RM) -f $@ - @tr -d "\015" < $(@:f) > $@ - -@@ -1538,10 +1538,12 @@ $(MISC)$/$(TARGET)_%.done : %.xrb - - .IF "$(COMMONPRJHIDOTHERTARGET)"!="" - $(COMMONPRJHIDOTHERTARGET) : $(PRJHIDOTHERTARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $@ - @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -- $(TYPE) $(PRJHIDOTHERTARGET) > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(PRJHIDOTHERTARGET) > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - .ENDIF - -@@ -1686,7 +1688,10 @@ ZIPDEPPHONY=.PHONY - .ENDIF - - last_target: -- @echo ------------- -+.IF "$(QUIET_BUILD)"=="" -+ @echo ------------- -+.ENDIF -+ $(NULL) - - $(MISC)$/$(TARGET)genjava.mk: $(IDLFILES) - -@@ -1709,16 +1714,24 @@ $(TARGETDPJ) : $(JAVAFILES) $(JAVATARGET) - .IF "$(NOOPT_FLAG)" == "" - - $(NOOPTTARGET): -+.IF "$(QUIET_BUILD)"=="" - @echo --- NOOPTFILES --- -+.ENDIF - @dmake $(MFLAGS) $(MAKEFILE) nopt=true $(NOOPTFILES) NOOPT_FLAG=TRUE $(CALLMACROS) -+.IF "$(QUIET_BUILD)"=="" - @echo --- NOOPTFILES OVER --- -+.ENDIF - - $(NOOPTFILES): -+.IF "$(QUIET_BUILD)"=="" - @echo --- NOOPT --- -+.ENDIF - @dmake $(MFLAGS) $(MAKEFILE) nopt=true NOOPT_FLAG=TRUE $(CALLMACROS) $@ -+.IF "$(QUIET_BUILD)"=="" - @echo --- NOOPT OVER --- - .ENDIF - .ENDIF -+.ENDIF - - - # ---------------------------------- -@@ -1729,14 +1742,22 @@ $(NOOPTFILES): - .IF "$(EXCEPTIONSNOOPT_FLAG)" == "" - - $(EXCEPTIONSNOOPTTARGET): -+.IF "$(QUIET_BUILD)"=="" - @echo --- EXCEPTIONSNOOPTFILES --- -+.ENDIF - @dmake $(MFLAGS) $(MAKEFILE) ENABLE_EXCEPTIONS=true $(EXCEPTIONSNOOPTFILES) EXCEPTIONSNOOPT_FLAG=TRUE nopt=true $(CALLMACROS) -+.IF "$(QUIET_BUILD)"=="" - @echo --- EXCEPTIONSNOOPTFILES OVER --- -+.ENDIF - - $(EXCEPTIONSNOOPTFILES): -+.IF "$(QUIET_BUILD)"=="" - @echo --- EXCEPTIONSNOOPT --- -+.ENDIF - @dmake $(MFLAGS) $(MAKEFILE) ENABLE_EXCEPTIONS=true EXCEPTIONSNOOPT_FLAG=TRUE nopt=true $(CALLMACROS) $@ -+.IF "$(QUIET_BUILD)"=="" - @echo --- EXCEPTIONSNOOPT OVER --- -+.ENDIF - - - .ENDIF -@@ -1946,10 +1967,14 @@ ZIPALLTARGET: \ - $(ZIP9TARGETN) - .ELSE - ZIPALLTARGET: -+.IF "$(QUIET_BUILD)"=="" - @echo --- -+.ENDIF - @echo nothing to zip for activated languages! -+.IF "$(QUIET_BUILD)"=="" - @echo --- - .ENDIF -+.ENDIF - - - #temporary workaround for non-existing delzip in extras -@@ -1998,10 +2023,12 @@ UNOUCRDEPxxx : $(UNOUCRDEP); - - #new hid.lst trigger with GEN_HID2=TRUE - $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))$/hid.lst .PHONY : -- @echo Making $@ : -+ @echo "Making: " $@ -+.IF "$(QUIET_BUILD)"=="" - @echo --------------- -+.ENDIF - @echo $(WORK_STAMP).$(LAST_MINOR) 010101010101010 > $@.$(ROUT).tmp -- $(TYPE) $(SOLARCOMMONBINDIR)$/hid$/*.hid | tr -d "\015" | $(SORT) -u >> $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(SOLARCOMMONBINDIR)$/hid$/*.hid | tr -d "\015" | $(SORT) -u >> $@.$(ROUT).tmp - @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - @-$(RENAME) $@.$(ROUT).tmp $@ - @-mkdir $(@:d)hid -diff --git solenv/inc/tg_app.mk solenv/inc/tg_app.mk -index 02a0014..386d147 100644 ---- solenv/inc/tg_app.mk -+++ solenv/inc/tg_app.mk -@@ -119,7 +119,7 @@ $(APP$(TNR)TARGETN): $(APP$(TNR)OBJS) $(APP$(TNR)LIBS) \ - $(APP$(TNR)IMP_ORD) \ - $(APP$(TNR)ICON) $(APP$(TNR)DEPN) $(USE_APP$(TNR)DEF) - @echo ------------------------------ -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(OS)"=="MACOSX" - @echo unx -@@ -143,7 +143,7 @@ $(APP$(TNR)TARGETN): $(APP$(TNR)OBJS) $(APP$(TNR)LIBS) \ - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - app $(APP$(TNR)RPATH) $@ - .IF "$(TARGETTYPE)"=="GUI" -- @echo "Making: $@.app" -+ @echo "Making: " $(@:f).app - @macosx-create-bundle $@ - .ENDIF # "$(TARGETTYPE)"=="GUI" - .ELSE # "$(OS)"=="MACOSX" -diff --git solenv/inc/tg_def.mk solenv/inc/tg_def.mk -index fc687ff..3efe3e9 100644 ---- solenv/inc/tg_def.mk -+++ solenv/inc/tg_def.mk -@@ -101,8 +101,10 @@ $(DEF$(TNR)TARGETN) : \ - $(DEF$(TNR)TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(EMQ)"$(SHL$(TNR)TARGETN:f)$(EMQ)" >$@.tmpfile - .IF "$(COM)"!="GCC" - @echo HEAPSIZE 0 >>$@.tmpfile -@@ -217,8 +219,10 @@ $(DEF$(TNR)TARGETN) : \ - $(DEF$(TNR)TARGETN) .PHONY : - .ENDIF # "$(link_always)"=="" - @+-$(RM) $@.tmpfile -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making Module-Definitionfile : $@ -+.ENDIF -+ @echo "Making: module definition file" $(@:f) - @echo LIBRARY $(SHL$(TNR)TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile - @echo DATA MULTIPLE >>$@.tmpfile - @echo DESCRIPTION 'StarView 3.00 $(DEF$(TNR)DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile -diff --git solenv/inc/tg_dep.mk solenv/inc/tg_dep.mk -index c30103f..d966234 100644 ---- solenv/inc/tg_dep.mk -+++ solenv/inc/tg_dep.mk -@@ -66,9 +66,11 @@ ALLDEP .PHONY: - .ENDIF # "$(USE_SHELL)"=="4nt" - .ENDIF # "$(GROUPSHELL:b)"=="4dos" - .ENDIF # "$(DEPFILES)" != "" -+.IF "$(QUIET_BUILD)"=="" - @echo --- - @echo $(PWD) - Old dependency files removed or updated - @echo --- -+.ENDIF - - - ALLDPC: \ -@@ -108,13 +110,17 @@ ALLDPC: \ - - - ALLDPC: -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ - @echo No Dependencies -+.ENDIF - @echo $(EMQ)# > $(MISC)$/$(TARGET).dpc - - ALLDEP: -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ - @echo No Dependencies -+.ENDIF - - .ENDIF - -diff --git solenv/inc/tg_java.mk solenv/inc/tg_java.mk -index c1beb30..fed22e2 100644 ---- solenv/inc/tg_java.mk -+++ solenv/inc/tg_java.mk -@@ -34,8 +34,10 @@ - $(CLASSDIR)$/com$/sun$/star$/upd$/$(VERSIONINFOFILE)_updversion.class .PHONY: $(MISC)$/java$/com$/sun$/star$/upd$/$(VERSIONINFOFILE)_updversion.java - - $(MISC)$/java$/com$/sun$/star$/upd$/$(VERSIONINFOFILE)_updversion.java .PHONY: -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(MKDIRHIER) $(MISC)$/java$/com$/sun$/star$/upd - .IF "$(GUI)"=="UNX" - @echo package com.sun.star.upd\; > $@ -diff --git solenv/inc/tg_lib.mk solenv/inc/tg_lib.mk -index ceb6d51..bc02f97 100644 ---- solenv/inc/tg_lib.mk -+++ solenv/inc/tg_lib.mk -@@ -37,7 +37,7 @@ - .IF "$(LIB$(TNR)ARCHIV)" != "" - - $(LIB$(TNR)ARCHIV) : $(LIB$(TNR)TARGET) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @-$(RM) $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd -@@ -73,10 +73,12 @@ $(LIB$(TNR)ARCHIV) : $(LIB$(TNR)TARGET) - $(LIB$(TNR)TARGET) : $(LIB$(TNR)FILES) \ - $(LIB$(TNR)OBJFILES) \ - $(LIB$(TNR)DEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo using: $(LIB$(TNR)FILES) - @echo using: $(LIB$(TNR)TARGET) - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $@ - .IF "$(GUI)"=="UNX" - @echo $(LIB$(TNR)OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)$/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@ -diff --git solenv/inc/tg_obj.mk solenv/inc/tg_obj.mk -index beb5574..28e24aa 100644 ---- solenv/inc/tg_obj.mk -+++ solenv/inc/tg_obj.mk -@@ -33,8 +33,10 @@ MKFILENAME:=TG_OBJ.MK - - .IF "$(OBJTARGET)"!="" - $(OBJTARGET): $(OBJFILES) $(IDLOBJFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="OS2" - .IF "$(LIBTARGET)"!="NO" - @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/) -@@ -53,7 +55,7 @@ $(OBJTARGET): $(OBJFILES) $(IDLOBJFILES) - .ENDIF # "$(COM)"=="GCC" - .ENDIF # "$(GUI)"=="WNT" - .IF "$(GUI)"=="UNX" -- echo $(foreach,i,$(OBJFILES:f) $(ROBJ)$/$(i:s/.obj/.o/)) | xargs -n1 > $@ -+ $(QUIET_BUILD) echo $(foreach,i,$(OBJFILES:f) $(ROBJ)$/$(i:s/.obj/.o/)) | xargs -n1 > $@ - .IF "$(OS)"=="MACOSX" - @-nm `cat $(OBJTARGET) | sed s\#'^'$(ROUT)\#$(PRJ)$/$(ROUT)\#g` > $(@:d)$(@:b).dump - .ELSE -@@ -66,8 +68,10 @@ $(OBJTARGET): $(OBJFILES) $(IDLOBJFILES) - .IF "$(SECOND_BUILD)"!="" - .IF "$($(SECOND_BUILD)OBJTARGET)"!="" - $($(SECOND_BUILD)OBJTARGET): $(REAL_$(SECOND_BUILD)_OBJFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="OS2" - .IF "$(LIBTARGET)"!="NO" - @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/) -@@ -87,7 +91,7 @@ $($(SECOND_BUILD)OBJTARGET): $(REAL_$(SECOND_BUILD)_OBJFILES) - .ENDIF - .ENDIF # "$(GUI)"=="WNT" - .IF "$(GUI)"=="UNX" -- echo $(foreach,i,$(REAL_$(SECOND_BUILD)_OBJFILES:f) $(ROBJ)$/$(i:s/.obj/.o/)) | xargs -n1 >> $@ -+ $(QUIET_BUILD) echo $(foreach,i,$(REAL_$(SECOND_BUILD)_OBJFILES:f) $(ROBJ)$/$(i:s/.obj/.o/)) | xargs -n1 >> $@ - .ENDIF # "$(GUI)"=="UNX" - .ENDIF # "$($(SECOND_BUILD)OBJTARGET)"!="" - .ENDIF # "$(SECOND_BUILD)"!="" -diff --git solenv/inc/tg_res.mk solenv/inc/tg_res.mk -index ef8e682..827c99c 100644 ---- solenv/inc/tg_res.mk -+++ solenv/inc/tg_res.mk -@@ -33,8 +33,10 @@ - .IF "$(RCTARGET)"!="" - $(RCTARGET): $(RCFILES) \ - $(RCDEPN) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(CCNUMVER)" > "001300000000" - .IF "$(MFC_INCLUDE)"!="" - $(RC) $(INCLUDE) -I$(SOLARRESDIR) $(foreach,i,$(ATL_INCLUDE) -I$(i)) -I$(MFC_INCLUDE) $(RCLANGFLAGS_$(@:d:d:b)) $(RCFLAGS) -diff --git solenv/inc/tg_rslb.mk solenv/inc/tg_rslb.mk -index b30a3f2..09390ca 100644 ---- solenv/inc/tg_rslb.mk -+++ solenv/inc/tg_rslb.mk -@@ -40,11 +40,13 @@ HIDRES$(TNR)PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))$/$(RESLIB$(TNR - #HACK cut off the dirty srs files which are included from solver - RESLIB$(TNR)HIDFILES:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,.srs,_srs.hid $(RESLIB$(TNR)SRSFILES))) - $(HIDRES$(TNR)PARTICLE): $(RESLIB$(TNR)HIDFILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -- @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) -+.ENDIF -+ @echo "Making: " $(@:f) -+ $(QUIET_BUILD) @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI) - # need to strip since solaris cannot handle tab-only whitespace here -- $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB$(TNR)HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(strip, $(subst,$/,/ $(RESLIB$(TNR)HIDFILES))) )| xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDRES$(TNR)PARTICLE) -@@ -57,7 +59,7 @@ $(RSC_MULTI$(TNR)) : \ - $(RESLIB$(TNR)BMPS) - @echo using rsc multi-res feature - .IF "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -72,7 +74,7 @@ $(RSC_MULTI$(TNR)) : \ - $(RSC$(TNR)HEADER) $(RESLIB$(TNR)SRSFILES) \ - ) > $(NULLDEV) - .ELSE # "$(common_build_reslib)"!="" -- $(RSC) -presponse @$(mktmp \ -+ $(QUIET_BUILD) $(RSC) -presponse @$(mktmp \ - -r -p \ - $(foreach,i,$(alllangiso) -lg$i \ - $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -@@ -91,7 +93,7 @@ $(RSC_MULTI$(TNR)) : \ - $(RESLIB$(TNR)TARGETN): \ - $(RESLIB$(TNR)SRSFILES) \ - $(RESLIB$(TNR)BMPS) -- @echo Making: $@ -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" - .IF "$(common_build_reslib)"!="" - @@-$(RM) $(RSC_MULTI$(TNR)) -diff --git solenv/inc/tg_scp.mk solenv/inc/tg_scp.mk -index e709205..20a2f37 100644 ---- solenv/inc/tg_scp.mk -+++ solenv/inc/tg_scp.mk -@@ -43,8 +43,10 @@ $(PAR)$/%.par : $(SOLARPARDIR)$/%.par - LOCALSCP$(TNR)FILES=$(foreach,i,$(SCP$(TNR)FILES) $(foreach,j,$(SCP$(TNR)LINK_PRODUCT_TYPE) $(PAR)$/$j$/$i )) - - $(SCP$(TNR)TARGETN): $(LOCALSCP$(TNR)FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(MKDIRHIER) $(BIN)$/$(SCP$(TNR)LINK_PRODUCT_TYPE) - $(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP$(TNR)FILES) $(subst,$(@:d:d:d), $(@:d:d))$/$(i:+","))) -o $@ - .ENDIF -diff --git solenv/inc/tg_sdi.mk solenv/inc/tg_sdi.mk -index 1cd1564..0788b96 100644 ---- solenv/inc/tg_sdi.mk -+++ solenv/inc/tg_sdi.mk -@@ -35,8 +35,10 @@ - - .IF "$(HIDSID$(TNR)PARTICLE)"!="" - $(HIDSID$(TNR)PARTICLE): $(SDI$(TNR)TARGET) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@.$(ROUT).tmp $@ - .IF "$(USE_SHELL)"=="4nt" - @$(TYPE) $(MISC)$/$(SDI$(TNR)NAME).sid | $(AWK) "$$1==\"#define\" { print $$2, $$3 }" > $@.$(ROUT).tmp -@@ -49,8 +51,10 @@ $(HIDSID$(TNR)PARTICLE): $(SDI$(TNR)TARGET) - - .IF "$(SDI$(TNR)TARGET)"!="" - $(SDI$(TNR)TARGET): $(SVSDI$(TNR)DEPEND) $(SDI$(TNR)NAME).sdi -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ - $(SVIDL) @$(mktmp \ - -fs$(INCCOMX)$/$(SDI$(TNR)NAME).hxx \ -diff --git solenv/inc/tg_shl.mk solenv/inc/tg_shl.mk -index fb8457d..489ba05 100644 ---- solenv/inc/tg_shl.mk -+++ solenv/inc/tg_shl.mk -@@ -79,7 +79,7 @@ SHL$(TNR)VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL$(TNR)T - .ENDIF # "$(GUI)" == "UNX" - $(MISC)$/$(SHL$(TNR)VERSIONOBJ:b).c : $(SOLARENV)$/src$/version.c $(INCCOM)$/$(SHL$(TNR)VERSIONOBJ:b).h - # $(COPY) $(SOLARENV)$/src$/version.c $@ -- $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL$(TNR)VERSIONOBJ:b).h/ > $@ -+ $(QUIET_BUILD) $(TYPE) $(SOLARENV)$/src$/version.c | $(SED) s/_version.h/$(SHL$(TNR)VERSIONOBJ:b).h/ > $@ - - .INIT : $(SHL$(TNR)VERSIONOBJDEP) - .ENDIF # "$(VERSIONOBJ)"!="" -@@ -141,16 +141,20 @@ $(USE_SHL$(TNR)VERSIONMAP): \ - .ENDIF - .ENDIF # "$(SHL$(TNR)OBJS)!"="" - @$(TYPE) /dev/null $(SHL$(TNR)LIBS:s/.lib/.dump/) >> $@.dump -- $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL$(TNR)INTERFACE) -f $(SHL$(TNR)FILTERFILE) -m $@ -+ $(QUIET_BUILD) $(PERL) $(SOLARENV)$/bin$/mapgen.pl -d $@.dump -s $(SHL$(TNR)INTERFACE) -f $(SHL$(TNR)FILTERFILE) -m $@ - - .ELSE # "$(SHL$(TNR)FILTERFILE)"!="" - USE_SHL$(TNR)VERSIONMAP=$(MISC)$/$(SHL$(TNR)TARGET).vmap - $(USE_SHL$(TNR)VERSIONMAP) : -+.IF "$(QUIET_BUILD)"=="" - @echo ----------------------------- - @echo SHL$(TNR)FILTERFILE not set! - @echo ----------------------------- - @$(TOUCH) $@ - @echo dummy file to keep the dependencies for later use. -+.ELSE -+ @$(TOUCH) $@ -+.ENDIF - # force_dmake_to_error - .ENDIF # "$(SHL$(TNR)FILTERFILE)"!="" - .ELSE # "$(USE_SHL$(TNR)VERSIONMAP)"!="" -@@ -177,11 +181,11 @@ $(USE_SHL$(TNR)VERSIONMAP): $(SHL$(TNR)VERSIONMAP) - # Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what - # happens if somebody will change it in the future - .IF "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(AWK) -f $(SOLARENV)$/bin$/addsym.awk > $@ - .ELIF "$(COMNAME)"=="sunpro5" -- tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@ - .ELSE # "$(COMID)"=="gcc3" -- tr -d "\015" < $(SHL$(TNR)VERSIONMAP) > $@ -+ $(QUIET_BUILD) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) > $@ - .ENDIF # "$(COMID)"=="gcc3" - @chmod a+w $@ - # Mac OS X post-processing generate an exported symbols list from the generated map file -@@ -287,8 +291,10 @@ $(SHL$(TNR)TARGETN) : \ - $(SHL$(TNR)DEPN) \ - $(SHL$(TNR)IMP_ORD) \ - $(SHL$(TNR)LINKLIST) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $(SHL$(TNR)TARGETN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(SHL$(TNR)DEFAULTRES)"!="" - @@-$(RM) $(MISC)$/$(SHL$(TNR)DEFAULTRES:b).rc -@@ -465,7 +471,7 @@ $(SHL$(TNR)TARGETN) : \ - @+source $(MISC)$/$(TARGET).$(@:b)_$(TNR).cmd - @$(PERL) $(SOLARENV)$/bin$/macosx-change-install-names.pl \ - shl $(SHL$(TNR)RPATH) $@ -- @echo "Making: $@.jnilib" -+ @echo "Making: " $(@:f).jnilib - @macosx-create-bundle $@ - .IF "$(UPDATER)"=="YES" - .IF "$(SHL$(TNR)NOCHECK)"=="" -@@ -475,22 +481,24 @@ $(SHL$(TNR)TARGETN) : \ - .ELSE # "$(OS)"=="MACOSX" - @-$(RM) $(MISC)$/$(TARGET).$(@:b)_$(TNR).cmd - @echo $(SHL$(TNR)LINKER) $(SHL$(TNR)LINKFLAGS) $(SHL$(TNR)SONAME) $(LINKFLAGSSHL) $(SHL$(TNR)VERSIONMAPPARA) -L$(PRJ)$/$(ROUT)$/lib $(SOLARLIB) $(STDSLO) $(SHL$(TNR)OBJS:s/.obj/.o/) \ -- $(SHL$(TNR)VERSIONOBJ) -o $@ \ -- `cat /dev/null $(SHL$(TNR)LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -- $(SHL$(TNR)STDLIBS) $(SHL$(TNR)ARCHIVES) $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_$(TNR).cmd -+ $(SHL$(TNR)VERSIONOBJ) -o $@ \ -+ `cat /dev/null $(SHL$(TNR)LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \ -+ $(SHL$(TNR)STDLIBS) $(SHL$(TNR)ARCHIVES) $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) $(LINKOUTPUT_FILTER) > $(MISC)$/$(TARGET).$(@:b)_$(TNR).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(TARGET).$(@:b)_$(TNR).cmd -+.ENDIF - @+source $(MISC)$/$(TARGET).$(@:b)_$(TNR).cmd - .IF "$(UPDATER)"=="YES" - .IF "$(SHL$(TNR)NOCHECK)"=="" -- -$(RM) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -- $(RENAME) $(SHL$(TNR)TARGETN) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -- $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -+ $(QUIET_BUILD) -$(RM) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -+ $(QUIET_BUILD) $(RENAME) $(SHL$(TNR)TARGETN) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) - .ENDIF # "$(SHL$(TNR)NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" - .IF "$(UNIXVERSIONNAMES)"!="" -- $(RM) $(LB)$/$(SHL$(TNR)TARGETN:b) -- cd $(LB) && ln -s $(SHL$(TNR)TARGETN:f) $(SHL$(TNR)TARGETN:b) -+ $(QUIET_BUILD) $(RM) $(LB)$/$(SHL$(TNR)TARGETN:b) -+ $(QUIET_BUILD) cd $(LB) && ln -s $(SHL$(TNR)TARGETN:f) $(SHL$(TNR)TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" - @ls -l $@ - .ENDIF # "$(GUI)" == "UNX" -@@ -601,8 +609,10 @@ $(SHL$(TNR)IMPLIBN): \ - $(SHL$(TNR)IMPLIBN): \ - $(SHL$(TNR)LIBS) - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------1 -- @echo Making: $(SHL$(TNR)IMPLIBN) -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)" == "WNT" - .IF "$(COM)"=="GCC" - @echo no ImportLibs on mingw -diff --git solenv/inc/tg_slo.mk solenv/inc/tg_slo.mk -index 42a7ba5..8cb7e48 100644 ---- solenv/inc/tg_slo.mk -+++ solenv/inc/tg_slo.mk -@@ -38,8 +38,10 @@ $(SLOTARGET): $(SLOFILES) $(IDLSLOFILES) - @echo $(SLOTARGET) - @echo $(&:+"\n") - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - # @$(RM) $@ - .IF "$(GUI)"=="WNT" - .IF "$(COM)"=="GCC" -@@ -60,7 +62,7 @@ $(SLOTARGET): $(SLOFILES) $(IDLSLOFILES) - .ENDIF # "$(GUI)"=="OS2" - - .IF "$(GUI)"=="UNX" -- echo $(foreach,i,$(SLOFILES:f) $(RSLO)$/$(i:s/.obj/.o/)) | xargs -n1 > $@ -+ $(QUIET_BUILD) echo $(foreach,i,$(SLOFILES:f) $(RSLO)$/$(i:s/.obj/.o/)) | xargs -n1 > $@ - .IF "$(OS)"=="MACOSX" - @-nm `cat $(SLOTARGET) | sed s\#'^'$(ROUT)\#$(PRJ)$/$(ROUT)\#g` > $(@:d)$(@:b).dump - .ELSE -@@ -76,8 +78,10 @@ $($(SECOND_BUILD)SLOTARGET): $(REAL_$(SECOND_BUILD)_SLOFILES) - @echo $(REAL_$(SECOND_BUILD)SLOTARGET) - @echo $(&:+"\n") - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="WNT" - .IF "$(COM)"=="GCC" - +$(ECHONL) $(foreach,i,$(REAL_$(SECOND_BUILD)_SLOFILES:f) $(RSLO)$/$(i)) | xargs -n1 > $@ -@@ -98,7 +102,7 @@ $($(SECOND_BUILD)SLOTARGET): $(REAL_$(SECOND_BUILD)_SLOFILES) - .ENDIF # "$(GUI)"=="WNT" - - .IF "$(GUI)"=="UNX" -- echo $(foreach,i,$(REAL_$(SECOND_BUILD)_SLOFILES:f) $(RSLO)$/$(i:s/.obj/.o/)) | xargs -n1 > $@ -+ $(QUIET_BUILD) echo $(foreach,i,$(REAL_$(SECOND_BUILD)_SLOFILES:f) $(RSLO)$/$(i:s/.obj/.o/)) | xargs -n1 > $@ - .ENDIF # "$(GUI)"=="UNX" - .ENDIF # "$($(SECOND_BUILD)SLOTARGET)"!="" - .ENDIF # "$(SECOND_BUILD)"!="" -diff --git solenv/inc/tg_srs.mk solenv/inc/tg_srs.mk -index 57dd6c1..dc686d4 100644 ---- solenv/inc/tg_srs.mk -+++ solenv/inc/tg_srs.mk -@@ -37,10 +37,12 @@ - HID$(TNR)FILES=$(foreach,i,$(SRC$(TNR)FILES:f) $(SRS)$/$(i:s/.src/.hid/)) - HIDSRS$(TNR)PARTICLE=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(SRS))$/$(SRS$(TNR)NAME)_srs.hid - $(HIDSRS$(TNR)PARTICLE) : $(HID$(TNR)FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @-$(RM) $@ -- $(TYPE) $(mktmp $(subst,$/,/ $(HID$(TNR)FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp -+ $(QUIET_BUILD) $(TYPE) $(mktmp $(subst,$/,/ $(HID$(TNR)FILES))) | xargs -s 1000 cat > $@.$(ROUT).tmp - @$(RENAME) $@.$(ROUT).tmp $@ - - ALLTAR : $(HIDSRS$(TNR)PARTICLE) -@@ -48,40 +50,59 @@ ALLTAR : $(HIDSRS$(TNR)PARTICLE) - .ENDIF # "$(BUILDHIDS)"!="" - - $(MISC)$/$(TARGET).$(SRS$(TNR)NAME).dprr: $(LOCALIZE_ME_DEST) - - $(MISC)$/$(TARGET).$(SRS$(TNR)NAME).dprr: $(SRC$(TNR)FILES) $(HIDSRS$(TNR)PARTICLE) $(HID$(TNR)FILES) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@-$(RM) $(MISC)$/$(TARGET).$(SRS$(TNR)NAME).dprr -- $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS$(TNR)NAME).srs} -fo=$@ -p=$(TARGET) $(SRC$(TNR)FILES) -+ $(QUIET_BUILD) $(RSC) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)$/$(SRS$(TNR)NAME).srs} -fo=$@ -p=$(TARGET) $(SRC$(TNR)FILES) - - .IF "$(WITH_LANG)"!="" - - $(foreach,i,$(SRC$(TNR)FILES) $(COMMONMISC)$/$(TARGET)$/$i) : $$(@:f) $(LOCALIZESDF) -- -$(MKDIR) $(@:d) -- -$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" -+ @-$(MKDIR) $(@:d) -+ @-$(RM) $@ - -$(MKDIRHIER) $(SOLARSRC)$/$(PRJNAME)$/common$(PROEXT)$/misc$/$(PRJNAME) - $(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @-$(MKDIR) $(@:d) $(PIPEERROR) cat - > /dev/null -+ @-$(RM) $@ -+ @ $(WRAPCMD) $(TRANSEX) -QQ -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all -+.ENDIF -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - $(SRS)$/$(SRS$(TNR)NAME).srs: $(LOCALIZE_ME_DEST) - - $(SRS)$/$(SRS$(TNR)NAME).srs: $(foreach,i,$(SRC$(TNR)FILES) $(COMMONMISC)$/$(TARGET)$/$i) - .ELSE # "$(WITH_LANG)"!="" - $(SRS)$/$(SRS$(TNR)NAME).srs: $(SRC$(TNR)FILES) - .ENDIF # "$(WITH_LANG)"!="" -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) -+.IF "$(QUIET_BUILD)"=="" - $(RSC) -presponse @$(mktmp \ - $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ - $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ - -fp=$@.$(INPATH) \ - $< \ - ) -- -$(RM) $@ -- $(RENAME) $@.$(INPATH) $@ -- -$(RM) $@.$(INPATH) -+.ELSE -+ @ $(RSC) -presponse @$(mktmp \ -+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \ -+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \ -+ -fp=$@.$(INPATH) \ -+ $< \ -+ ) $(PIPEERROR) cat - > /dev/null -+.ENDIF -+ @-$(RM) $@ -+ @$(RENAME) $@.$(INPATH) $@ -+ @-$(RM) $@.$(INPATH) - - .ENDIF # "$(SRS$(TNR)NAME)"!="" - -diff --git solenv/inc/tg_yxx.mk solenv/inc/tg_yxx.mk -index f228a3d..0031914 100644 ---- solenv/inc/tg_yxx.mk -+++ solenv/inc/tg_yxx.mk -@@ -31,8 +31,10 @@ - - - $(MISC)$/%.cxx : %.y -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" || "$(USE_SHELL)" != "4nt" - tr -d "\015" < $< > $(MISC)$/stripped_$< - .ELSE -@@ -46,8 +48,10 @@ $(MISC)$/%.cxx : %.y - $(TYPE) $(INCCOM)$/$(@:b).hxx >& $(NULLDEV) - - $(INCCOM)$/yy%.cxx : %.y -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - .IF "$(GUI)"=="UNX" || "$(USE_SHELL)" != "4nt" - tr -d "\015" < $< > $(MISC)$/stripped_$< - .ELSE -diff --git solenv/inc/tg_zip.mk solenv/inc/tg_zip.mk -index 8561c6b..bc3cd5d 100644 ---- solenv/inc/tg_zip.mk -+++ solenv/inc/tg_zip.mk -@@ -118,8 +118,10 @@ $(ZIP$(TNR)DEPFILE) : - - - $(ZIP$(TNR)TARGETN) : delzip $(ZIP$(TNR)DEPS) -+.IF "$(QUIET_BUILD)"=="" - @echo ------------------------------ -- @echo Making: $@ -+.ENDIF -+ @echo "Making: " $(@:f) - @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)) - @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles - @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) ) -diff --git vcl/source/window/makefile.mk vcl/source/window/makefile.mk -index 2893863..2a78933 100644 ---- vcl/source/window/makefile.mk -+++ vcl/source/window/makefile.mk -@@ -96,10 +96,10 @@ SLOFILES= \ - - $(INCCOM)$/cuilib.hxx: makefile.mk - .IF "$(GUI)"=="UNX" -- $(RM) $@ -- echo \#define DLL_NAME \"libcui$(DLLPOSTFIX)$(DLLPOST)\" >$@ -+ @$(RM) $@ -+ @echo \#define DLL_NAME \"libcui$(DLLPOSTFIX)$(DLLPOST)\" >$@ - .ELSE -- echo $(EMQ)#define DLL_NAME $(EMQ)"cui$(DLLPOSTFIX)$(DLLPOST)$(EMQ)" >$@ -+ @echo $(EMQ)#define DLL_NAME $(EMQ)"cui$(DLLPOSTFIX)$(DLLPOST)$(EMQ)" >$@ - .ENDIF - - $(SLO)$/abstdlg.obj : $(INCCOM)$/cuilib.hxx -diff --git vcl/unx/source/gdi/makefile.mk vcl/unx/source/gdi/makefile.mk -index 4f2f640..ba1323e 100644 ---- vcl/unx/source/gdi/makefile.mk -+++ vcl/unx/source/gdi/makefile.mk -@@ -109,9 +109,9 @@ ALLTAR : $(MACOSXRC) - XSALSETLIBNAME=$(DLLPRE)spa$(DLLPOSTFIX)$(DLLPOST) - - $(INCCOM)$/rtsname.hxx: -- rm -f $(INCCOM)$/rtsname.hxx ; \ -- echo "#define _XSALSET_LIBNAME "\"$(XSALSETLIBNAME)\" > $(INCCOM)$/rtsname.hxx -+ @rm -f $(INCCOM)$/rtsname.hxx ; \ -+ echo "#define _XSALSET_LIBNAME "\"$(XSALSETLIBNAME)\" > $(INCCOM)$/rtsname.hxx - - $(SLO)$/salpimpl.obj : $(INCCOM)$/rtsname.hxx - $(SLO)$/salprnpsp.obj : $(INCCOM)$/rtsname.hxx - diff --git a/applied_patches/0011-dbaccess-default-varchar-lenght.diff b/applied_patches/0026-dbaccess-default-varchar-lenght.diff similarity index 100% rename from applied_patches/0011-dbaccess-default-varchar-lenght.diff rename to applied_patches/0026-dbaccess-default-varchar-lenght.diff diff --git a/applied_patches/0026-quiet-build-more.diff b/applied_patches/0026-quiet-build-more.diff deleted file mode 100644 index 41913895f..000000000 --- a/applied_patches/0026-quiet-build-more.diff +++ /dev/null @@ -1,814 +0,0 @@ -More quiet build stuff - -From: Thorsten Behrens - - ---- - - dmake/make.c | 5 ++- - dmake/tests/misc-13 | 2 + - dmake/tests/misc-15 | 2 + - dmake/tests/targets-28 | 4 +- - solenv/bin/checkdll.sh | 2 + - solenv/inc/_tg_lib.mk | 60 ++++++++++++++++++++++++++++++++ - solenv/inc/_tg_shl.mk | 80 +++++++++++++++++++++++++++++++++++++----- - solenv/inc/tg_lib.mk | 6 +++ - solenv/inc/tg_shl.mk | 8 ++++ - soltools/checkdll/checkdll.c | 16 ++++++-- - 10 files changed, 162 insertions(+), 23 deletions(-) - - -diff --git dmake/make.c dmake/make.c -index 4f120a6..7ad8fd1 100644 ---- dmake/make.c -+++ dmake/make.c -@@ -251,8 +251,9 @@ Make_targets()/* - - for( lp = Targets->ce_prq; lp != NIL(LINK); lp = lp->cl_next ) { - CELLPTR tgt = lp->cl_prq; -- if( !(tgt->ce_attr & A_UPDATED) ) -- printf( "`%s' is up to date\n", tgt->CE_NAME ); -+ if( !(tgt->ce_attr & A_UPDATED) -+ && (Verbose & V_MAKE) ) -+ printf( "`%s' is up to date\n", tgt->CE_NAME ); - } - - DB_RETURN( 0 ); -diff --git dmake/tests/misc-13 dmake/tests/misc-13 -index a2381a8..7493e74 100755 ---- dmake/tests/misc-13 -+++ dmake/tests/misc-13 -@@ -38,7 +38,7 @@ TeSt.target : - - EOT - --output=`eval ${DMAKEPROG} -r -f $file1` -+output=`eval ${DMAKEPROG} -vm -r -f $file1` - result=$? - - if echo "$output" | grep -v ".target' is up to date" > /dev/null 2>&1 ; then -diff --git dmake/tests/misc-15 dmake/tests/misc-15 -index 1c52324..a213c2d 100755 ---- dmake/tests/misc-15 -+++ dmake/tests/misc-15 -@@ -37,7 +37,7 @@ MYTARGET:=\$(PWD)/target.abc - - EOT - --output=`eval ${DMAKEPROG} -r -f $file1` -+output=`eval ${DMAKEPROG} -vm -r -f $file1` - result=$? - - if echo "$output" | grep "target.abc' is up to date" > /dev/null 2>&1 ; then -diff --git dmake/tests/targets-28 dmake/tests/targets-28 -index da202b0..0943eb6 100755 ---- dmake/tests/targets-28 -+++ dmake/tests/targets-28 -@@ -112,10 +112,10 @@ sleep 1 - - # This tests that aa.x is not build as the dependency chain is intact with - # the virtual target aa.y having the same time stamp as aa.z. --output3=`eval ${DMAKEPROG} -rf $file1 2>&1` -+output3=`eval ${DMAKEPROG} -vm -rf $file1 2>&1` - result3=$? - --if test $result3 = 0 -a "$output3" = "\`aa.x' is up to date" ; then -+if test $result3 = 0 && echo "$output3" | grep "aa.x' is up to date" > /dev/null 2>&1 ; then - echo "Subtest 3: OK" - result3=0 - else -diff --git solenv/bin/checkdll.sh solenv/bin/checkdll.sh -index 776b580..0218df6 100755 ---- solenv/bin/checkdll.sh -+++ solenv/bin/checkdll.sh -@@ -77,7 +77,7 @@ if [ -x $checkdll ]; then - export LD_LIBRARY_PATH;; - esac - -- $checkdll "$*" -+ $checkdll "$@" - if [ $? -ne 0 ]; then exit 1 ; fi - - for parameter in $*; do -diff --git solenv/inc/_tg_lib.mk solenv/inc/_tg_lib.mk -index 103e283..258378c 100644 ---- solenv/inc/_tg_lib.mk -+++ solenv/inc/_tg_lib.mk -@@ -21,14 +21,18 @@ $(LIB1ARCHIV) : $(LIB1TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB1ARCHIV) >> $(MISC)$/$(LIB1ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB1ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB1ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB1ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB1FLAGS) $(LIBFLAGS) $(LIB1ARCHIV) `cat $(LIB1TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB1ARCHIV:b).cmd - @+echo ranlib $(LIB1ARCHIV) >> $(MISC)$/$(LIB1ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB1ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB1ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -86,7 +90,9 @@ $(LIB1TARGET) : $(LIB1FILES) \ - .ENDIF # "$(LIB1FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB1OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB1OBJFILES) $(LIB1FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -116,14 +122,18 @@ $(LIB2ARCHIV) : $(LIB2TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB2ARCHIV) >> $(MISC)$/$(LIB2ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB2ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB2ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB2ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB2FLAGS) $(LIBFLAGS) $(LIB2ARCHIV) `cat $(LIB2TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB2ARCHIV:b).cmd - @+echo ranlib $(LIB2ARCHIV) >> $(MISC)$/$(LIB2ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB2ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB2ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -181,7 +191,9 @@ $(LIB2TARGET) : $(LIB2FILES) \ - .ENDIF # "$(LIB2FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB2OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB2OBJFILES) $(LIB2FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -211,14 +223,18 @@ $(LIB3ARCHIV) : $(LIB3TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB3ARCHIV) >> $(MISC)$/$(LIB3ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB3ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB3ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB3ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB3FLAGS) $(LIBFLAGS) $(LIB3ARCHIV) `cat $(LIB3TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB3ARCHIV:b).cmd - @+echo ranlib $(LIB3ARCHIV) >> $(MISC)$/$(LIB3ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB3ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB3ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -276,7 +292,9 @@ $(LIB3TARGET) : $(LIB3FILES) \ - .ENDIF # "$(LIB3FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB3OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB3OBJFILES) $(LIB3FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -306,14 +324,18 @@ $(LIB4ARCHIV) : $(LIB4TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB4ARCHIV) >> $(MISC)$/$(LIB4ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB4ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB4ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB4ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB4FLAGS) $(LIBFLAGS) $(LIB4ARCHIV) `cat $(LIB4TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB4ARCHIV:b).cmd - @+echo ranlib $(LIB4ARCHIV) >> $(MISC)$/$(LIB4ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB4ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB4ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -371,7 +393,9 @@ $(LIB4TARGET) : $(LIB4FILES) \ - .ENDIF # "$(LIB4FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB4OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB4OBJFILES) $(LIB4FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -401,14 +425,18 @@ $(LIB5ARCHIV) : $(LIB5TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB5ARCHIV) >> $(MISC)$/$(LIB5ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB5ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB5ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB5ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB5FLAGS) $(LIBFLAGS) $(LIB5ARCHIV) `cat $(LIB5TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB5ARCHIV:b).cmd - @+echo ranlib $(LIB5ARCHIV) >> $(MISC)$/$(LIB5ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB5ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB5ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -466,7 +494,9 @@ $(LIB5TARGET) : $(LIB5FILES) \ - .ENDIF # "$(LIB5FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB5OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB5OBJFILES) $(LIB5FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -496,14 +526,18 @@ $(LIB6ARCHIV) : $(LIB6TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB6ARCHIV) >> $(MISC)$/$(LIB6ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB6ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB6ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB6ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB6FLAGS) $(LIBFLAGS) $(LIB6ARCHIV) `cat $(LIB6TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB6ARCHIV:b).cmd - @+echo ranlib $(LIB6ARCHIV) >> $(MISC)$/$(LIB6ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB6ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB6ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -561,7 +595,9 @@ $(LIB6TARGET) : $(LIB6FILES) \ - .ENDIF # "$(LIB6FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB6OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB6OBJFILES) $(LIB6FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -591,14 +627,18 @@ $(LIB7ARCHIV) : $(LIB7TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB7ARCHIV) >> $(MISC)$/$(LIB7ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB7ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB7ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB7ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB7FLAGS) $(LIBFLAGS) $(LIB7ARCHIV) `cat $(LIB7TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB7ARCHIV:b).cmd - @+echo ranlib $(LIB7ARCHIV) >> $(MISC)$/$(LIB7ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB7ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB7ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -656,7 +696,9 @@ $(LIB7TARGET) : $(LIB7FILES) \ - .ENDIF # "$(LIB7FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB7OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB7OBJFILES) $(LIB7FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -686,14 +728,18 @@ $(LIB8ARCHIV) : $(LIB8TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB8ARCHIV) >> $(MISC)$/$(LIB8ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB8ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB8ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB8ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB8FLAGS) $(LIBFLAGS) $(LIB8ARCHIV) `cat $(LIB8TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB8ARCHIV:b).cmd - @+echo ranlib $(LIB8ARCHIV) >> $(MISC)$/$(LIB8ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB8ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB8ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -751,7 +797,9 @@ $(LIB8TARGET) : $(LIB8FILES) \ - .ENDIF # "$(LIB8FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB8OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB8OBJFILES) $(LIB8FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -781,14 +829,18 @@ $(LIB9ARCHIV) : $(LIB9TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB9ARCHIV) >> $(MISC)$/$(LIB9ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB9ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB9ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB9ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB9FLAGS) $(LIBFLAGS) $(LIB9ARCHIV) `cat $(LIB9TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB9ARCHIV:b).cmd - @+echo ranlib $(LIB9ARCHIV) >> $(MISC)$/$(LIB9ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB9ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB9ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -846,7 +898,9 @@ $(LIB9TARGET) : $(LIB9FILES) \ - .ENDIF # "$(LIB9FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB9OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB9OBJFILES) $(LIB9FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -@@ -876,14 +930,18 @@ $(LIB10ARCHIV) : $(LIB10TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB10ARCHIV) >> $(MISC)$/$(LIB10ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB10ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB10ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB10ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB10FLAGS) $(LIBFLAGS) $(LIB10ARCHIV) `cat $(LIB10TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB10ARCHIV:b).cmd - @+echo ranlib $(LIB10ARCHIV) >> $(MISC)$/$(LIB10ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB10ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB10ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -941,7 +999,9 @@ $(LIB10TARGET) : $(LIB10FILES) \ - .ENDIF # "$(LIB10FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB10OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB10OBJFILES) $(LIB10FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -diff --git solenv/inc/_tg_shl.mk solenv/inc/_tg_shl.mk -index a9f08dc..19afa21 100644 ---- solenv/inc/_tg_shl.mk -+++ solenv/inc/_tg_shl.mk -@@ -459,7 +459,11 @@ $(SHL1TARGETN) : \ - .IF "$(SHL1NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL1TARGETN) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) -- -s $(SHL1TARGETN:d)check_$(SHL1TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL1NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -467,7 +471,9 @@ $(SHL1TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL1TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL1TARGETN:f) $(SHL1TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -1007,7 +1013,11 @@ $(SHL2TARGETN) : \ - .IF "$(SHL2NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL2TARGETN) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) -- -s $(SHL2TARGETN:d)check_$(SHL2TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL2NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -1015,7 +1025,9 @@ $(SHL2TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL2TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL2TARGETN:f) $(SHL2TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -1555,7 +1567,11 @@ $(SHL3TARGETN) : \ - .IF "$(SHL3NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL3TARGETN) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) -- -s $(SHL3TARGETN:d)check_$(SHL3TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL3NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -1563,7 +1579,9 @@ $(SHL3TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL3TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL3TARGETN:f) $(SHL3TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -2103,7 +2121,11 @@ $(SHL4TARGETN) : \ - .IF "$(SHL4NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL4TARGETN) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) -- -s $(SHL4TARGETN:d)check_$(SHL4TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL4NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -2111,7 +2133,9 @@ $(SHL4TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL4TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL4TARGETN:f) $(SHL4TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -2651,7 +2675,11 @@ $(SHL5TARGETN) : \ - .IF "$(SHL5NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL5TARGETN) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) -- -s $(SHL5TARGETN:d)check_$(SHL5TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL5NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -2659,7 +2687,9 @@ $(SHL5TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL5TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL5TARGETN:f) $(SHL5TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -3199,7 +3229,11 @@ $(SHL6TARGETN) : \ - .IF "$(SHL6NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL6TARGETN) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) -- -s $(SHL6TARGETN:d)check_$(SHL6TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL6NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -3207,7 +3241,9 @@ $(SHL6TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL6TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL6TARGETN:f) $(SHL6TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -3747,7 +3783,11 @@ $(SHL7TARGETN) : \ - .IF "$(SHL7NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL7TARGETN) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) -- -s $(SHL7TARGETN:d)check_$(SHL7TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL7NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -3755,7 +3795,9 @@ $(SHL7TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL7TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL7TARGETN:f) $(SHL7TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -4295,7 +4337,11 @@ $(SHL8TARGETN) : \ - .IF "$(SHL8NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL8TARGETN) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) -- -s $(SHL8TARGETN:d)check_$(SHL8TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL8NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -4303,7 +4349,9 @@ $(SHL8TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL8TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL8TARGETN:f) $(SHL8TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -4843,7 +4891,11 @@ $(SHL9TARGETN) : \ - .IF "$(SHL9NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL9TARGETN) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) -- -s $(SHL9TARGETN:d)check_$(SHL9TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL9NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -4851,7 +4903,9 @@ $(SHL9TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL9TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL9TARGETN:f) $(SHL9TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -@@ -5391,7 +5445,11 @@ $(SHL10TARGETN) : \ - .IF "$(SHL10NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL10TARGETN) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) -- -s $(SHL10TARGETN:d)check_$(SHL10TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL10NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -5399,7 +5457,9 @@ $(SHL10TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL10TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL10TARGETN:f) $(SHL10TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -diff --git solenv/inc/tg_lib.mk solenv/inc/tg_lib.mk -index bc02f97..064f1a0 100644 ---- solenv/inc/tg_lib.mk -+++ solenv/inc/tg_lib.mk -@@ -54,14 +54,18 @@ $(LIB$(TNR)ARCHIV) : $(LIB$(TNR)TARGET) - .IF "$(OS)" == "MACOSX" - @echo ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd - .ENDIF -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd - .ELSE # "$(GUI)"=="UNX" - .IF "$(GUI)$(COM)"=="WNTGCC" - @+-$(RM) $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd - @+echo $(LIBMGR) $(LIB$(TNR)FLAGS) $(LIBFLAGS) $(LIB$(TNR)ARCHIV) `cat $(LIB$(TNR)TARGET) | sed s#'^'$(ROUT)#$(PRJ)$/$(ROUT)#g` > $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd - @+echo ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd -+.IF "$(QUIET_BUILD)"=="" - @cat $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd -+.ENDIF - @+source $(MISC)$/$(LIB$(TNR)ARCHIV:b).cmd - .ELSE - @echo just a dummy > $@ -@@ -119,7 +123,9 @@ $(LIB$(TNR)TARGET) : $(LIB$(TNR)FILES) \ - .ENDIF # "$(LIB$(TNR)FILES)"!="" - .ELSE # "$(GUI)"=="WNT" - @-$(RM) $@ -+.IF "$(QUIET_BUILD)"=="" - echo $(LIBMGR) r $@ $(LIB$(TNR)OBJFILES) -+.ENDIF - $(LIBMGR) r $@ $(LIB$(TNR)OBJFILES) $(LIB$(TNR)FILES) bla.lib - .ENDIF # "$(GUI)"=="WNT" - .ENDIF # "$(GUI)"=="UNX" -diff --git solenv/inc/tg_shl.mk solenv/inc/tg_shl.mk -index 489ba05..98b2040 100644 ---- solenv/inc/tg_shl.mk -+++ solenv/inc/tg_shl.mk -@@ -492,7 +492,11 @@ $(SHL$(TNR)TARGETN) : \ - .IF "$(SHL$(TNR)NOCHECK)"=="" - $(QUIET_BUILD) -$(RM) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) - $(QUIET_BUILD) $(RENAME) $(SHL$(TNR)TARGETN) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -- $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -+.IF "$(QUIET_BUILD)"=="" -+ $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -+.ELSE -+ $(QUIET_BUILD) $(SOLARENV)$/bin$/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) -- -s $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f) -+.ENDIF - .ENDIF # "$(SHL$(TNR)NOCHECK)"!="" - .ENDIF # "$(UPDATER)"=="YES" - .ENDIF # "$(OS)"=="MACOSX" -@@ -500,7 +504,9 @@ $(SHL$(TNR)TARGETN) : \ - $(QUIET_BUILD) $(RM) $(LB)$/$(SHL$(TNR)TARGETN:b) - $(QUIET_BUILD) cd $(LB) && ln -s $(SHL$(TNR)TARGETN:f) $(SHL$(TNR)TARGETN:b) - .ENDIF # "$(UNIXVERSIONNAMES)"!="" -+.IF "$(QUIET_BUILD)"=="" - @ls -l $@ -+.ENDIF - .ENDIF # "$(GUI)" == "UNX" - - .IF "$(GUI)" == "OS2" -diff --git soltools/checkdll/checkdll.c soltools/checkdll/checkdll.c -index 44c554b..10164d1 100644 ---- soltools/checkdll/checkdll.c -+++ soltools/checkdll/checkdll.c -@@ -47,33 +47,39 @@ static const char *psymbol = "GetVersionInfo"; - - void usage() - { -- fprintf(stderr, "usage: %s \n", pprog_name); -+ fprintf(stderr, "usage: %s [-s] \n", pprog_name); - return; - } - - int main(int argc, char *argv[]) - { - int rc; -+ int silent=0; - void *phandle; - char *(*pfun)(void); - -- if ( argc < 2 || argc > 3) { -+ if ( argc < 2 || argc > 4) { - usage(); - return 1; - } - -+ if ( !strcmp(argv[1],"-s") ) { -+ silent = 1; -+ ++argv, --argc; -+ } -+ - if ( (rc = access( argv[1], R_OK )) == -1 ) { - fprintf(stderr, "%s: ERROR: %s: %s\n", -- pprog_name, argv[1], strerror(errno)); -+ pprog_name, argv[1], strerror(errno)); - return 2; - } - -- printf("Checking DLL %s ...", argv[1]); -+ if (!silent) printf("Checking DLL %s ...", argv[1]); - fflush(stdout); - - if ( (phandle = dlopen(argv[1], RTLD_NOW)) != NULL ) { - if ( (pfun = (char *(*)(void))dlsym(phandle, psymbol)) != NULL ) { -- printf(": ok\n"); -+ if (!silent) printf(": ok\n"); - } - else - { -diff --git idlc/source/idlcmain.cxx idlc/source/idlcmain.cxx -index 792cd59..f56b945 100644 ---- idlc/source/idlcmain.cxx -+++ idlc/source/idlcmain.cxx -@@ -132,11 +132,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) - options.getProgramName().getStr(), - sal::static_int_cast< long >(nErrors), - options.prepareVersion().getStr()); -- } else -- { -- fprintf(stdout, "%s: returned successful%s", -- options.getProgramName().getStr(), -- options.prepareVersion().getStr()); - } - return nErrors; - } -diff --git solenv/bin/deliver.pl solenv/bin/deliver.pl -index bfd947e..afc5fd2 100755 ---- solenv/bin/deliver.pl -+++ solenv/bin/deliver.pl -@@ -399,7 +399,7 @@ sub parse_options - { - my $arg; - my $dontdeletecommon = 0; -- $opt_silent = 1 if ( defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'FALSE'); -+ $opt_silent = 1 if ( !defined $ENV{VERBOSE} || (defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'FALSE')); - $opt_verbose = 1 if ( defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'TRUE'); - while ( $arg = shift @ARGV ) { - $arg =~ /^-force$/ and $opt_force = 1 and next; -diff --git solenv/inc/target.mk solenv/inc/target.mk -index 635da62..75b4802 100644 ---- solenv/inc/target.mk -+++ solenv/inc/target.mk -@@ -1395,38 +1395,38 @@ $(EXTUPDATEINFO_DEST) : $(EXTUPDATEINFO_SOURCE) - - makedoc: - @@-mkdir $(OUT)$/ucrdoc -- $(IDLC) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -C -O$(OUT)$/ucrdoc$/$(IDLPACKAGE) $(DEPIDLFILES:+"\n")) -+ $(QUIET_BUILD) $(IDLC) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -C -O$(OUT)$/ucrdoc$/$(IDLPACKAGE) $(DEPIDLFILES:+"\n")) - # -$(UNOIDL) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -Bdoc -P..$/$(PRJNAME)$/$(IDLPACKAGE) -OH$(PRJ)$/..$/unodoc $(DOCIDLFILES) $(IDLFILES) - - .IF "$(LOCALDBTARGET)"!="" - $(LOCALDBTARGET) : $(URDFILES) $(DEPIDLFILES) -- $(IDLC) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -O$(OUT)$/ucr$/$(IDLPACKAGE) $(all_outdated_idl)) -- -$(RM) $@ -- $(REGMERGE) $@ UCR @$(mktmp $(URDFILES)) -+ $(QUIET_BUILD) $(IDLC) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -O$(OUT)$/ucr$/$(IDLPACKAGE) $(all_outdated_idl)) -+ @-$(RM) $@ -+ $(QUIET_BUILD) $(REGMERGE) $@ UCR @$(mktmp $(URDFILES)) - .ENDIF - - .IF "$(LOCALDOCDBTARGET)"!="" - $(LOCALDOCDBTARGET) : $(URDDOCFILES) $(DEPIDLFILES) -- $(IDLC) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -C -O$(OUT)$/ucrdoc$/$(IDLPACKAGE) $(all_outdated_idl)) -- -$(RM) $@ -- $(REGMERGE) $@ UCR @$(mktmp $(URDDOCFILES)) -+ $(QUIET_BUILD) $(IDLC) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -C -O$(OUT)$/ucrdoc$/$(IDLPACKAGE) $(all_outdated_idl)) -+ @-$(RM) $@ -+ $(QUIET_BUILD) $(REGMERGE) $@ UCR @$(mktmp $(URDDOCFILES)) - .ENDIF - - .IF "$(UNOIDLDBTARGET)"!="" - $(UNOIDLDBTARGET) : $(UNOIDLDBFILES) $(UNOIDLDBREGS) -- -$(RM) $@ -- $(REGMERGE) $@ / @$(mktmp $(UNOIDLDBFILES) $(UNOIDLDBREGS)) -+ @-$(RM) $@ -+ $(QUIET_BUILD) $(REGMERGE) $@ / @$(mktmp $(UNOIDLDBFILES) $(UNOIDLDBREGS)) - .IF "$(LOCALREGDB)"!="" -- $(REGMERGE) $(LOCALREGDB) / $@ -+ $(QUIET_BUILD) $(REGMERGE) $(LOCALREGDB) / $@ - .ENDIF - .ENDIF # "$(UNOIDLDBTARGET)"!="" - - .IF "$(UNOIDLDBDOCTARGET)"!="" - $(UNOIDLDBDOCTARGET) : $(UNOIDLDBDOCFILES) $(UNOIDLDBDOCREGS) -- -$(RM) $@ -- $(REGMERGE) $@ / @$(mktmp $(UNOIDLDBDOCFILES) $(UNOIDLDBDOCREGS)) -+ @-$(RM) $@ -+ $(QUIET_BUILD) $(REGMERGE) $@ / @$(mktmp $(UNOIDLDBDOCFILES) $(UNOIDLDBDOCREGS)) - .IF "$(LOCALREGDB)"!="" -- $(REGMERGE) $(LOCALREGDB) / $@ -+ $(QUIET_BUILD) $(REGMERGE) $(LOCALREGDB) / $@ - .ENDIF - .ENDIF # "$(UNOIDLDBDOCTARGET)"!="" - diff --git a/applied_patches/0012-linkoo-type.diff b/applied_patches/0027-linkoo-type.diff similarity index 100% rename from applied_patches/0012-linkoo-type.diff rename to applied_patches/0027-linkoo-type.diff diff --git a/applied_patches/0013-selection-crash-svx-svdmrkv.diff b/applied_patches/0028-selection-crash-svx-svdmrkv.diff similarity index 100% rename from applied_patches/0013-selection-crash-svx-svdmrkv.diff rename to applied_patches/0028-selection-crash-svx-svdmrkv.diff diff --git a/applied_patches/0017-sal-doublefree.diff b/applied_patches/0029-sal-doublefree.diff similarity index 100% rename from applied_patches/0017-sal-doublefree.diff rename to applied_patches/0029-sal-doublefree.diff diff --git a/applied_patches/0018-sw-graphic-save-problem.diff b/applied_patches/0030-sw-graphic-save-problem.diff similarity index 100% rename from applied_patches/0018-sw-graphic-save-problem.diff rename to applied_patches/0030-sw-graphic-save-problem.diff diff --git a/applied_patches/0019-sal-strintern-speed.diff b/applied_patches/0031-sal-strintern-speed.diff similarity index 100% rename from applied_patches/0019-sal-strintern-speed.diff rename to applied_patches/0031-sal-strintern-speed.diff diff --git a/applied_patches/0020-sal-strintern-speed-fix.diff b/applied_patches/0032-sal-strintern-speed-fix.diff similarity index 100% rename from applied_patches/0020-sal-strintern-speed-fix.diff rename to applied_patches/0032-sal-strintern-speed-fix.diff diff --git a/applied_patches/0021-fix-linkoo.diff b/applied_patches/0033-fix-linkoo.diff similarity index 100% rename from applied_patches/0021-fix-linkoo.diff rename to applied_patches/0033-fix-linkoo.diff diff --git a/applied_patches/0022-fix-gtk-a11y.diff b/applied_patches/0034-fix-gtk-a11y.diff similarity index 100% rename from applied_patches/0022-fix-gtk-a11y.diff rename to applied_patches/0034-fix-gtk-a11y.diff diff --git a/applied_patches/0023-fix-gtk-a11y-gail-version-warning.diff b/applied_patches/0035-fix-gtk-a11y-gail-version-warning.diff similarity index 100% rename from applied_patches/0023-fix-gtk-a11y-gail-version-warning.diff rename to applied_patches/0035-fix-gtk-a11y-gail-version-warning.diff diff --git a/applied_patches/0024-linkoo-dev300.diff b/applied_patches/0036-linkoo-dev300.diff similarity index 100% rename from applied_patches/0024-linkoo-dev300.diff rename to applied_patches/0036-linkoo-dev300.diff diff --git a/applied_patches/0027-writerfilter-qnametostr-NOOPTFILES.diff b/applied_patches/0037-writerfilter-qnametostr-NOOPTFILES.diff similarity index 100% rename from applied_patches/0027-writerfilter-qnametostr-NOOPTFILES.diff rename to applied_patches/0037-writerfilter-qnametostr-NOOPTFILES.diff diff --git a/applied_patches/0028-sc-cellsuno-avoid-early-destruction.diff b/applied_patches/0038-sc-cellsuno-avoid-early-destruction.diff similarity index 100% rename from applied_patches/0028-sc-cellsuno-avoid-early-destruction.diff rename to applied_patches/0038-sc-cellsuno-avoid-early-destruction.diff diff --git a/applied_patches/0029-speed-sal-fewer-lstats.diff b/applied_patches/0039-speed-sal-fewer-lstats.diff similarity index 100% rename from applied_patches/0029-speed-sal-fewer-lstats.diff rename to applied_patches/0039-speed-sal-fewer-lstats.diff diff --git a/applied_patches/0030-cjk-character-units-imp.diff b/applied_patches/0040-cjk-character-units-imp.diff similarity index 100% rename from applied_patches/0030-cjk-character-units-imp.diff rename to applied_patches/0040-cjk-character-units-imp.diff diff --git a/applied_patches/0031-sw-default-cjk-fontsize.diff b/applied_patches/0041-sw-default-cjk-fontsize.diff similarity index 100% rename from applied_patches/0031-sw-default-cjk-fontsize.diff rename to applied_patches/0041-sw-default-cjk-fontsize.diff diff --git a/applied_patches/0032-cjk-character-units-ui.diff b/applied_patches/0042-cjk-character-units-ui.diff similarity index 100% rename from applied_patches/0032-cjk-character-units-ui.diff rename to applied_patches/0042-cjk-character-units-ui.diff diff --git a/applied_patches/0043-basic-add-missing-includes-after-cws-npower10.diff b/applied_patches/0043-basic-add-missing-includes-after-cws-npower10.diff deleted file mode 100644 index 55d7a318d..000000000 --- a/applied_patches/0043-basic-add-missing-includes-after-cws-npower10.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- basic/source/runtime/methods.cxx.ark 2008-07-11 12:16:19.216882727 +0200 -+++ basic/source/runtime/methods.cxx 2008-07-11 13:22:14.260948113 +0200 -@@ -51,6 +51,7 @@ - #include - #include - #include -+#include - - #include "runtime.hxx" - #include "sbunoobj.hxx" -@@ -123,6 +124,8 @@ using namespace com::sun::star::io; - #include - #endif - -+using namespace rtl; -+ - static void FilterWhiteSpace( String& rStr ) - { - rStr.EraseAllChars( ' ' ); diff --git a/applied_patches/0033-cjk-character-units-rulers-sync-with-pggrid-fix.diff b/applied_patches/0043-cjk-character-units-rulers-sync-with-pggrid-fix.diff similarity index 100% rename from applied_patches/0033-cjk-character-units-rulers-sync-with-pggrid-fix.diff rename to applied_patches/0043-cjk-character-units-rulers-sync-with-pggrid-fix.diff diff --git a/applied_patches/0034-cjk-character-units-fix.diff b/applied_patches/0044-cjk-character-units-fix.diff similarity index 100% rename from applied_patches/0034-cjk-character-units-fix.diff rename to applied_patches/0044-cjk-character-units-fix.diff diff --git a/applied_patches/0044-vba-show-data-form-link-fix.diff b/applied_patches/0044-vba-show-data-form-link-fix.diff deleted file mode 100644 index 9dd75a9fb..000000000 --- a/applied_patches/0044-vba-show-data-form-link-fix.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git sc/source/ui/inc/tabvwsh.hxx sc/source/ui/inc/tabvwsh.hxx -index 7ce1670..d8966e2 100644 ---- sc/source/ui/inc/tabvwsh.hxx -+++ sc/source/ui/inc/tabvwsh.hxx -@@ -251,7 +251,7 @@ public: - - virtual ~ScTabViewShell(); - -- Window* GetDialogParent(); -+ SC_DLLPUBLIC Window* GetDialogParent(); - - bool IsRefInputMode() const; - void ExecuteInputDirect(); diff --git a/applied_patches/0035-cjk-character-units-fix-376788.diff b/applied_patches/0045-cjk-character-units-fix-376788.diff similarity index 100% rename from applied_patches/0035-cjk-character-units-fix-376788.diff rename to applied_patches/0045-cjk-character-units-fix-376788.diff diff --git a/applied_patches/0036-cjk-character-units-in-pggrid-fix.diff b/applied_patches/0046-cjk-character-units-in-pggrid-fix.diff similarity index 100% rename from applied_patches/0036-cjk-character-units-in-pggrid-fix.diff rename to applied_patches/0046-cjk-character-units-in-pggrid-fix.diff diff --git a/applied_patches/0037-wpsimport-config_office.diff b/applied_patches/0047-wpsimport-config_office.diff similarity index 100% rename from applied_patches/0037-wpsimport-config_office.diff rename to applied_patches/0047-wpsimport-config_office.diff diff --git a/applied_patches/0038-wpsimport-filter.diff b/applied_patches/0048-wpsimport-filter.diff similarity index 100% rename from applied_patches/0038-wpsimport-filter.diff rename to applied_patches/0048-wpsimport-filter.diff diff --git a/applied_patches/0039-wpsimport-scp2.diff b/applied_patches/0049-wpsimport-scp2.diff similarity index 100% rename from applied_patches/0039-wpsimport-scp2.diff rename to applied_patches/0049-wpsimport-scp2.diff diff --git a/applied_patches/0040-wpsimport-writerperfect.diff b/applied_patches/0050-wpsimport-writerperfect.diff similarity index 100% rename from applied_patches/0040-wpsimport-writerperfect.diff rename to applied_patches/0050-wpsimport-writerperfect.diff diff --git a/applied_patches/0041-libwps.diff b/applied_patches/0051-libwps.diff similarity index 100% rename from applied_patches/0041-libwps.diff rename to applied_patches/0051-libwps.diff diff --git a/applied_patches/0042-wps-registry.diff b/applied_patches/0052-wps-registry.diff similarity index 100% rename from applied_patches/0042-wps-registry.diff rename to applied_patches/0052-wps-registry.diff diff --git a/applied_patches/0045-libwpg.diff b/applied_patches/0053-libwpg.diff similarity index 100% rename from applied_patches/0045-libwpg.diff rename to applied_patches/0053-libwpg.diff diff --git a/applied_patches/0046-wpgimporter.diff b/applied_patches/0054-wpgimporter.diff similarity index 100% rename from applied_patches/0046-wpgimporter.diff rename to applied_patches/0054-wpgimporter.diff diff --git a/applied_patches/0047-jvmfwk-gij-paths.diff b/applied_patches/0055-jvmfwk-gij-paths.diff similarity index 100% rename from applied_patches/0047-jvmfwk-gij-paths.diff rename to applied_patches/0055-jvmfwk-gij-paths.diff diff --git a/applied_patches/0048-buildfix-qadevOOo-java-encoding.diff b/applied_patches/0056-buildfix-qadevOOo-java-encoding.diff similarity index 100% rename from applied_patches/0048-buildfix-qadevOOo-java-encoding.diff rename to applied_patches/0056-buildfix-qadevOOo-java-encoding.diff diff --git a/applied_patches/0049-debug-bits.diff b/applied_patches/0057-debug-bits.diff similarity index 100% rename from applied_patches/0049-debug-bits.diff rename to applied_patches/0057-debug-bits.diff diff --git a/applied_patches/0050-gui-sw-scroll.diff b/applied_patches/0058-gui-sw-scroll.diff similarity index 100% rename from applied_patches/0050-gui-sw-scroll.diff rename to applied_patches/0058-gui-sw-scroll.diff diff --git a/applied_patches/0058-vba-default-enable-calcmacros.diff b/applied_patches/0058-vba-default-enable-calcmacros.diff deleted file mode 100644 index ac3ab4998..000000000 --- a/applied_patches/0058-vba-default-enable-calcmacros.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- officecfg/registry/schema/org/openoffice/Office/Calc.xcs 2008-05-29 23:19:11.000000000 +0100 -+++ officecfg/registry/schema/org/openoffice/Office/Calc.xcs 2008-05-30 15:24:26.000000000 +0100 -@@ -1313,7 +1313,7 @@ - Indicates whether VBA macros are imported without comments to be executable. - - -- false -+ true - - - diff --git a/applied_patches/0059-vba-ide-choose-macro-to-run.diff b/applied_patches/0059-vba-ide-choose-macro-to-run.diff deleted file mode 100644 index 6559585d3..000000000 --- a/applied_patches/0059-vba-ide-choose-macro-to-run.diff +++ /dev/null @@ -1,32 +0,0 @@ ---- basctl/source/basicide/baside2.cxx.old 2009-04-02 10:56:36.000000000 +0000 -+++ basctl/source/basicide/baside2.cxx 2009-04-06 16:41:44.000000000 +0000 -@@ -331,6 +331,8 @@ BOOL ModulWindow::BasicExecute() - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); - AddStatus( BASWIN_RUNNINGBASIC ); - USHORT nStart, nEnd, nCurMethodStart = 0; -+ TextSelection aSel = GetEditView()->GetSelection(); -+ nCurMethodStart = ( aSel.GetStart().GetPara() + 1 ); - SbMethod* pMethod = 0; - // erstes Macro, sonst blind "Main" (ExtSearch?) - for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ ) -@@ -338,16 +340,16 @@ BOOL ModulWindow::BasicExecute() - SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro ); - DBG_ASSERT( pM, "Method?" ); - pM->GetLineRange( nStart, nEnd ); -- if ( !pMethod || ( nStart < nCurMethodStart ) ) -+ if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd ) - { - pMethod = pM; -- nCurMethodStart = nStart; -+ break; - } - } - if ( !pMethod ) -- pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD ); -+ return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE; - -- if ( pMethod ) -+ else - { - pMethod->SetDebugFlags( aStatus.nBasicFlags ); - BasicDLL::SetDebugMode( TRUE ); diff --git a/applied_patches/0051-vcl-menu-fixes.diff b/applied_patches/0059-vcl-menu-fixes.diff similarity index 100% rename from applied_patches/0051-vcl-menu-fixes.diff rename to applied_patches/0059-vcl-menu-fixes.diff diff --git a/applied_patches/0052-uses-vfs.diff b/applied_patches/0060-uses-vfs.diff similarity index 100% rename from applied_patches/0052-uses-vfs.diff rename to applied_patches/0060-uses-vfs.diff diff --git a/applied_patches/0053-buildfix-x86-64-visibility-workaround.diff b/applied_patches/0061-buildfix-x86-64-visibility-workaround.diff similarity index 100% rename from applied_patches/0053-buildfix-x86-64-visibility-workaround.diff rename to applied_patches/0061-buildfix-x86-64-visibility-workaround.diff diff --git a/applied_patches/0054-redirect-extensions.diff b/applied_patches/0062-redirect-extensions.diff similarity index 100% rename from applied_patches/0054-redirect-extensions.diff rename to applied_patches/0062-redirect-extensions.diff diff --git a/applied_patches/0055-libwpd.diff b/applied_patches/0063-libwpd.diff similarity index 100% rename from applied_patches/0055-libwpd.diff rename to applied_patches/0063-libwpd.diff diff --git a/applied_patches/0056-writerperfect-nocondensedparagraphs.diff b/applied_patches/0064-writerperfect-nocondensedparagraphs.diff similarity index 100% rename from applied_patches/0056-writerperfect-nocondensedparagraphs.diff rename to applied_patches/0064-writerperfect-nocondensedparagraphs.diff diff --git a/applied_patches/0057-offapi-typecheck-whitelist.diff b/applied_patches/0065-offapi-typecheck-whitelist.diff similarity index 100% rename from applied_patches/0057-offapi-typecheck-whitelist.diff rename to applied_patches/0065-offapi-typecheck-whitelist.diff diff --git a/applied_patches/0060-build-ant-1.6.diff b/applied_patches/0066-build-ant-1.6.diff similarity index 100% rename from applied_patches/0060-build-ant-1.6.diff rename to applied_patches/0066-build-ant-1.6.diff diff --git a/applied_patches/0061-buildfix-fmtargs.diff b/applied_patches/0067-buildfix-fmtargs.diff similarity index 100% rename from applied_patches/0061-buildfix-fmtargs.diff rename to applied_patches/0067-buildfix-fmtargs.diff diff --git a/applied_patches/0062-nsplugin-path.diff b/applied_patches/0068-nsplugin-path.diff similarity index 100% rename from applied_patches/0062-nsplugin-path.diff rename to applied_patches/0068-nsplugin-path.diff diff --git a/applied_patches/0063-printing-bugfix-254573.diff b/applied_patches/0069-printing-bugfix-254573.diff similarity index 100% rename from applied_patches/0063-printing-bugfix-254573.diff rename to applied_patches/0069-printing-bugfix-254573.diff diff --git a/applied_patches/0064-sd-toolbar-advanced-shapes.diff b/applied_patches/0070-sd-toolbar-advanced-shapes.diff similarity index 100% rename from applied_patches/0064-sd-toolbar-advanced-shapes.diff rename to applied_patches/0070-sd-toolbar-advanced-shapes.diff diff --git a/applied_patches/0065-svx-shapes-default-word-wrap-enable.diff b/applied_patches/0071-svx-shapes-default-word-wrap-enable.diff similarity index 100% rename from applied_patches/0065-svx-shapes-default-word-wrap-enable.diff rename to applied_patches/0071-svx-shapes-default-word-wrap-enable.diff diff --git a/applied_patches/0066-svx-honour-customshape-capabilities.diff b/applied_patches/0072-svx-honour-customshape-capabilities.diff similarity index 100% rename from applied_patches/0066-svx-honour-customshape-capabilities.diff rename to applied_patches/0072-svx-honour-customshape-capabilities.diff diff --git a/applied_patches/0067-check-buttons-rendering-fix.diff b/applied_patches/0073-check-buttons-rendering-fix.diff similarity index 100% rename from applied_patches/0067-check-buttons-rendering-fix.diff rename to applied_patches/0073-check-buttons-rendering-fix.diff diff --git a/applied_patches/0068-padmin-nofontconfig.diff b/applied_patches/0074-padmin-nofontconfig.diff similarity index 100% rename from applied_patches/0068-padmin-nofontconfig.diff rename to applied_patches/0074-padmin-nofontconfig.diff diff --git a/applied_patches/0069-wizards-source-importwizard-filesmodul-xba.diff b/applied_patches/0075-wizards-source-importwizard-filesmodul-xba.diff similarity index 100% rename from applied_patches/0069-wizards-source-importwizard-filesmodul-xba.diff rename to applied_patches/0075-wizards-source-importwizard-filesmodul-xba.diff diff --git a/applied_patches/0070-automation-testtool-oobuildfix.diff b/applied_patches/0076-automation-testtool-oobuildfix.diff similarity index 100% rename from applied_patches/0070-automation-testtool-oobuildfix.diff rename to applied_patches/0076-automation-testtool-oobuildfix.diff diff --git a/applied_patches/0071-helpcontent2-auxiliary-cfg.diff b/applied_patches/0077-helpcontent2-auxiliary-cfg.diff similarity index 100% rename from applied_patches/0071-helpcontent2-auxiliary-cfg.diff rename to applied_patches/0077-helpcontent2-auxiliary-cfg.diff diff --git a/applied_patches/0072-desktop-safer-user-dir-perm.diff b/applied_patches/0078-desktop-safer-user-dir-perm.diff similarity index 100% rename from applied_patches/0072-desktop-safer-user-dir-perm.diff rename to applied_patches/0078-desktop-safer-user-dir-perm.diff diff --git a/applied_patches/0073-desktop-application-octet-stream-mime-type.diff b/applied_patches/0079-desktop-application-octet-stream-mime-type.diff similarity index 100% rename from applied_patches/0073-desktop-application-octet-stream-mime-type.diff rename to applied_patches/0079-desktop-application-octet-stream-mime-type.diff diff --git a/applied_patches/0079-new-SQLLEN.diff b/applied_patches/0079-new-SQLLEN.diff deleted file mode 100644 index 12f74afc3..000000000 --- a/applied_patches/0079-new-SQLLEN.diff +++ /dev/null @@ -1,1884 +0,0 @@ -Index: connectivity/source/inc/odbc/OResultSet.hxx -=================================================================== ---- connectivity/source/inc/odbc/OResultSet.hxx (revision 274960) -+++ connectivity/source/inc/odbc/OResultSet.hxx (working copy) -@@ -128,7 +128,7 @@ - typedef ::std::vector TDataRow; - - TVoidVector m_aBindVector; -- ::std::vector m_aLengthVector; -+ ::std::vector m_aLengthVector; - ::std::map m_aODBCColumnTypes; - ::com::sun::star::uno::Sequence m_aBookmark; - -Index: connectivity/source/inc/odbc/OResultSetMetaData.hxx -=================================================================== ---- connectivity/source/inc/odbc/OResultSetMetaData.hxx (revision 274960) -+++ connectivity/source/inc/odbc/OResultSetMetaData.hxx (working copy) -@@ -80,13 +80,13 @@ - virtual ~OResultSetMetaData(); - - -- static SWORD getNumColAttrib(OConnection* _pConnection -+ static SQLLEN getNumColAttrib(OConnection* _pConnection - ,SQLHANDLE _aStatementHandle - ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface - ,sal_Int32 _column - ,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - -- static SWORD getColumnODBCType(OConnection* _pConnection -+ static SQLSMALLINT getColumnODBCType(OConnection* _pConnection - ,SQLHANDLE _aStatementHandle - ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface - ,sal_Int32 column) -Index: connectivity/source/inc/odbc/OTools.hxx -=================================================================== ---- connectivity/source/inc/odbc/OTools.hxx (revision 274960) -+++ connectivity/source/inc/odbc/OTools.hxx (working copy) -@@ -197,7 +197,7 @@ - static ::rtl::OUString getStringValue( OConnection* _pConnection, - SQLHANDLE _aStatementHandle, - sal_Int32 columnIndex, -- SWORD _fSqlType, -+ SQLSMALLINT _fSqlType, - sal_Bool &_bWasNull, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, - rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); -@@ -205,7 +205,7 @@ - static ::com::sun::star::uno::Sequence getBytesValue(OConnection* _pConnection, - SQLHANDLE _aStatementHandle, - sal_Int32 columnIndex, -- SWORD _fSqlType, -+ SQLSMALLINT _fSqlType, - sal_Bool &_bWasNull, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - static void getValue( OConnection* _pConnection, -@@ -215,7 +215,7 @@ - sal_Bool &_bWasNull, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, - void* _pValue, -- SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); -+ SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - - /** - bindData copies the from pValue to pData -@@ -229,10 +229,10 @@ - static void bindData( SQLSMALLINT _nOdbcType, - sal_Bool _bUseWChar, - sal_Int8 *&_pData, -- SQLINTEGER*& pLen, -+ SQLLEN*& pLen, - const void* _pValue, - rtl_TextEncoding _nTextEncoding, -- SQLUINTEGER& _nColumnSize); -+ SQLULEN& _nColumnSize); - - static void bindParameter( OConnection* _pConnection, - SQLHANDLE _hStmt, -@@ -254,7 +254,7 @@ - SQLSMALLINT _nMaxLen, - const void* _pValue, - void* _pData, -- SQLINTEGER *pLen, -+ SQLLEN *pLen, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, - rtl_TextEncoding _nTextEncoding, - sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); -Index: connectivity/source/inc/odbc/OStatement.hxx -=================================================================== ---- connectivity/source/inc/odbc/OStatement.hxx (revision 274960) -+++ connectivity/source/inc/odbc/OStatement.hxx (working copy) -@@ -130,7 +130,7 @@ - */ - virtual OResultSet* createResulSet(); - -- sal_Int32 getRowCount () throw( ::com::sun::star::sdbc::SQLException); -+ SQLLEN getRowCount () throw( ::com::sun::star::sdbc::SQLException); - - - void disposeResultSet(); -Index: connectivity/source/inc/odbc/OFunctions.hxx -=================================================================== ---- connectivity/source/inc/odbc/OFunctions.hxx (revision 274960) -+++ connectivity/source/inc/odbc/OFunctions.hxx (working copy) -@@ -187,7 +187,7 @@ - SQLSMALLINT * StringLengthPtr, - SQLSMALLINT * TypePtr, - SQLSMALLINT * SubTypePtr, -- SQLINTEGER * LengthPtr, -+ SQLLEN * LengthPtr, - SQLSMALLINT * PrecisionPtr, - SQLSMALLINT * ScalePtr, - SQLSMALLINT * NullablePtr); -@@ -203,8 +203,8 @@ - SQLSMALLINT Precision, - SQLSMALLINT Scale, - SQLPOINTER DataPtr, -- SQLINTEGER * StringLengthPtr, -- SQLINTEGER * IndicatorPtr); -+ SQLLEN * StringLengthPtr, -+ SQLLEN * IndicatorPtr); - - #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j) - */ -@@ -221,11 +221,11 @@ - SQLSMALLINT InputOutputType, - SQLSMALLINT ValueType, - SQLSMALLINT ParameterType, -- SQLUINTEGER ColumnSize, -+ SQLULEN ColumnSize, - SQLSMALLINT DecimalDigits, - SQLPOINTER ParameterValuePtr, -- SQLINTEGER BufferLength, -- SQLINTEGER * StrLen_or_IndPtr); -+ SQLLEN BufferLength, -+ SQLLEN * StrLen_or_IndPtr); - - #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j) - -@@ -266,7 +266,7 @@ - typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle, - SQLUSMALLINT ParameterNumber, - SQLSMALLINT * DataTypePtr, -- SQLUINTEGER * ParameterSizePtr, -+ SQLULEN * ParameterSizePtr, - SQLSMALLINT * DecimalDigitsPtr, - SQLSMALLINT * NullablePtr); - -@@ -284,13 +284,13 @@ - - typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle, - SQLPOINTER DataPtr, -- SQLINTEGER StrLen_or_Ind); -+ SQLLEN StrLen_or_Ind); - - #define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c) - - // Retrieving results and information about results - typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle, -- SQLINTEGER * RowCountPtr); -+ SQLLEN * RowCountPtr); - - #define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b) - -@@ -300,12 +300,12 @@ - #define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b) - - typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle, -- SQLSMALLINT ColumnNumber, -+ SQLUSMALLINT ColumnNumber, - SQLCHAR * ColumnName, - SQLSMALLINT BufferLength, - SQLSMALLINT * NameLengthPtr, - SQLSMALLINT * DataTypePtr, -- SQLUINTEGER * ColumnSizePtr, -+ SQLULEN * ColumnSizePtr, - SQLSMALLINT * DecimalDigitsPtr, - SQLSMALLINT * NullablePtr); - -@@ -317,7 +317,7 @@ - SQLPOINTER CharacterAttributePtr, - SQLSMALLINT BufferLength, - SQLSMALLINT * StringLengthPtr, -- SQLPOINTER NumericAttributePtr); -+ SQLLEN * NumericAttributePtr); - - #define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g) - -@@ -325,8 +325,8 @@ - SQLUSMALLINT ColumnNumber, - SQLSMALLINT TargetType, - SQLPOINTER TargetValuePtr, -- SQLINTEGER BufferLength, -- SQLINTEGER * StrLen_or_IndPtr); -+ SQLLEN BufferLength, -+ SQLLEN * StrLen_or_IndPtr); - - #define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f) - -@@ -336,7 +336,7 @@ - - typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle, - SQLSMALLINT FetchOrientation, -- SQLINTEGER FetchOffset); -+ SQLLEN FetchOffset); - - #define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c) - -@@ -344,20 +344,20 @@ - SQLUSMALLINT ColumnNumber, - SQLSMALLINT TargetType, - SQLPOINTER TargetValuePtr, -- SQLINTEGER BufferLength, -- SQLINTEGER * StrLen_or_IndPtr); -+ SQLLEN BufferLength, -+ SQLLEN * StrLen_or_IndPtr); - - #define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f) - - typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle, -- SQLUSMALLINT RowNumber, -+ SQLSETPOSIROW RowNumber, - SQLUSMALLINT Operation, - SQLUSMALLINT LockType); - - #define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d) - - typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle, -- SQLUSMALLINT Operation); -+ SQLSMALLINT Operation); - - #define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b) - -@@ -461,15 +461,15 @@ - #define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g) - - typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle, -- SQLSMALLINT IdentifierType, -+ SQLUSMALLINT IdentifierType, - SQLCHAR * CatalogName, - SQLSMALLINT NameLength1, - SQLCHAR * SchemaName, - SQLSMALLINT NameLength2, - SQLCHAR * TableName, - SQLSMALLINT NameLength3, -- SQLSMALLINT Scope, -- SQLSMALLINT Nullable); -+ SQLUSMALLINT Scope, -+ SQLUSMALLINT Nullable); - - #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j) - -Index: connectivity/source/drivers/odbcbase/OConnection.cxx -=================================================================== ---- connectivity/source/drivers/odbcbase/OConnection.cxx (revision 274960) -+++ connectivity/source/drivers/odbcbase/OConnection.cxx (working copy) -@@ -108,7 +108,7 @@ - SQLRETURN nSQLRETURN = 0; - SDB_ODBC_CHAR szConnStrOut[4096]; - SDB_ODBC_CHAR szConnStrIn[2048]; -- SWORD cbConnStrOut; -+ SQLSMALLINT cbConnStrOut; - memset(szConnStrOut,'\0',4096); - memset(szConnStrIn,'\0',2048); - ::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding())); -Index: connectivity/source/drivers/odbcbase/OTools.cxx -=================================================================== ---- connectivity/source/drivers/odbcbase/OTools.cxx (revision 274960) -+++ connectivity/source/drivers/odbcbase/OTools.cxx (working copy) -@@ -56,16 +56,16 @@ - sal_Bool &_bWasNull, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, - void* _pValue, -- SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) -+ SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) - { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getValue" ); -- SQLINTEGER pcbValue = SQL_NULL_DATA; -+ SQLLEN pcbValue = SQL_NULL_DATA; - OTools::ThrowException(_pConnection, - (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, - (SQLUSMALLINT)columnIndex, - _nType, - _pValue, -- (SQLINTEGER)_rSize, -+ _nSize, - &pcbValue), - _aStatementHandle,SQL_HANDLE_STMT,_xInterface,sal_False); - _bWasNull = pcbValue == SQL_NULL_DATA; -@@ -86,12 +86,12 @@ - { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindParameter" ); - SQLRETURN nRetcode; -- SWORD fSqlType; -- SWORD fCType; -- SDWORD nMaxLen = 0; -+ SQLSMALLINT fSqlType; -+ SQLSMALLINT fCType; -+ SQLLEN nMaxLen = 0; - // void*& pData = pDataBuffer; -- SQLINTEGER* pLen = (SQLINTEGER*)pLenBuffer; -- SQLUINTEGER nColumnSize=0; -+ SQLLEN* pLen = (SQLLEN*)pLenBuffer; -+ SQLULEN nColumnSize=0; - SQLSMALLINT nDecimalDigits=0; - - OTools::getBindTypes(_bUseWChar,_bUseOldTimeDate,_nODBCtype,fCType,fSqlType); -@@ -123,10 +123,10 @@ - void OTools::bindData( SQLSMALLINT _nOdbcType, - sal_Bool _bUseWChar, - sal_Int8 *&_pData, -- SQLINTEGER*& pLen, -+ SQLLEN*& pLen, - const void* _pValue, - rtl_TextEncoding _nTextEncoding, -- SQLUINTEGER& _nColumnSize) -+ SQLULEN& _nColumnSize) - { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindData" ); - _nColumnSize = 0; -@@ -222,7 +222,7 @@ - { - sal_Int32 nLen = 0; - nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); -- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); -+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); - } - break; - case SQL_LONGVARCHAR: -@@ -235,21 +235,21 @@ - ::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding)); - nLen = aString.getLength(); - } -- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); -+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); - } break; - case SQL_DATE: - *(DATE_STRUCT*)_pData = *(DATE_STRUCT*)_pValue; -- *pLen = (SDWORD)sizeof(DATE_STRUCT); -+ *pLen = (SQLLEN)sizeof(DATE_STRUCT); - _nColumnSize = 10; - break; - case SQL_TIME: - *(TIME_STRUCT*)_pData = *(TIME_STRUCT*)_pValue; -- *pLen = (SDWORD)sizeof(TIME_STRUCT); -+ *pLen = (SQLLEN)sizeof(TIME_STRUCT); - _nColumnSize = 8; - break; - case SQL_TIMESTAMP: - *(TIMESTAMP_STRUCT*)_pData = *(TIMESTAMP_STRUCT*)_pValue; -- *pLen = (SDWORD)sizeof(TIMESTAMP_STRUCT); -+ *pLen = (SQLLEN)sizeof(TIMESTAMP_STRUCT); - _nColumnSize = 19; - break; - } -@@ -262,7 +262,7 @@ - SQLSMALLINT _nMaxLen, - const void* _pValue, - void* _pData, -- SQLINTEGER *pLen, -+ SQLLEN *pLen, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, - rtl_TextEncoding _nTextEncoding, - sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) -@@ -271,7 +271,7 @@ - SQLRETURN nRetcode; - SQLSMALLINT fSqlType; - SQLSMALLINT fCType; -- SQLSMALLINT nMaxLen = _nMaxLen; -+ SQLLEN nMaxLen = _nMaxLen; - - OTools::getBindTypes( sal_False, - _bUseOldTimeDate, -@@ -375,7 +375,7 @@ - _pData = (void*)(columnIndex); - sal_Int32 nLen = 0; - nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); -- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); -+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); - } - break; - case SQL_LONGVARCHAR: -@@ -383,7 +383,7 @@ - _pData = (void*)(columnIndex); - sal_Int32 nLen = 0; - nLen = ((::rtl::OUString*)_pValue)->getLength(); -- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); -+ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); - } break; - case SQL_DATE: - *pLen = sizeof(DATE_STRUCT); -@@ -446,10 +446,10 @@ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::ThrowException" ); - - SDB_ODBC_CHAR szSqlState[5]; -- SDWORD pfNativeError; -+ SQLINTEGER pfNativeError; - SDB_ODBC_CHAR szErrorMessage[SQL_MAX_MESSAGE_LENGTH]; - szErrorMessage[0] = '\0'; -- SWORD pcbErrorMsg = 0; -+ SQLSMALLINT pcbErrorMsg = 0; - - // Informationen zur letzten Operation: - // wenn hstmt != SQL_NULL_HSTMT ist (Benutzung von SetStatus in SdbCursor, SdbTable, ...), -@@ -478,7 +478,7 @@ - Sequence OTools::getBytesValue(OConnection* _pConnection, - SQLHANDLE _aStatementHandle, - sal_Int32 columnIndex, -- SWORD _fSqlType, -+ SQLSMALLINT _fSqlType, - sal_Bool &_bWasNull, - const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException) - { -@@ -486,14 +486,14 @@ - char aCharArray[2048]; - // Erstmal versuchen, die Daten mit dem kleinen Puffer - // abzuholen: -- SQLINTEGER nMaxLen = sizeof aCharArray - 1; -+ SQLLEN nMaxLen = sizeof aCharArray - 1; - // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen); -- SQLINTEGER pcbValue = 0; -+ SQLLEN pcbValue = 0; - OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, - (SQLUSMALLINT)columnIndex, - _fSqlType, - (SQLPOINTER)aCharArray, -- (SQLINTEGER)nMaxLen, -+ nMaxLen, - &pcbValue), - _aStatementHandle,SQL_HANDLE_STMT,_xInterface); - -@@ -540,7 +540,7 @@ - ::rtl::OUString OTools::getStringValue(OConnection* _pConnection, - SQLHANDLE _aStatementHandle, - sal_Int32 columnIndex, -- SWORD _fSqlType, -+ SQLSMALLINT _fSqlType, - sal_Bool &_bWasNull, - const Reference< XInterface >& _xInterface, - rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException) -@@ -555,15 +555,15 @@ - { - sal_Unicode waCharArray[2048]; - // read the unicode data -- sal_Int32 nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1; -+ SQLLEN nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1; - // GETDATA(SQL_C_WCHAR, waCharArray, nMaxLen + sizeof(sal_Unicode)); - -- SQLINTEGER pcbValue=0; -+ SQLLEN pcbValue=0; - OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, - (SQLUSMALLINT)columnIndex, - SQL_C_WCHAR, - &waCharArray, -- (SQLINTEGER)nMaxLen*sizeof(sal_Unicode), -+ (SQLLEN)nMaxLen*sizeof(sal_Unicode), - &pcbValue), - _aStatementHandle,SQL_HANDLE_STMT,_xInterface); - _bWasNull = pcbValue == SQL_NULL_DATA; -@@ -571,7 +571,7 @@ - return ::rtl::OUString(); - // Bei Fehler bricht der GETDATA-Makro mit return ab, - // bei NULL mit break! -- SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); -+ SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); - waCharArray[nLen] = 0; - aData = ::rtl::OUString(waCharArray); - -@@ -595,7 +595,7 @@ - (SQLUSMALLINT)columnIndex, - SQL_C_WCHAR, - &waCharArray, -- (SQLINTEGER)nLen+1, -+ (SQLLEN)nLen+1, - &pcbValue), - _aStatementHandle,SQL_HANDLE_STMT,_xInterface); - nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); -@@ -610,21 +610,21 @@ - char aCharArray[2048]; - // Erstmal versuchen, die Daten mit dem kleinen Puffer - // abzuholen: -- SDWORD nMaxLen = sizeof aCharArray - 1; -+ SQLLEN nMaxLen = sizeof aCharArray - 1; - // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen); -- SQLINTEGER pcbValue = 0; -+ SQLLEN pcbValue = 0; - OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, - (SQLUSMALLINT)columnIndex, - SQL_C_CHAR, - &aCharArray, -- (SQLINTEGER)nMaxLen, -+ nMaxLen, - &pcbValue), - _aStatementHandle,SQL_HANDLE_STMT,_xInterface); - _bWasNull = pcbValue == SQL_NULL_DATA; - if(_bWasNull) - return ::rtl::OUString(); - -- SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); -+ SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); - aCharArray[nLen] = 0; - if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 ) - --nLen; -Index: connectivity/source/drivers/odbcbase/OStatement.cxx -=================================================================== ---- connectivity/source/drivers/odbcbase/OStatement.cxx (revision 274960) -+++ connectivity/source/drivers/odbcbase/OStatement.cxx (working copy) -@@ -250,13 +250,13 @@ - m_xResultSet = Reference< XResultSet >(); - } - //-------------------------------------------------------------------- --sal_Int32 OStatement_Base::getRowCount () throw( SQLException) -+SQLLEN OStatement_Base::getRowCount () throw( SQLException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - checkDisposed(OStatement_BASE::rBHelper.bDisposed); - - -- sal_Int32 numRows = 0; -+ SQLLEN numRows = 0; - - try { - THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows)); -@@ -523,7 +523,9 @@ - SQLRETURN nError = N3SQLMoreResults(m_aStatementHandle); - if(nError == SQL_SUCCESS) - { -- N3SQLRowCount(m_aStatementHandle,&pArray[j]); -+ SQLLEN nRowCount=0; -+ N3SQLRowCount(m_aStatementHandle,&nRowCount); -+ pArray[j] = nRowCount; - } - } - return aRet; -Index: connectivity/source/drivers/odbcbase/OPreparedStatement.cxx -=================================================================== ---- connectivity/source/drivers/odbcbase/OPreparedStatement.cxx (revision 274960) -+++ connectivity/source/drivers/odbcbase/OPreparedStatement.cxx (working copy) -@@ -446,11 +446,11 @@ - checkParameterIndex(parameterIndex); - - sal_Int8* lenBuf = getLengthBuf (parameterIndex); -- *(SDWORD*)lenBuf = SQL_NULL_DATA; -+ *(SQLLEN*)lenBuf = SQL_NULL_DATA; - - -- SQLINTEGER prec = 0; -- SQLUINTEGER nColumnSize = 0; -+ SQLLEN prec = 0; -+ SQLULEN nColumnSize = 0; - if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR) - { - prec = 1; -@@ -476,7 +476,7 @@ - nDecimalDigits, - NULL, - prec, -- (SDWORD*)lenBuf -+ (SQLLEN*)lenBuf - ); - OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this); - } -@@ -861,7 +861,7 @@ - - // Bind the parameter with SQL_LEN_DATA_AT_EXEC - SQLSMALLINT Ctype = SQL_C_CHAR; -- SDWORD atExec = SQL_LEN_DATA_AT_EXEC (length); -+ SQLLEN atExec = SQL_LEN_DATA_AT_EXEC (length); - memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex)); - memcpy (lenBuf, &atExec, sizeof (atExec)); - -@@ -872,14 +872,14 @@ - OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - N3SQLBindParameter(m_aStatementHandle, - (SQLUSMALLINT)ParameterIndex, -- (SQLSMALLINT)SQL_PARAM_INPUT, -+ (SQLUSMALLINT)SQL_PARAM_INPUT, - Ctype, - (SQLSMALLINT)SQLtype, -- (SQLUINTEGER)length, -+ (SQLULEN)length, - 0, - dataBuf, - sizeof(ParameterIndex), -- (SDWORD*)lenBuf); -+ (SQLLEN*)lenBuf); - - // Save the input stream - boundParams[ParameterIndex - 1].setInputStream (x, length); -Index: connectivity/source/drivers/odbcbase/OResultSet.cxx -=================================================================== ---- connectivity/source/drivers/odbcbase/OResultSet.cxx (revision 274960) -+++ connectivity/source/drivers/odbcbase/OResultSet.cxx (working copy) -@@ -843,8 +843,8 @@ - checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - - -- SQLSMALLINT nMaxLen = 20; -- SQLINTEGER nRealLen = 0; -+ SQLLEN nMaxLen = 20; -+ SQLLEN nRealLen = 0; - Sequence aBookmark(nMaxLen); - - SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle, -@@ -925,7 +925,7 @@ - sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) ); - if ( bPositionByBookmark ) - { -- SQLINTEGER nRealLen = 0; -+ SQLLEN nRealLen = 0; - nRet = N3SQLBindCol(m_aStatementHandle, - 0, - SQL_C_VARBOOKMARK, -Index: connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx -=================================================================== ---- connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx (revision 274960) -+++ connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx (working copy) -@@ -86,13 +86,13 @@ - return sValue; - } - // ------------------------------------------------------------------------- --SWORD OResultSetMetaData::getNumColAttrib(OConnection* _pConnection -+SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection - ,SQLHANDLE _aStatementHandle - ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface - ,sal_Int32 _column - ,sal_Int32 _ident) throw(SQLException, RuntimeException) - { -- SWORD nValue=0; -+ SQLLEN nValue=0; - OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle, - (SQLUSMALLINT)_column, - (SQLUSMALLINT)_ident, -@@ -117,13 +117,13 @@ - return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE); - } - // ------------------------------------------------------------------------- --SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection -+SQLSMALLINT OResultSetMetaData::getColumnODBCType(OConnection* _pConnection - ,SQLHANDLE _aStatementHandle - ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface - ,sal_Int32 column) - throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) - { -- SWORD nType = 0; -+ SQLSMALLINT nType = 0; - try - { - nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE); -Index: unixODBC/inc/sql.h -=================================================================== ---- unixODBC/inc/sql.h (revision 274960) -+++ unixODBC/inc/sql.h (working copy) -@@ -7,6 +7,7 @@ - #ifndef __SQL_H - #define __SQL_H - -+ - /**************************** - * default to 3.51 declare something else before here and you get a whole new ball of wax - ***************************/ -@@ -14,7 +15,9 @@ - #define ODBCVER 0x0351 - #endif - -+#ifndef __SQLTYPES_H - #include "sqltypes.h" -+#endif - - #ifdef __cplusplus - extern "C" { -@@ -270,6 +273,7 @@ - #define SQL_NULL_HSTMT 0 - #if (ODBCVER >= 0x0300) - #define SQL_NULL_HDESC 0 -+#define SQL_NULL_DESC 0 - #endif - - /* null handle used in place of parent handle when allocating HENV */ -@@ -562,254 +566,257 @@ - #define SQL_NC_HIGH 0 - #define SQL_NC_LOW 1 - --SQLRETURN SQLAllocConnect(SQLHENV EnvironmentHandle, -- SQLHDBC *ConnectionHandle); -+ SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle, -+ SQLHDBC *ConnectionHandle); - --SQLRETURN SQLAllocEnv(SQLHENV *EnvironmentHandle); -+ SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLAllocHandle(SQLSMALLINT HandleType, -- SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); -+ SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, -+ SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); - #endif - --SQLRETURN SQLAllocStmt(SQLHDBC ConnectionHandle, -- SQLHSTMT *StatementHandle); -+ SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle, -+ SQLHSTMT *StatementHandle); - --SQLRETURN SQLBindCol(SQLHSTMT StatementHandle, -- SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, -- SQLPOINTER TargetValue, SQLINTEGER BufferLength, -- SQLINTEGER *StrLen_or_Ind); -+ SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, -+ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, -+ SQLPOINTER TargetValue, SQLLEN BufferLength, -+ SQLLEN *StrLen_or_Ind); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLBindParam(SQLHSTMT StatementHandle, -- SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, -- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, -- SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, -- SQLINTEGER *StrLen_or_Ind); -+ SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle, -+ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, -+ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, -+ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, -+ SQLLEN *StrLen_or_Ind); - #endif - --SQLRETURN SQLCancel(SQLHSTMT StatementHandle); -+ SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLCloseCursor(SQLHSTMT StatementHandle); -+ SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle); - --SQLRETURN SQLColAttribute (SQLHSTMT StatementHandle, -- SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, -- SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, -- SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute); -+ SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle, -+ SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, -+ SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, -+ SQLSMALLINT *StringLength, SQLLEN *NumericAttribute -+ /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ ); -+ /* Ms now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */ -+ - #endif - - --SQLRETURN SQLColumns(SQLHSTMT StatementHandle, -- SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, -- SQLCHAR *TableName, SQLSMALLINT NameLength3, -- SQLCHAR *ColumnName, SQLSMALLINT NameLength4); -+ SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, -+ SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -+ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, -+ SQLCHAR *TableName, SQLSMALLINT NameLength3, -+ SQLCHAR *ColumnName, SQLSMALLINT NameLength4); - - --SQLRETURN SQLConnect(SQLHDBC ConnectionHandle, -- SQLCHAR *ServerName, SQLSMALLINT NameLength1, -- SQLCHAR *UserName, SQLSMALLINT NameLength2, -- SQLCHAR *Authentication, SQLSMALLINT NameLength3); -+ SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, -+ SQLCHAR *ServerName, SQLSMALLINT NameLength1, -+ SQLCHAR *UserName, SQLSMALLINT NameLength2, -+ SQLCHAR *Authentication, SQLSMALLINT NameLength3); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLCopyDesc(SQLHDESC SourceDescHandle, -- SQLHDESC TargetDescHandle); -+ SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, -+ SQLHDESC TargetDescHandle); - #endif - --SQLRETURN SQLDataSources(SQLHENV EnvironmentHandle, -- SQLUSMALLINT Direction, SQLCHAR *ServerName, -- SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, -- SQLCHAR *Description, SQLSMALLINT BufferLength2, -- SQLSMALLINT *NameLength2); -+ SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle, -+ SQLUSMALLINT Direction, SQLCHAR *ServerName, -+ SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, -+ SQLCHAR *Description, SQLSMALLINT BufferLength2, -+ SQLSMALLINT *NameLength2); - --SQLRETURN SQLDescribeCol(SQLHSTMT StatementHandle, -- SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, -- SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, -- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, -- SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); -+ SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, -+ SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, -+ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, -+ SQLSMALLINT *DataType, SQLULEN *ColumnSize, -+ SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); - --SQLRETURN SQLDisconnect(SQLHDBC ConnectionHandle); -+ SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, -- SQLSMALLINT CompletionType); -+ SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, -+ SQLSMALLINT CompletionType); - #endif - --SQLRETURN SQLError(SQLHENV EnvironmentHandle, -- SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, -- SQLCHAR *Sqlstate, SQLINTEGER *NativeError, -- SQLCHAR *MessageText, SQLSMALLINT BufferLength, -- SQLSMALLINT *TextLength); -+ SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle, -+ SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, -+ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, -+ SQLCHAR *MessageText, SQLSMALLINT BufferLength, -+ SQLSMALLINT *TextLength); - --SQLRETURN SQLExecDirect(SQLHSTMT StatementHandle, -- SQLCHAR *StatementText, SQLINTEGER TextLength); -+ SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle, -+ SQLCHAR *StatementText, SQLINTEGER TextLength); - --SQLRETURN SQLExecute(SQLHSTMT StatementHandle); -+ SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle); - --SQLRETURN SQLFetch(SQLHSTMT StatementHandle); -+ SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLFetchScroll(SQLHSTMT StatementHandle, -- SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset); -+ SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, -+ SQLSMALLINT FetchOrientation, SQLLEN FetchOffset); - #endif - --SQLRETURN SQLFreeConnect(SQLHDBC ConnectionHandle); -+ SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle); - --SQLRETURN SQLFreeEnv(SQLHENV EnvironmentHandle); -+ SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); -+ SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); - #endif - --SQLRETURN SQLFreeStmt(SQLHSTMT StatementHandle, -- SQLUSMALLINT Option); -+ SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, -+ SQLUSMALLINT Option); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLGetConnectAttr(SQLHDBC ConnectionHandle, -- SQLINTEGER Attribute, SQLPOINTER Value, -- SQLINTEGER BufferLength, SQLINTEGER *StringLength); -+ SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, -+ SQLINTEGER Attribute, SQLPOINTER Value, -+ SQLINTEGER BufferLength, SQLINTEGER *StringLength); - #endif - --SQLRETURN SQLGetConnectOption(SQLHDBC ConnectionHandle, -- SQLUSMALLINT Option, SQLPOINTER Value); -+ SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle, -+ SQLUSMALLINT Option, SQLPOINTER Value); - --SQLRETURN SQLGetCursorName(SQLHSTMT StatementHandle, -- SQLCHAR *CursorName, SQLSMALLINT BufferLength, -- SQLSMALLINT *NameLength); -+ SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle, -+ SQLCHAR *CursorName, SQLSMALLINT BufferLength, -+ SQLSMALLINT *NameLength); - --SQLRETURN SQLGetData(SQLHSTMT StatementHandle, -- SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, -- SQLPOINTER TargetValue, SQLINTEGER BufferLength, -- SQLINTEGER *StrLen_or_Ind); -+ SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, -+ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, -+ SQLPOINTER TargetValue, SQLLEN BufferLength, -+ SQLLEN *StrLen_or_Ind); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, -- SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, -- SQLPOINTER Value, SQLINTEGER BufferLength, -- SQLINTEGER *StringLength); -+ SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, -+ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, -+ SQLPOINTER Value, SQLINTEGER BufferLength, -+ SQLINTEGER *StringLength); - --SQLRETURN SQLGetDescRec(SQLHDESC DescriptorHandle, -- SQLSMALLINT RecNumber, SQLCHAR *Name, -- SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, -- SQLSMALLINT *Type, SQLSMALLINT *SubType, -- SQLINTEGER *Length, SQLSMALLINT *Precision, -- SQLSMALLINT *Scale, SQLSMALLINT *Nullable); -+ SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, -+ SQLSMALLINT RecNumber, SQLCHAR *Name, -+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, -+ SQLSMALLINT *Type, SQLSMALLINT *SubType, -+ SQLLEN *Length, SQLSMALLINT *Precision, -+ SQLSMALLINT *Scale, SQLSMALLINT *Nullable); - --SQLRETURN SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, -- SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, -- SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, -- SQLSMALLINT *StringLength); -+ SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, -+ SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, -+ SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, -+ SQLSMALLINT *StringLength); - --SQLRETURN SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, -- SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, -- SQLINTEGER *NativeError, SQLCHAR *MessageText, -- SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); -+ SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, -+ SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, -+ SQLINTEGER *NativeError, SQLCHAR *MessageText, -+ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); - --SQLRETURN SQLGetEnvAttr(SQLHENV EnvironmentHandle, -- SQLINTEGER Attribute, SQLPOINTER Value, -- SQLINTEGER BufferLength, SQLINTEGER *StringLength); -+ SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, -+ SQLINTEGER Attribute, SQLPOINTER Value, -+ SQLINTEGER BufferLength, SQLINTEGER *StringLength); - #endif /* ODBCVER >= 0x0300 */ - --SQLRETURN SQLGetFunctions(SQLHDBC ConnectionHandle, -- SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); -+ SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle, -+ SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); - --SQLRETURN SQLGetInfo(SQLHDBC ConnectionHandle, -- SQLUSMALLINT InfoType, SQLPOINTER InfoValue, -- SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); -+ SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, -+ SQLUSMALLINT InfoType, SQLPOINTER InfoValue, -+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLGetStmtAttr(SQLHSTMT StatementHandle, -- SQLINTEGER Attribute, SQLPOINTER Value, -- SQLINTEGER BufferLength, SQLINTEGER *StringLength); -+ SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, -+ SQLINTEGER Attribute, SQLPOINTER Value, -+ SQLINTEGER BufferLength, SQLINTEGER *StringLength); - #endif /* ODBCVER >= 0x0300 */ - --SQLRETURN SQLGetStmtOption(SQLHSTMT StatementHandle, -- SQLUSMALLINT Option, SQLPOINTER Value); -+ SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle, -+ SQLUSMALLINT Option, SQLPOINTER Value); - --SQLRETURN SQLGetTypeInfo(SQLHSTMT StatementHandle, -- SQLSMALLINT DataType); -+ SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, -+ SQLSMALLINT DataType); - --SQLRETURN SQLNumResultCols(SQLHSTMT StatementHandle, -- SQLSMALLINT *ColumnCount); -+ SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, -+ SQLSMALLINT *ColumnCount); - --SQLRETURN SQLParamData(SQLHSTMT StatementHandle, -- SQLPOINTER *Value); -+ SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, -+ SQLPOINTER *Value); - --SQLRETURN SQLPrepare(SQLHSTMT StatementHandle, -- SQLCHAR *StatementText, SQLINTEGER TextLength); -+ SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle, -+ SQLCHAR *StatementText, SQLINTEGER TextLength); - --SQLRETURN SQLPutData(SQLHSTMT StatementHandle, -- SQLPOINTER Data, SQLINTEGER StrLen_or_Ind); -+ SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, -+ SQLPOINTER Data, SQLLEN StrLen_or_Ind); - --SQLRETURN SQLRowCount(SQLHSTMT StatementHandle, -- SQLINTEGER *RowCount); -+ SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle, -+ SQLLEN *RowCount); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle, -- SQLINTEGER Attribute, SQLPOINTER Value, -- SQLINTEGER StringLength); -+ SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, -+ SQLINTEGER Attribute, SQLPOINTER Value, -+ SQLINTEGER StringLength); - #endif /* ODBCVER >= 0x0300 */ - --SQLRETURN SQLSetConnectOption(SQLHDBC ConnectionHandle, -- SQLUSMALLINT Option, SQLUINTEGER Value); -+ SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle, -+ SQLUSMALLINT Option, SQLULEN Value); - --SQLRETURN SQLSetCursorName(SQLHSTMT StatementHandle, -- SQLCHAR *CursorName, SQLSMALLINT NameLength); -+ SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle, -+ SQLCHAR *CursorName, SQLSMALLINT NameLength); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLSetDescField(SQLHDESC DescriptorHandle, -- SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, -- SQLPOINTER Value, SQLINTEGER BufferLength); -+ SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, -+ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, -+ SQLPOINTER Value, SQLINTEGER BufferLength); - --SQLRETURN SQLSetDescRec(SQLHDESC DescriptorHandle, -- SQLSMALLINT RecNumber, SQLSMALLINT Type, -- SQLSMALLINT SubType, SQLINTEGER Length, -- SQLSMALLINT Precision, SQLSMALLINT Scale, -- SQLPOINTER Data, SQLINTEGER *StringLength, -- SQLINTEGER *Indicator); -+ SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, -+ SQLSMALLINT RecNumber, SQLSMALLINT Type, -+ SQLSMALLINT SubType, SQLLEN Length, -+ SQLSMALLINT Precision, SQLSMALLINT Scale, -+ SQLPOINTER Data, SQLLEN *StringLength, -+ SQLLEN *Indicator); - --SQLRETURN SQLSetEnvAttr(SQLHENV EnvironmentHandle, -- SQLINTEGER Attribute, SQLPOINTER Value, -- SQLINTEGER StringLength); -+ SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, -+ SQLINTEGER Attribute, SQLPOINTER Value, -+ SQLINTEGER StringLength); - #endif /* ODBCVER >= 0x0300 */ - --SQLRETURN SQLSetParam(SQLHSTMT StatementHandle, -- SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, -- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, -- SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, -- SQLINTEGER *StrLen_or_Ind); -+ SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle, -+ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, -+ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, -+ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, -+ SQLLEN *StrLen_or_Ind); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLSetStmtAttr(SQLHSTMT StatementHandle, -- SQLINTEGER Attribute, SQLPOINTER Value, -- SQLINTEGER StringLength); -+ SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, -+ SQLINTEGER Attribute, SQLPOINTER Value, -+ SQLINTEGER StringLength); - #endif - --SQLRETURN SQLSetStmtOption(SQLHSTMT StatementHandle, -- SQLUSMALLINT Option, SQLUINTEGER Value); -+ SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle, -+ SQLUSMALLINT Option, SQLULEN Value); - --SQLRETURN SQLSpecialColumns(SQLHSTMT StatementHandle, -- SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, -- SQLSMALLINT NameLength1, SQLCHAR *SchemaName, -- SQLSMALLINT NameLength2, SQLCHAR *TableName, -- SQLSMALLINT NameLength3, SQLUSMALLINT Scope, -- SQLUSMALLINT Nullable); -+ SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, -+ SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, -+ SQLSMALLINT NameLength1, SQLCHAR *SchemaName, -+ SQLSMALLINT NameLength2, SQLCHAR *TableName, -+ SQLSMALLINT NameLength3, SQLUSMALLINT Scope, -+ SQLUSMALLINT Nullable); - --SQLRETURN SQLStatistics(SQLHSTMT StatementHandle, -- SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, -- SQLCHAR *TableName, SQLSMALLINT NameLength3, -- SQLUSMALLINT Unique, SQLUSMALLINT Reserved); -+ SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, -+ SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -+ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, -+ SQLCHAR *TableName, SQLSMALLINT NameLength3, -+ SQLUSMALLINT Unique, SQLUSMALLINT Reserved); - --SQLRETURN SQLTables(SQLHSTMT StatementHandle, -- SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, -- SQLCHAR *TableName, SQLSMALLINT NameLength3, -- SQLCHAR *TableType, SQLSMALLINT NameLength4); -+ SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, -+ SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -+ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, -+ SQLCHAR *TableName, SQLSMALLINT NameLength3, -+ SQLCHAR *TableType, SQLSMALLINT NameLength4); - --SQLRETURN SQLTransact(SQLHENV EnvironmentHandle, -- SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); -+ SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, -+ SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); - - #ifdef __cplusplus - } -Index: unixODBC/inc/sqlext.h -=================================================================== ---- unixODBC/inc/sqlext.h (revision 274960) -+++ unixODBC/inc/sqlext.h (working copy) -@@ -39,7 +39,9 @@ - - /* END - unixODBC ONLY */ - -+#ifndef __SQL_H - #include "sql.h" -+#endif - - #ifdef __cplusplus - extern "C" { /* Assume C declarations for C++ */ -@@ -47,8 +49,8 @@ - - /* generally useful constants */ - #define SQL_SPEC_MAJOR 3 /* Major version of specification */ --#define SQL_SPEC_MINOR 51 /* Minor version of specification */ --#define SQL_SPEC_STRING "03.51" /* String constant for version */ -+#define SQL_SPEC_MINOR 52 /* Minor version of specification */ -+#define SQL_SPEC_STRING "03.52" /* String constant for version */ - - #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */ - #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */ -@@ -72,6 +74,11 @@ - #define SQL_ATTR_ODBC_VERSION 200 - #define SQL_ATTR_CONNECTION_POOLING 201 - #define SQL_ATTR_CP_MATCH 202 -+ -+/* unixODBC additions */ -+#define SQL_ATTR_UNIXODBC_SYSPATH 65001 -+#define SQL_ATTR_UNIXODBC_VERSION 65002 -+#define SQL_ATTR_UNIXODBC_ENVATTR 65003 - #endif /* ODBCVER >= 0x0300 */ - - #if (ODBCVER >= 0x0300) -@@ -127,6 +134,8 @@ - - #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */ - -+#define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */ -+ - #if (ODBCVER >= 0x0351) - /* ODBC Driver Manager sets this connection attribute to a unicode driver - (which supports SQLConnectW) when the application is an ANSI application -@@ -170,7 +179,7 @@ - #define SQL_OPT_TRACE_OFF 0UL - #define SQL_OPT_TRACE_ON 1UL - #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF --#define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG" -+#define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG" - - /* SQL_ODBC_CURSORS options */ - #define SQL_CUR_USE_IF_NEEDED 0UL -@@ -516,7 +525,12 @@ - #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/ - #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/ - #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/ -+ -+#if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE) -+#define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */ -+#else - #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */ -+#endif - - #if (ODBCVER >= 0x0350) - #define SQL_C_GUID SQL_GUID -@@ -751,6 +765,7 @@ - #define SQL_CONVERT_VARBINARY 69 - #define SQL_CONVERT_VARCHAR 70 - #define SQL_CONVERT_LONGVARBINARY 71 -+#define SQL_CONVERT_GUID 173 - #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */ - #define SQL_CORRELATION_NAME 74 - #define SQL_NON_NULLABLE_COLUMNS 75 -@@ -780,7 +795,9 @@ - #define SQL_QUALIFIER_LOCATION 114 - - #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300) -+#ifndef SQL_OJ_CAPABILITIES - #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ -+#endif - #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */ - - /*----------------------------------------------*/ -@@ -927,6 +944,7 @@ - #define SQL_CVT_WCHAR 0x00200000L - #define SQL_CVT_WLONGVARCHAR 0x00400000L - #define SQL_CVT_WVARCHAR 0x00800000L -+#define SQL_CVT_GUID 0x01000000L - - #endif /* ODBCVER >= 0x0300 */ - -@@ -1199,7 +1217,7 @@ - #define SQL_FILE_NOT_SUPPORTED 0x0000 - #define SQL_FILE_TABLE 0x0001 - #define SQL_FILE_QUALIFIER 0x0002 --#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER // ODBC 3.0 -+#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */ - - - /* SQL_GETDATA_EXTENSIONS values */ -@@ -1688,7 +1706,7 @@ - #define SQL_DRIVER_PROMPT 2 - #define SQL_DRIVER_COMPLETE_REQUIRED 3 - --SQLRETURN SQLDriverConnect( -+SQLRETURN SQL_API SQLDriverConnect( - SQLHDBC hdbc, - SQLHWND hwnd, - SQLCHAR *szConnStrIn, -@@ -1762,8 +1780,7 @@ - #define SQL_PT_FUNCTION 2 - - /* This define is too large for RC */ --#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS," --/* -+#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ - "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ - "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ - "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ -@@ -1794,9 +1811,8 @@ - "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ - "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\ - "YEAR,ZONE" --*/ - --SQLRETURN SQLBrowseConnect( -+SQLRETURN SQL_API SQLBrowseConnect( - SQLHDBC hdbc, - SQLCHAR *szConnStrIn, - SQLSMALLINT cbConnStrIn, -@@ -1805,21 +1821,21 @@ - SQLSMALLINT *pcbConnStrOut); - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLBulkOperations( -+SQLRETURN SQL_API SQLBulkOperations( - SQLHSTMT StatementHandle, - SQLSMALLINT Operation); - #endif /* ODBCVER >= 0x0300 */ - --SQLRETURN SQLColAttributes( -+SQLRETURN SQL_API SQLColAttributes( - SQLHSTMT hstmt, - SQLUSMALLINT icol, - SQLUSMALLINT fDescType, - SQLPOINTER rgbDesc, - SQLSMALLINT cbDescMax, - SQLSMALLINT *pcbDesc, -- SQLINTEGER *pfDesc); -+ SQLLEN *pfDesc); - --SQLRETURN SQLColumnPrivileges( -+SQLRETURN SQL_API SQLColumnPrivileges( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, -@@ -1830,22 +1846,22 @@ - SQLCHAR *szColumnName, - SQLSMALLINT cbColumnName); - --SQLRETURN SQLDescribeParam( -+SQLRETURN SQL_API SQLDescribeParam( - SQLHSTMT hstmt, - SQLUSMALLINT ipar, - SQLSMALLINT *pfSqlType, -- SQLUINTEGER *pcbParamDef, -+ SQLULEN *pcbParamDef, - SQLSMALLINT *pibScale, - SQLSMALLINT *pfNullable); - --SQLRETURN SQLExtendedFetch( -+SQLRETURN SQL_API SQLExtendedFetch( - SQLHSTMT hstmt, - SQLUSMALLINT fFetchType, -- SQLINTEGER irow, -- SQLUINTEGER *pcrow, -- SQLUSMALLINT *rgfRowStatus); -+ SQLLEN irow, -+ SQLULEN *pcrow, -+ SQLUSMALLINT *rgfRowStatus); - --SQLRETURN SQLForeignKeys( -+SQLRETURN SQL_API SQLForeignKeys( - SQLHSTMT hstmt, - SQLCHAR *szPkCatalogName, - SQLSMALLINT cbPkCatalogName, -@@ -1860,10 +1876,10 @@ - SQLCHAR *szFkTableName, - SQLSMALLINT cbFkTableName); - --SQLRETURN SQLMoreResults( -+SQLRETURN SQL_API SQLMoreResults( - SQLHSTMT hstmt); - --SQLRETURN SQLNativeSql( -+SQLRETURN SQL_API SQLNativeSql( - SQLHDBC hdbc, - SQLCHAR *szSqlStrIn, - SQLINTEGER cbSqlStrIn, -@@ -1871,16 +1887,16 @@ - SQLINTEGER cbSqlStrMax, - SQLINTEGER *pcbSqlStr); - --SQLRETURN SQLNumParams( -+SQLRETURN SQL_API SQLNumParams( - SQLHSTMT hstmt, - SQLSMALLINT *pcpar); - --SQLRETURN SQLParamOptions( -+SQLRETURN SQL_API SQLParamOptions( - SQLHSTMT hstmt, -- SQLUINTEGER crow, -- SQLUINTEGER *pirow); -+ SQLULEN crow, -+ SQLULEN *pirow); - --SQLRETURN SQLPrimaryKeys( -+SQLRETURN SQL_API SQLPrimaryKeys( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, -@@ -1889,7 +1905,7 @@ - SQLCHAR *szTableName, - SQLSMALLINT cbTableName); - --SQLRETURN SQLProcedureColumns( -+SQLRETURN SQL_API SQLProcedureColumns( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, -@@ -1900,7 +1916,7 @@ - SQLCHAR *szColumnName, - SQLSMALLINT cbColumnName); - --SQLRETURN SQLProcedures( -+SQLRETURN SQL_API SQLProcedures( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, -@@ -1909,13 +1925,13 @@ - SQLCHAR *szProcName, - SQLSMALLINT cbProcName); - --SQLRETURN SQLSetPos( -+SQLRETURN SQL_API SQLSetPos( - SQLHSTMT hstmt, -- SQLUSMALLINT irow, -+ SQLSETPOSIROW irow, - SQLUSMALLINT fOption, - SQLUSMALLINT fLock); - --SQLRETURN SQLTablePrivileges( -+SQLRETURN SQL_API SQLTablePrivileges( - SQLHSTMT hstmt, - SQLCHAR *szCatalogName, - SQLSMALLINT cbCatalogName, -@@ -1924,7 +1940,7 @@ - SQLCHAR *szTableName, - SQLSMALLINT cbTableName); - --SQLRETURN SQLDrivers( -+SQLRETURN SQL_API SQLDrivers( - SQLHENV henv, - SQLUSMALLINT fDirection, - SQLCHAR *szDriverDesc, -@@ -1934,17 +1950,17 @@ - SQLSMALLINT cbDrvrAttrMax, - SQLSMALLINT *pcbDrvrAttr); - --SQLRETURN SQLBindParameter( -+SQLRETURN SQL_API SQLBindParameter( - SQLHSTMT hstmt, - SQLUSMALLINT ipar, - SQLSMALLINT fParamType, - SQLSMALLINT fCType, - SQLSMALLINT fSqlType, -- SQLUINTEGER cbColDef, -+ SQLULEN cbColDef, - SQLSMALLINT ibScale, - SQLPOINTER rgbValue, -- SQLINTEGER cbValueMax, -- SQLINTEGER *pcbValue); -+ SQLLEN cbValueMax, -+ SQLLEN *pcbValue); - - /*---------------------------------------------------------*/ - /* SQLAllocHandleStd is implemented to make SQLAllocHandle */ -@@ -1972,7 +1988,7 @@ - #endif /* ODBC_STD */ - - #if (ODBCVER >= 0x0300) --SQLRETURN SQLAllocHandleStd( -+SQLRETURN SQL_API SQLAllocHandleStd( - SQLSMALLINT fHandleType, - SQLHANDLE hInput, - SQLHANDLE *phOutput); -@@ -1999,21 +2015,57 @@ - #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */ - - /* Deprecated functions from prior versions of ODBC */ --SQLRETURN SQLSetScrollOptions( /* Use SQLSetStmtOptions */ -+SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */ - SQLHSTMT hstmt, - SQLUSMALLINT fConcurrency, -- SQLINTEGER crowKeyset, -+ SQLLEN crowKeyset, - SQLUSMALLINT crowRowset); - --/* Tracing section */ -+/*! -+ * \defgroup Tracing. -+ * -+ * unixODBC implements a slight variation of the tracing mechanism used -+ * on MS platforms. The unixODBC method loses the ability to produce trace -+ * output for invalid handles but gains the following; -+ * -+ * - better concurrency -+ * - allows tracing to be turned on/off and configured at finer granularity -+ * - hopefully; better performance -+ * -+ * unixODBC provides a cross-platform helper library called 'trace' and an -+ * example/default trace plugin called 'odbctrac'. Those writing an ODBC -+ * driver can use the 'trace' helper library (a static library). Those wanting -+ * to create custom trace output can implement a different version of the -+ * 'odbctrac' plugin. -+ * -+ * The text file driver (odbctxt) included with unixODBC is an example of a -+ * driver using the 'trace' helper library. -+ * -+ * The 'trace' library and the example plugin 'odbctrac' are designed to be -+ * portable on all platforms where unixODBC is available and on MS platforms. -+ * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly -+ * portable. On MS platforms - this compliments traditional tracing (mostly -+ * just used by the Driver Manager). -+ * -+ * \sa trace -+ * odbctxt -+ * odbctrac -+ */ -+/*@{*/ -+#define TRACE_VERSION 1000 /*!< Version of trace API */ -+#ifdef UNICODE -+RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */ -+#else -+RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */ -+#endif -+RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */ -+SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */ -+#ifdef __cplusplus -+DWORD TraceVersion(); /*!< Returns trace API version */ -+#else -+DWORD TraceVersion(VOID); /*!< Returns trace API version */ -+#endif - --#define TRACE_VERSION 1000 /* Version of trace API */ -- --RETCODE TraceOpenLogFile(LPWSTR,LPWSTR,DWORD); /* open a trace log file */ --RETCODE TraceCloseLogFile(); /* Request to close a trace log */ --VOID TraceReturn(RETCODE,RETCODE); /* Processes trace after FN is called */ --DWORD TraceVersion(); /* Returns trace API version */ -- - /* Functions for Visual Studio Analyzer*/ - /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */ - #define TRACE_ON 0x00000001L -@@ -2028,7 +2080,11 @@ - #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */ - - typedef struct tagODBC_VS_ARGS { -+#ifdef GUID_DEFINED - const GUID *pguidEvent; /* the GUID for event */ -+#else -+ const void *pguidEvent; /* the GUID for event */ -+#endif - DWORD dwFlags; /* flags for the call */ - union { - WCHAR *wszArg; -@@ -2042,10 +2098,25 @@ - } ODBC_VS_ARGS, *PODBC_VS_ARGS; - - VOID FireVSDebugEvent(PODBC_VS_ARGS); -+/*@}*/ - -- - #ifdef __cplusplus - } - #endif - -+/* -+ * connection pooling retry times -+ */ -+ -+BOOL ODBCSetTryWaitValue ( DWORD dwValue ); -+#ifdef __cplusplus -+DWORD ODBCGetTryWaitValue ( ); -+#else -+DWORD ODBCGetTryWaitValue ( VOID ); - #endif -+ -+#ifndef __SQLUCODE_H -+#include "sqlucode.h" -+#endif -+ -+#endif -Index: unixODBC/inc/sqltypes.h -=================================================================== ---- unixODBC/inc/sqltypes.h (revision 274960) -+++ unixODBC/inc/sqltypes.h (working copy) -@@ -26,48 +26,111 @@ - #define ODBCVER 0x0351 - #endif - -+/* -+ * if thi sis set, then use a 4 byte unicode definition, insteead of the 2 bye that MS use -+ */ -+ -+#ifdef SQL_WCHART_CONVERT -+/* -+ * Use this if you want to use the C/C++ portable definition of a wide char, wchar_t -+ * Microsoft hardcoded a definition of unsigned short which may not be compatible with -+ * your platform specific wide char definition. -+ */ -+#include -+#endif -+ -+#include -+ - #ifdef __cplusplus - extern "C" { - #endif - --#ifndef SIZEOF_LONG --# if defined(__alpha__) || defined(__x86_64__) || defined(__ia64__) || defined(__s390x__) || defined(__sparcv9) || defined(__LP64__) --# define SIZEOF_LONG 8 --#else --# define SIZEOF_LONG 4 -+#ifndef SIZEOF_LONG_INT -+# define SIZEOF_LONG_INT SAL_TYPES_SIZEOFLONG - #endif -+#ifndef ODBCINT64 -+# define ODBCINT64 sal_Int64 - #endif -+#ifndef UODBCINT64 -+# define UODBCINT64 sal_uInt64 -+#endif - -+/* -+ * this is defined by configure, but will not be on a normal application build -+ * the install creates a unixodbc_conf.h file that contains the current build settings -+ */ -+ -+#ifndef SIZEOF_LONG_INT -+#include -+#endif -+ -+#ifndef SIZEOF_LONG_INT -+#error "Needs to know how big a long int is to continue!!!" -+#endif -+ - /**************************** - * These make up for having no windows.h - ***************************/ -+#ifndef ALLREADY_HAVE_WINDOWS_TYPE -+ - #define FAR - #define CALLBACK -+#ifdef __OS2__ -+#define SQL_API _System -+#else - #define SQL_API -+#endif - #define BOOL int - typedef void* HWND; --#ifndef CHAR --typedef char* GUID; -+typedef char CHAR; -+#ifdef UNICODE -+ -+/* -+ * NOTE: The Microsoft unicode define is only for apps that want to use TCHARs and -+ * be able to compile for both unicode and non-unicode with the same source. -+ * This is not recommanded for linux applications and is not supported -+ * by the standard linux string header files. -+ */ -+#ifdef SQL_WCHART_CONVERT -+typedef wchar_t TCHAR; -+#else -+typedef signed short TCHAR; - #endif --#define GUID_DEFINED --typedef char CHAR; -+ -+#else -+typedef char TCHAR; -+#endif -+ - #ifndef DONT_TD_VOID - typedef void VOID; - #endif -+ - typedef unsigned short WORD; --#if SIZEOF_LONG == 4 -- typedef unsigned long DWORD; -+#if (SIZEOF_LONG_INT == 4) -+typedef unsigned long DWORD; - #else -- typedef unsigned int DWORD; -+typedef unsigned int DWORD; - #endif - typedef unsigned char BYTE; -+ -+#ifdef SQL_WCHART_CONVERT -+typedef wchar_t WCHAR; -+#else - typedef unsigned short WCHAR; --typedef WCHAR* LPWSTR; -+#endif -+ -+typedef WCHAR* LPWSTR; - typedef const char* LPCSTR; -+typedef const WCHAR* LPCWSTR; -+typedef TCHAR* LPTSTR; - typedef char* LPSTR; - typedef DWORD* LPDWORD; - -+typedef void* HINSTANCE; - -+#endif -+ -+ - /**************************** - * standard SQL* data types. use these as much as possible when using ODBC calls/vars - ***************************/ -@@ -80,11 +143,61 @@ - typedef double SQLFLOAT; - #endif - --#if SIZEOF_LONG == 4 -- typedef long SQLINTEGER; -+/* -+ * can't use a long it fails on 64 platforms -+ */ -+ -+/* -+ * Hopefully by now it should be safe to assume most drivers know about SQLLEN now -+ * and the defaukt is now sizeof( SQLLEN ) = 8 on 64 bit platforms -+ * -+ */ -+ -+#if (SIZEOF_LONG_INT == 8) -+#ifdef BUILD_LEGACY_64_BIT_MODE -+typedef int SQLINTEGER; -+typedef unsigned int SQLUINTEGER; -+#define SQLLEN SQLINTEGER -+#define SQLULEN SQLUINTEGER -+#define SQLSETPOSIROW SQLUSMALLINT -+/* -+ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril -+ * -+ typedef SQLULEN SQLROWCOUNT; -+ typedef SQLULEN SQLROWSETSIZE; -+ typedef SQLULEN SQLTRANSID; -+ typedef SQLLEN SQLROWOFFSET; -+*/ - #else -- typedef int SQLINTEGER; -+typedef int SQLINTEGER; -+typedef unsigned int SQLUINTEGER; -+typedef long SQLLEN; -+typedef unsigned long SQLULEN; -+typedef unsigned long SQLSETPOSIROW; -+/* -+ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril -+ * -+ typedef SQLULEN SQLTRANSID; -+ typedef SQLULEN SQLROWCOUNT; -+ typedef SQLUINTEGER SQLROWSETSIZE; -+ typedef SQLLEN SQLROWOFFSET; -+ */ -+typedef SQLULEN SQLROWCOUNT; -+typedef SQLULEN SQLROWSETSIZE; -+typedef SQLULEN SQLTRANSID; -+typedef SQLLEN SQLROWOFFSET; - #endif -+#else -+typedef long SQLINTEGER; -+typedef unsigned long SQLUINTEGER; -+#define SQLLEN SQLINTEGER -+#define SQLULEN SQLUINTEGER -+#define SQLSETPOSIROW SQLUSMALLINT -+typedef SQLULEN SQLROWCOUNT; -+typedef SQLULEN SQLROWSETSIZE; -+typedef SQLULEN SQLTRANSID; -+typedef SQLLEN SQLROWOFFSET; -+#endif - - #if (ODBCVER >= 0x0300) - typedef unsigned char SQLNUMERIC; -@@ -107,39 +220,58 @@ - - typedef SQLSMALLINT SQLRETURN; - --/* typedef void * SQLHANDLE; */ -- --typedef SQLINTEGER SQLHANDLE; - #if (ODBCVER >= 0x0300) -- -+typedef void * SQLHANDLE; - typedef SQLHANDLE SQLHENV; - typedef SQLHANDLE SQLHDBC; - typedef SQLHANDLE SQLHSTMT; - typedef SQLHANDLE SQLHDESC; -+#else -+typedef void * SQLHENV; -+typedef void * SQLHDBC; -+typedef void * SQLHSTMT; -+/* -+ * some things like PHP won't build without this -+ */ -+typedef void * SQLHANDLE; -+#endif - -+/**************************** -+ * These are cast into the actual struct that is being passed around. The -+ * DriverManager knows what its structs look like and the Driver knows about its -+ * structs... the app knows nothing about them... just void* -+ * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT -+ ***************************/ -+ -+#if (ODBCVER >= 0x0300) -+typedef SQLHANDLE HENV; -+typedef SQLHANDLE HDBC; -+typedef SQLHANDLE HSTMT; - #else --typedef SQLINTEGER SQLHENV; --typedef SQLINTEGER SQLHDBC; --typedef SQLINTEGER SQLHSTMT; -+typedef void * HENV; -+typedef void * HDBC; -+typedef void * HSTMT; - #endif - - - /**************************** - * more basic data types to augment what windows.h provides - ***************************/ -+#ifndef ALLREADY_HAVE_WINDOWS_TYPE -+ - typedef unsigned char UCHAR; - typedef signed char SCHAR; - typedef SCHAR SQLSCHAR; --#if SIZEOF_LONG == 4 -- typedef long int SDWORD; -- typedef unsigned long int UDWORD; -+#if (SIZEOF_LONG_INT == 4) -+typedef long int SDWORD; -+typedef unsigned long int UDWORD; - #else -- typedef signed int SDWORD; -- typedef unsigned int UDWORD; -+typedef int SDWORD; -+typedef unsigned int UDWORD; - #endif - typedef signed short int SWORD; - typedef unsigned short int UWORD; --typedef UDWORD SQLUINTEGER; -+typedef unsigned int UINT; - typedef signed long SLONG; - typedef signed short SSHORT; - typedef unsigned long ULONG; -@@ -151,20 +283,7 @@ - typedef signed short RETCODE; - typedef void* SQLHWND; - --/**************************** -- * These are cast into the actual struct that is being passed around. The -- * DriverManager knows what its structs look like and the Driver knows about its -- * structs... the app knows nothing about them... just void* -- * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT -- ***************************/ --/* --typedef void* HENV; --typedef void* HDBC; --typedef void* HSTMT; --*/ --typedef SQLHANDLE HENV; --typedef SQLHANDLE HDBC; --typedef SQLHANDLE HSTMT; -+#endif - - /**************************** - * standard structs for working with date/times -@@ -263,12 +382,41 @@ - /**************************** - * - ***************************/ --#if (ODBCVER >= 0x0300) --#define ODBCINT64 long -+#ifndef ODBCINT64 -+# if (ODBCVER >= 0x0300) -+# if (SIZEOF_LONG_INT == 8) -+# define ODBCINT64 long -+# define UODBCINT64 unsigned long -+# else -+# ifdef HAVE_LONG_LONG -+# define ODBCINT64 long long -+# define UODBCINT64 unsigned long long -+# else -+/* -+ * may fail in some cases, but what else can we do ? -+ */ -+struct __bigint_struct -+{ -+ int hiword; -+ unsigned int loword; -+}; -+struct __bigint_struct_u -+{ -+ unsigned int hiword; -+ unsigned int loword; -+}; -+# define ODBCINT64 struct __bigint_struct -+# define UODBCINT64 struct __bigint_struct_u -+# endif -+# endif -+#endif -+#endif -+ - #ifdef ODBCINT64 - typedef ODBCINT64 SQLBIGINT; --typedef unsigned ODBCINT64 SQLUBIGINT; - #endif -+#ifdef UODBCINT64 -+typedef UODBCINT64 SQLUBIGINT; - #endif - - -@@ -288,6 +436,7 @@ - - #if (ODBCVER >= 0x0350) - #ifdef GUID_DEFINED -+#ifndef ALLREADY_HAVE_WINDOWS_TYPE - typedef GUID SQLGUID; - #else - typedef struct tagSQLGUID -@@ -298,18 +447,21 @@ - BYTE Data4[ 8 ]; - } SQLGUID; - #endif -+#else -+typedef struct tagSQLGUID -+{ -+ DWORD Data1; -+ WORD Data2; -+ WORD Data3; -+ BYTE Data4[ 8 ]; -+} SQLGUID; - #endif -+#endif - -+typedef SQLULEN BOOKMARK; - --typedef unsigned long int BOOKMARK; -+typedef WCHAR SQLWCHAR; - -- --#ifdef _WCHAR_T_DEFINED --typedef wchar_t SQLWCHAR; --#else --typedef unsigned short SQLWCHAR; --#endif -- - #ifdef UNICODE - typedef SQLWCHAR SQLTCHAR; - #else -@@ -321,3 +473,6 @@ - #endif - - #endif -+ -+ -+ diff --git a/applied_patches/0074-xmlsecurity-verify-usages.diff b/applied_patches/0080-xmlsecurity-verify-usages.diff similarity index 100% rename from applied_patches/0074-xmlsecurity-verify-usages.diff rename to applied_patches/0080-xmlsecurity-verify-usages.diff diff --git a/applied_patches/0075-jvmfwk-modified-javavendors-xml.diff b/applied_patches/0081-jvmfwk-modified-javavendors-xml.diff similarity index 100% rename from applied_patches/0075-jvmfwk-modified-javavendors-xml.diff rename to applied_patches/0081-jvmfwk-modified-javavendors-xml.diff diff --git a/applied_patches/0076-libxmlsec-findcerts.diff b/applied_patches/0082-libxmlsec-findcerts.diff similarity index 100% rename from applied_patches/0076-libxmlsec-findcerts.diff rename to applied_patches/0082-libxmlsec-findcerts.diff diff --git a/applied_patches/0077-sfx2-check-existing-template-dirs.diff b/applied_patches/0083-sfx2-check-existing-template-dirs.diff similarity index 100% rename from applied_patches/0077-sfx2-check-existing-template-dirs.diff rename to applied_patches/0083-sfx2-check-existing-template-dirs.diff diff --git a/applied_patches/0078-vcl-kerning-fix.diff b/applied_patches/0084-vcl-kerning-fix.diff similarity index 100% rename from applied_patches/0078-vcl-kerning-fix.diff rename to applied_patches/0084-vcl-kerning-fix.diff diff --git a/applied_patches/0085-new-SQLLEN.diff b/applied_patches/0085-new-SQLLEN.diff new file mode 100644 index 000000000..75d790032 --- /dev/null +++ b/applied_patches/0085-new-SQLLEN.diff @@ -0,0 +1,1887 @@ +Index: connectivity/source/inc/odbc/OResultSet.hxx +=================================================================== +--- connectivity/source/inc/odbc/OResultSet.hxx (revision 274960) ++++ connectivity/source/inc/odbc/OResultSet.hxx (working copy) +@@ -128,7 +128,7 @@ + typedef ::std::vector TDataRow; + + TVoidVector m_aBindVector; +- ::std::vector m_aLengthVector; ++ ::std::vector m_aLengthVector; + ::std::map m_aODBCColumnTypes; + ::com::sun::star::uno::Sequence m_aBookmark; + +Index: connectivity/source/inc/odbc/OResultSetMetaData.hxx +=================================================================== +--- connectivity/source/inc/odbc/OResultSetMetaData.hxx (revision 274960) ++++ connectivity/source/inc/odbc/OResultSetMetaData.hxx (working copy) +@@ -80,13 +80,13 @@ + virtual ~OResultSetMetaData(); + + +- static SWORD getNumColAttrib(OConnection* _pConnection ++ static SQLLEN getNumColAttrib(OConnection* _pConnection + ,SQLHANDLE _aStatementHandle + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface + ,sal_Int32 _column + ,sal_Int32 ident) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + +- static SWORD getColumnODBCType(OConnection* _pConnection ++ static SQLSMALLINT getColumnODBCType(OConnection* _pConnection + ,SQLHANDLE _aStatementHandle + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface + ,sal_Int32 column) +Index: connectivity/source/inc/odbc/OTools.hxx +=================================================================== +--- connectivity/source/inc/odbc/OTools.hxx (revision 274960) ++++ connectivity/source/inc/odbc/OTools.hxx (working copy) +@@ -197,7 +197,7 @@ + static ::rtl::OUString getStringValue( OConnection* _pConnection, + SQLHANDLE _aStatementHandle, + sal_Int32 columnIndex, +- SWORD _fSqlType, ++ SQLSMALLINT _fSqlType, + sal_Bool &_bWasNull, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, + rtl_TextEncoding _nTextEncoding) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); +@@ -205,7 +205,7 @@ + static ::com::sun::star::uno::Sequence getBytesValue(OConnection* _pConnection, + SQLHANDLE _aStatementHandle, + sal_Int32 columnIndex, +- SWORD _fSqlType, ++ SQLSMALLINT _fSqlType, + sal_Bool &_bWasNull, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + static void getValue( OConnection* _pConnection, +@@ -215,7 +215,7 @@ + sal_Bool &_bWasNull, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, + void* _pValue, +- SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); ++ SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + /** + bindData copies the from pValue to pData +@@ -229,10 +229,10 @@ + static void bindData( SQLSMALLINT _nOdbcType, + sal_Bool _bUseWChar, + sal_Int8 *&_pData, +- SQLINTEGER*& pLen, ++ SQLLEN*& pLen, + const void* _pValue, + rtl_TextEncoding _nTextEncoding, +- SQLUINTEGER& _nColumnSize); ++ SQLULEN& _nColumnSize); + + static void bindParameter( OConnection* _pConnection, + SQLHANDLE _hStmt, +@@ -254,7 +254,7 @@ + SQLSMALLINT _nMaxLen, + const void* _pValue, + void* _pData, +- SQLINTEGER *pLen, ++ SQLLEN *pLen, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, + rtl_TextEncoding _nTextEncoding, + sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); +Index: connectivity/source/inc/odbc/OStatement.hxx +=================================================================== +--- connectivity/source/inc/odbc/OStatement.hxx (revision 274960) ++++ connectivity/source/inc/odbc/OStatement.hxx (working copy) +@@ -130,7 +130,7 @@ + */ + virtual OResultSet* createResulSet(); + +- sal_Int32 getRowCount () throw( ::com::sun::star::sdbc::SQLException); ++ SQLLEN getRowCount () throw( ::com::sun::star::sdbc::SQLException); + + + void disposeResultSet(); +Index: connectivity/source/inc/odbc/OFunctions.hxx +=================================================================== +--- connectivity/source/inc/odbc/OFunctions.hxx (revision 274960) ++++ connectivity/source/inc/odbc/OFunctions.hxx (working copy) +@@ -187,7 +187,7 @@ + SQLSMALLINT * StringLengthPtr, + SQLSMALLINT * TypePtr, + SQLSMALLINT * SubTypePtr, +- SQLINTEGER * LengthPtr, ++ SQLLEN * LengthPtr, + SQLSMALLINT * PrecisionPtr, + SQLSMALLINT * ScalePtr, + SQLSMALLINT * NullablePtr); +@@ -203,8 +203,8 @@ + SQLSMALLINT Precision, + SQLSMALLINT Scale, + SQLPOINTER DataPtr, +- SQLINTEGER * StringLengthPtr, +- SQLINTEGER * IndicatorPtr); ++ SQLLEN * StringLengthPtr, ++ SQLLEN * IndicatorPtr); + + #define N3SQLSetDescRec(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSetDescRec)getOdbcFunction(ODBC3SQLSetDescRec))(a,b,c,d,e,f,g,h,i,j) + */ +@@ -221,11 +221,11 @@ + SQLSMALLINT InputOutputType, + SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, +- SQLUINTEGER ColumnSize, ++ SQLULEN ColumnSize, + SQLSMALLINT DecimalDigits, + SQLPOINTER ParameterValuePtr, +- SQLINTEGER BufferLength, +- SQLINTEGER * StrLen_or_IndPtr); ++ SQLLEN BufferLength, ++ SQLLEN * StrLen_or_IndPtr); + + #define N3SQLBindParameter(a,b,c,d,e,f,g,h,i,j) (*(T3SQLBindParameter)getOdbcFunction(ODBC3SQLBindParameter))(a,b,c,d,e,f,g,h,i,j) + +@@ -266,7 +266,7 @@ + typedef SQLRETURN (SQL_API *T3SQLDescribeParam) (SQLHSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, + SQLSMALLINT * DataTypePtr, +- SQLUINTEGER * ParameterSizePtr, ++ SQLULEN * ParameterSizePtr, + SQLSMALLINT * DecimalDigitsPtr, + SQLSMALLINT * NullablePtr); + +@@ -284,13 +284,13 @@ + + typedef SQLRETURN (SQL_API *T3SQLPutData) ( SQLHSTMT StatementHandle, + SQLPOINTER DataPtr, +- SQLINTEGER StrLen_or_Ind); ++ SQLLEN StrLen_or_Ind); + + #define N3SQLPutData(a,b,c) (*(T3SQLPutData)getOdbcFunction(ODBC3SQLPutData))(a,b,c) + + // Retrieving results and information about results + typedef SQLRETURN (SQL_API *T3SQLRowCount) ( SQLHSTMT StatementHandle, +- SQLINTEGER * RowCountPtr); ++ SQLLEN * RowCountPtr); + + #define N3SQLRowCount(a,b) (*(T3SQLRowCount)getOdbcFunction(ODBC3SQLRowCount))(a,b) + +@@ -300,12 +300,12 @@ + #define N3SQLNumResultCols(a,b) (*(T3SQLNumResultCols)getOdbcFunction(ODBC3SQLNumResultCols))(a,b) + + typedef SQLRETURN (SQL_API *T3SQLDescribeCol) ( SQLHSTMT StatementHandle, +- SQLSMALLINT ColumnNumber, ++ SQLUSMALLINT ColumnNumber, + SQLCHAR * ColumnName, + SQLSMALLINT BufferLength, + SQLSMALLINT * NameLengthPtr, + SQLSMALLINT * DataTypePtr, +- SQLUINTEGER * ColumnSizePtr, ++ SQLULEN * ColumnSizePtr, + SQLSMALLINT * DecimalDigitsPtr, + SQLSMALLINT * NullablePtr); + +@@ -317,7 +317,7 @@ + SQLPOINTER CharacterAttributePtr, + SQLSMALLINT BufferLength, + SQLSMALLINT * StringLengthPtr, +- SQLPOINTER NumericAttributePtr); ++ SQLLEN * NumericAttributePtr); + + #define N3SQLColAttribute(a,b,c,d,e,f,g) (*(T3SQLColAttribute)getOdbcFunction(ODBC3SQLColAttribute))(a,b,c,d,e,f,g) + +@@ -325,8 +325,8 @@ + SQLUSMALLINT ColumnNumber, + SQLSMALLINT TargetType, + SQLPOINTER TargetValuePtr, +- SQLINTEGER BufferLength, +- SQLINTEGER * StrLen_or_IndPtr); ++ SQLLEN BufferLength, ++ SQLLEN * StrLen_or_IndPtr); + + #define N3SQLBindCol(a,b,c,d,e,f) (*(T3SQLBindCol)getOdbcFunction(ODBC3SQLBindCol))(a,b,c,d,e,f) + +@@ -336,7 +336,7 @@ + + typedef SQLRETURN (SQL_API *T3SQLFetchScroll) ( SQLHSTMT StatementHandle, + SQLSMALLINT FetchOrientation, +- SQLINTEGER FetchOffset); ++ SQLLEN FetchOffset); + + #define N3SQLFetchScroll(a,b,c) (*(T3SQLFetchScroll)getOdbcFunction(ODBC3SQLFetchScroll))(a,b,c) + +@@ -344,20 +344,20 @@ + SQLUSMALLINT ColumnNumber, + SQLSMALLINT TargetType, + SQLPOINTER TargetValuePtr, +- SQLINTEGER BufferLength, +- SQLINTEGER * StrLen_or_IndPtr); ++ SQLLEN BufferLength, ++ SQLLEN * StrLen_or_IndPtr); + + #define N3SQLGetData(a,b,c,d,e,f) (*(T3SQLGetData)getOdbcFunction(ODBC3SQLGetData))(a,b,c,d,e,f) + + typedef SQLRETURN (SQL_API *T3SQLSetPos) ( SQLHSTMT StatementHandle, +- SQLUSMALLINT RowNumber, ++ SQLSETPOSIROW RowNumber, + SQLUSMALLINT Operation, + SQLUSMALLINT LockType); + + #define N3SQLSetPos(a,b,c,d) (*(T3SQLSetPos)getOdbcFunction(ODBC3SQLSetPos))(a,b,c,d) + + typedef SQLRETURN (SQL_API *T3SQLBulkOperations) ( SQLHSTMT StatementHandle, +- SQLUSMALLINT Operation); ++ SQLSMALLINT Operation); + + #define N3SQLBulkOperations(a,b) (*(T3SQLBulkOperations)getOdbcFunction(ODBC3SQLBulkOperations))(a,b) + +@@ -461,15 +461,15 @@ + #define N3SQLProcedures(a,b,c,d,e,f,g) (*(T3SQLProcedures)getOdbcFunction(ODBC3SQLProcedures))(a,b,c,d,e,f,g) + + typedef SQLRETURN (SQL_API *T3SQLSpecialColumns) (SQLHSTMT StatementHandle, +- SQLSMALLINT IdentifierType, ++ SQLUSMALLINT IdentifierType, + SQLCHAR * CatalogName, + SQLSMALLINT NameLength1, + SQLCHAR * SchemaName, + SQLSMALLINT NameLength2, + SQLCHAR * TableName, + SQLSMALLINT NameLength3, +- SQLSMALLINT Scope, +- SQLSMALLINT Nullable); ++ SQLUSMALLINT Scope, ++ SQLUSMALLINT Nullable); + + #define N3SQLSpecialColumns(a,b,c,d,e,f,g,h,i,j) (*(T3SQLSpecialColumns)getOdbcFunction(ODBC3SQLSpecialColumns))(a,b,c,d,e,f,g,h,i,j) + +Index: connectivity/source/drivers/odbcbase/OConnection.cxx +=================================================================== +--- connectivity/source/drivers/odbcbase/OConnection.cxx (revision 274960) ++++ connectivity/source/drivers/odbcbase/OConnection.cxx (working copy) +@@ -108,7 +108,7 @@ + SQLRETURN nSQLRETURN = 0; + SDB_ODBC_CHAR szConnStrOut[4096]; + SDB_ODBC_CHAR szConnStrIn[2048]; +- SWORD cbConnStrOut; ++ SQLSMALLINT cbConnStrOut; + memset(szConnStrOut,'\0',4096); + memset(szConnStrIn,'\0',2048); + ::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding())); +Index: connectivity/source/drivers/odbcbase/OTools.cxx +=================================================================== +--- connectivity/source/drivers/odbcbase/OTools.cxx (revision 274960) ++++ connectivity/source/drivers/odbcbase/OTools.cxx (working copy) +@@ -56,16 +56,16 @@ + sal_Bool &_bWasNull, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, + void* _pValue, +- SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) ++ SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getValue" ); +- SQLINTEGER pcbValue = SQL_NULL_DATA; ++ SQLLEN pcbValue = SQL_NULL_DATA; + OTools::ThrowException(_pConnection, + (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, + (SQLUSMALLINT)columnIndex, + _nType, + _pValue, +- (SQLINTEGER)_rSize, ++ _nSize, + &pcbValue), + _aStatementHandle,SQL_HANDLE_STMT,_xInterface,sal_False); + _bWasNull = pcbValue == SQL_NULL_DATA; +@@ -86,12 +86,12 @@ + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindParameter" ); + SQLRETURN nRetcode; +- SWORD fSqlType; +- SWORD fCType; +- SDWORD nMaxLen = 0; ++ SQLSMALLINT fSqlType; ++ SQLSMALLINT fCType; ++ SQLLEN nMaxLen = 0; + // void*& pData = pDataBuffer; +- SQLINTEGER* pLen = (SQLINTEGER*)pLenBuffer; +- SQLUINTEGER nColumnSize=0; ++ SQLLEN* pLen = (SQLLEN*)pLenBuffer; ++ SQLULEN nColumnSize=0; + SQLSMALLINT nDecimalDigits=0; + + OTools::getBindTypes(_bUseWChar,_bUseOldTimeDate,_nODBCtype,fCType,fSqlType); +@@ -123,10 +123,10 @@ + void OTools::bindData( SQLSMALLINT _nOdbcType, + sal_Bool _bUseWChar, + sal_Int8 *&_pData, +- SQLINTEGER*& pLen, ++ SQLLEN*& pLen, + const void* _pValue, + rtl_TextEncoding _nTextEncoding, +- SQLUINTEGER& _nColumnSize) ++ SQLULEN& _nColumnSize) + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindData" ); + _nColumnSize = 0; +@@ -222,7 +222,7 @@ + { + sal_Int32 nLen = 0; + nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); +- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); ++ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); + } + break; + case SQL_LONGVARCHAR: +@@ -235,21 +235,21 @@ + ::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding)); + nLen = aString.getLength(); + } +- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); ++ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); + } break; + case SQL_DATE: + *(DATE_STRUCT*)_pData = *(DATE_STRUCT*)_pValue; +- *pLen = (SDWORD)sizeof(DATE_STRUCT); ++ *pLen = (SQLLEN)sizeof(DATE_STRUCT); + _nColumnSize = 10; + break; + case SQL_TIME: + *(TIME_STRUCT*)_pData = *(TIME_STRUCT*)_pValue; +- *pLen = (SDWORD)sizeof(TIME_STRUCT); ++ *pLen = (SQLLEN)sizeof(TIME_STRUCT); + _nColumnSize = 8; + break; + case SQL_TIMESTAMP: + *(TIMESTAMP_STRUCT*)_pData = *(TIMESTAMP_STRUCT*)_pValue; +- *pLen = (SDWORD)sizeof(TIMESTAMP_STRUCT); ++ *pLen = (SQLLEN)sizeof(TIMESTAMP_STRUCT); + _nColumnSize = 19; + break; + } +@@ -262,7 +262,7 @@ + SQLSMALLINT _nMaxLen, + const void* _pValue, + void* _pData, +- SQLINTEGER *pLen, ++ SQLLEN *pLen, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, + rtl_TextEncoding _nTextEncoding, + sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) +@@ -271,7 +271,7 @@ + SQLRETURN nRetcode; + SQLSMALLINT fSqlType; + SQLSMALLINT fCType; +- SQLSMALLINT nMaxLen = _nMaxLen; ++ SQLLEN nMaxLen = _nMaxLen; + + OTools::getBindTypes( sal_False, + _bUseOldTimeDate, +@@ -375,7 +375,7 @@ + _pData = (void*)(columnIndex); + sal_Int32 nLen = 0; + nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); +- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); ++ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); + } + break; + case SQL_LONGVARCHAR: +@@ -383,7 +383,7 @@ + _pData = (void*)(columnIndex); + sal_Int32 nLen = 0; + nLen = ((::rtl::OUString*)_pValue)->getLength(); +- *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); ++ *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); + } break; + case SQL_DATE: + *pLen = sizeof(DATE_STRUCT); +@@ -446,10 +446,10 @@ + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::ThrowException" ); + + SDB_ODBC_CHAR szSqlState[5]; +- SDWORD pfNativeError; ++ SQLINTEGER pfNativeError; + SDB_ODBC_CHAR szErrorMessage[SQL_MAX_MESSAGE_LENGTH]; + szErrorMessage[0] = '\0'; +- SWORD pcbErrorMsg = 0; ++ SQLSMALLINT pcbErrorMsg = 0; + + // Informationen zur letzten Operation: + // wenn hstmt != SQL_NULL_HSTMT ist (Benutzung von SetStatus in SdbCursor, SdbTable, ...), +@@ -478,7 +478,7 @@ + Sequence OTools::getBytesValue(OConnection* _pConnection, + SQLHANDLE _aStatementHandle, + sal_Int32 columnIndex, +- SWORD _fSqlType, ++ SQLSMALLINT _fSqlType, + sal_Bool &_bWasNull, + const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException) + { +@@ -486,14 +486,14 @@ + char aCharArray[2048]; + // Erstmal versuchen, die Daten mit dem kleinen Puffer + // abzuholen: +- SQLINTEGER nMaxLen = sizeof aCharArray - 1; ++ SQLLEN nMaxLen = sizeof aCharArray - 1; + // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen); +- SQLINTEGER pcbValue = 0; ++ SQLLEN pcbValue = 0; + OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, + (SQLUSMALLINT)columnIndex, + _fSqlType, + (SQLPOINTER)aCharArray, +- (SQLINTEGER)nMaxLen, ++ nMaxLen, + &pcbValue), + _aStatementHandle,SQL_HANDLE_STMT,_xInterface); + +@@ -540,7 +540,7 @@ + ::rtl::OUString OTools::getStringValue(OConnection* _pConnection, + SQLHANDLE _aStatementHandle, + sal_Int32 columnIndex, +- SWORD _fSqlType, ++ SQLSMALLINT _fSqlType, + sal_Bool &_bWasNull, + const Reference< XInterface >& _xInterface, + rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException) +@@ -555,15 +555,15 @@ + { + sal_Unicode waCharArray[2048]; + // read the unicode data +- sal_Int32 nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1; ++ SQLLEN nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1; + // GETDATA(SQL_C_WCHAR, waCharArray, nMaxLen + sizeof(sal_Unicode)); + +- SQLINTEGER pcbValue=0; ++ SQLLEN pcbValue=0; + OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, + (SQLUSMALLINT)columnIndex, + SQL_C_WCHAR, + &waCharArray, +- (SQLINTEGER)nMaxLen*sizeof(sal_Unicode), ++ (SQLLEN)nMaxLen*sizeof(sal_Unicode), + &pcbValue), + _aStatementHandle,SQL_HANDLE_STMT,_xInterface); + _bWasNull = pcbValue == SQL_NULL_DATA; +@@ -571,9 +571,9 @@ Sequence OTools::getBytesValue(OConnection* _pConnection, + return ::rtl::OUString(); + // Bei Fehler bricht der GETDATA-Makro mit return ab, + // bei NULL mit break! +- SQLINTEGER nRealSize = 0; ++ SQLLEN nRealSize = 0; + if ( pcbValue > -1 ) + nRealSize = pcbValue / sizeof(sal_Unicode); +- SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1); ++ SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1); + waCharArray[nLen] = 0; + aData.append(waCharArray,nLen); +@@ -595,7 +595,7 @@ + (SQLUSMALLINT)columnIndex, + SQL_C_WCHAR, + &waCharArray, +- (SQLINTEGER)nLen+1, ++ (SQLLEN)nLen+1, + &pcbValue), + _aStatementHandle,SQL_HANDLE_STMT,_xInterface); + nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); +@@ -610,21 +610,21 @@ + char aCharArray[2048]; + // Erstmal versuchen, die Daten mit dem kleinen Puffer + // abzuholen: +- SDWORD nMaxLen = sizeof aCharArray - 1; ++ SQLLEN nMaxLen = sizeof aCharArray - 1; + // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen); +- SQLINTEGER pcbValue = 0; ++ SQLLEN pcbValue = 0; + OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, + (SQLUSMALLINT)columnIndex, + SQL_C_CHAR, + &aCharArray, +- (SQLINTEGER)nMaxLen, ++ nMaxLen, + &pcbValue), + _aStatementHandle,SQL_HANDLE_STMT,_xInterface); + _bWasNull = pcbValue == SQL_NULL_DATA; + if(_bWasNull) + return ::rtl::OUString(); + +- SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); ++ SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); + aCharArray[nLen] = 0; + if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 ) + --nLen; +Index: connectivity/source/drivers/odbcbase/OStatement.cxx +=================================================================== +--- connectivity/source/drivers/odbcbase/OStatement.cxx (revision 274960) ++++ connectivity/source/drivers/odbcbase/OStatement.cxx (working copy) +@@ -250,13 +250,13 @@ + m_xResultSet = Reference< XResultSet >(); + } + //-------------------------------------------------------------------- +-sal_Int32 OStatement_Base::getRowCount () throw( SQLException) ++SQLLEN OStatement_Base::getRowCount () throw( SQLException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(OStatement_BASE::rBHelper.bDisposed); + + +- sal_Int32 numRows = 0; ++ SQLLEN numRows = 0; + + try { + THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows)); +@@ -523,7 +523,9 @@ + SQLRETURN nError = N3SQLMoreResults(m_aStatementHandle); + if(nError == SQL_SUCCESS) + { +- N3SQLRowCount(m_aStatementHandle,&pArray[j]); ++ SQLLEN nRowCount=0; ++ N3SQLRowCount(m_aStatementHandle,&nRowCount); ++ pArray[j] = nRowCount; + } + } + return aRet; +Index: connectivity/source/drivers/odbcbase/OPreparedStatement.cxx +=================================================================== +--- connectivity/source/drivers/odbcbase/OPreparedStatement.cxx (revision 274960) ++++ connectivity/source/drivers/odbcbase/OPreparedStatement.cxx (working copy) +@@ -446,11 +446,11 @@ + checkParameterIndex(parameterIndex); + + sal_Int8* lenBuf = getLengthBuf (parameterIndex); +- *(SDWORD*)lenBuf = SQL_NULL_DATA; ++ *(SQLLEN*)lenBuf = SQL_NULL_DATA; + + +- SQLINTEGER prec = 0; +- SQLUINTEGER nColumnSize = 0; ++ SQLLEN prec = 0; ++ SQLULEN nColumnSize = 0; + if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR) + { + prec = 1; +@@ -476,7 +476,7 @@ + nDecimalDigits, + NULL, + prec, +- (SDWORD*)lenBuf ++ (SQLLEN*)lenBuf + ); + OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this); + } +@@ -861,7 +861,7 @@ + + // Bind the parameter with SQL_LEN_DATA_AT_EXEC + SQLSMALLINT Ctype = SQL_C_CHAR; +- SDWORD atExec = SQL_LEN_DATA_AT_EXEC (length); ++ SQLLEN atExec = SQL_LEN_DATA_AT_EXEC (length); + memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex)); + memcpy (lenBuf, &atExec, sizeof (atExec)); + +@@ -872,14 +872,14 @@ + OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); + N3SQLBindParameter(m_aStatementHandle, + (SQLUSMALLINT)ParameterIndex, +- (SQLSMALLINT)SQL_PARAM_INPUT, ++ (SQLUSMALLINT)SQL_PARAM_INPUT, + Ctype, + (SQLSMALLINT)SQLtype, +- (SQLUINTEGER)length, ++ (SQLULEN)length, + 0, + dataBuf, + sizeof(ParameterIndex), +- (SDWORD*)lenBuf); ++ (SQLLEN*)lenBuf); + + // Save the input stream + boundParams[ParameterIndex - 1].setInputStream (x, length); +Index: connectivity/source/drivers/odbcbase/OResultSet.cxx +=================================================================== +--- connectivity/source/drivers/odbcbase/OResultSet.cxx (revision 274960) ++++ connectivity/source/drivers/odbcbase/OResultSet.cxx (working copy) +@@ -843,8 +843,8 @@ + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + + +- SQLSMALLINT nMaxLen = 20; +- SQLINTEGER nRealLen = 0; ++ SQLLEN nMaxLen = 20; ++ SQLLEN nRealLen = 0; + Sequence aBookmark(nMaxLen); + + SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle, +@@ -925,7 +925,7 @@ + sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) ); + if ( bPositionByBookmark ) + { +- SQLINTEGER nRealLen = 0; ++ SQLLEN nRealLen = 0; + nRet = N3SQLBindCol(m_aStatementHandle, + 0, + SQL_C_VARBOOKMARK, +Index: connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx +=================================================================== +--- connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx (revision 274960) ++++ connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx (working copy) +@@ -86,13 +86,13 @@ + return sValue; + } + // ------------------------------------------------------------------------- +-SWORD OResultSetMetaData::getNumColAttrib(OConnection* _pConnection ++SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection + ,SQLHANDLE _aStatementHandle + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface + ,sal_Int32 _column + ,sal_Int32 _ident) throw(SQLException, RuntimeException) + { +- SWORD nValue=0; ++ SQLLEN nValue=0; + OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle, + (SQLUSMALLINT)_column, + (SQLUSMALLINT)_ident, +@@ -117,13 +117,13 @@ + return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE); + } + // ------------------------------------------------------------------------- +-SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection ++SQLSMALLINT OResultSetMetaData::getColumnODBCType(OConnection* _pConnection + ,SQLHANDLE _aStatementHandle + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface + ,sal_Int32 column) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) + { +- SWORD nType = 0; ++ SQLSMALLINT nType = 0; + try + { + nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE); +Index: unixODBC/inc/sql.h +=================================================================== +--- unixODBC/inc/sql.h (revision 274960) ++++ unixODBC/inc/sql.h (working copy) +@@ -7,6 +7,7 @@ + #ifndef __SQL_H + #define __SQL_H + ++ + /**************************** + * default to 3.51 declare something else before here and you get a whole new ball of wax + ***************************/ +@@ -14,7 +15,9 @@ + #define ODBCVER 0x0351 + #endif + ++#ifndef __SQLTYPES_H + #include "sqltypes.h" ++#endif + + #ifdef __cplusplus + extern "C" { +@@ -270,6 +273,7 @@ + #define SQL_NULL_HSTMT 0 + #if (ODBCVER >= 0x0300) + #define SQL_NULL_HDESC 0 ++#define SQL_NULL_DESC 0 + #endif + + /* null handle used in place of parent handle when allocating HENV */ +@@ -562,254 +566,257 @@ + #define SQL_NC_HIGH 0 + #define SQL_NC_LOW 1 + +-SQLRETURN SQLAllocConnect(SQLHENV EnvironmentHandle, +- SQLHDBC *ConnectionHandle); ++ SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle, ++ SQLHDBC *ConnectionHandle); + +-SQLRETURN SQLAllocEnv(SQLHENV *EnvironmentHandle); ++ SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLAllocHandle(SQLSMALLINT HandleType, +- SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); ++ SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, ++ SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); + #endif + +-SQLRETURN SQLAllocStmt(SQLHDBC ConnectionHandle, +- SQLHSTMT *StatementHandle); ++ SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle, ++ SQLHSTMT *StatementHandle); + +-SQLRETURN SQLBindCol(SQLHSTMT StatementHandle, +- SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, +- SQLPOINTER TargetValue, SQLINTEGER BufferLength, +- SQLINTEGER *StrLen_or_Ind); ++ SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, ++ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, ++ SQLPOINTER TargetValue, SQLLEN BufferLength, ++ SQLLEN *StrLen_or_Ind); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLBindParam(SQLHSTMT StatementHandle, +- SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, +- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, +- SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, +- SQLINTEGER *StrLen_or_Ind); ++ SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle, ++ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, ++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, ++ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, ++ SQLLEN *StrLen_or_Ind); + #endif + +-SQLRETURN SQLCancel(SQLHSTMT StatementHandle); ++ SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLCloseCursor(SQLHSTMT StatementHandle); ++ SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle); + +-SQLRETURN SQLColAttribute (SQLHSTMT StatementHandle, +- SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, +- SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, +- SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute); ++ SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle, ++ SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, ++ SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, ++ SQLSMALLINT *StringLength, SQLLEN *NumericAttribute ++ /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ ); ++ /* Ms now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */ ++ + #endif + + +-SQLRETURN SQLColumns(SQLHSTMT StatementHandle, +- SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, +- SQLCHAR *TableName, SQLSMALLINT NameLength3, +- SQLCHAR *ColumnName, SQLSMALLINT NameLength4); ++ SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, ++ SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, ++ SQLCHAR *TableName, SQLSMALLINT NameLength3, ++ SQLCHAR *ColumnName, SQLSMALLINT NameLength4); + + +-SQLRETURN SQLConnect(SQLHDBC ConnectionHandle, +- SQLCHAR *ServerName, SQLSMALLINT NameLength1, +- SQLCHAR *UserName, SQLSMALLINT NameLength2, +- SQLCHAR *Authentication, SQLSMALLINT NameLength3); ++ SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, ++ SQLCHAR *ServerName, SQLSMALLINT NameLength1, ++ SQLCHAR *UserName, SQLSMALLINT NameLength2, ++ SQLCHAR *Authentication, SQLSMALLINT NameLength3); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLCopyDesc(SQLHDESC SourceDescHandle, +- SQLHDESC TargetDescHandle); ++ SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, ++ SQLHDESC TargetDescHandle); + #endif + +-SQLRETURN SQLDataSources(SQLHENV EnvironmentHandle, +- SQLUSMALLINT Direction, SQLCHAR *ServerName, +- SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, +- SQLCHAR *Description, SQLSMALLINT BufferLength2, +- SQLSMALLINT *NameLength2); ++ SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle, ++ SQLUSMALLINT Direction, SQLCHAR *ServerName, ++ SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, ++ SQLCHAR *Description, SQLSMALLINT BufferLength2, ++ SQLSMALLINT *NameLength2); + +-SQLRETURN SQLDescribeCol(SQLHSTMT StatementHandle, +- SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, +- SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, +- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, +- SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); ++ SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, ++ SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, ++ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, ++ SQLSMALLINT *DataType, SQLULEN *ColumnSize, ++ SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); + +-SQLRETURN SQLDisconnect(SQLHDBC ConnectionHandle); ++ SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, +- SQLSMALLINT CompletionType); ++ SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, ++ SQLSMALLINT CompletionType); + #endif + +-SQLRETURN SQLError(SQLHENV EnvironmentHandle, +- SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, +- SQLCHAR *Sqlstate, SQLINTEGER *NativeError, +- SQLCHAR *MessageText, SQLSMALLINT BufferLength, +- SQLSMALLINT *TextLength); ++ SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle, ++ SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, ++ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, ++ SQLCHAR *MessageText, SQLSMALLINT BufferLength, ++ SQLSMALLINT *TextLength); + +-SQLRETURN SQLExecDirect(SQLHSTMT StatementHandle, +- SQLCHAR *StatementText, SQLINTEGER TextLength); ++ SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle, ++ SQLCHAR *StatementText, SQLINTEGER TextLength); + +-SQLRETURN SQLExecute(SQLHSTMT StatementHandle); ++ SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle); + +-SQLRETURN SQLFetch(SQLHSTMT StatementHandle); ++ SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLFetchScroll(SQLHSTMT StatementHandle, +- SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset); ++ SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, ++ SQLSMALLINT FetchOrientation, SQLLEN FetchOffset); + #endif + +-SQLRETURN SQLFreeConnect(SQLHDBC ConnectionHandle); ++ SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle); + +-SQLRETURN SQLFreeEnv(SQLHENV EnvironmentHandle); ++ SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); ++ SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); + #endif + +-SQLRETURN SQLFreeStmt(SQLHSTMT StatementHandle, +- SQLUSMALLINT Option); ++ SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, ++ SQLUSMALLINT Option); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLGetConnectAttr(SQLHDBC ConnectionHandle, +- SQLINTEGER Attribute, SQLPOINTER Value, +- SQLINTEGER BufferLength, SQLINTEGER *StringLength); ++ SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, ++ SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength); + #endif + +-SQLRETURN SQLGetConnectOption(SQLHDBC ConnectionHandle, +- SQLUSMALLINT Option, SQLPOINTER Value); ++ SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle, ++ SQLUSMALLINT Option, SQLPOINTER Value); + +-SQLRETURN SQLGetCursorName(SQLHSTMT StatementHandle, +- SQLCHAR *CursorName, SQLSMALLINT BufferLength, +- SQLSMALLINT *NameLength); ++ SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle, ++ SQLCHAR *CursorName, SQLSMALLINT BufferLength, ++ SQLSMALLINT *NameLength); + +-SQLRETURN SQLGetData(SQLHSTMT StatementHandle, +- SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, +- SQLPOINTER TargetValue, SQLINTEGER BufferLength, +- SQLINTEGER *StrLen_or_Ind); ++ SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, ++ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, ++ SQLPOINTER TargetValue, SQLLEN BufferLength, ++ SQLLEN *StrLen_or_Ind); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, +- SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, +- SQLPOINTER Value, SQLINTEGER BufferLength, +- SQLINTEGER *StringLength); ++ SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, ++ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, ++ SQLPOINTER Value, SQLINTEGER BufferLength, ++ SQLINTEGER *StringLength); + +-SQLRETURN SQLGetDescRec(SQLHDESC DescriptorHandle, +- SQLSMALLINT RecNumber, SQLCHAR *Name, +- SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, +- SQLSMALLINT *Type, SQLSMALLINT *SubType, +- SQLINTEGER *Length, SQLSMALLINT *Precision, +- SQLSMALLINT *Scale, SQLSMALLINT *Nullable); ++ SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, ++ SQLSMALLINT RecNumber, SQLCHAR *Name, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, ++ SQLSMALLINT *Type, SQLSMALLINT *SubType, ++ SQLLEN *Length, SQLSMALLINT *Precision, ++ SQLSMALLINT *Scale, SQLSMALLINT *Nullable); + +-SQLRETURN SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, +- SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, +- SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, +- SQLSMALLINT *StringLength); ++ SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, ++ SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, ++ SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, ++ SQLSMALLINT *StringLength); + +-SQLRETURN SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, +- SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, +- SQLINTEGER *NativeError, SQLCHAR *MessageText, +- SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); ++ SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, ++ SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, ++ SQLINTEGER *NativeError, SQLCHAR *MessageText, ++ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); + +-SQLRETURN SQLGetEnvAttr(SQLHENV EnvironmentHandle, +- SQLINTEGER Attribute, SQLPOINTER Value, +- SQLINTEGER BufferLength, SQLINTEGER *StringLength); ++ SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, ++ SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength); + #endif /* ODBCVER >= 0x0300 */ + +-SQLRETURN SQLGetFunctions(SQLHDBC ConnectionHandle, +- SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); ++ SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle, ++ SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); + +-SQLRETURN SQLGetInfo(SQLHDBC ConnectionHandle, +- SQLUSMALLINT InfoType, SQLPOINTER InfoValue, +- SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); ++ SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, ++ SQLUSMALLINT InfoType, SQLPOINTER InfoValue, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLGetStmtAttr(SQLHSTMT StatementHandle, +- SQLINTEGER Attribute, SQLPOINTER Value, +- SQLINTEGER BufferLength, SQLINTEGER *StringLength); ++ SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, ++ SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength); + #endif /* ODBCVER >= 0x0300 */ + +-SQLRETURN SQLGetStmtOption(SQLHSTMT StatementHandle, +- SQLUSMALLINT Option, SQLPOINTER Value); ++ SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle, ++ SQLUSMALLINT Option, SQLPOINTER Value); + +-SQLRETURN SQLGetTypeInfo(SQLHSTMT StatementHandle, +- SQLSMALLINT DataType); ++ SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, ++ SQLSMALLINT DataType); + +-SQLRETURN SQLNumResultCols(SQLHSTMT StatementHandle, +- SQLSMALLINT *ColumnCount); ++ SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, ++ SQLSMALLINT *ColumnCount); + +-SQLRETURN SQLParamData(SQLHSTMT StatementHandle, +- SQLPOINTER *Value); ++ SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, ++ SQLPOINTER *Value); + +-SQLRETURN SQLPrepare(SQLHSTMT StatementHandle, +- SQLCHAR *StatementText, SQLINTEGER TextLength); ++ SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle, ++ SQLCHAR *StatementText, SQLINTEGER TextLength); + +-SQLRETURN SQLPutData(SQLHSTMT StatementHandle, +- SQLPOINTER Data, SQLINTEGER StrLen_or_Ind); ++ SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, ++ SQLPOINTER Data, SQLLEN StrLen_or_Ind); + +-SQLRETURN SQLRowCount(SQLHSTMT StatementHandle, +- SQLINTEGER *RowCount); ++ SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle, ++ SQLLEN *RowCount); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle, +- SQLINTEGER Attribute, SQLPOINTER Value, +- SQLINTEGER StringLength); ++ SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, ++ SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength); + #endif /* ODBCVER >= 0x0300 */ + +-SQLRETURN SQLSetConnectOption(SQLHDBC ConnectionHandle, +- SQLUSMALLINT Option, SQLUINTEGER Value); ++ SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle, ++ SQLUSMALLINT Option, SQLULEN Value); + +-SQLRETURN SQLSetCursorName(SQLHSTMT StatementHandle, +- SQLCHAR *CursorName, SQLSMALLINT NameLength); ++ SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle, ++ SQLCHAR *CursorName, SQLSMALLINT NameLength); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLSetDescField(SQLHDESC DescriptorHandle, +- SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, +- SQLPOINTER Value, SQLINTEGER BufferLength); ++ SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, ++ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, ++ SQLPOINTER Value, SQLINTEGER BufferLength); + +-SQLRETURN SQLSetDescRec(SQLHDESC DescriptorHandle, +- SQLSMALLINT RecNumber, SQLSMALLINT Type, +- SQLSMALLINT SubType, SQLINTEGER Length, +- SQLSMALLINT Precision, SQLSMALLINT Scale, +- SQLPOINTER Data, SQLINTEGER *StringLength, +- SQLINTEGER *Indicator); ++ SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, ++ SQLSMALLINT RecNumber, SQLSMALLINT Type, ++ SQLSMALLINT SubType, SQLLEN Length, ++ SQLSMALLINT Precision, SQLSMALLINT Scale, ++ SQLPOINTER Data, SQLLEN *StringLength, ++ SQLLEN *Indicator); + +-SQLRETURN SQLSetEnvAttr(SQLHENV EnvironmentHandle, +- SQLINTEGER Attribute, SQLPOINTER Value, +- SQLINTEGER StringLength); ++ SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, ++ SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength); + #endif /* ODBCVER >= 0x0300 */ + +-SQLRETURN SQLSetParam(SQLHSTMT StatementHandle, +- SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, +- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, +- SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, +- SQLINTEGER *StrLen_or_Ind); ++ SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle, ++ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, ++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, ++ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, ++ SQLLEN *StrLen_or_Ind); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLSetStmtAttr(SQLHSTMT StatementHandle, +- SQLINTEGER Attribute, SQLPOINTER Value, +- SQLINTEGER StringLength); ++ SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, ++ SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength); + #endif + +-SQLRETURN SQLSetStmtOption(SQLHSTMT StatementHandle, +- SQLUSMALLINT Option, SQLUINTEGER Value); ++ SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle, ++ SQLUSMALLINT Option, SQLULEN Value); + +-SQLRETURN SQLSpecialColumns(SQLHSTMT StatementHandle, +- SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, +- SQLSMALLINT NameLength1, SQLCHAR *SchemaName, +- SQLSMALLINT NameLength2, SQLCHAR *TableName, +- SQLSMALLINT NameLength3, SQLUSMALLINT Scope, +- SQLUSMALLINT Nullable); ++ SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, ++ SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, ++ SQLSMALLINT NameLength1, SQLCHAR *SchemaName, ++ SQLSMALLINT NameLength2, SQLCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLUSMALLINT Scope, ++ SQLUSMALLINT Nullable); + +-SQLRETURN SQLStatistics(SQLHSTMT StatementHandle, +- SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, +- SQLCHAR *TableName, SQLSMALLINT NameLength3, +- SQLUSMALLINT Unique, SQLUSMALLINT Reserved); ++ SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, ++ SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, ++ SQLCHAR *TableName, SQLSMALLINT NameLength3, ++ SQLUSMALLINT Unique, SQLUSMALLINT Reserved); + +-SQLRETURN SQLTables(SQLHSTMT StatementHandle, +- SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, +- SQLCHAR *TableName, SQLSMALLINT NameLength3, +- SQLCHAR *TableType, SQLSMALLINT NameLength4); ++ SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, ++ SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, ++ SQLCHAR *TableName, SQLSMALLINT NameLength3, ++ SQLCHAR *TableType, SQLSMALLINT NameLength4); + +-SQLRETURN SQLTransact(SQLHENV EnvironmentHandle, +- SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); ++ SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, ++ SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); + + #ifdef __cplusplus + } +Index: unixODBC/inc/sqlext.h +=================================================================== +--- unixODBC/inc/sqlext.h (revision 274960) ++++ unixODBC/inc/sqlext.h (working copy) +@@ -39,7 +39,9 @@ + + /* END - unixODBC ONLY */ + ++#ifndef __SQL_H + #include "sql.h" ++#endif + + #ifdef __cplusplus + extern "C" { /* Assume C declarations for C++ */ +@@ -47,8 +49,8 @@ + + /* generally useful constants */ + #define SQL_SPEC_MAJOR 3 /* Major version of specification */ +-#define SQL_SPEC_MINOR 51 /* Minor version of specification */ +-#define SQL_SPEC_STRING "03.51" /* String constant for version */ ++#define SQL_SPEC_MINOR 52 /* Minor version of specification */ ++#define SQL_SPEC_STRING "03.52" /* String constant for version */ + + #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */ + #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */ +@@ -72,6 +74,11 @@ + #define SQL_ATTR_ODBC_VERSION 200 + #define SQL_ATTR_CONNECTION_POOLING 201 + #define SQL_ATTR_CP_MATCH 202 ++ ++/* unixODBC additions */ ++#define SQL_ATTR_UNIXODBC_SYSPATH 65001 ++#define SQL_ATTR_UNIXODBC_VERSION 65002 ++#define SQL_ATTR_UNIXODBC_ENVATTR 65003 + #endif /* ODBCVER >= 0x0300 */ + + #if (ODBCVER >= 0x0300) +@@ -127,6 +134,8 @@ + + #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */ + ++#define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */ ++ + #if (ODBCVER >= 0x0351) + /* ODBC Driver Manager sets this connection attribute to a unicode driver + (which supports SQLConnectW) when the application is an ANSI application +@@ -170,7 +179,7 @@ + #define SQL_OPT_TRACE_OFF 0UL + #define SQL_OPT_TRACE_ON 1UL + #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF +-#define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG" ++#define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG" + + /* SQL_ODBC_CURSORS options */ + #define SQL_CUR_USE_IF_NEEDED 0UL +@@ -516,7 +525,12 @@ + #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/ + #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/ + #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/ ++ ++#if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE) ++#define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */ ++#else + #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */ ++#endif + + #if (ODBCVER >= 0x0350) + #define SQL_C_GUID SQL_GUID +@@ -751,6 +765,7 @@ + #define SQL_CONVERT_VARBINARY 69 + #define SQL_CONVERT_VARCHAR 70 + #define SQL_CONVERT_LONGVARBINARY 71 ++#define SQL_CONVERT_GUID 173 + #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */ + #define SQL_CORRELATION_NAME 74 + #define SQL_NON_NULLABLE_COLUMNS 75 +@@ -780,7 +795,9 @@ + #define SQL_QUALIFIER_LOCATION 114 + + #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300) ++#ifndef SQL_OJ_CAPABILITIES + #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ ++#endif + #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */ + + /*----------------------------------------------*/ +@@ -927,6 +944,7 @@ + #define SQL_CVT_WCHAR 0x00200000L + #define SQL_CVT_WLONGVARCHAR 0x00400000L + #define SQL_CVT_WVARCHAR 0x00800000L ++#define SQL_CVT_GUID 0x01000000L + + #endif /* ODBCVER >= 0x0300 */ + +@@ -1199,7 +1217,7 @@ + #define SQL_FILE_NOT_SUPPORTED 0x0000 + #define SQL_FILE_TABLE 0x0001 + #define SQL_FILE_QUALIFIER 0x0002 +-#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER // ODBC 3.0 ++#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */ + + + /* SQL_GETDATA_EXTENSIONS values */ +@@ -1688,7 +1706,7 @@ + #define SQL_DRIVER_PROMPT 2 + #define SQL_DRIVER_COMPLETE_REQUIRED 3 + +-SQLRETURN SQLDriverConnect( ++SQLRETURN SQL_API SQLDriverConnect( + SQLHDBC hdbc, + SQLHWND hwnd, + SQLCHAR *szConnStrIn, +@@ -1762,8 +1780,7 @@ + #define SQL_PT_FUNCTION 2 + + /* This define is too large for RC */ +-#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS," +-/* ++#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ + "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ + "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ + "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ +@@ -1794,9 +1811,8 @@ + "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ + "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\ + "YEAR,ZONE" +-*/ + +-SQLRETURN SQLBrowseConnect( ++SQLRETURN SQL_API SQLBrowseConnect( + SQLHDBC hdbc, + SQLCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, +@@ -1805,21 +1821,21 @@ + SQLSMALLINT *pcbConnStrOut); + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLBulkOperations( ++SQLRETURN SQL_API SQLBulkOperations( + SQLHSTMT StatementHandle, + SQLSMALLINT Operation); + #endif /* ODBCVER >= 0x0300 */ + +-SQLRETURN SQLColAttributes( ++SQLRETURN SQL_API SQLColAttributes( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, + SQLSMALLINT cbDescMax, + SQLSMALLINT *pcbDesc, +- SQLINTEGER *pfDesc); ++ SQLLEN *pfDesc); + +-SQLRETURN SQLColumnPrivileges( ++SQLRETURN SQL_API SQLColumnPrivileges( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, +@@ -1830,22 +1846,22 @@ + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +-SQLRETURN SQLDescribeParam( ++SQLRETURN SQL_API SQLDescribeParam( + SQLHSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT *pfSqlType, +- SQLUINTEGER *pcbParamDef, ++ SQLULEN *pcbParamDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + +-SQLRETURN SQLExtendedFetch( ++SQLRETURN SQL_API SQLExtendedFetch( + SQLHSTMT hstmt, + SQLUSMALLINT fFetchType, +- SQLINTEGER irow, +- SQLUINTEGER *pcrow, +- SQLUSMALLINT *rgfRowStatus); ++ SQLLEN irow, ++ SQLULEN *pcrow, ++ SQLUSMALLINT *rgfRowStatus); + +-SQLRETURN SQLForeignKeys( ++SQLRETURN SQL_API SQLForeignKeys( + SQLHSTMT hstmt, + SQLCHAR *szPkCatalogName, + SQLSMALLINT cbPkCatalogName, +@@ -1860,10 +1876,10 @@ + SQLCHAR *szFkTableName, + SQLSMALLINT cbFkTableName); + +-SQLRETURN SQLMoreResults( ++SQLRETURN SQL_API SQLMoreResults( + SQLHSTMT hstmt); + +-SQLRETURN SQLNativeSql( ++SQLRETURN SQL_API SQLNativeSql( + SQLHDBC hdbc, + SQLCHAR *szSqlStrIn, + SQLINTEGER cbSqlStrIn, +@@ -1871,16 +1887,16 @@ + SQLINTEGER cbSqlStrMax, + SQLINTEGER *pcbSqlStr); + +-SQLRETURN SQLNumParams( ++SQLRETURN SQL_API SQLNumParams( + SQLHSTMT hstmt, + SQLSMALLINT *pcpar); + +-SQLRETURN SQLParamOptions( ++SQLRETURN SQL_API SQLParamOptions( + SQLHSTMT hstmt, +- SQLUINTEGER crow, +- SQLUINTEGER *pirow); ++ SQLULEN crow, ++ SQLULEN *pirow); + +-SQLRETURN SQLPrimaryKeys( ++SQLRETURN SQL_API SQLPrimaryKeys( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, +@@ -1889,7 +1905,7 @@ + SQLCHAR *szTableName, + SQLSMALLINT cbTableName); + +-SQLRETURN SQLProcedureColumns( ++SQLRETURN SQL_API SQLProcedureColumns( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, +@@ -1900,7 +1916,7 @@ + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +-SQLRETURN SQLProcedures( ++SQLRETURN SQL_API SQLProcedures( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, +@@ -1909,13 +1925,13 @@ + SQLCHAR *szProcName, + SQLSMALLINT cbProcName); + +-SQLRETURN SQLSetPos( ++SQLRETURN SQL_API SQLSetPos( + SQLHSTMT hstmt, +- SQLUSMALLINT irow, ++ SQLSETPOSIROW irow, + SQLUSMALLINT fOption, + SQLUSMALLINT fLock); + +-SQLRETURN SQLTablePrivileges( ++SQLRETURN SQL_API SQLTablePrivileges( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, +@@ -1924,7 +1940,7 @@ + SQLCHAR *szTableName, + SQLSMALLINT cbTableName); + +-SQLRETURN SQLDrivers( ++SQLRETURN SQL_API SQLDrivers( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLCHAR *szDriverDesc, +@@ -1934,17 +1950,17 @@ + SQLSMALLINT cbDrvrAttrMax, + SQLSMALLINT *pcbDrvrAttr); + +-SQLRETURN SQLBindParameter( ++SQLRETURN SQL_API SQLBindParameter( + SQLHSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT fParamType, + SQLSMALLINT fCType, + SQLSMALLINT fSqlType, +- SQLUINTEGER cbColDef, ++ SQLULEN cbColDef, + SQLSMALLINT ibScale, + SQLPOINTER rgbValue, +- SQLINTEGER cbValueMax, +- SQLINTEGER *pcbValue); ++ SQLLEN cbValueMax, ++ SQLLEN *pcbValue); + + /*---------------------------------------------------------*/ + /* SQLAllocHandleStd is implemented to make SQLAllocHandle */ +@@ -1972,7 +1988,7 @@ + #endif /* ODBC_STD */ + + #if (ODBCVER >= 0x0300) +-SQLRETURN SQLAllocHandleStd( ++SQLRETURN SQL_API SQLAllocHandleStd( + SQLSMALLINT fHandleType, + SQLHANDLE hInput, + SQLHANDLE *phOutput); +@@ -1999,21 +2015,57 @@ + #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */ + + /* Deprecated functions from prior versions of ODBC */ +-SQLRETURN SQLSetScrollOptions( /* Use SQLSetStmtOptions */ ++SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */ + SQLHSTMT hstmt, + SQLUSMALLINT fConcurrency, +- SQLINTEGER crowKeyset, ++ SQLLEN crowKeyset, + SQLUSMALLINT crowRowset); + +-/* Tracing section */ ++/*! ++ * \defgroup Tracing. ++ * ++ * unixODBC implements a slight variation of the tracing mechanism used ++ * on MS platforms. The unixODBC method loses the ability to produce trace ++ * output for invalid handles but gains the following; ++ * ++ * - better concurrency ++ * - allows tracing to be turned on/off and configured at finer granularity ++ * - hopefully; better performance ++ * ++ * unixODBC provides a cross-platform helper library called 'trace' and an ++ * example/default trace plugin called 'odbctrac'. Those writing an ODBC ++ * driver can use the 'trace' helper library (a static library). Those wanting ++ * to create custom trace output can implement a different version of the ++ * 'odbctrac' plugin. ++ * ++ * The text file driver (odbctxt) included with unixODBC is an example of a ++ * driver using the 'trace' helper library. ++ * ++ * The 'trace' library and the example plugin 'odbctrac' are designed to be ++ * portable on all platforms where unixODBC is available and on MS platforms. ++ * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly ++ * portable. On MS platforms - this compliments traditional tracing (mostly ++ * just used by the Driver Manager). ++ * ++ * \sa trace ++ * odbctxt ++ * odbctrac ++ */ ++/*@{*/ ++#define TRACE_VERSION 1000 /*!< Version of trace API */ ++#ifdef UNICODE ++RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */ ++#else ++RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */ ++#endif ++RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */ ++SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */ ++#ifdef __cplusplus ++DWORD TraceVersion(); /*!< Returns trace API version */ ++#else ++DWORD TraceVersion(VOID); /*!< Returns trace API version */ ++#endif + +-#define TRACE_VERSION 1000 /* Version of trace API */ +- +-RETCODE TraceOpenLogFile(LPWSTR,LPWSTR,DWORD); /* open a trace log file */ +-RETCODE TraceCloseLogFile(); /* Request to close a trace log */ +-VOID TraceReturn(RETCODE,RETCODE); /* Processes trace after FN is called */ +-DWORD TraceVersion(); /* Returns trace API version */ +- + /* Functions for Visual Studio Analyzer*/ + /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */ + #define TRACE_ON 0x00000001L +@@ -2028,7 +2080,11 @@ + #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */ + + typedef struct tagODBC_VS_ARGS { ++#ifdef GUID_DEFINED + const GUID *pguidEvent; /* the GUID for event */ ++#else ++ const void *pguidEvent; /* the GUID for event */ ++#endif + DWORD dwFlags; /* flags for the call */ + union { + WCHAR *wszArg; +@@ -2042,10 +2098,25 @@ + } ODBC_VS_ARGS, *PODBC_VS_ARGS; + + VOID FireVSDebugEvent(PODBC_VS_ARGS); ++/*@}*/ + +- + #ifdef __cplusplus + } + #endif + ++/* ++ * connection pooling retry times ++ */ ++ ++BOOL ODBCSetTryWaitValue ( DWORD dwValue ); ++#ifdef __cplusplus ++DWORD ODBCGetTryWaitValue ( ); ++#else ++DWORD ODBCGetTryWaitValue ( VOID ); + #endif ++ ++#ifndef __SQLUCODE_H ++#include "sqlucode.h" ++#endif ++ ++#endif +Index: unixODBC/inc/sqltypes.h +=================================================================== +--- unixODBC/inc/sqltypes.h (revision 274960) ++++ unixODBC/inc/sqltypes.h (working copy) +@@ -26,48 +26,111 @@ + #define ODBCVER 0x0351 + #endif + ++/* ++ * if thi sis set, then use a 4 byte unicode definition, insteead of the 2 bye that MS use ++ */ ++ ++#ifdef SQL_WCHART_CONVERT ++/* ++ * Use this if you want to use the C/C++ portable definition of a wide char, wchar_t ++ * Microsoft hardcoded a definition of unsigned short which may not be compatible with ++ * your platform specific wide char definition. ++ */ ++#include ++#endif ++ ++#include ++ + #ifdef __cplusplus + extern "C" { + #endif + +-#ifndef SIZEOF_LONG +-# if defined(__alpha__) || defined(__x86_64__) || defined(__ia64__) || defined(__s390x__) || defined(__sparcv9) || defined(__LP64__) +-# define SIZEOF_LONG 8 +-#else +-# define SIZEOF_LONG 4 ++#ifndef SIZEOF_LONG_INT ++# define SIZEOF_LONG_INT SAL_TYPES_SIZEOFLONG + #endif ++#ifndef ODBCINT64 ++# define ODBCINT64 sal_Int64 + #endif ++#ifndef UODBCINT64 ++# define UODBCINT64 sal_uInt64 ++#endif + ++/* ++ * this is defined by configure, but will not be on a normal application build ++ * the install creates a unixodbc_conf.h file that contains the current build settings ++ */ ++ ++#ifndef SIZEOF_LONG_INT ++#include ++#endif ++ ++#ifndef SIZEOF_LONG_INT ++#error "Needs to know how big a long int is to continue!!!" ++#endif ++ + /**************************** + * These make up for having no windows.h + ***************************/ ++#ifndef ALLREADY_HAVE_WINDOWS_TYPE ++ + #define FAR + #define CALLBACK ++#ifdef __OS2__ ++#define SQL_API _System ++#else + #define SQL_API ++#endif + #define BOOL int + typedef void* HWND; +-#ifndef CHAR +-typedef char* GUID; ++typedef char CHAR; ++#ifdef UNICODE ++ ++/* ++ * NOTE: The Microsoft unicode define is only for apps that want to use TCHARs and ++ * be able to compile for both unicode and non-unicode with the same source. ++ * This is not recommanded for linux applications and is not supported ++ * by the standard linux string header files. ++ */ ++#ifdef SQL_WCHART_CONVERT ++typedef wchar_t TCHAR; ++#else ++typedef signed short TCHAR; + #endif +-#define GUID_DEFINED +-typedef char CHAR; ++ ++#else ++typedef char TCHAR; ++#endif ++ + #ifndef DONT_TD_VOID + typedef void VOID; + #endif ++ + typedef unsigned short WORD; +-#if SIZEOF_LONG == 4 +- typedef unsigned long DWORD; ++#if (SIZEOF_LONG_INT == 4) ++typedef unsigned long DWORD; + #else +- typedef unsigned int DWORD; ++typedef unsigned int DWORD; + #endif + typedef unsigned char BYTE; ++ ++#ifdef SQL_WCHART_CONVERT ++typedef wchar_t WCHAR; ++#else + typedef unsigned short WCHAR; +-typedef WCHAR* LPWSTR; ++#endif ++ ++typedef WCHAR* LPWSTR; + typedef const char* LPCSTR; ++typedef const WCHAR* LPCWSTR; ++typedef TCHAR* LPTSTR; + typedef char* LPSTR; + typedef DWORD* LPDWORD; + ++typedef void* HINSTANCE; + ++#endif ++ ++ + /**************************** + * standard SQL* data types. use these as much as possible when using ODBC calls/vars + ***************************/ +@@ -80,11 +143,61 @@ + typedef double SQLFLOAT; + #endif + +-#if SIZEOF_LONG == 4 +- typedef long SQLINTEGER; ++/* ++ * can't use a long it fails on 64 platforms ++ */ ++ ++/* ++ * Hopefully by now it should be safe to assume most drivers know about SQLLEN now ++ * and the defaukt is now sizeof( SQLLEN ) = 8 on 64 bit platforms ++ * ++ */ ++ ++#if (SIZEOF_LONG_INT == 8) ++#ifdef BUILD_LEGACY_64_BIT_MODE ++typedef int SQLINTEGER; ++typedef unsigned int SQLUINTEGER; ++#define SQLLEN SQLINTEGER ++#define SQLULEN SQLUINTEGER ++#define SQLSETPOSIROW SQLUSMALLINT ++/* ++ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril ++ * ++ typedef SQLULEN SQLROWCOUNT; ++ typedef SQLULEN SQLROWSETSIZE; ++ typedef SQLULEN SQLTRANSID; ++ typedef SQLLEN SQLROWOFFSET; ++*/ + #else +- typedef int SQLINTEGER; ++typedef int SQLINTEGER; ++typedef unsigned int SQLUINTEGER; ++typedef long SQLLEN; ++typedef unsigned long SQLULEN; ++typedef unsigned long SQLSETPOSIROW; ++/* ++ * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril ++ * ++ typedef SQLULEN SQLTRANSID; ++ typedef SQLULEN SQLROWCOUNT; ++ typedef SQLUINTEGER SQLROWSETSIZE; ++ typedef SQLLEN SQLROWOFFSET; ++ */ ++typedef SQLULEN SQLROWCOUNT; ++typedef SQLULEN SQLROWSETSIZE; ++typedef SQLULEN SQLTRANSID; ++typedef SQLLEN SQLROWOFFSET; + #endif ++#else ++typedef long SQLINTEGER; ++typedef unsigned long SQLUINTEGER; ++#define SQLLEN SQLINTEGER ++#define SQLULEN SQLUINTEGER ++#define SQLSETPOSIROW SQLUSMALLINT ++typedef SQLULEN SQLROWCOUNT; ++typedef SQLULEN SQLROWSETSIZE; ++typedef SQLULEN SQLTRANSID; ++typedef SQLLEN SQLROWOFFSET; ++#endif + + #if (ODBCVER >= 0x0300) + typedef unsigned char SQLNUMERIC; +@@ -107,39 +220,58 @@ + + typedef SQLSMALLINT SQLRETURN; + +-/* typedef void * SQLHANDLE; */ +- +-typedef SQLINTEGER SQLHANDLE; + #if (ODBCVER >= 0x0300) +- ++typedef void * SQLHANDLE; + typedef SQLHANDLE SQLHENV; + typedef SQLHANDLE SQLHDBC; + typedef SQLHANDLE SQLHSTMT; + typedef SQLHANDLE SQLHDESC; ++#else ++typedef void * SQLHENV; ++typedef void * SQLHDBC; ++typedef void * SQLHSTMT; ++/* ++ * some things like PHP won't build without this ++ */ ++typedef void * SQLHANDLE; ++#endif + ++/**************************** ++ * These are cast into the actual struct that is being passed around. The ++ * DriverManager knows what its structs look like and the Driver knows about its ++ * structs... the app knows nothing about them... just void* ++ * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT ++ ***************************/ ++ ++#if (ODBCVER >= 0x0300) ++typedef SQLHANDLE HENV; ++typedef SQLHANDLE HDBC; ++typedef SQLHANDLE HSTMT; + #else +-typedef SQLINTEGER SQLHENV; +-typedef SQLINTEGER SQLHDBC; +-typedef SQLINTEGER SQLHSTMT; ++typedef void * HENV; ++typedef void * HDBC; ++typedef void * HSTMT; + #endif + + + /**************************** + * more basic data types to augment what windows.h provides + ***************************/ ++#ifndef ALLREADY_HAVE_WINDOWS_TYPE ++ + typedef unsigned char UCHAR; + typedef signed char SCHAR; + typedef SCHAR SQLSCHAR; +-#if SIZEOF_LONG == 4 +- typedef long int SDWORD; +- typedef unsigned long int UDWORD; ++#if (SIZEOF_LONG_INT == 4) ++typedef long int SDWORD; ++typedef unsigned long int UDWORD; + #else +- typedef signed int SDWORD; +- typedef unsigned int UDWORD; ++typedef int SDWORD; ++typedef unsigned int UDWORD; + #endif + typedef signed short int SWORD; + typedef unsigned short int UWORD; +-typedef UDWORD SQLUINTEGER; ++typedef unsigned int UINT; + typedef signed long SLONG; + typedef signed short SSHORT; + typedef unsigned long ULONG; +@@ -151,20 +283,7 @@ + typedef signed short RETCODE; + typedef void* SQLHWND; + +-/**************************** +- * These are cast into the actual struct that is being passed around. The +- * DriverManager knows what its structs look like and the Driver knows about its +- * structs... the app knows nothing about them... just void* +- * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT +- ***************************/ +-/* +-typedef void* HENV; +-typedef void* HDBC; +-typedef void* HSTMT; +-*/ +-typedef SQLHANDLE HENV; +-typedef SQLHANDLE HDBC; +-typedef SQLHANDLE HSTMT; ++#endif + + /**************************** + * standard structs for working with date/times +@@ -263,12 +382,41 @@ + /**************************** + * + ***************************/ +-#if (ODBCVER >= 0x0300) +-#define ODBCINT64 long ++#ifndef ODBCINT64 ++# if (ODBCVER >= 0x0300) ++# if (SIZEOF_LONG_INT == 8) ++# define ODBCINT64 long ++# define UODBCINT64 unsigned long ++# else ++# ifdef HAVE_LONG_LONG ++# define ODBCINT64 long long ++# define UODBCINT64 unsigned long long ++# else ++/* ++ * may fail in some cases, but what else can we do ? ++ */ ++struct __bigint_struct ++{ ++ int hiword; ++ unsigned int loword; ++}; ++struct __bigint_struct_u ++{ ++ unsigned int hiword; ++ unsigned int loword; ++}; ++# define ODBCINT64 struct __bigint_struct ++# define UODBCINT64 struct __bigint_struct_u ++# endif ++# endif ++#endif ++#endif ++ + #ifdef ODBCINT64 + typedef ODBCINT64 SQLBIGINT; +-typedef unsigned ODBCINT64 SQLUBIGINT; + #endif ++#ifdef UODBCINT64 ++typedef UODBCINT64 SQLUBIGINT; + #endif + + +@@ -288,6 +436,7 @@ + + #if (ODBCVER >= 0x0350) + #ifdef GUID_DEFINED ++#ifndef ALLREADY_HAVE_WINDOWS_TYPE + typedef GUID SQLGUID; + #else + typedef struct tagSQLGUID +@@ -298,18 +447,21 @@ + BYTE Data4[ 8 ]; + } SQLGUID; + #endif ++#else ++typedef struct tagSQLGUID ++{ ++ DWORD Data1; ++ WORD Data2; ++ WORD Data3; ++ BYTE Data4[ 8 ]; ++} SQLGUID; + #endif ++#endif + ++typedef SQLULEN BOOKMARK; + +-typedef unsigned long int BOOKMARK; ++typedef WCHAR SQLWCHAR; + +- +-#ifdef _WCHAR_T_DEFINED +-typedef wchar_t SQLWCHAR; +-#else +-typedef unsigned short SQLWCHAR; +-#endif +- + #ifdef UNICODE + typedef SQLWCHAR SQLTCHAR; + #else +@@ -321,3 +473,6 @@ + #endif + + #endif ++ ++ ++ diff --git a/applied_patches/0080-jpegc.c.diff b/applied_patches/0086-jpegc.c.diff similarity index 100% rename from applied_patches/0080-jpegc.c.diff rename to applied_patches/0086-jpegc.c.diff diff --git a/applied_patches/0087-save-doc-withembedded-doc-with-vba-crash.diff b/applied_patches/0087-save-doc-withembedded-doc-with-vba-crash.diff deleted file mode 100644 index 4a66f01f8..000000000 --- a/applied_patches/0087-save-doc-withembedded-doc-with-vba-crash.diff +++ /dev/null @@ -1,45 +0,0 @@ -Index: sw/source/ui/app/docsh.cxx -=================================================================== -RCS file: /cvs/sw/sw/source/ui/app/docsh.cxx,v -retrieving revision 1.71.24.1 -diff -u -p -r1.71.24.1 docsh.cxx ---- sw/source/ui/app/docsh.cxx 17 Aug 2007 07:10:07 -0000 1.71.24.1 -+++ sw/source/ui/app/docsh.cxx 14 Nov 2007 12:12:36 -0000 -@@ -642,16 +642,6 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& - xDocSh->DoClose(); - } - -- if( pDoc->ContainsMSVBasic() ) -- { -- //TODO/MBA: it looks as that this code can be removed! -- //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() ); -- //aTmp.SaveOrDelMSVBAStorage( FALSE, aEmptyStr ); -- if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) -- nVBWarning = SvxImportMSVBasic:: -- GetSaveWarningOfMSVBAStorage( *this ); -- pDoc->SetContainsMSVBasic( FALSE ); -- } - - // TabellenBox Edit beenden! - if( pWrtShell ) -Index: svx/source/msfilter/msoleexp.cxx -=================================================================== -RCS file: /cvs/graphics/svx/source/msfilter/msoleexp.cxx,v -retrieving revision 1.20 -diff -u -p -r1.20 msoleexp.cxx ---- svx/source/msfilter/msoleexp.cxx 27 Jun 2007 18:35:44 -0000 1.20 -+++ svx/source/msfilter/msoleexp.cxx 14 Nov 2007 12:19:05 -0000 -@@ -272,7 +272,12 @@ void SvxMSExportOLEObjects::ExportOLEObj - aSeq[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); - aSeq[1].Value <<= ::rtl::OUString( pExpFilter->GetName() ); - uno::Reference < frame::XStorable > xStor( rObj->getComponent(), uno::UNO_QUERY ); -- xStor->storeToURL( ::rtl::OUString::createFromAscii( "private:stream" ), aSeq ); -+ try -+ { -+ xStor->storeToURL( ::rtl::OUString::createFromAscii( "private:stream" ), aSeq ); -+ } -+ catch( uno::Exception& ) {} // #TODO really handle exceptions - interactionalhandler etc. ? -+ - SotStorageRef xOLEStor = new SotStorage( pStream, TRUE ); - xOLEStor->CopyTo( &rDestStg ); - rDestStg.Commit(); diff --git a/applied_patches/0081-tools-urlobj-smb-scheme-patch.diff b/applied_patches/0087-tools-urlobj-smb-scheme-patch.diff similarity index 100% rename from applied_patches/0081-tools-urlobj-smb-scheme-patch.diff rename to applied_patches/0087-tools-urlobj-smb-scheme-patch.diff diff --git a/applied_patches/0082-samba-hyperlinks-sc-sd.diff b/applied_patches/0088-samba-hyperlinks-sc-sd.diff similarity index 100% rename from applied_patches/0082-samba-hyperlinks-sc-sd.diff rename to applied_patches/0088-samba-hyperlinks-sc-sd.diff diff --git a/applied_patches/0083-tools-qa-urlobj-unittest.diff b/applied_patches/0089-tools-qa-urlobj-unittest.diff similarity index 100% rename from applied_patches/0083-tools-qa-urlobj-unittest.diff rename to applied_patches/0089-tools-qa-urlobj-unittest.diff diff --git a/applied_patches/0089-win32-invalid-names.diff b/applied_patches/0089-win32-invalid-names.diff deleted file mode 100644 index 4ce8840bd..000000000 --- a/applied_patches/0089-win32-invalid-names.diff +++ /dev/null @@ -1,48 +0,0 @@ ---- sal/osl/w32/file.cxx 2006-12-01 17:56:16.000000000 +0000 -+++ sal/osl/w32/file.cxx 2007-06-08 10:30:26.828125000 +0000 -@@ -175,6 +175,7 @@ using namespace osl; - #define VALIDATEPATH_ALLOW_ELLIPSE 0x0002 - #define VALIDATEPATH_ALLOW_RELATIVE 0x0004 - #define VALIDATEPATH_ALLOW_UNC 0x0008 -+#define VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD 0x0010 - - #define WSTR_SYSTEM_ROOT_PATH L"\\\\.\\" - -@@ -1108,9 +1109,10 @@ namespace /* private */ - case '.': - if ( dwFlags & VALIDATEPATH_ALLOW_ELLIPSE ) - { -- if ( 1 == lpCurrent - lpComponent ) -+ if ( (dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD) || -+ 1 == lpCurrent - lpComponent ) - { -- /* Current directory is O.K. */ -+ /* Either do allow periods anywhere, or current directory */ - lpComponentEnd = lpCurrent; - break; - } -@@ -1123,8 +1125,13 @@ namespace /* private */ - } - case 0: - case ' ': -- lpComponentEnd = lpCurrent - 1; -- fValid = FALSE; -+ if ( dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD ) -+ lpComponentEnd = lpCurrent; -+ else -+ { -+ lpComponentEnd = lpCurrent - 1; -+ fValid = FALSE; -+ } - break; - default: - lpComponentEnd = lpCurrent; -@@ -1365,7 +1372,7 @@ namespace /* private */ - lpComponent = lpszPath + i; - } - -- fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags ); -+ fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags | VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD); - - if ( fValid && lpComponent ) - { diff --git a/applied_patches/0084-svx-text-rotation-fix.diff b/applied_patches/0090-svx-text-rotation-fix.diff similarity index 100% rename from applied_patches/0084-svx-text-rotation-fix.diff rename to applied_patches/0090-svx-text-rotation-fix.diff diff --git a/applied_patches/0085-sfx-check-real-help-path.diff b/applied_patches/0091-sfx-check-real-help-path.diff similarity index 100% rename from applied_patches/0085-sfx-check-real-help-path.diff rename to applied_patches/0091-sfx-check-real-help-path.diff diff --git a/applied_patches/0086-xmlhelp-work-with-symlinks.diff b/applied_patches/0092-xmlhelp-work-with-symlinks.diff similarity index 100% rename from applied_patches/0086-xmlhelp-work-with-symlinks.diff rename to applied_patches/0092-xmlhelp-work-with-symlinks.diff diff --git a/applied_patches/0088-localize-pl-cygwin-paths.diff b/applied_patches/0093-localize-pl-cygwin-paths.diff similarity index 100% rename from applied_patches/0088-localize-pl-cygwin-paths.diff rename to applied_patches/0093-localize-pl-cygwin-paths.diff diff --git a/applied_patches/0094-win32-invalid-names.diff b/applied_patches/0094-win32-invalid-names.diff new file mode 100644 index 000000000..019d4baca --- /dev/null +++ b/applied_patches/0094-win32-invalid-names.diff @@ -0,0 +1,50 @@ +--- sal/osl/w32/file_url.h ++++ sal/osl/w32/file_url.h +@@ -175,6 +175,7 @@ + #define VALIDATEPATH_ALLOW_ELLIPSE 0x0002 + #define VALIDATEPATH_ALLOW_RELATIVE 0x0004 + #define VALIDATEPATH_ALLOW_UNC 0x0008 ++#define VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD 0x0010 + + DWORD IsValidFilePath ( + rtl_uString * path, +--- sal/osl/w32/file_url.cxx ++++ sal/osl/w32/file_url.cxx +@@ -1108,9 +1109,10 @@ + case '.': + if ( dwFlags & VALIDATEPATH_ALLOW_ELLIPSE ) + { +- if ( 1 == lpCurrent - lpComponent ) ++ if ( (dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD) || ++ 1 == lpCurrent - lpComponent ) + { +- /* Current directory is O.K. */ ++ /* Either do allow periods anywhere, or current directory */ + lpComponentEnd = lpCurrent; + break; + } +@@ -1123,8 +1125,13 @@ namespace /* private */ + } + case 0: + case ' ': +- lpComponentEnd = lpCurrent - 1; +- fValid = FALSE; ++ if ( dwFlags & VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD ) ++ lpComponentEnd = lpCurrent; ++ else ++ { ++ lpComponentEnd = lpCurrent - 1; ++ fValid = FALSE; ++ } + break; + default: + lpComponentEnd = lpCurrent; +@@ -1365,7 +1372,7 @@ namespace /* private */ + lpComponent = lpszPath + i; + } + +- fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags ); ++ fValid = IsValidFilePathComponent( lpComponent, &lpComponent, dwFlags | VALIDATEPATH_ALLOW_INVALID_SPACE_AND_PERIOD); + + if ( fValid && lpComponent ) + { diff --git a/applied_patches/0095-forms-radio-button-group-names.diff b/applied_patches/0095-forms-radio-button-group-names.diff deleted file mode 100644 index 7e46cdfb7..000000000 --- a/applied_patches/0095-forms-radio-button-group-names.diff +++ /dev/null @@ -1,897 +0,0 @@ -diff --git extensions/inc/extensio.hrc extensions/inc/extensio.hrc -index fe70aa3..c3dbd20 100644 ---- extensions/inc/extensio.hrc -+++ extensions/inc/extensio.hrc -@@ -458,9 +458,10 @@ - #define HID_PROP_NOLABEL (HID_FORMS_START + 340) - #define HID_PROP_WRITING_MODE (HID_FORMS_START + 341) - #define HID_PROP_ANCHOR_TYPE (HID_FORMS_START + 343) -+#define HID_PROP_GROUP_NAME (HID_FORMS_START + 344) - // please adjust HID_LAST_FORMS_ID if you add new ids here! - --#define HID_LAST_FORMS_ID HID_PROP_ANCHOR_TYPE -+#define HID_LAST_FORMS_ID HID_PROP_GROUP_NAME - - #if HID_LAST_FORMS_ID > HID_FORMS_END - #error id overflow -diff --git extensions/source/propctrlr/formmetadata.cxx extensions/source/propctrlr/formmetadata.cxx -index ae07c9a..1fe7db6 100644 ---- extensions/source/propctrlr/formmetadata.cxx -+++ extensions/source/propctrlr/formmetadata.cxx -@@ -143,6 +143,7 @@ namespace pcr - DEF_INFO_3( LABEL, LABEL, LABEL, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), - DEF_INFO_2( CONTROLLABEL, LABELCONTROL, CONTROLLABEL, FORM_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( WRITING_MODE, WRITING_MODE, WRITING_MODE, FORM_VISIBLE, ENUM, COMPOSEABLE ), -+ DEF_INFO_3( GROUP_NAME, GROUP_NAME, GROUP_NAME, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), - DEF_INFO_2( TEXT, TEXT, TEXT, DIALOG_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( MAXTEXTLEN, MAXTEXTLEN, MAXTEXTLEN, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), - DEF_INFO_3( EDITMASK, EDITMASK, EDITMASK, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ), -diff --git extensions/source/propctrlr/formmetadata.hxx extensions/source/propctrlr/formmetadata.hxx -index 8ebacf4..ba9174f 100644 ---- extensions/source/propctrlr/formmetadata.hxx -+++ extensions/source/propctrlr/formmetadata.hxx -@@ -166,6 +166,7 @@ namespace pcr - #define PROPERTY_ID_ALLOWADDITIONS 20 - #define PROPERTY_ID_ALLOWEDITS 21 - #define PROPERTY_ID_ALLOWDELETIONS 22 -+ #define PROPERTY_ID_GROUP_NAME 23 - #define PROPERTY_ID_NAVIGATION 24 - #define PROPERTY_ID_CYCLE 25 - #define PROPERTY_ID_HIDDEN_VALUE 26 -diff --git extensions/source/propctrlr/formres.src extensions/source/propctrlr/formres.src -index a52afa2..21a1288 100644 ---- extensions/source/propctrlr/formres.src -+++ extensions/source/propctrlr/formres.src -@@ -230,6 +230,10 @@ String RID_STR_NAME - { - Text [ en-US ] = "Name" ; - }; -+String RID_STR_GROUP_NAME -+{ -+ Text [ en-US ] = "Group name" ; -+}; - String RID_STR_TABINDEX - { - Text [ en-US ] = "Tab order" ; -diff --git extensions/source/propctrlr/formresid.hrc extensions/source/propctrlr/formresid.hrc -index a889086..aed2207 100644 ---- extensions/source/propctrlr/formresid.hrc -+++ extensions/source/propctrlr/formresid.hrc -@@ -150,6 +150,7 @@ - #define RID_STR_CURSOR_TYPE ( RID_FORMBROWSER_START + 121 ) - #define RID_STR_ENABLE_VISIBLE ( RID_FORMBROWSER_START + 122 ) - #define RID_STR_WHEEL_BEHAVIOR ( RID_FORMBROWSER_START + 123 ) -+#define RID_STR_GROUP_NAME ( RID_FORMBROWSER_START + 124 ) - // FREE - // FREE - // FREE -diff --git extensions/source/propctrlr/formstrings.hxx extensions/source/propctrlr/formstrings.hxx -index 606184e..fad672d 100644 ---- extensions/source/propctrlr/formstrings.hxx -+++ extensions/source/propctrlr/formstrings.hxx -@@ -50,6 +50,7 @@ namespace pcr - PCR_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex"); - PCR_CONSTASCII_STRING( PROPERTY_TAG, "Tag"); - PCR_CONSTASCII_STRING( PROPERTY_NAME, "Name"); -+ PCR_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName"); - PCR_CONSTASCII_STRING( PROPERTY_VALUE, "Value"); - PCR_CONSTASCII_STRING( PROPERTY_TEXT, "Text"); - PCR_CONSTASCII_STRING( PROPERTY_NAVIGATION, "NavigationBarMode"); ---- extensions/util/hidother.src -+++ extensions/util/hidother.src -@@ -307,6 +307,7 @@ hidspecial HID_CHECK_FOR_UPD_DESCRIPTION { HelpId = HID_CHECK_FOR_UPD_DES - hidspecial HID_PROP_FONT { HelpId = HID_PROP_FONT; } - hidspecial HID_PROP_FORMATKEY { HelpId = HID_PROP_FORMATKEY; } - hidspecial HID_PROP_GROUPBOX { HelpId = HID_PROP_GROUPBOX; } -+hidspecial HID_PROP_GROUP_NAME { HelpId = HID_PROP_GROUP_NAME; } - hidspecial HID_PROP_HEIGHT { HelpId = HID_PROP_HEIGHT; } - hidspecial HID_PROP_HELPTEXT { HelpId = HID_PROP_HELPTEXT; } - hidspecial HID_PROP_HELPURL { HelpId = HID_PROP_HELPURL; } -diff --git forms/source/component/GroupManager.cxx forms/source/component/GroupManager.cxx -index d831a82..f5a9ecb 100644 ---- forms/source/component/GroupManager.cxx -+++ forms/source/component/GroupManager.cxx -@@ -127,14 +127,13 @@ OGroupComp::OGroupComp(const Reference& rxSet, sal_Int32 nInsertPo - ,m_xControlModel(rxSet,UNO_QUERY) - ,m_nPos( nInsertPos ) - ,m_nTabIndex(0) -+ ,m_aName( OGroupManager::GetGroupName( rxSet ) ) - { - if (m_xComponent.is()) - { - if (hasProperty( PROPERTY_TABINDEX, m_xComponent ) ) - // Indices kleiner 0 werden wie 0 behandelt - m_nTabIndex = Max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0)); -- -- m_xComponent->getPropertyValue( PROPERTY_NAME ) >>= m_aName; - } - } - -@@ -321,7 +320,8 @@ void OGroupManager::removeFromGroupMap(const ::rtl::OUString& _sGroupName,const - aFind->second.RemoveComponent( _xSet ); - - // Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren -- if ( aFind->second.Count() == 1 ) -+ sal_Int32 nCount = aFind->second.Count(); -+ if ( nCount == 1 || nCount == 0 ) - { - OActiveGroups::iterator aActiveFind = ::std::find( - m_aActiveGroupMap.begin(), -@@ -332,7 +332,7 @@ void OGroupManager::removeFromGroupMap(const ::rtl::OUString& _sGroupName,const - { - // the group is active. Deactivate it if the remaining component - // is *no* radio button -- if ( !isRadioButton( aFind->second.GetObject( 0 ) ) ) -+ if ( nCount == 0 || !isRadioButton( aFind->second.GetObject( 0 ) ) ) - m_aActiveGroupMap.erase( aActiveFind ); - } - } -@@ -341,6 +341,8 @@ void OGroupManager::removeFromGroupMap(const ::rtl::OUString& _sGroupName,const - - // Bei Component als PropertyChangeListener abmelden - _xSet->removePropertyChangeListener( PROPERTY_NAME, this ); -+ if (hasProperty(PROPERTY_GROUP_NAME, _xSet)) -+ _xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this ); - if (hasProperty(PROPERTY_TABINDEX, _xSet)) - _xSet->removePropertyChangeListener( PROPERTY_TABINDEX, this ); - } -@@ -351,10 +353,23 @@ void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) thro - - // Component aus Gruppe entfernen - ::rtl::OUString sGroupName; -- if (evt.PropertyName == PROPERTY_NAME) -+ if (hasProperty( PROPERTY_GROUP_NAME, xSet )) -+ xSet->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName; -+ if (evt.PropertyName == PROPERTY_NAME) { -+ if (sGroupName.getLength() > 0) -+ return; // group hasn't changed; ignore this name change. -+ // no GroupName; use Name as GroupNme -+ evt.OldValue >>= sGroupName; -+ } -+ else if (evt.PropertyName == PROPERTY_GROUP_NAME) { - evt.OldValue >>= sGroupName; -+ if (sGroupName.getLength() == 0) { -+ // No prior GroupName; fallback to Nme -+ xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName; -+ } -+ } - else -- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName; -+ sGroupName = GetGroupName( xSet ); - - removeFromGroupMap(sGroupName,xSet); - -@@ -437,8 +452,7 @@ void OGroupManager::InsertElement( const Reference& xSet ) - m_pCompGroup->InsertComponent( xSet ); - - // Component in Gruppe aufnehmen -- ::rtl::OUString sGroupName; -- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName; -+ ::rtl::OUString sGroupName( GetGroupName( xSet ) ); - - OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName); - -@@ -476,6 +490,8 @@ void OGroupManager::InsertElement( const Reference& xSet ) - - // Bei Component als PropertyChangeListener anmelden - xSet->addPropertyChangeListener( PROPERTY_NAME, this ); -+ if (hasProperty(PROPERTY_GROUP_NAME, xSet)) -+ xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this ); - - // Tabindex muss nicht jeder unterstuetzen - if (hasProperty(PROPERTY_TABINDEX, xSet)) -@@ -492,12 +508,26 @@ void OGroupManager::RemoveElement( const Reference& xSet ) - return; - - // Component aus Gruppe entfernen -- ::rtl::OUString sGroupName; -- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName; -+ ::rtl::OUString sGroupName( GetGroupName( xSet ) ); - - removeFromGroupMap(sGroupName,xSet); - } - -+::rtl::OUString OGroupManager::GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent ) -+{ -+ if (!xComponent.is()) -+ return ::rtl::OUString(); -+ ::rtl::OUString sGroupName; -+ if (hasProperty( PROPERTY_GROUP_NAME, xComponent )) { -+ xComponent->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName; -+ if (sGroupName.getLength() == 0) -+ xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName; -+ } -+ else -+ xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName; -+ return sGroupName; -+} -+ - //......................................................................... - } // namespace frm - //......................................................................... -diff --git forms/source/component/GroupManager.hxx forms/source/component/GroupManager.hxx -index bc5a059..b139998 100644 ---- forms/source/component/GroupManager.hxx -+++ forms/source/component/GroupManager.hxx -@@ -220,6 +220,8 @@ public: - void getGroup(sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup, ::rtl::OUString& Name); - void getGroupByName(const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > getControlModels(); -+ -+ static ::rtl::OUString GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent ); - }; - - -diff --git forms/source/component/RadioButton.cxx forms/source/component/RadioButton.cxx -index b77979b..d9674c5 100644 ---- forms/source/component/RadioButton.cxx -+++ forms/source/component/RadioButton.cxx -@@ -31,6 +31,7 @@ - // MARKER(update_precomp.py): autogen include statement, do not remove - #include "precompiled_forms.hxx" - #include "RadioButton.hxx" -+#include "GroupManager.hxx" - #include "property.hxx" - #ifndef _FRM_PROPERTY_HRC_ - #include "property.hrc" -@@ -122,6 +123,7 @@ ORadioButtonModel::ORadioButtonModel(const Reference& _rxF - m_nClassId = FormComponentType::RADIOBUTTON; - m_aLabelServiceName = FRM_SUN_COMPONENT_GROUPBOX; - initValueProperty( PROPERTY_STATE, PROPERTY_ID_STATE ); -+ startAggregatePropertyListening( PROPERTY_GROUP_NAME ); - } - - //------------------------------------------------------------------ -@@ -169,7 +171,11 @@ StringSequence SAL_CALL ORadioButtonModel::getSupportedServiceNames() throw(Runt - void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue) - { - // mein Name -- ::rtl::OUString sMyName(m_aName); -+ ::rtl::OUString sMyGroup; -+ if (hasProperty(PROPERTY_GROUP_NAME, this)) -+ this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sMyGroup; -+ if (sMyGroup.getLength() == 0) -+ sMyGroup = m_aName; - - // meine Siblings durchiterieren - Reference xIndexAccess(getParent(), UNO_QUERY); -@@ -177,8 +183,9 @@ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, cons - { - Reference xMyProps; - query_interface(static_cast(this), xMyProps); -- ::rtl::OUString sCurrentName; -- for (sal_Int32 i=0; igetCount(); ++i) -+ ::rtl::OUString sCurrentGroup; -+ sal_Int32 nNumSiblings = xIndexAccess->getCount(); -+ for (sal_Int32 i=0; i xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY); - if (!xSiblingProperties.is()) -@@ -195,8 +202,8 @@ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, cons - continue; - - // das 'zur selben Gruppe gehoeren' wird am Namen festgemacht -- xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sCurrentName; -- if (sCurrentName == sMyName) -+ sCurrentGroup = OGroupManager::GetGroupName( xSiblingProperties ); -+ if (sCurrentGroup == sMyGroup) - xSiblingProperties->setPropertyValue(rPropName, rValue); - } - } -@@ -223,40 +230,7 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons - // die andere Richtung : wenn sich mein Name aendert ... - if (nHandle == PROPERTY_ID_NAME) - { -- // ... muss ich testen, ob ich Siblings mit dem selben Namen habe, damit ich deren ControlSource uebernehmen kann -- Reference xIndexAccess(getParent(), UNO_QUERY); -- if (xIndexAccess.is()) -- { -- ::rtl::OUString sName; -- ::rtl::OUString sControlSource; -- -- Reference xMyProps; -- query_interface(static_cast(this), xMyProps); -- for (sal_Int32 i=0; igetCount(); ++i) -- { -- Reference xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY); -- if (!xSiblingProperties.is()) -- continue; -- -- if (xMyProps == xSiblingProperties) -- // nur wenn ich nicht mich selber gefunden habe -- continue; -- -- sal_Int16 nType = 0; -- xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType; -- if (nType != FormComponentType::RADIOBUTTON) -- // nur Radio-Buttons -- continue; -- -- xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sName; -- // Control, das zur gleichen Gruppe gehoert ? -- if (rValue == sName) -- { -- setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE)); -- break; -- } -- } -- } -+ setControlSource(); - } - - if (nHandle == PROPERTY_ID_DEFAULTCHECKED) -@@ -274,6 +248,52 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons - } - } - -+void ORadioButtonModel::setControlSource() -+{ -+ Reference xIndexAccess(getParent(), UNO_QUERY); -+ if (xIndexAccess.is()) -+ { -+ ::rtl::OUString sName, sGroupName; -+ -+ if (hasProperty(PROPERTY_GROUP_NAME, this)) -+ this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sGroupName; -+ this->getPropertyValue(PROPERTY_NAME) >>= sName; -+ -+ Reference xMyProps; -+ query_interface(static_cast(this), xMyProps); -+ for (sal_Int32 i=0; igetCount(); ++i) -+ { -+ Reference xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY); -+ if (!xSiblingProperties.is()) -+ continue; -+ -+ if (xMyProps == xSiblingProperties) -+ // nur wenn ich nicht mich selber gefunden habe -+ continue; -+ -+ sal_Int16 nType = 0; -+ xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType; -+ if (nType != FormComponentType::RADIOBUTTON) -+ // nur Radio-Buttons -+ continue; -+ -+ ::rtl::OUString sSiblingName, sSiblingGroupName; -+ if (hasProperty(PROPERTY_GROUP_NAME, xSiblingProperties)) -+ xSiblingProperties->getPropertyValue(PROPERTY_GROUP_NAME) >>= sSiblingGroupName; -+ xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sSiblingName; -+ -+ if ((sGroupName.getLength() == 0 && sSiblingGroupName.getLength() == 0 && // (no group name -+ sName == sSiblingName) || // names match) or -+ (sGroupName.getLength() != 0 && sSiblingGroupName.getLength() != 0 && // (have group name -+ sGroupName == sSiblingGroupName)) // they match) -+ { -+ setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE)); -+ break; -+ } -+ } -+ } -+} -+ - //------------------------------------------------------------------------------ - void ORadioButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const - { -@@ -363,6 +383,13 @@ void ORadioButtonModel::_propertyChanged(const PropertyChangeEvent& _rEvent) thr - SetSiblingPropsTo( PROPERTY_STATE, aZero ); - } - } -+ else if ( _rEvent.PropertyName.equals( PROPERTY_GROUP_NAME ) ) -+ { -+ setControlSource(); -+ // Can't call OReferenceValueComponent::_propertyChanged(), as it -+ // doesn't know what to do with the GroupName property. -+ return; -+ } - - OReferenceValueComponent::_propertyChanged( _rEvent ); - } -diff --git forms/source/component/RadioButton.hxx forms/source/component/RadioButton.hxx -index c193f8a..e1a7e7e 100644 ---- forms/source/component/RadioButton.hxx -+++ forms/source/component/RadioButton.hxx -@@ -87,6 +87,8 @@ private: - our mutex is aquired exactly once - */ - void setNewAggregateState( const ::com::sun::star::uno::Any& _rValue ); -+ -+ void setControlSource(); - }; - - //================================================================== -diff --git forms/source/inc/frm_strings.hxx forms/source/inc/frm_strings.hxx -index 864160f..4b2efb9 100644 ---- forms/source/inc/frm_strings.hxx -+++ forms/source/inc/frm_strings.hxx -@@ -100,6 +100,7 @@ namespace frm - FORMS_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex" ); - FORMS_CONSTASCII_STRING( PROPERTY_TAG, "Tag" ); - FORMS_CONSTASCII_STRING( PROPERTY_NAME, "Name" ); -+ FORMS_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName" ); - FORMS_CONSTASCII_STRING( PROPERTY_CLASSID, "ClassId" ); - FORMS_CONSTASCII_STRING( PROPERTY_FETCHSIZE, "FetchSize" ); - FORMS_CONSTASCII_STRING( PROPERTY_VALUE, "Value" ); -diff --git forms/source/inc/property.hrc forms/source/inc/property.hrc -index d5e2476..20bdaf7 100644 ---- forms/source/inc/property.hrc -+++ forms/source/inc/property.hrc -@@ -63,7 +63,7 @@ namespace frm - #define PROPERTY_ID_INPUT_REQUIRED (PROPERTY_ID_START + 19) - #define PROPERTY_ID_WRITING_MODE (PROPERTY_ID_START + 20) - #define PROPERTY_ID_CONTEXT_WRITING_MODE (PROPERTY_ID_START + 21) -- // free -+#define PROPERTY_ID_GROUP_NAME (PROPERTY_ID_START + 22) - // free - // free - // free -diff --git svx/source/msfilter/msocximex.cxx svx/source/msfilter/msocximex.cxx -index fab7d46..37b720b 100644 ---- svx/source/msfilter/msocximex.cxx -+++ svx/source/msfilter/msocximex.cxx -@@ -1709,6 +1709,12 @@ sal_Bool OCX_OptionButton::Import(com::sun::star::uno::Reference< - aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE; - rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp ); - -+ if ( pGroupName ) -+ { -+ aTmp <<= lclCreateOUString( pGroupName, nGroupNameLen ); -+ rPropSet->setPropertyValue( WW8_ASCII2STR("GroupName"), aTmp); -+ } -+ - aFontData.Import(rPropSet); - return sal_True; - } -diff --git toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx -index 1e65e6f..1301975 100644 ---- toolkit/inc/toolkit/controls/dialogcontrol.hxx -+++ toolkit/inc/toolkit/controls/dialogcontrol.hxx -@@ -51,6 +51,7 @@ - #include - #include - #include -+#include - - // ---------------------------------------------------- - // class UnoControlDialogModel -@@ -182,6 +183,14 @@ protected: - void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor ); - - void implUpdateGroupStructure(); -+private: -+ void AddRadioButtonToGroup ( -+ const ::com::sun::star::uno::Reference< XControlModel >& rControlModel, -+ const ::rtl::OUString& rPropertyName, -+ ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups, -+ ModelGroup*& rpCurrentGroup ); -+ void AddRadioButtonGroup ( -+ ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups ); - }; - - // ---------------------------------------------------- ---- toolkit/inc/toolkit/helper/property.hxx -+++ toolkit/inc/toolkit/helper/property.hxx -@@ -192,6 +192,7 @@ namespace rtl { - #define BASEPROPERTY_GRID_COLUMNMODEL 143 - #define BASEPROPERTY_GRID_SELECTIONMODE 144 - #define BASEPROPERTY_ENABLEVISIBLE 145 // sal_Bool -+#define BASEPROPERTY_GROUPNAME 146 // ::rtl::OUString - - - // Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen. -diff --git toolkit/source/awt/vclxwindows.cxx toolkit/source/awt/vclxwindows.cxx -index bfa828b..206280b 100644 ---- toolkit/source/awt/vclxwindows.cxx -+++ toolkit/source/awt/vclxwindows.cxx -@@ -1105,6 +1105,7 @@ void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) - BASEPROPERTY_VERTICALALIGN, - BASEPROPERTY_WRITING_MODE, - BASEPROPERTY_CONTEXT_WRITING_MODE, -+ BASEPROPERTY_GROUPNAME, - 0); - VCLXImageConsumer::ImplGetPropertyIds( rIds ); - } -diff --git toolkit/source/controls/dialogcontrol.cxx toolkit/source/controls/dialogcontrol.cxx -index 0aebfb8..3fd5723 100644 ---- toolkit/source/controls/dialogcontrol.cxx -+++ toolkit/source/controls/dialogcontrol.cxx -@@ -142,6 +142,18 @@ namespace - return xGraphic; - } - -+ static ::rtl::OUString lcl_GetStringProperty( const ::rtl::OUString& sProperty, const Reference< XPropertySet >& xSet ) -+ { -+ ::rtl::OUString sValue; -+ Reference< XPropertySetInfo > xPSI; -+ if (xSet.is() && (xPSI = xSet->getPropertySetInfo()).is() && -+ xPSI->hasPropertyByName( sProperty ) ) -+ { -+ xSet->getPropertyValue( sProperty ) >>= sValue; -+ } -+ return sValue; -+ } -+ - } - - // ---------------------------------------------------------------------------- -@@ -897,6 +909,63 @@ void UnoControlDialogModel::implNotifyTabModelChange( const ::rtl::OUString& _rA - } - } - -+// ---------------------------------------------------------------------------- -+void UnoControlDialogModel::AddRadioButtonGroup ( -+ ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups ) -+{ -+ if ( rNamedGroups.size() == 0 ) -+ return; -+ -+ size_t nGroups = maGroups.size(); -+ maGroups.reserve( nGroups + rNamedGroups.size() ); -+ ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = rNamedGroups.begin(), e = rNamedGroups.end(); -+ for( ; i != e; ++i) -+ { -+ maGroups.push_back( i->second ); -+ } -+ -+ rNamedGroups.clear(); -+} -+ -+void UnoControlDialogModel::AddRadioButtonToGroup ( -+ const Reference< XControlModel >& rControlModel, -+ const ::rtl::OUString& rPropertyName, -+ ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups, -+ ModelGroup*& rpCurrentGroup ) -+{ -+ Reference< XPropertySet > xCurProps( rControlModel, UNO_QUERY ); -+ ::rtl::OUString sGroup = lcl_GetStringProperty( rPropertyName, xCurProps ); -+ const sal_Int32 nControlModelStep = lcl_getDialogStep( rControlModel ); -+ -+ if ( sGroup.getLength() == 0 ) -+ { -+ // Create a new group if: -+ if ( maGroups.size() == 0 || // no groups -+ rpCurrentGroup == NULL || // previous group was closed -+ (nControlModelStep != 0 && // control step matches current group -+ maGroups.back().size() > 0 && // (group 0 == display everywhere) -+ nControlModelStep != lcl_getDialogStep( maGroups.back().back() ) ) ) -+ { -+ size_t nGroups = maGroups.size(); -+ maGroups.resize( nGroups + 1 ); -+ } -+ rpCurrentGroup = &maGroups.back(); -+ } -+ else -+ { -+ // Different steps get different sets of named groups -+ if ( rNamedGroups.size() > 0 && -+ rNamedGroups.begin()->second.size() > 0 ) -+ { -+ const sal_Int32 nPrevStep = lcl_getDialogStep( rNamedGroups.begin()->second.front() ); -+ if ( nControlModelStep != nPrevStep ) -+ AddRadioButtonGroup( rNamedGroups ); -+ } -+ -+ rpCurrentGroup = &rNamedGroups[ sGroup ]; -+ } -+ rpCurrentGroup->push_back( rControlModel ); -+} - - // ---------------------------------------------------------------------------- - void UnoControlDialogModel::implUpdateGroupStructure() -@@ -921,10 +990,13 @@ void UnoControlDialogModel::implUpdateGroupStructure() - - GroupingMachineState eState = eLookingForGroup; // the current state of our machine - Reference< XServiceInfo > xModelSI; // for checking for a radion button -- AllGroups::iterator aCurrentGroup = maGroups.end(); // the group which we're currently building -- sal_Int32 nCurrentGroupStep = -1; // the step which all controls of the current group belong to -+ ModelGroup* aCurrentGroup = NULL; // the group which we're currently building - sal_Bool bIsRadioButton; // is it a radio button? - -+ const ::rtl::OUString GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "GroupName" ) ); -+ -+ ::std::map< ::rtl::OUString, ModelGroup > aNamedGroups; -+ - #if OSL_DEBUG_LEVEL > 1 - ::std::vector< ::rtl::OUString > aCurrentGroupLabels; - #endif -@@ -945,14 +1017,8 @@ void UnoControlDialogModel::implUpdateGroupStructure() - // the current model is a radio button - // -> we found the beginning of a new group - // create the place for this group -- size_t nGroups = maGroups.size(); -- maGroups.resize( nGroups + 1 ); -- aCurrentGroup = maGroups.begin() + nGroups; -- // and add the (only, til now) member -- aCurrentGroup->push_back( *pControlModels ); -- -- // get the step which all controls of this group now have to belong to -- nCurrentGroupStep = lcl_getDialogStep( *pControlModels ); -+ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup ); -+ - // new state: looking for further members - eState = eExpandingGroup; - -@@ -970,7 +1036,7 @@ void UnoControlDialogModel::implUpdateGroupStructure() - { - if ( !bIsRadioButton ) - { // no radio button -> the group is done -- aCurrentGroup = maGroups.end(); -+ aCurrentGroup = NULL; - eState = eLookingForGroup; - #if OSL_DEBUG_LEVEL > 1 - aCurrentGroupLabels.clear(); -@@ -978,48 +1044,9 @@ void UnoControlDialogModel::implUpdateGroupStructure() - continue; - } - -- // it is a radio button - is it on the proper page? -- const sal_Int32 nThisModelStep = lcl_getDialogStep( *pControlModels ); -- if ( ( nThisModelStep == nCurrentGroupStep ) // the current button is on the same dialog page -- || ( 0 == nThisModelStep ) // the current button appears on all pages -- ) -- { -- // -> it belongs to the same group -- aCurrentGroup->push_back( *pControlModels ); -- // state still is eExpandingGroup - we're looking for further elements -- eState = eExpandingGroup; -+ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup ); - - #if OSL_DEBUG_LEVEL > 1 -- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY ); -- ::rtl::OUString sLabel; -- if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) ) -- xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel; -- aCurrentGroupLabels.push_back( sLabel ); --#endif -- continue; -- } -- -- // it's a radio button, but on a different page -- // -> we open a new group for it -- -- // close the old group -- aCurrentGroup = maGroups.end(); --#if OSL_DEBUG_LEVEL > 1 -- aCurrentGroupLabels.clear(); --#endif -- -- // open a new group -- size_t nGroups = maGroups.size(); -- maGroups.resize( nGroups + 1 ); -- aCurrentGroup = maGroups.begin() + nGroups; -- // and add the (only, til now) member -- aCurrentGroup->push_back( *pControlModels ); -- -- nCurrentGroupStep = nThisModelStep; -- -- // state is the same: we still are looking for further elements of the current group -- eState = eExpandingGroup; --#if OSL_DEBUG_LEVEL > 1 - Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY ); - ::rtl::OUString sLabel; - if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) ) -@@ -1031,6 +1058,7 @@ void UnoControlDialogModel::implUpdateGroupStructure() - } - } - -+ AddRadioButtonGroup( aNamedGroups ); - mbGroupsUpToDate = sal_True; - } - -diff --git toolkit/source/controls/unocontrolmodel.cxx toolkit/source/controls/unocontrolmodel.cxx -index 33e7b7b..453be84 100644 ---- toolkit/source/controls/unocontrolmodel.cxx -+++ toolkit/source/controls/unocontrolmodel.cxx -@@ -348,6 +348,7 @@ void UnoControlModel::ImplPropertyChanged( sal_uInt16 ) - case BASEPROPERTY_ENABLEVISIBLE: - case BASEPROPERTY_DECORATION: aDefault <<= (sal_Bool) sal_True; break; - -+ case BASEPROPERTY_GROUPNAME: - case BASEPROPERTY_HELPTEXT: - case BASEPROPERTY_HELPURL: - case BASEPROPERTY_IMAGEURL: -diff --git toolkit/source/helper/property.cxx toolkit/source/helper/property.cxx -index 0a26448..13102ff 100644 ---- toolkit/source/helper/property.cxx -+++ toolkit/source/helper/property.cxx -@@ -180,6 +180,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount ) - DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ), - - DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ), -+ DECL_PROP_2 ( "GroupName", GROUPNAME, ::rtl::OUString, BOUND, MAYBEDEFAULT ), - DECL_PROP_2 ( "HelpText", HELPTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ), - DECL_PROP_2 ( "HelpURL", HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ), - DECL_PROP_2 ( "HideInactiveSelection", HIDEINACTIVESELECTION, bool, BOUND, MAYBEDEFAULT ), -diff --git xmloff/inc/xmlnmspe.hxx xmloff/inc/xmlnmspe.hxx -index 060a5a5..88516fe 100644 ---- xmloff/inc/xmlnmspe.hxx -+++ xmloff/inc/xmlnmspe.hxx -@@ -95,6 +95,7 @@ XML_OLD_NAMESPACE( META, 6U ) - - // experimental namespaces - XML_NAMESPACE( FIELD, 100U ) -+XML_NAMESPACE( FORMX, 101U ) // form interop extensions - - - #endif // _XMLOFF_XMLNMSPE_HXX -diff --git xmloff/inc/xmloff/xmltoken.hxx xmloff/inc/xmloff/xmltoken.hxx -index 11116de..e710a61 100644 ---- xmloff/inc/xmloff/xmltoken.hxx -+++ xmloff/inc/xmloff/xmltoken.hxx -@@ -142,6 +142,10 @@ namespace xmloff { namespace token { - XML_NP_GRDDL, - XML_N_GRDDL, - -+ // jonp: 2008-09-24 Excel Interop -+ XML_NP_FORMX, -+ XML_N_FORMX, -+ - // units - XML_UNIT_MM, - XML_UNIT_M, -diff --git xmloff/source/core/xmlexp.cxx xmloff/source/core/xmlexp.cxx -index 694df43..1dc010d 100644 ---- xmloff/source/core/xmlexp.cxx -+++ xmloff/source/core/xmlexp.cxx -@@ -314,6 +314,7 @@ void SvXMLExport::_InitCtor() - mpNamespaceMap->Add( GetXMLToken(XML_NP_XSD), GetXMLToken(XML_N_XSD), XML_NAMESPACE_XSD ); - mpNamespaceMap->Add( GetXMLToken(XML_NP_XSI), GetXMLToken(XML_N_XSI), XML_NAMESPACE_XSI ); - mpNamespaceMap->Add( GetXMLToken(XML_NP_FIELD), GetXMLToken(XML_N_FIELD), XML_NAMESPACE_FIELD ); -+ mpNamespaceMap->Add( GetXMLToken(XML_NP_FORMX), GetXMLToken(XML_N_FORMX), XML_NAMESPACE_FORMX ); - } - // RDFa: needed for content and header/footer styles - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) -diff --git xmloff/source/core/xmlimp.cxx xmloff/source/core/xmlimp.cxx -index e3b116c..a827e5b 100644 ---- xmloff/source/core/xmlimp.cxx -+++ xmloff/source/core/xmlimp.cxx -@@ -108,6 +108,7 @@ sal_Char __READONLY_DATA sXML_np__script[] = "_script"; - sal_Char __READONLY_DATA sXML_np__config[] = "_config"; - sal_Char __READONLY_DATA sXML_np__db[] = "_db"; - sal_Char __READONLY_DATA sXML_np__xforms[] = "_xforms"; -+sal_Char __READONLY_DATA sXML_np__formx[] = "_formx"; - sal_Char __READONLY_DATA sXML_np__xsd[] = "_xsd"; - sal_Char __READONLY_DATA sXML_np__xsi[] = "_xsi"; - sal_Char __READONLY_DATA sXML_np__field[] = "_field"; -@@ -283,6 +284,9 @@ void SvXMLImport::_InitCtor() - mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xforms) ), - GetXMLToken(XML_N_XFORMS_1_0), - XML_NAMESPACE_XFORMS ); -+ mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__formx) ), -+ GetXMLToken( XML_N_FORMX ), -+ XML_NAMESPACE_FORMX ); - mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xsd) ), - GetXMLToken(XML_N_XSD), - XML_NAMESPACE_XSD ); -diff --git xmloff/source/core/xmltoken.cxx xmloff/source/core/xmltoken.cxx -index 8d66db2..24faf3d 100644 ---- xmloff/source/core/xmltoken.cxx -+++ xmloff/source/core/xmltoken.cxx -@@ -150,6 +150,10 @@ namespace xmloff { namespace token { - TOKEN( "grddl", XML_NP_GRDDL ), - TOKEN( "http://www.w3.org/2003/g/data-view#", XML_N_GRDDL ), - -+ // jonp: 2008-09-24 Excel Interop -+ TOKEN( "formx", XML_NP_FORMX ), -+ TOKEN( "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0", XML_N_FORMX ), -+ - // units - TOKEN( "mm", XML_UNIT_MM ), - TOKEN( "m", XML_UNIT_M ), -diff --git xmloff/source/forms/elementexport.cxx xmloff/source/forms/elementexport.cxx -index 357b434..cb859fb 100644 ---- xmloff/source/forms/elementexport.cxx -+++ xmloff/source/forms/elementexport.cxx -@@ -1113,6 +1113,39 @@ namespace xmloff - } - - // ---------------------------------- -+ // the string properties -+ { -+ static sal_Int32 nStringPropertyAttributeIds[] = -+ { // attribute flags -+ SCA_GROUP_NAME -+ }; -+ static const ::rtl::OUString* pStringPropertyNames[] = -+ { // property names -+ &PROPERTY_GROUP_NAME -+ }; -+ -+ sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] ); -+ #if OSL_DEBUG_LEVEL > 0 -+ sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] ); -+ OSL_ENSURE( ( nIdCount == nNameCount ), -+ "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" ); -+ #endif -+ for ( i = 0; i < nIdCount; ++i ) -+ if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial ) -+ { -+ exportStringPropertyAttribute( -+ OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ), -+ OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ), -+ *( pStringPropertyNames[i] ) -+ ); -+ #if OSL_DEBUG_LEVEL > 0 -+ // reset the bit for later checking -+ m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i]; -+ #endif -+ } -+ } -+ -+ // ---------------------------------- - if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial) - { - // need to export the min value and the max value as attributes -@@ -1570,6 +1603,8 @@ namespace xmloff - } - if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) ) - m_nIncludeSpecial |= SCA_IMAGE_POSITION; -+ if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) ) -+ m_nIncludeSpecial |= SCA_GROUP_NAME; - m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED; - m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE; - break; -diff --git xmloff/source/forms/formattributes.cxx xmloff/source/forms/formattributes.cxx -index 4314711..5df31ed 100644 ---- xmloff/source/forms/formattributes.cxx -+++ xmloff/source/forms/formattributes.cxx -@@ -195,6 +195,7 @@ namespace xmloff - case SCA_MAX_VALUE: return "max-value"; - case SCA_MIN_VALUE: return "min-value"; - case SCA_VALIDATION: return "validation"; -+ case SCA_GROUP_NAME: return "group-name"; - case SCA_MULTI_LINE: return "multi-line"; - case SCA_AUTOMATIC_COMPLETION: return "auto-complete"; - case SCA_MULTIPLE: return "multiple"; -@@ -215,9 +216,12 @@ namespace xmloff - } - - //--------------------------------------------------------------------- -- sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 /*_nId*/) -+ sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 _nId) - { -- // nothing special here -+ switch( _nId ) -+ { -+ case SCA_GROUP_NAME: return XML_NAMESPACE_FORMX; -+ } - return XML_NAMESPACE_FORM; - } - -diff --git xmloff/source/forms/formattributes.hxx xmloff/source/forms/formattributes.hxx -index 50bad1b..ef6e7eb 100644 ---- xmloff/source/forms/formattributes.hxx -+++ xmloff/source/forms/formattributes.hxx -@@ -126,6 +126,7 @@ namespace xmloff - #define SCA_MAX_VALUE 0x00000002 - #define SCA_MIN_VALUE 0x00000004 - #define SCA_VALIDATION 0x00000008 -+ #define SCA_GROUP_NAME 0x00000010 - #define SCA_MULTI_LINE 0x00000020 - #define SCA_AUTOMATIC_COMPLETION 0x00000080 - #define SCA_MULTIPLE 0x00000100 -diff --git xmloff/source/forms/layerimport.cxx xmloff/source/forms/layerimport.cxx -index 4381ddd..cf73233 100644 ---- xmloff/source/forms/layerimport.cxx -+++ xmloff/source/forms/layerimport.cxx -@@ -97,6 +97,8 @@ namespace xmloff - m_aAttributeMetaData.addStringProperty( - OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME); - m_aAttributeMetaData.addStringProperty( -+ OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME); -+ m_aAttributeMetaData.addStringProperty( - OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL); - m_aAttributeMetaData.addStringProperty( - OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL); -diff --git xmloff/source/forms/strings.hxx xmloff/source/forms/strings.hxx -index 5b992ef..b067c7b 100644 ---- xmloff/source/forms/strings.hxx -+++ xmloff/source/forms/strings.hxx -@@ -207,6 +207,7 @@ namespace xmloff - XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition"); - XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN, "ImageAlign"); - XMLFORM_CONSTASCII_STRING( PROPERTY_SCALE_IMAGE, "ScaleImage"); -+ XMLFORM_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName"); - - XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL, "BoundCell"); - XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE, "CellRange"); diff --git a/applied_patches/0095-openldap-i105016.diff b/applied_patches/0095-openldap-i105016.diff new file mode 100644 index 000000000..b899fab41 --- /dev/null +++ b/applied_patches/0095-openldap-i105016.diff @@ -0,0 +1,45 @@ +Index: extensions/source/config/ldap/wrapldapinclude.hxx +=================================================================== +--- extensions/source/config/ldap/wrapldapinclude.hxx (revision 276155) ++++ extensions/source/config/ldap/wrapldapinclude.hxx (working copy) +@@ -35,6 +35,12 @@ + + #ifdef WITH_OPENLDAP + #include ++#ifndef LDAP_API ++# define LDAP_API(rt) rt ++#endif ++#ifndef LDAP_CALL ++# define LDAP_CALL ++#endif + #else + #ifndef LDAP_INCLUDED + #define LDAP_INCLUDED +Index: extensions/source/config/ldap/ldapaccess.cxx +=================================================================== +--- extensions/source/config/ldap/ldapaccess.cxx (revision 276155) ++++ extensions/source/config/ldap/ldapaccess.cxx (working copy) +@@ -315,14 +315,17 @@ + if ( !s_Ldap_Module ) + { + #if defined(WIN) || defined(WNT) +- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("nsldap32v50.dll")); ++# define LIBLDAP "nsldap32v50.dll" + #else +-#ifdef WITH_OPENLDAP +- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap.so")); +-#else +- const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap50.so")); ++# ifdef WITH_OPENLDAP ++# define xstr(s) str(s) ++# define str(s) #s ++# define LIBLDAP "libldap-" xstr(LDAP_VENDOR_VERSION_MAJOR) "." xstr(LDAP_VENDOR_VERSION_MINOR) ".so." xstr(LDAP_VENDOR_VERSION_MAJOR) ++# else ++# define LIBLDAP "libldap50.so" ++# endif + #endif +-#endif ++ const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(LIBLDAP)); + + // load the dbtools library + s_Ldap_Module = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0); diff --git a/applied_patches/0090-customunittext-pixel.diff b/applied_patches/0096-customunittext-pixel.diff similarity index 100% rename from applied_patches/0090-customunittext-pixel.diff rename to applied_patches/0096-customunittext-pixel.diff diff --git a/applied_patches/0096-xl-import-formradiobutton.diff b/applied_patches/0096-xl-import-formradiobutton.diff deleted file mode 100644 index 0ce913222..000000000 --- a/applied_patches/0096-xl-import-formradiobutton.diff +++ /dev/null @@ -1,136 +0,0 @@ -diff --git sc/source/filter/excel/xiescher.cxx sc/source/filter/excel/xiescher.cxx -index b19de94..1df3f38 100644 ---- sc/source/filter/excel/xiescher.cxx -+++ sc/source/filter/excel/xiescher.cxx -@@ -1709,22 +1709,15 @@ SdrObject* XclImpControlHelper::CreateSdrObjectFromShape( - return xSdrObj.release(); - } - --void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) const -+void XclImpControlHelper::ApplySheetLinkProps() const - { -+ - Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( mxShape ); - if( !xCtrlModel.is() ) - return; -- - ScfPropertySet aPropSet( xCtrlModel ); - -- // #118053# #i51348# set object name at control model -- aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() ); -- -- // control visible and printable? -- aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() ); -- aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() ); -- -- // sheet links -+ // sheet links - if( SfxObjectShell* pDocShell = mrRoot.GetDocShell() ) - { - Reference< XMultiServiceFactory > xFactory( pDocShell->GetModel(), UNO_QUERY ); -@@ -1787,7 +1780,26 @@ void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) co - } - } - } -+} -+ -+void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) const -+{ -+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( mxShape ); -+ if( !xCtrlModel.is() ) -+ return; -+ -+ ApplySheetLinkProps(); -+ -+ ScfPropertySet aPropSet( xCtrlModel ); -+ -+ // #118053# #i51348# set object name at control model -+ aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() ); -+ -+ // control visible and printable? -+ aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() ); -+ aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() ); - -+ - // virtual call for type specific processing - DoProcessControl( aPropSet ); - } -@@ -2118,6 +2130,45 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const - { - XclImpCheckBoxObj::DoProcessControl( rPropSet ); - // TODO: grouping -+ XclImpOptionButtonObj* pTbxObj = dynamic_cast< XclImpOptionButtonObj* >( GetObjectManager().FindDrawObj( XclObjId( GetScTab(), mnNextInGroup ) ).get() ); -+ if ( ( pTbxObj && pTbxObj->mnFirstInGroup ) ) -+ { -+ // Group has terminated -+ // traverse each RadioButton in group and -+ // a) apply the groupname -+ // b) propagate the linked cell from the lead radiobutton -+ // c) apply the correct Ref value -+ XclImpOptionButtonObj* pLeader = pTbxObj; -+ ; -+ sal_Int32 nRefVal = 1; -+ OSL_TRACE( "0x%x start group ", pLeader->GetObjId().mnObjId ); -+ do -+ { -+ -+ Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( pTbxObj->mxShape ); -+ if ( xCtrlModel.is() ) -+ { -+ ScfPropertySet aProps( xCtrlModel ); -+ rtl::OUString sGroupName = rtl::OUString::valueOf( static_cast< sal_Int32 >( pLeader->GetDffShapeId() ) ); -+ -+ aProps.SetStringProperty( CREATE_OUSTRING( "GroupName" ), sGroupName ); -+ aProps.SetStringProperty( CREATE_OUSTRING( "RefValue" ), rtl::OUString::valueOf( nRefVal++ ) ); -+ if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() ) -+ { -+ // propagate cell link info -+ pTbxObj->mxCellLink.reset( new ScAddress( *pLeader->mxCellLink.get() ) ); -+ pTbxObj->ApplySheetLinkProps(); -+ } -+ pTbxObj = dynamic_cast< XclImpOptionButtonObj* >( GetObjectManager().FindDrawObj( XclObjId( GetScTab(), pTbxObj->mnNextInGroup ) ).get() ); -+ } -+ else -+ pTbxObj = NULL; -+ } while ( pTbxObj && !( pTbxObj->mnFirstInGroup == 1 ) ); -+ } -+ else -+ { -+ // not the leader? try and find it -+ } - } - - OUString XclImpOptionButtonObj::DoGetServiceName() const -diff --git sc/source/filter/inc/xiescher.hxx sc/source/filter/inc/xiescher.hxx -index 2296996..3e59515 100644 ---- sc/source/filter/inc/xiescher.hxx -+++ sc/source/filter/inc/xiescher.hxx -@@ -498,6 +498,10 @@ protected: - /** Derived classes will set additional properties for the current form control. */ - virtual void DoProcessControl( ScfPropertySet& rPropSet ) const; - -+ void ApplySheetLinkProps() const; -+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > -+ mxShape; /// The UNO wrapper of the control shape. -+ ScfRef< ScAddress > mxCellLink; /// Linked cell in the Calc document. - private: - /** Reads a list of cell ranges from a formula at the current stream position. */ - void ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm ); -@@ -506,9 +510,6 @@ private: - - private: - const XclImpRoot& mrRoot; /// Not derived from XclImpRoot to allow multiple inheritance. -- mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > -- mxShape; /// The UNO wrapper of the control shape. -- ScfRef< ScAddress > mxCellLink; /// Linked cell in the Calc document. - ScfRef< ScRange > mxSrcRange; /// Source data range in the Calc document. - XclCtrlBindMode meBindMode; /// Value binding mode. - }; -@@ -610,6 +611,7 @@ protected: - virtual XclTbxEventType DoGetEventType() const; - - protected: -+ void ApplyGrouping( XclImpOptionButtonObj& rLeader, sal_Int32 nRefVal ); - sal_uInt16 mnNextInGroup; /// Next option button in a group. - sal_uInt16 mnFirstInGroup; /// 1 = Button is the first in a group. - }; diff --git a/applied_patches/0091-customunittext-percent.diff b/applied_patches/0097-customunittext-percent.diff similarity index 100% rename from applied_patches/0091-customunittext-percent.diff rename to applied_patches/0097-customunittext-percent.diff diff --git a/applied_patches/0097-dialog-groupname-persist.diff b/applied_patches/0097-dialog-groupname-persist.diff deleted file mode 100644 index 1ba641cde..000000000 --- a/applied_patches/0097-dialog-groupname-persist.diff +++ /dev/null @@ -1,374 +0,0 @@ -diff --git svx/inc/svx/msocximex.hxx svx/inc/svx/msocximex.hxx -index 2d0827f..733304d 100644 ---- svx/inc/svx/msocximex.hxx -+++ svx/inc/svx/msocximex.hxx -@@ -289,6 +289,7 @@ public: - sal_uInt16 mnTabPos; - UniString sName; - UniString msToolTip; -+ UniString msParentName; - OCX_FontData aFontData; - SfxObjectShell *pDocSh; - protected: -@@ -506,54 +507,8 @@ typedef std::vector::iterator CtrlIterator; - typedef std::vector::const_iterator CtrlIteratorConst; - typedef std::vector CtrlList; - -- -- --class RBGroup --{ -- public: -- RBGroup():mRBGroupPos(0){} -- RBGroup(sal_uInt16& groupPos ):mRBGroupPos(groupPos){} -- sal_Int16 tabPos() const { return mRBGroupPos; } -- std::vector::size_type numControls() -- { return mpControls.size(); } -- std::vector& controls() { return mpControls; } -- -- void add(OCX_Control* pRB); -- private: -- sal_uInt16 mRBGroupPos; -- std::vector mpControls; --}; -- --typedef ::std::hash_map < ::rtl::OUString, RBGroup*, ::rtl::OUStringHash, -- ::std::equal_to< ::rtl::OUString > > RBGroupHash; --typedef std::vector::iterator GroupIterator; -- - class OCX_OptionButton; - --class RBGroupManager --{ --public: -- RBGroupManager( String& defaultName ); -- ~RBGroupManager(); -- -- CtrlList insertGroupsIntoControlList( const CtrlList& sourceList ); -- void addRadioButton( OCX_OptionButton* pRButton ); --private: -- -- void addSeperator( std::vector< OCX_Control* >& dest ); -- void copyList( std::vector< OCX_Control* >& src, -- std::vector< OCX_Control* >& dest, -- bool addGroupSeperator ); -- -- RBGroupHash rbGroups; -- String mSDefaultName; -- std::vector< RBGroup* > groupList; -- sal_uInt16 numRadioButtons; --}; -- -- -- -- - class OCX_ContainerControl : public OCX_Control - { - public: -@@ -593,7 +548,6 @@ protected: - OCX_Control* pParent = NULL ); - rtl::OUString createSubStreamName( const sal_uInt32& subStorageID ); - -- RBGroupManager rbGroupMgr; - com::sun::star::uno::Reference< - com::sun::star::container::XNameContainer > mxParent; - std::vector mpControls; -diff --git svx/source/msfilter/msocximex.cxx svx/source/msfilter/msocximex.cxx -index 2aba883..617caf8 100644 ---- svx/source/msfilter/msocximex.cxx -+++ svx/source/msfilter/msocximex.cxx -@@ -825,176 +825,6 @@ class ContainerRecordReaderFac - - // ============================================================================ - --void RBGroup::add(OCX_Control* pRB) --{ -- // The tab index for the group is calculated as -- // the lowest tab index found in the list of RadioButtons -- if ( pRB->mnTabPos < mRBGroupPos ) -- { -- mRBGroupPos = pRB->mnTabPos; -- CtrlIterator aEnd = mpControls.end(); -- for (CtrlIterator aIter = mpControls.begin(); aIter != aEnd; ++ aIter ) -- { -- (*aIter)->mnTabPos = mRBGroupPos; -- } -- } -- mpControls.push_back( pRB ); --} -- --struct SortGroupByTabPos --{ -- bool operator()( const RBGroup* a, const RBGroup* b ) -- { -- return a->tabPos() < b->tabPos(); -- } --}; -- --RBGroupManager::RBGroupManager( String& defaultName ):mSDefaultName( defaultName ), -- numRadioButtons(0) --{ -- groupList.reserve( 8 ); // reserve far more than we expect --} -- --RBGroupManager::~RBGroupManager() --{ -- for ( GroupIterator gIter=groupList.begin(); gIter!=groupList.end(); ++gIter ) -- { -- delete( *gIter ); -- } --} -- --// Loose description of the method below ( I sure there is a better way to do --// this ) --// In order to "fake" MS grouping behavior for OptionButtons the OptionButtons --// in the same group need to have consecutive tab indices ( regardless of the --// imported tab indices of the RadioButtons ). Additionally if two --// groups of OptionButtons end up having all consecutive indices they --// will be treated as a single group by OpenOffice. In this case --// a dummy seperator control needs to be inserted between the groups. --// --// This method returns a new list "destinationList" containing the controls --// passed in "sourceList" and the OptionButtons contained in the various --// Groups maintained by this class. --// Controls are ordered in the destination list by tab index. --// Each RadioButtonGroup has a tab index associated with it. --// ( Tab index of a RadioGroup is determined as the tab index of the --// OptionButton control with the lowest tab index in the group ) -- -- --void RBGroupManager::addRadioButton( OCX_OptionButton* pRButton ) --{ -- if ( pRButton ) -- { -- OUString groupName = mSDefaultName; -- if ( pRButton->nGroupNameLen ) -- { -- groupName = -- lclCreateOUString(pRButton->pGroupName, -- pRButton->nGroupNameLen); -- } -- ++numRadioButtons; -- RBGroupHash::iterator iter = rbGroups.find( groupName ); -- if ( iter != rbGroups.end() ) -- { -- iter->second->controls().push_back( pRButton ); -- } -- else -- { -- RBGroup* newGroup = new RBGroup(pRButton->mnTabPos); -- newGroup->controls().push_back( pRButton ); -- rbGroups[ groupName ] = newGroup; -- groupList.push_back( newGroup ); -- } -- -- } --} -- --CtrlList RBGroupManager::insertGroupsIntoControlList( const CtrlList& sourceList ) --{ -- ::std::sort( groupList.begin(), groupList.end(), SortGroupByTabPos() ); -- std::vector destinationList; -- if ( groupList.size() ) -- { -- destinationList.reserve( sourceList.size() + numRadioButtons ); -- -- GroupIterator groupEnd = groupList.end(); -- CtrlIteratorConst sourceEnd = sourceList.end(); -- -- size_t prevGroupListSize = 0; -- -- CtrlIteratorConst containees = sourceList.begin(); -- GroupIterator groupIter=groupList.begin(); -- while ( containees != sourceEnd || -- groupIter != groupEnd ) -- { -- bool addGroupSeperator = false; -- if ( containees != sourceEnd ) -- { -- if ( groupIter != groupEnd ) -- { -- sal_Int16 groupTabPos = (*groupIter)->tabPos(); -- if ( (*containees)->mnTabPos >= groupTabPos ) -- { -- if ( !(destinationList.size() >= prevGroupListSize )) -- { -- addGroupSeperator = true; -- } -- copyList( (*groupIter)->controls(), destinationList, addGroupSeperator ); -- ++groupIter; -- -- prevGroupListSize = destinationList.size(); -- } -- } -- destinationList.push_back(*containees); -- ++containees; -- } -- else -- { -- if ( groupIter != groupEnd ) -- { -- if ( !(destinationList.size() > prevGroupListSize )) -- { -- addGroupSeperator = true; -- } -- copyList( (*groupIter)->controls(), destinationList, addGroupSeperator ); -- ++groupIter; -- prevGroupListSize = destinationList.size(); -- } -- } -- } -- } -- else -- { -- destinationList = sourceList; -- } -- return destinationList; -- --} -- -- --void RBGroupManager::addSeperator( std::vector< OCX_Control* >& dest ) --{ -- OCX_Control* seperator = new OCX_CommandButton; -- seperator->SetInDialog(true); -- seperator->sName = C2S("GroupSeperator"); -- dest.push_back( seperator ); --} -- --void RBGroupManager::copyList( std::vector< OCX_Control* >& src, -- std::vector< OCX_Control* >& dest, -- bool addGroupSeperator ) --{ -- if ( addGroupSeperator ) -- { -- addSeperator( dest ); -- } -- -- for ( CtrlIterator rbIter = src.begin(); rbIter != src.end(); ++rbIter ) -- { -- dest.push_back( *rbIter ); -- } --} -- - class OCX_UserFormLabel : public OCX_Label - { - public: -@@ -1698,6 +1528,36 @@ sal_Bool OCX_OptionButton::Import(com::s - aTmp <<= nTmp; - rPropSet->setPropertyValue( WW8_ASCII2STR("DefaultState"), aTmp); - } -+ // If this is a dialog control then we need to set a groupname *always* -+ rtl::OUString sGroupName = lclCreateOUString( pGroupName, nGroupNameLen ); -+ if ( GetInDialog() ) // Userform/Dialog -+ { -+ // By default groupnames are not set in Excel, it's not unusual to have -+ // a number of groups of radiobuttons located inside frame ( or other container -+ // controls ) where there is *no* specific groupname set for the radiobuttons. -+ // But... there is implicit grouping for radio buttons in seperate containers -+ // e.g. radio buttons in a frame are by default in the same group. -+ // Unfortunately in openoffice there are no containers below the dialog itself :-( -+ // To ensure correct grouping for imported radiobuttons either with no groupname -+ // or identical groupnames that are in separate containers we *must* ensure -+ // that a suitable groupname is applied. -+ // Because controlNames are unique even across different containers we can use the -+ // controls container (e.g. parent) name as a prefix for a group name -+ rtl::OUString sParentName = msParentName; -+ sGroupName = sParentName.concat( C2U( ":" ) ).concat( sGroupName ); -+ } -+ if ( sGroupName.getLength() > 0 ) -+ { -+ OSL_TRACE("RadioButton %s has groupname %s", -+ rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sGroupName, RTL_TEXTENCODING_UTF8 ).getStr() ); -+ try -+ { -+ rPropSet->setPropertyValue( WW8_ASCII2STR("GroupName"), aTmp); -+ } -+ catch( uno::Exception& ) -+ { -+ } -+ } - - if (pCaption) - { -@@ -3416,7 +3276,7 @@ OCX_ContainerControl::OCX_ContainerContr - const ::rtl::OUString& sN, - const uno::Reference< container::XNameContainer > &rParent, - OCX_Control* pParent ) : -- OCX_Control(sN, pParent), rbGroupMgr( sName ), mxParent(rParent), nNoRecords(0), nTotalLen(0), containerType( STDCONTAINER ) -+ OCX_Control(sN, pParent), mxParent(rParent), nNoRecords(0), nTotalLen(0), containerType( STDCONTAINER ) - { - - mContainerStorage = parent->OpenSotStorage(storageName, -@@ -3627,6 +3487,7 @@ void OCX_ContainerControl::ProcessContro - // applied to all containees - pControl->mnStep = mnStep; - } -+ pControl->msParentName = sName; - - // #117490# DR: container records provide size of substream, use it here... - -@@ -3637,17 +3498,7 @@ void OCX_ContainerControl::ProcessContro - // set stream to position behind substream of this control - oStream->Seek( nStrmPos + rec.nSubStreamLen ); - -- //need to fake grouping behaviour for radio ( option ) buttons -- if ( rec.nTypeIdent == OPTIONBUTTON ) -- { -- OCX_OptionButton* pRButton = -- static_cast< OCX_OptionButton*>(pControl); -- rbGroupMgr.addRadioButton( pRButton ); -- } -- else -- { -- mpControls.push_back( pControl ); -- } -+ mpControls.push_back( pControl ); - } - } - -@@ -3670,7 +3521,6 @@ sal_Bool OCX_ContainerControl::Read(SvSt - // this ensures that the default tab index created by Star/Open office - // reflects the "flattened" ms tab order. - ::std::sort( mpControls.begin(), mpControls.end(), SortOrderByTabPos() ); -- mpControls = rbGroupMgr.insertGroupsIntoControlList( mpControls ); - return true; - } - -diff --git xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx -index f864d51..4f87c16 100644 ---- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx -+++ xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx -@@ -458,6 +458,8 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles, Reference< - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); - readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); -+ readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ), -+ OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":group-name") ) ); - - sal_Int16 nState = 0; - if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState) -diff --git xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx -index 9db354d..92c1a09 100644 ---- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx -+++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx -@@ -1634,6 +1634,9 @@ void TitledBoxElement::endElement() - ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("multiline") ), - xAttributes ); -+ ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ), -+ OUString( RTL_CONSTASCII_USTRINGPARAM("group-name") ), -+ xAttributes ); - - sal_Int16 nVal = 0; - sal_Bool bChecked = sal_False; -@@ -1775,6 +1778,9 @@ void RadioGroupElement::endElement() - ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("multiline") ), - xAttributes ); -+ ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ), -+ OUString( RTL_CONSTASCII_USTRINGPARAM("group-name") ), -+ xAttributes ); - sal_Int16 nVal = 0; - sal_Bool bChecked = sal_False; - if (getBoolAttr( &bChecked, diff --git a/applied_patches/0092-i93000.diff b/applied_patches/0098-i93000.diff similarity index 100% rename from applied_patches/0092-i93000.diff rename to applied_patches/0098-i93000.diff diff --git a/applied_patches/0093-padmin-dialog-resize.diff b/applied_patches/0099-padmin-dialog-resize.diff similarity index 100% rename from applied_patches/0093-padmin-dialog-resize.diff rename to applied_patches/0099-padmin-dialog-resize.diff diff --git a/applied_patches/0094-sw-dialogs-resize.diff b/applied_patches/0100-sw-dialogs-resize.diff similarity index 100% rename from applied_patches/0094-sw-dialogs-resize.diff rename to applied_patches/0100-sw-dialogs-resize.diff diff --git a/applied_patches/0098-webdav-locking-from-ooo-build-2-4-1.diff b/applied_patches/0101-webdav-locking-from-ooo-build-2-4-1.diff similarity index 100% rename from applied_patches/0098-webdav-locking-from-ooo-build-2-4-1.diff rename to applied_patches/0101-webdav-locking-from-ooo-build-2-4-1.diff diff --git a/applied_patches/0099-webdav-locking-local-temp-file.diff b/applied_patches/0102-webdav-locking-local-temp-file.diff similarity index 100% rename from applied_patches/0099-webdav-locking-local-temp-file.diff rename to applied_patches/0102-webdav-locking-local-temp-file.diff diff --git a/applied_patches/0100-gnome-vfs-locking-config_office.diff b/applied_patches/0103-gnome-vfs-locking-config_office.diff similarity index 100% rename from applied_patches/0100-gnome-vfs-locking-config_office.diff rename to applied_patches/0103-gnome-vfs-locking-config_office.diff diff --git a/applied_patches/0101-gnome-vfs-locking-ucb.diff b/applied_patches/0104-gnome-vfs-locking-ucb.diff similarity index 100% rename from applied_patches/0101-gnome-vfs-locking-ucb.diff rename to applied_patches/0104-gnome-vfs-locking-ucb.diff diff --git a/applied_patches/0102-gnome-vfs-late-init.diff b/applied_patches/0105-gnome-vfs-late-init.diff similarity index 100% rename from applied_patches/0102-gnome-vfs-late-init.diff rename to applied_patches/0105-gnome-vfs-late-init.diff diff --git a/applied_patches/0103-unxsplash-rework.diff b/applied_patches/0106-unxsplash-rework.diff similarity index 100% rename from applied_patches/0103-unxsplash-rework.diff rename to applied_patches/0106-unxsplash-rework.diff diff --git a/applied_patches/0104-hack-readd-GetStringParam.diff b/applied_patches/0107-hack-readd-GetStringParam.diff similarity index 100% rename from applied_patches/0104-hack-readd-GetStringParam.diff rename to applied_patches/0107-hack-readd-GetStringParam.diff diff --git a/applied_patches/0105-unxsplash-new-osl-pipe.diff b/applied_patches/0108-unxsplash-new-osl-pipe.diff similarity index 100% rename from applied_patches/0105-unxsplash-new-osl-pipe.diff rename to applied_patches/0108-unxsplash-new-osl-pipe.diff diff --git a/applied_patches/0106-unxsplash-new-osl-pipe-slot.diff b/applied_patches/0109-unxsplash-new-osl-pipe-slot.diff similarity index 100% rename from applied_patches/0106-unxsplash-new-osl-pipe-slot.diff rename to applied_patches/0109-unxsplash-new-osl-pipe-slot.diff diff --git a/applied_patches/0107-unxsplash-finish-on-hangup.diff b/applied_patches/0110-unxsplash-finish-on-hangup.diff similarity index 100% rename from applied_patches/0107-unxsplash-finish-on-hangup.diff rename to applied_patches/0110-unxsplash-finish-on-hangup.diff diff --git a/applied_patches/0108-unxsplash-rpath.diff b/applied_patches/0111-unxsplash-rpath.diff similarity index 100% rename from applied_patches/0108-unxsplash-rpath.diff rename to applied_patches/0111-unxsplash-rpath.diff diff --git a/applied_patches/0109-unxsplash-3layer.diff b/applied_patches/0112-unxsplash-3layer.diff similarity index 100% rename from applied_patches/0109-unxsplash-3layer.diff rename to applied_patches/0112-unxsplash-3layer.diff diff --git a/applied_patches/0113-csv-import-preserve-options-sc.diff b/applied_patches/0113-csv-import-preserve-options-sc.diff deleted file mode 100644 index 05709916a..000000000 --- a/applied_patches/0113-csv-import-preserve-options-sc.diff +++ /dev/null @@ -1,647 +0,0 @@ -diff --git sc/source/ui/dbgui/asciiopt.cxx sc/source/ui/dbgui/asciiopt.cxx -index bf6521e..df25128 100644 ---- sc/source/ui/dbgui/asciiopt.cxx -+++ sc/source/ui/dbgui/asciiopt.cxx -@@ -56,6 +56,7 @@ ScAsciiOptions::ScAsciiOptions() : - bFixedLen ( FALSE ), - aFieldSeps ( ';' ), - bMergeFieldSeps ( FALSE ), -+ bQuotedFieldAsText(false), - cTextSep ( cDefaultTextSep ), - eCharSet ( gsl_getSystemTextEncoding() ), - bCharSetSystem ( FALSE ), -@@ -71,6 +72,7 @@ ScAsciiOptions::ScAsciiOptions(const ScAsciiOptions& rOpt) : - bFixedLen ( rOpt.bFixedLen ), - aFieldSeps ( rOpt.aFieldSeps ), - bMergeFieldSeps ( rOpt.bMergeFieldSeps ), -+ bQuotedFieldAsText(rOpt.bQuotedFieldAsText), - cTextSep ( rOpt.cTextSep ), - eCharSet ( rOpt.eCharSet ), - bCharSetSystem ( rOpt.bCharSetSystem ), -@@ -155,6 +157,7 @@ ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy ) - bFixedLen = rCpy.bFixedLen; - aFieldSeps = rCpy.aFieldSeps; - bMergeFieldSeps = rCpy.bMergeFieldSeps; -+ bQuotedFieldAsText = rCpy.bQuotedFieldAsText; - cTextSep = rCpy.cTextSep; - eCharSet = rCpy.eCharSet; - bCharSetSystem = rCpy.bCharSetSystem; -@@ -169,6 +172,7 @@ BOOL ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const - if ( bFixedLen == rCmp.bFixedLen && - aFieldSeps == rCmp.aFieldSeps && - bMergeFieldSeps == rCmp.bMergeFieldSeps && -+ bQuotedFieldAsText == rCmp.bQuotedFieldAsText && - cTextSep == rCmp.cTextSep && - eCharSet == rCmp.eCharSet && - bCharSetSystem == rCmp.bCharSetSystem && -@@ -286,6 +290,13 @@ void ScAsciiOptions::ReadFromString( const String& rString ) - pColFormat = NULL; - } - } -+ -+ // Import quoted field as text. -+ if (nCount >= 6) -+ { -+ aToken = rString.GetToken(5, ','); -+ bQuotedFieldAsText = aToken.EqualsAscii("true") ? true : false; -+ } - } - - -@@ -357,6 +368,11 @@ String ScAsciiOptions::WriteToString() const - aOutStr += String::CreateFromInt32(pColFormat[nInfo]); - } - -+ aOutStr += ','; -+ -+ // Import quoted field as text. -+ aOutStr += String::CreateFromAscii(bQuotedFieldAsText ? "true" : "false"); -+ - return aOutStr; - } - -diff --git sc/source/ui/dbgui/asciiopt.hrc sc/source/ui/dbgui/asciiopt.hrc -index 2dcfe00..60c8500 100644 ---- sc/source/ui/dbgui/asciiopt.hrc -+++ sc/source/ui/dbgui/asciiopt.hrc -@@ -56,4 +56,5 @@ - #define FT_AT_ROW 59 - #define NF_AT_ROW 60 - #define CB_ASONCE 90 -+#define CB_QUOTED_AS_TEXT 91 - #define STR_TEXTTOCOLUMNS 100 -diff --git sc/source/ui/dbgui/asciiopt.src sc/source/ui/dbgui/asciiopt.src -index e6cc493..da10a39 100644 ---- sc/source/ui/dbgui/asciiopt.src -+++ sc/source/ui/dbgui/asciiopt.src -@@ -34,24 +34,24 @@ ModalDialog RID_SCDLG_ASCII - { - OutputSize = TRUE ; - SVLook = TRUE ; -- Size = MAP_APPFONT ( 320 , 247 ) ; -+ Size = MAP_APPFONT ( 320 , 264 ) ; - Text [ en-US ] = "Text Import" ; - Moveable = TRUE ; - FixedLine FL_WIDTH - { -- Pos = MAP_APPFONT ( 6 , 132 ) ; -+ Pos = MAP_APPFONT ( 6 , 147 ) ; - Size = MAP_APPFONT ( 252 , 8 ) ; - Text [ en-US ] = "Fields" ; - }; - FixedText FT_TYPE - { -- Pos = MAP_APPFONT ( 12 , 145 ) ; -+ Pos = MAP_APPFONT ( 12 , 160 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "Column t~ype"; - }; - ListBox LB_TYPE1 - { -- Pos = MAP_APPFONT ( 76 , 143 ) ; -+ Pos = MAP_APPFONT ( 76 , 158 ) ; - Size = MAP_APPFONT ( 60 , 68 ) ; - TabStop = TRUE ; - DropDown = TRUE ; -@@ -194,7 +194,7 @@ ModalDialog RID_SCDLG_ASCII - HelpId = HID_SC_ASCII_TABCTR ; - Border = TRUE ; - DialogControl = TRUE ; -- Pos = MAP_APPFONT ( 12 , 159 ) ; -+ Pos = MAP_APPFONT ( 12 , 176 ) ; - Size = MAP_APPFONT ( 243 , 82 ) ; - }; - CheckBox CB_ASONCE -@@ -204,6 +204,13 @@ ModalDialog RID_SCDLG_ASCII - TabStop = TRUE ; - Text [ en-US ] = "Merge ~delimiters" ; - }; -+ CheckBox CB_QUOTED_AS_TEXT -+ { -+ Pos = MAP_APPFONT ( 20 , 129 ) ; -+ Size = MAP_APPFONT ( 130 , 10 ) ; -+ TabStop = TRUE ; -+ Text [ en-US ] = "~Quoted field as text" ; -+ }; - String STR_TEXTTOCOLUMNS - { - Text [ en-US ] = "Text to Columns" ; -diff --git sc/source/ui/dbgui/csvgrid.cxx sc/source/ui/dbgui/csvgrid.cxx -index ddbfb44..5725645 100644 ---- sc/source/ui/dbgui/csvgrid.cxx -+++ sc/source/ui/dbgui/csvgrid.cxx -@@ -737,7 +737,8 @@ void ScCsvGrid::ImplSetTextLineSep( - while( *pChar && (nColIx < sal::static_int_cast(CSV_MAXCOLCOUNT)) ) - { - // scan for next cell text -- pChar = ScImportExport::ScanNextFieldFromString( pChar, aCellText, cTextSep, pSepChars, bMergeSep ); -+ bool bIsQuoted = false; -+ pChar = ScImportExport::ScanNextFieldFromString( pChar, aCellText, cTextSep, pSepChars, bMergeSep, bIsQuoted ); - - // update column width - sal_Int32 nWidth = Max( CSV_MINCOLWIDTH, aCellText.Len() + sal_Int32( 1 ) ); -diff --git sc/source/ui/dbgui/csvruler.cxx sc/source/ui/dbgui/csvruler.cxx -index 5437f9b..b42ebaf 100644 ---- sc/source/ui/dbgui/csvruler.cxx -+++ sc/source/ui/dbgui/csvruler.cxx -@@ -37,8 +37,76 @@ - #include "AccessibleCsvControl.hxx" - - -+#include -+#include -+#include -+#include "miscuno.hxx" -+ -+using namespace rtl; -+using namespace com::sun::star::uno; -+ -+ -+ -+// ============================================================================ -+#define SEP_PATH "Office.Calc/Dialogs/CSVImport" -+#define FIXED_WIDTH_LIST "FixedWidthList" -+ -+ - // ============================================================================ - -+static void load_FixedWidthList(ScCsvSplits &aSplits) -+{ -+ String sSplits; -+ OUString sFixedWidthLists; -+ -+ SequenceaValues; -+ const Any *pProperties; -+ Sequence aNames(1); -+ OUString* pNames = aNames.getArray(); -+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); -+ -+ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST ); -+ aValues = aItem.GetProperties( aNames ); -+ pProperties = aValues.getConstArray(); -+ -+ if( pProperties[0].hasValue() ) -+ { -+ aSplits.Clear(); -+ pProperties[0] >>= sFixedWidthLists; -+ -+ sSplits = String( sFixedWidthLists ); -+ -+ // String ends with a semi-colon so there is no 'int' after the last one. -+ for(int i=0;i aValues; -+ Any *pProperties; -+ Sequence aNames(1); -+ OUString* pNames = aNames.getArray(); -+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); -+ -+ pNames[0] = OUString::createFromAscii( FIXED_WIDTH_LIST ); -+ aValues = aItem.GetProperties( aNames ); -+ pProperties = aValues.getArray(); -+ pProperties[0] <<= sFixedWidthLists; -+ -+ aItem.PutProperties(aNames, aValues); -+} -+ - ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) : - ScCsvControl( rParent ), - mnPosCursorLast( 1 ) -@@ -48,6 +116,13 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) : - InitSizeData(); - maBackgrDev.SetFont( GetFont() ); - maRulerDev.SetFont( GetFont() ); -+ -+ load_FixedWidthList( maSplits ); -+} -+ -+ScCsvRuler::~ScCsvRuler() -+{ -+ save_FixedWidthList( maSplits ); - } - - -diff --git sc/source/ui/dbgui/scuiasciiopt.cxx sc/source/ui/dbgui/scuiasciiopt.cxx -index 2c31e08..a10e8fb 100644 ---- sc/source/ui/dbgui/scuiasciiopt.cxx -+++ sc/source/ui/dbgui/scuiasciiopt.cxx -@@ -44,6 +44,12 @@ - // ause - #include "editutil.hxx" - -+#include -+#include -+#include -+#include "miscuno.hxx" -+ -+ - //! TODO make dynamic - #ifdef WIN - const SCSIZE ASCIIDLG_MAXROWS = 10000; -@@ -51,6 +57,20 @@ const SCSIZE ASCIIDLG_MAXROWS = 10000; - const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT; - #endif - -+ -+using namespace rtl; -+using namespace com::sun::star::uno; -+ -+// Defines - CSV Import Preserve Options -+#define FIXED_WIDTH "FixedWidth" -+#define FROM_ROW "FromRow" -+#define CHAR_SET "CharSet" -+#define SEPARATORS "Separators" -+#define TEXT_SEPARATORS "TextSeparators" -+#define MERGE_DELIMITERS "MergeDelimiters" -+#define QUOTED_AS_TEXT "QuotedFieldAsText" -+#define SEP_PATH "Office.Calc/Dialogs/CSVImport" -+ - // ============================================================================ - - void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect ) -@@ -98,11 +118,82 @@ sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList ) - return c; - } - -+static void load_Separators( OUString &sFieldSeparators, OUString &sTextSeparators, -+ bool &bMergeDelimiters, bool& bQuotedAsText, bool &bFixedWidth, -+ sal_Int32 &nFromRow, sal_Int32 &nCharSet ) -+{ -+ SequenceaValues; -+ const Any *pProperties; -+ Sequence aNames(7); -+ OUString* pNames = aNames.getArray(); -+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); -+ -+ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS ); -+ pNames[1] = OUString::createFromAscii( SEPARATORS ); -+ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS ); -+ pNames[3] = OUString::createFromAscii( FIXED_WIDTH ); -+ pNames[4] = OUString::createFromAscii( FROM_ROW ); -+ pNames[5] = OUString::createFromAscii( CHAR_SET ); -+ pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT ); -+ aValues = aItem.GetProperties( aNames ); -+ pProperties = aValues.getConstArray(); -+ if( pProperties[1].hasValue() ) -+ pProperties[1] >>= sFieldSeparators; -+ -+ if( pProperties[2].hasValue() ) -+ pProperties[2] >>= sTextSeparators; -+ -+ if( pProperties[0].hasValue() ) -+ bMergeDelimiters = ScUnoHelpFunctions::GetBoolFromAny( pProperties[0] ); -+ -+ if( pProperties[3].hasValue() ) -+ bFixedWidth = ScUnoHelpFunctions::GetBoolFromAny( pProperties[3] ); -+ -+ if( pProperties[4].hasValue() ) -+ pProperties[4] >>= nFromRow; -+ -+ if( pProperties[5].hasValue() ) -+ pProperties[5] >>= nCharSet; -+ -+ if ( pProperties[6].hasValue() ) -+ pProperties[6] >>= bQuotedAsText; -+} -+ -+static void save_Separators( String maSeparators, String maTxtSep, bool bMergeDelimiters, bool bQuotedAsText, -+ bool bFixedWidth, sal_Int32 nFromRow, sal_Int32 nCharSet ) -+{ -+ OUString sFieldSeparators = OUString( maSeparators ); -+ OUString sTextSeparators = OUString( maTxtSep ); -+ Sequence aValues; -+ Any *pProperties; -+ Sequence aNames(7); -+ OUString* pNames = aNames.getArray(); -+ ScLinkConfigItem aItem( OUString::createFromAscii( SEP_PATH ) ); -+ -+ pNames[0] = OUString::createFromAscii( MERGE_DELIMITERS ); -+ pNames[1] = OUString::createFromAscii( SEPARATORS ); -+ pNames[2] = OUString::createFromAscii( TEXT_SEPARATORS ); -+ pNames[3] = OUString::createFromAscii( FIXED_WIDTH ); -+ pNames[4] = OUString::createFromAscii( FROM_ROW ); -+ pNames[5] = OUString::createFromAscii( CHAR_SET ); -+ pNames[6] = OUString::createFromAscii( QUOTED_AS_TEXT ); -+ aValues = aItem.GetProperties( aNames ); -+ pProperties = aValues.getArray(); -+ pProperties[1] <<= sFieldSeparators; -+ pProperties[2] <<= sTextSeparators; -+ ScUnoHelpFunctions::SetBoolInAny( pProperties[0], bMergeDelimiters ); -+ ScUnoHelpFunctions::SetBoolInAny( pProperties[3], bFixedWidth ); -+ pProperties[4] <<= nFromRow; -+ pProperties[5] <<= nCharSet; -+ pProperties[6] <<= static_cast(bQuotedAsText); -+ -+ aItem.PutProperties(aNames, aValues); -+} - - // ---------------------------------------------------------------------------- - - ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, -- SvStream* pInStream, sal_Unicode cSep ) : -+ SvStream* pInStream, sal_Unicode /*cSep*/ ) : - ModalDialog ( pParent, ScResId( RID_SCDLG_ASCII ) ), - mpDatStream ( pInStream ), - mnStreamPos( pInStream ? pInStream->Tell() : 0 ), -@@ -128,6 +215,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, - aCkbOther ( this, ScResId( CKB_OTHER ) ), - aEdOther ( this, ScResId( ED_OTHER ) ), - aCkbAsOnce ( this, ScResId( CB_ASONCE) ), -+ aCkbQuotedAsText( this, ScResId(CB_QUOTED_AS_TEXT) ), - aFtTextSep ( this, ScResId( FT_TEXTSEP ) ), - aCbTextSep ( this, ScResId( CB_TEXTSEP ) ), - -@@ -146,14 +234,15 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, - aFldSepList ( ScResId( SCSTR_FIELDSEP ) ), - aTextSepList( ScResId( SCSTR_TEXTSEP ) ), - mcTextSep ( ScAsciiOptions::cDefaultTextSep ), -- maStrTextToColumns( ScResId( STR_TEXTTOCOLUMNS ) ) -+ maStrTextToColumns( ScResId( STR_TEXTTOCOLUMNS ) ), -+ mbFileImport(true) - { - FreeResource(); -+ mbFileImport = aDatName.Len() > 0; - - String aName = GetText(); - // aDatName is empty if invoked during paste from clipboard. -- BOOL bClipboard = (aDatName.Len() == 0); -- if (!bClipboard) -+ if (mbFileImport) - { - aName.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" - [")); - aName += aDatName; -@@ -161,20 +250,51 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, - } - SetText( aName ); - -- switch(cSep) -+ -+ OUString sFieldSeparators; -+ OUString sTextSeparators; -+ bool bMergeDelimiters = false; -+ bool bFixedWidth = false; -+ bool bQuotedFieldAsText = true; -+ sal_Int32 nFromRow = 1; -+ sal_Int32 nCharSet = -1; -+ if (mbFileImport) -+ // load separators only when importing csv files. -+ load_Separators (sFieldSeparators, sTextSeparators, bMergeDelimiters, -+ bQuotedFieldAsText, bFixedWidth, nFromRow, nCharSet); -+ maFieldSeparators = String(sFieldSeparators); -+ -+ if( bMergeDelimiters ) -+ aCkbAsOnce.Check(); -+ if (bQuotedFieldAsText) -+ aCkbQuotedAsText.Check(); -+ if( bFixedWidth ) -+ aRbFixed.Check(); -+ if( nFromRow != 1 ) -+ aNfRow.SetValue( nFromRow ); -+ -+ ByteString bString(maFieldSeparators,RTL_TEXTENCODING_MS_1252); -+ const sal_Char *aSep = bString.GetBuffer(); -+ int len = maFieldSeparators.Len(); -+ for (int i = 0; i < len; ++i) - { -- case '\t': aCkbTab.Check(); break; -- case ';': aCkbSemicolon.Check(); break; -- case ',': aCkbComma.Check(); break; -- case ' ': aCkbSpace.Check(); break; -- default: -- aCkbOther.Check(); -- aEdOther.SetText( cSep ); -+ switch( aSep[i] ) -+ { -+ case '\t': aCkbTab.Check(); break; -+ case ';': aCkbSemicolon.Check(); break; -+ case ',': aCkbComma.Check(); break; -+ case ' ': aCkbSpace.Check(); break; -+ default: -+ aCkbOther.Check(); -+ aEdOther.SetText( aEdOther.GetText() + OUString( aSep[i] ) ); -+ } - } -+ -+ // Get Separators from the dialog - maFieldSeparators = GetSeparators(); - - // Clipboard is always Unicode, else detect. -- BOOL bPreselectUnicode = bClipboard; -+ bool bPreselectUnicode = !mbFileImport; - // Sniff for Unicode / not - if( !bPreselectUnicode && mpDatStream ) - { -@@ -210,6 +330,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, - - // *** Separator characters *** - lcl_FillCombo( aCbTextSep, aTextSepList, mcTextSep ); -+ aCbTextSep.SetText( sTextSeparators ); - - Link aSeparatorHdl =LINK( this, ScImportAsciiDlg, SeparatorHdl ); - aCbTextSep.SetSelectHdl( aSeparatorHdl ); -@@ -218,6 +339,7 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, - aCkbSemicolon.SetClickHdl( aSeparatorHdl ); - aCkbComma.SetClickHdl( aSeparatorHdl ); - aCkbAsOnce.SetClickHdl( aSeparatorHdl ); -+ aCkbQuotedAsText.SetClickHdl( aSeparatorHdl ); - aCkbSpace.SetClickHdl( aSeparatorHdl ); - aCkbOther.SetClickHdl( aSeparatorHdl ); - aEdOther.SetModifyHdl( aSeparatorHdl ); -@@ -230,6 +352,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, - aLbCharSet.InsertTextEncoding( RTL_TEXTENCODING_DONTKNOW, aCharSetUser ); - aLbCharSet.SelectTextEncoding( bPreselectUnicode ? - RTL_TEXTENCODING_UNICODE : gsl_getSystemTextEncoding() ); -+ -+ if( nCharSet >= 0 ) -+ aLbCharSet.SelectEntryPos( nCharSet ); -+ - SetSelectedCharSet(); - aLbCharSet.SetSelectHdl( LINK( this, ScImportAsciiDlg, CharSetHdl ) ); - -@@ -261,6 +387,10 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,String aDatName, - - ScImportAsciiDlg::~ScImportAsciiDlg() - { -+ if (mbFileImport) -+ save_Separators( maFieldSeparators, aCbTextSep.GetText(), aCkbAsOnce.IsChecked(), -+ aCkbQuotedAsText.IsChecked(), aRbFixed.IsChecked(), -+ aNfRow.GetValue(), aLbCharSet.GetSelectEntryPos()); - delete[] mpRowPosArray; - } - -@@ -346,6 +476,7 @@ void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt ) - { - rOpt.SetFieldSeps( GetSeparators() ); - rOpt.SetMergeSeps( aCkbAsOnce.IsChecked() ); -+ rOpt.SetQuotedAsText(aCkbQuotedAsText.IsChecked()); - rOpt.SetTextSep( lcl_CharFromCombo( aCbTextSep, aTextSepList ) ); - } - } -@@ -357,6 +488,10 @@ void ScImportAsciiDlg::SetTextToColumnsMode() - aLbCharSet.Disable(); - aFtRow.Disable(); - aNfRow.Disable(); -+ -+ // Quoted field as text option is not used for text to columns mode. -+ aCkbQuotedAsText.Check(false); -+ aCkbQuotedAsText.Disable(); - } - - void ScImportAsciiDlg::SetSelectedCharSet() -@@ -393,6 +528,7 @@ void ScImportAsciiDlg::SetupSeparatorCtrls() - aCkbOther.Enable( bEnable ); - aEdOther.Enable( bEnable ); - aCkbAsOnce.Enable( bEnable ); -+ aCkbQuotedAsText.Enable( bEnable ); - aFtTextSep.Enable( bEnable ); - aCbTextSep.Enable( bEnable ); - } -diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx -index 344dcae..d2cb0cd 100644 ---- sc/source/ui/docshell/impex.cxx -+++ sc/source/ui/docshell/impex.cxx -@@ -792,12 +792,10 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm ) - // - - --bool lcl_PutString( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, -- const String& rStr, BYTE nColFormat, -- ::utl::TransliterationWrapper& rTransliteration, -- CalendarWrapper& rCalendar, -- ::utl::TransliterationWrapper* pSecondTransliteration, -- CalendarWrapper* pSecondCalendar ) -+static bool lcl_PutString( -+ ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, BYTE nColFormat, -+ ::utl::TransliterationWrapper& rTransliteration, CalendarWrapper& rCalendar, -+ ::utl::TransliterationWrapper* pSecondTransliteration, CalendarWrapper* pSecondCalendar ) - { - bool bMultiLine = false; - if ( nColFormat == SC_COL_SKIP || !rStr.Len() || !ValidCol(nCol) || !ValidRow(nRow) ) -@@ -1168,7 +1166,8 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) - // SC_COL_SKIP. - while (*p && nCol <= MAXCOL+1) - { -- p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge ); -+ bool bIsQuoted = false; -+ p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge, bIsQuoted ); - - BYTE nFmt = SC_COL_STANDARD; - for ( i=nInfoStart; i MAXCOL) - bOverflow = TRUE; // display warning on import - else if (!bDetermineRange) -+ { -+ if (bIsQuoted && pExtOptions && pExtOptions->IsQuotedAsText()) -+ nFmt = SC_COL_TEXT; -+ - bMultiLine |= lcl_PutString( pDoc, nCol, nRow, - nTab, aCell, nFmt, aTransliteration, - aCalendar, pEnglishTransliteration, - pEnglishCalendar); -+ } - ++nCol; - } - -@@ -1262,11 +1266,13 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm ) - - // static - const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* p, -- String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, BOOL bMergeSeps ) -+ String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted ) - { -+ rbIsQuoted = false; - rField.Erase(); - if ( *p == cStr ) // String in Anfuehrungszeichen - { -+ rbIsQuoted = true; - const sal_Unicode* p1; - p1 = p = lcl_ScanString( p, rField, cStr, DQM_ESCAPE ); - while ( *p && !ScGlobal::UnicodeStrChr( pSeps, *p ) ) -diff --git sc/source/ui/inc/asciiopt.hxx sc/source/ui/inc/asciiopt.hxx -index 1d12606..394f2dc 100644 ---- sc/source/ui/inc/asciiopt.hxx -+++ sc/source/ui/inc/asciiopt.hxx -@@ -65,6 +65,7 @@ private: - BOOL bFixedLen; - String aFieldSeps; - BOOL bMergeFieldSeps; -+ bool bQuotedFieldAsText; - sal_Unicode cTextSep; - CharSet eCharSet; - BOOL bCharSetSystem; -@@ -93,6 +94,7 @@ public: - BOOL GetCharSetSystem() const { return bCharSetSystem; } - const String& GetFieldSeps() const { return aFieldSeps; } - BOOL IsMergeSeps() const { return bMergeFieldSeps; } -+ bool IsQuotedAsText() const { return bQuotedFieldAsText; } - sal_Unicode GetTextSep() const { return cTextSep; } - BOOL IsFixedLen() const { return bFixedLen; } - USHORT GetInfoCount() const { return nInfoCount; } -@@ -105,6 +107,7 @@ public: - void SetFixedLen( BOOL bSet ) { bFixedLen = bSet; } - void SetFieldSeps( const String& rStr ) { aFieldSeps = rStr; } - void SetMergeSeps( BOOL bSet ) { bMergeFieldSeps = bSet; } -+ void SetQuotedAsText(bool bSet) { bQuotedFieldAsText = bSet; } - void SetTextSep( sal_Unicode c ) { cTextSep = c; } - void SetStartRow( long nRow) { nStartRow= nRow; } - -diff --git sc/source/ui/inc/csvruler.hxx sc/source/ui/inc/csvruler.hxx -index c251831..cd67708 100644 ---- sc/source/ui/inc/csvruler.hxx -+++ sc/source/ui/inc/csvruler.hxx -@@ -71,6 +71,7 @@ private: - // ------------------------------------------------------------------------ - public: - explicit ScCsvRuler( ScCsvControl& rParent ); -+ ~ScCsvRuler(); - - // common ruler handling -------------------------------------------------- - public: -diff --git sc/source/ui/inc/impex.hxx sc/source/ui/inc/impex.hxx -index 515063a..aaddeeb 100644 ---- sc/source/ui/inc/impex.hxx -+++ sc/source/ui/inc/impex.hxx -@@ -98,7 +98,7 @@ public: - - static BOOL IsFormatSupported( ULONG nFormat ); - static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p, -- String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, BOOL bMergeSeps ); -+ String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted ); - static void WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, BOOL bZero = FALSE ); - static void WriteUnicodeOrByteEndl( SvStream& rStrm ); - static inline BOOL IsEndianSwap( const SvStream& rStrm ); -diff --git sc/source/ui/inc/scuiasciiopt.hxx sc/source/ui/inc/scuiasciiopt.hxx -index 6712193..45c3e71 100644 ---- sc/source/ui/inc/scuiasciiopt.hxx -+++ sc/source/ui/inc/scuiasciiopt.hxx -@@ -64,6 +64,7 @@ class ScImportAsciiDlg : public ModalDialog - CheckBox aCkbOther; - Edit aEdOther; - CheckBox aCkbAsOnce; -+ CheckBox aCkbQuotedAsText; - FixedText aFtTextSep; - ComboBox aCbTextSep; - -@@ -87,6 +88,7 @@ class ScImportAsciiDlg : public ModalDialog - - CharSet meCharSet; /// Selected char set. - bool mbCharSetSystem; /// Is System char set selected? -+ bool mbFileImport; /// Is this dialog involked for csv file import ? - - public: - ScImportAsciiDlg( diff --git a/applied_patches/0110-unxsplash-bmp-alias.diff b/applied_patches/0113-unxsplash-bmp-alias.diff similarity index 100% rename from applied_patches/0110-unxsplash-bmp-alias.diff rename to applied_patches/0113-unxsplash-bmp-alias.diff diff --git a/applied_patches/0114-csv-import-preserve-options-officecfg.diff b/applied_patches/0114-csv-import-preserve-options-officecfg.diff deleted file mode 100644 index b271f2728..000000000 --- a/applied_patches/0114-csv-import-preserve-options-officecfg.diff +++ /dev/null @@ -1,86 +0,0 @@ -diff --git officecfg/registry/schema/org/openoffice/Office/Calc.xcs officecfg/registry/schema/org/openoffice/Office/Calc.xcs -index 3c3fe6b..09e5c52 100644 ---- officecfg/registry/schema/org/openoffice/Office/Calc.xcs -+++ officecfg/registry/schema/org/openoffice/Office/Calc.xcs -@@ -1019,6 +1019,81 @@ - NULL - - -+ -+ -+ Contains the dialogs settings. -+ -+ -+ -+ Contains setting for Text CSV Import -+ -+ -+ -+ muthusuba -+ Merge Delimiter check box status -+ -+ -+ false -+ -+ -+ -+ kyoshida -+ If true, quoted field is always imported as text -+ with no exception. -+ -+ -+ true -+ -+ -+ -+ muthusuba -+ List of Separators - as a String -+ -+ -+ ; -+ -+ -+ -+ muthusuba -+ Text Separators -+ -+ -+ " -+ -+ -+ -+ muthusuba -+ Fixed width -+ -+ -+ false -+ -+ -+ -+ muthusuba -+ From Row -+ -+ -+ 1 -+ -+ -+ -+ muthusuba -+ Char Set -+ -+ -+ -1 -+ -+ -+ -+ muthusuba -+ Fixed Width List of separators -+ -+ -+ -+ -+ -+ - - - Contains settings that affect cell calculation. diff --git a/applied_patches/0111-sw-html-insert-unknown-tags.diff b/applied_patches/0114-sw-html-insert-unknown-tags.diff similarity index 100% rename from applied_patches/0111-sw-html-insert-unknown-tags.diff rename to applied_patches/0114-sw-html-insert-unknown-tags.diff diff --git a/applied_patches/0115-gcc4-visibility-sc.diff b/applied_patches/0115-gcc4-visibility-sc.diff deleted file mode 100644 index 4c183512d..000000000 --- a/applied_patches/0115-gcc4-visibility-sc.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- sc/inc/optutil.hxx.old 2000-11-02 20:08:15.000000000 +0100 -+++ sc/inc/optutil.hxx 2005-08-02 19:32:54.000000000 +0200 -@@ -70,6 +70,7 @@ - #include - #include - -+#include "scdllapi.h" - - class ScOptionsUtil - { -@@ -80,7 +84,7 @@ - - // ConfigItem for classes that use items from several sub trees - --class ScLinkConfigItem : public utl::ConfigItem -+class SC_DLLPUBLIC ScLinkConfigItem : public utl::ConfigItem - { - Link aCommitLink; - diff --git a/applied_patches/0112-sw-ww8-field-fix.diff b/applied_patches/0115-sw-ww8-field-fix.diff similarity index 100% rename from applied_patches/0112-sw-ww8-field-fix.diff rename to applied_patches/0115-sw-ww8-field-fix.diff diff --git a/applied_patches/0118-sc-datapilot-autoformat.diff b/applied_patches/0118-sc-datapilot-autoformat.diff dissimilarity index 79% index 7ad5ddba2..2610b2e96 100644 --- a/applied_patches/0118-sc-datapilot-autoformat.diff +++ b/applied_patches/0118-sc-datapilot-autoformat.diff @@ -1,399 +1,356 @@ ---- sc/inc/dpobject.hxx -+++ sc/inc/dpobject.hxx -@@ -106,6 +106,7 @@ private: - ScDPOutput* pOutput; - BOOL bSettingsChanged; - BOOL bAlive; // FALSE if only used to hold settings -+ USHORT nAutoFormatIndex; - BOOL bAllowMove; - long nHeaderRows; // page fields plus filter button - -@@ -137,6 +138,9 @@ public: - void SetOutRange(const ScRange& rRange); - const ScRange& GetOutRange() const { return aOutRange; } - -+ void SetAutoFormatIndex (const USHORT nIndex); -+ USHORT GetAutoFormatIndex () { if (this == NULL) return 65535; else return nAutoFormatIndex; } -+ - void SetSheetDesc(const ScSheetSourceDesc& rDesc); - void SetImportDesc(const ScImportSourceDesc& rDesc); - void SetServiceData(const ScDPServiceDesc& rDesc); ---- sc/inc/sc.hrc.old 2009-04-06 16:41:39.000000000 +0000 -+++ sc/inc/sc.hrc 2009-04-06 16:41:48.000000000 +0000 -@@ -1652,6 +1652,9 @@ - #define SID_DATA_FORM (SC_OOO_BUILD_START + 2) // menu (in Data menu) - #define RID_SCDLG_DATAFORM (SC_OOO_BUILD_START + 3) // dialog - -+// Autoformat for DataPilot -+#define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 4) -+ - #endif - - ---- sc/sdi/pivotsh.sdi.old 2009-04-02 10:44:54.000000000 +0000 -+++ sc/sdi/pivotsh.sdi 2009-04-06 16:41:48.000000000 +0000 -@@ -34,6 +34,7 @@ interface Pivot - SID_PIVOT_RECALC [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] - SID_PIVOT_KILL [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] - SID_DP_FILTER [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] -+ SID_PIVOT_AFMT [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] - } - - shell ScPivotShell ---- sc/sdi/scalc.sdi.old 2009-04-06 16:41:39.000000000 +0000 -+++ sc/sdi/scalc.sdi 2009-04-06 16:41:48.000000000 +0000 -@@ -1900,6 +1900,31 @@ SfxVoidItem DeletePivotTable SID_PIVOT_K - GroupId = GID_DATA; - ] - -+SfxVoidItem AutoFormatPivotTable SID_PIVOT_AFMT -+() -+[ -+ /* flags: */ -+ AutoUpdate = FALSE, -+ Cachable = Cachable, -+ FastCall = FALSE, -+ HasCoreId = FALSE, -+ HasDialog = FALSE, -+ ReadOnlyDoc = TRUE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ -+ /* config: */ -+ AccelConfig = FALSE, -+ MenuConfig = TRUE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_DATA; -+] -+ -+ - //-------------------------------------------------------------------------- - SfxVoidItem DeletePrintArea SID_DELETE_PRINTAREA - () ---- sc/source/core/data/dpobject.cxx -+++ sc/source/core/data/dpobject.cxx -@@ -165,6 +165,7 @@ ScDPObject::ScDPObject( ScDocument* pD ) : - pOutput( NULL ), - bSettingsChanged( FALSE ), - bAlive( FALSE ), -+ nAutoFormatIndex( 65535 ), - bAllowMove( FALSE ), - nHeaderRows( 0 ) - { -@@ -178,6 +179,7 @@ ScDPObject::ScDPObject(const ScDPObject& - pOutput( NULL ), - bSettingsChanged( FALSE ), - bAlive( FALSE ), -+ nAutoFormatIndex( r.nAutoFormatIndex ), - bAllowMove( FALSE ), - nHeaderRows( r.nHeaderRows ) - { -@@ -234,6 +236,11 @@ void ScDPObject::SetSaveData(const ScDPS - InvalidateData(); // re-init source from SaveData - } - -+void ScDPObject::SetAutoFormatIndex(const USHORT nIndex) -+{ -+ nAutoFormatIndex = nIndex; -+} -+ - void ScDPObject::SetOutRange(const ScRange& rRange) - { - aOutRange = rRange; ---- sc/source/ui/docshell/dbdocfun.cxx.old 2009-04-02 10:45:27.000000000 +0000 -+++ sc/source/ui/docshell/dbdocfun.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -1390,6 +1390,35 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPO - delete pNewUndoDoc; - delete pUndoDPObj; - -+ if (const_cast(pNewObj)->GetAutoFormatIndex() != 65535) -+ { -+ ScViewData* pViewData = rDocShell.GetViewData(); -+ rDocShell.GetViewData()->GetViewShell()->GetDBData( TRUE, SC_DB_OLD ); -+ const ScMarkData& rMark1 = pViewData->GetMarkData(); -+ SCCOL nStartCol; -+ SCROW nStartRow; -+ SCTAB nStartTab; -+ SCCOL nEndCol; -+ SCROW nEndRow; -+ SCTAB nEndTab; -+ -+ rDocShell.GetViewData()->GetSimpleArea( nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab ); -+ ScRange Outrange = pNewObj->GetOutRange(); -+ if (( (Outrange.aStart.Col() <= nStartCol) && (nStartCol <= Outrange.aEnd.Col() )&& (nStartTab == Outrange.aStart.Tab())) -+ && ( (Outrange.aStart.Row() <= nStartRow) && (nStartRow <= Outrange.aEnd.Row() )) ) -+ { -+ -+ if ( !rMark1.IsMarked() && !rMark1.IsMultiMarked() ) -+ rDocShell.GetViewData()->GetViewShell()->MarkDataArea( TRUE ); -+ //FIXME: Autoformat even when clicked from a non-dp cell. -+ pViewData->MoveNextRow(); -+ rDocShell.GetViewData()->GetViewShell()->AutoFormat( const_cast(pNewObj)->GetAutoFormatIndex()); -+ rDocShell.GetViewData()->GetViewShell()->AutoFormatPivotTable( const_cast(pNewObj), const_cast(pNewObj)->GetAutoFormatIndex() ); -+ pViewData->MovePrevRow(); -+ } -+ } -+ -+ - if (bDone) - aModificator.SetDocumentModified(); - ---- sc/source/ui/inc/dbfunc.hxx.old 2009-04-02 10:45:37.000000000 +0000 -+++ sc/source/ui/inc/dbfunc.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -90,6 +90,8 @@ public: - const ScDPObject& rSource, BOOL bApi = FALSE ); - void DeletePivotTable(); - void RecalcPivotTable(); -+ void AutoFormatPivotTable(USHORT nIndex); -+ void AutoFormatPivotTable(ScDPObject* pDPObj, USHORT nIndex); - - BOOL HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts ); - BOOL HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo ); ---- sc/source/ui/inc/viewdata.hxx.old 2009-04-02 10:45:37.000000000 +0000 -+++ sc/source/ui/inc/viewdata.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -331,6 +331,10 @@ public: - - ScMarkType GetSimpleArea( SCCOL& rStartCol, SCROW& rStartRow, SCTAB& rStartTab, - SCCOL& rEndCol, SCROW& rEndRow, SCTAB& rEndTab ) const; -+ -+ void MoveNextRow(); -+ void MovePrevRow(); -+ - ScMarkType GetSimpleArea( ScRange& rRange ) const; - /// May modify rNewMark using MarkToSimple(). - ScMarkType GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) const; ---- sc/source/ui/miscdlgs/makefile.mk -+++ sc/source/ui/miscdlgs/makefile.mk -@@ -117,7 +117,9 @@ LIB1OBJFILES = \ - $(SLO)$/conflictsdlg.obj \ - $(SLO)$/sharedocdlg.obj \ - $(SLO)$/protectiondlg.obj \ -- $(SLO)$/retypepassdlg.obj -+ $(SLO)$/retypepassdlg.obj \ -+ $(SLO)$/scuiautofmt.obj \ -+ $(SLO)$/strindlg.obj - - EXCEPTIONSFILES = \ - $(SLO)$/acredlin.obj \ ---- sc/source/ui/src/popup.src.old 2009-04-02 10:45:23.000000000 +0000 -+++ sc/source/ui/src/popup.src 2009-04-06 16:41:48.000000000 +0000 -@@ -206,6 +206,84 @@ Menu RID_POPUP_PIVOT - Text [ en-US ] = "~Start..." ; - }; - MenuItem -+ { -+ Identifier = SID_PIVOT_AFMT ; -+ HelpId = SID_PIVOT_AFMT ; -+ Text [ en-US ] = "~AutoFormat..." ; -+ Text [ de ] = "A~utoFormat" ; -+ Text [ af ] = "OutoFormateer..." ; -+ Text [ ar ] = "تنسيق تلقائي..." ; -+ Text [ as-IN ] = "স্বয়ংক্ৰিয় ফৰমেট ..." ; -+ Text [ be-BY ] = "Аўта-фармат..." ; -+ Text [ bg ] = "Автоформат..." ; -+ Text [ br ] = "EmVentrezhañ..." ; -+ Text [ bs ] = "AutoFormat..." ; -+ Text [ ca ] = "Formatació automàtica..." ; -+ Text [ cs ] = "Automatický formát..." ; -+ Text [ cy ] = "AwtoFformat..." ; -+ Text [ da ] = "Autoformat..." ; -+ Text [ el ] = "Αυτόματη μορφοποίηση..." ; -+ Text [ en-GB ] = "AutoFormat..." ; -+ Text [ en-ZA ] = "AutoFormat..." ; -+ Text [ eo ] = "Aŭtomate Formati..." ; -+ Text [ es ] = "Formateado automático..." ; -+ Text [ et ] = "Automaatvormindus..." ; -+ Text [ fa ] = "قالب‌بندی خودکار..." ; -+ Text [ fi ] = "Automaattinen muotoilu..." ; -+ Text [ fr ] = "AutoFormat..." ; -+ Text [ ga ] = "UathFhormáidigh..." ; -+ Text [ gu ] = "આપોઆપબંધારણ..." ; -+ Text [ gu-IN ] = "આપોઆપબંધારણ..." ; -+ Text [ hi-IN ] = "स्वचालित ढंग से रचना..." ; -+ Text [ hr ] = "SamoOblikovanje..." ; -+ Text [ hu ] = "Automatikus formázás..." ; -+ Text [ it ] = "Formattazione automatica..." ; -+ Text [ ja ] = "オートフォーマット..." ; -+ Text [ ka ] = "ავტო-ფორმატირება..." ; -+ Text [ km ] = "ទ្រង់ទ្រាយ​ស្វ័យប្រវត្តិ..." ; -+ Text [ ko ] = "자동 서식..." ; -+ Text [ ku ] = "TeşekirinaBixweber..." ; -+ Text [ lt ] = "Automatinis formatavimas..." ; -+ Text [ mk ] = "Автоматско форматирање..." ; -+ Text [ ml-IN ] = "സ്വയം രൂപപ്പെടുത്തുക..." ; -+ Text [ mr-IN ] = "स्वंयचलित रचना..." ; -+ Text [ nb ] = "Autoformatering..." ; -+ Text [ nl ] = "AutoOpmaak..." ; -+ Text [ nn ] = "Autoformatering..." ; -+ Text [ nr ] = "Fometha ngokuzenzakalela..." ; -+ Text [ ns ] = "Fomate ye e Itiragalelago..." ; -+ Text [ or-IN ] = "ସ୍ବଯଂଚାଳିତଫର୍ମାଟ..." ; -+ Text [ pa-IN ] = "ਸਵੈ-ਫਾਰਮਿਟ..." ; -+ Text [ pl ] = "Autoformatowanie..." ; -+ Text [ pt ] = "Formatação automática..." ; -+ Text [ pt-BR ] = "AutoFormatar..." ; -+ Text [ ru ] = "Автоформат..." ; -+ Text [ rw ] = "Nyamwihamiterere..." ; -+ Text [ sh-YU ] = "Automatsko formatiranje..." ; -+ Text [ sk ] = "Automatický formát..." ; -+ Text [ sl ] = "Samooblikovanje..." ; -+ Text [ sr-CS ] = "Аутоматско форматирање..." ; -+ Text [ ss ] = "Kutifomethekela..." ; -+ Text [ st ] = "Fomate e iketsahallang..." ; -+ Text [ sv ] = "Autoformat..." ; -+ Text [ sw-TZ ] = "AutoFormat..." ; -+ Text [ ta ] = "தானியக்க வடிவம்..." ; -+ Text [ ta-IN ] = "தானியக்க வடிவம்..." ; -+ Text [ te-IN ] = "స్వయంరూపలావణ్యం..." ; -+ Text [ tg ] = "Автоформат..." ; -+ Text [ th ] = "AutoFormat..." ; -+ Text [ tr ] = "Otomatik Biçimlendirme..." ; -+ Text [ ts ] = "Fomati yo tiendlekela hi yoxe..." ; -+ Text [ uk ] = "Автоформат..." ; -+ Text [ ur-IN ] = "خودکارطریقہ..." ; -+ Text [ ve ] = "OthoFomathi..." ; -+ Text [ vi ] = "Tự định dạng..." ; -+ Text [ xh ] = "Ulungiselelo Oluzenzekelayo..." ; -+ Text [ zh-CN ] = "自动格式..." ; -+ Text [ zh-TW ] = "自動格式..." ; -+ Text [ zu ] = "Isakhiwo esizenzekelayo..." ; -+ }; -+ MenuItem - { - Identifier = SID_PIVOT_RECALC ; - HelpId = SID_PIVOT_RECALC ; ---- sc/source/ui/view/dbfunc3.cxx.old 2009-04-02 10:45:40.000000000 +0000 -+++ sc/source/ui/view/dbfunc3.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -1976,7 +1976,28 @@ void ScDBFunc::RepeatDB( BOOL bRecord ) - else // "Keine Operationen auszufuehren" - ErrorMessage(STR_MSSG_REPEATDB_0); - } -+void ScDBFunc::AutoFormatPivotTable(USHORT nIndex) -+{ -+ ScDocument* pDoc = GetViewData()->GetDocument(); - -+ // old pivot not used any more -+ -+ ScDPObject* pDPObj = pDoc->GetDPAtCursor( GetViewData()->GetCurX(), -+ GetViewData()->GetCurY(), -+ GetViewData()->GetTabNo() ); -+ if ( pDPObj ) -+ { -+ pDPObj->SetAutoFormatIndex(nIndex); -+ } -+ else -+ ErrorMessage(STR_PIVOT_NOTFOUND); -+ -+} -+ -+void ScDBFunc::AutoFormatPivotTable(ScDPObject* pDPObj, USHORT nIndex) -+{ -+ pDPObj->SetAutoFormatIndex(nIndex); -+} - - - ---- sc/source/ui/view/pivotsh.cxx.old 2009-04-02 10:45:40.000000000 +0000 -+++ sc/source/ui/view/pivotsh.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -56,6 +56,12 @@ - #include "uiitems.hxx" - //CHINA001 #include "pfiltdlg.hxx" - #include "scabstdlg.hxx" //CHINA001 -+ -+#include "autoform.hxx" -+#include "scuiautofmt.hxx" -+#include "editable.hxx" -+ -+ - //------------------------------------------------------------------------ - - #define ScPivotShell -@@ -99,13 +105,56 @@ void ScPivotShell::Execute( SfxRequest& - { - switch ( rReq.GetSlot() ) - { -- case SID_PIVOT_RECALC: -- pViewShell->RecalcPivotTable(); -- break; -+ case SID_PIVOT_AFMT: -+ { -+ ScViewData* pViewData = pViewShell->GetViewData(); -+ -+ pViewShell->GetDBData( TRUE, SC_DB_OLD ); -+ const ScMarkData& rMark1 = pViewData->GetMarkData(); -+ if ( !rMark1.IsMarked() && !rMark1.IsMultiMarked() ) -+ pViewShell->MarkDataArea( TRUE ); -+ -+ Window* pDlgParent = pViewShell->GetDialogParent(); -+ -+ pViewData->MoveNextRow(); -+ -+ ScGlobal::ClearAutoFormat(); -+ ScAutoFormatData* pNewEntry = pViewShell->CreateAutoFormatData(); -+ ScAutoFormatDlg* pDlg = new ScAutoFormatDlg( -+ pDlgParent, -+ ScGlobal::GetAutoFormat(), -+ pNewEntry, -+ pViewShell->GetViewData()->GetDocument() ); -+ -+ if ( pDlg->Execute() == RET_OK ) -+ { -+ ScEditableTester aTester( pViewShell ); -+ if ( !aTester.IsEditable() ) -+ { -+ pViewShell->ErrorMessage(aTester.GetMessageId()); -+ } -+ else -+ { -+ /* AutoFormat and Store the index */ -+ pViewShell->AutoFormat( pDlg->GetIndex() ); -+ pViewShell->AutoFormatPivotTable( pDlg->GetIndex() ); -+ } -+ } -+ delete pDlg; -+ delete pNewEntry; - -+ -+ //pViewShell->DeletePivotTable(); -+ //pViewShell->RecalcPivotTable(); -+ break; -+ } - case SID_PIVOT_KILL: - pViewShell->DeletePivotTable(); - break; -+ case SID_PIVOT_RECALC: -+ //pViewShell->DeletePivotTable(); -+ pViewShell->RecalcPivotTable(); -+ break; - - case SID_DP_FILTER: - { ---- sc/source/ui/view/viewdata.cxx.old 2009-04-02 10:45:40.000000000 +0000 -+++ sc/source/ui/view/viewdata.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -670,6 +670,22 @@ void ScViewData::RefreshZoom() - aLogicMode.SetScaleY( GetZoomY() ); - } - -+void ScViewData::MoveNextRow() -+{ -+ ScRange aMarkRange; -+ aMarkData.GetMarkArea(aMarkRange); -+ aMarkRange.aStart.Set(aMarkRange.aStart.Col(), aMarkRange.aStart.Row() +1, aMarkRange.aStart.Tab()); -+ aMarkData.SetMarkArea(aMarkRange); -+} -+ -+void ScViewData::MovePrevRow() -+{ -+ ScRange aMarkRange; -+ aMarkData.GetMarkArea(aMarkRange); -+ aMarkRange.aStart.Set(aMarkRange.aStart.Col(), aMarkRange.aStart.Row() -1, aMarkRange.aStart.Tab()); -+ aMarkData.SetMarkArea(aMarkRange); -+} -+ - void ScViewData::SetPagebreakMode( BOOL bSet ) - { - bPagebreak = bSet; +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index d67b625..33d0240 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -1664,6 +1664,9 @@ + #define SID_DATA_FORM (SC_OOO_BUILD_START + 2) // menu (in Data menu) + #define RID_SCDLG_DATAFORM (SC_OOO_BUILD_START + 3) // dialog + +-#endif ++// Autoformat for DataPilot ++#define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 4) ++ ++#endif + + +diff --git sc/sdi/pivotsh.sdi sc/sdi/pivotsh.sdi +index ddbb49c..94821e5 100644 +--- sc/sdi/pivotsh.sdi ++++ sc/sdi/pivotsh.sdi +@@ -34,6 +34,7 @@ interface Pivot + SID_PIVOT_RECALC [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] + SID_PIVOT_KILL [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] + SID_DP_FILTER [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] ++ SID_PIVOT_AFMT [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] + } + + shell ScPivotShell +diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi +index 39380f8..ad21670 100644 +--- sc/sdi/scalc.sdi ++++ sc/sdi/scalc.sdi +@@ -1900,6 +1900,30 @@ SfxVoidItem DeletePivotTable SID_PIVOT_KILL + GroupId = GID_DATA; + ] + ++SfxVoidItem AutoFormatPivotTable SID_PIVOT_AFMT ++() ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = FALSE, ++ ReadOnlyDoc = TRUE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = FALSE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = FALSE, ++ GroupId = GID_DATA; ++] ++ + //-------------------------------------------------------------------------- + SfxVoidItem DeletePrintArea SID_DELETE_PRINTAREA + () +diff --git sc/source/ui/docshell/dbdocfun.cxx sc/source/ui/docshell/dbdocfun.cxx +index 8ee336e..d525da1 100644 +--- sc/source/ui/docshell/dbdocfun.cxx ++++ sc/source/ui/docshell/dbdocfun.cxx +@@ -1405,6 +1405,36 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb + delete pNewUndoDoc; + delete pUndoDPObj; + ++ if (const_cast(pNewObj)->GetAutoFormatIndex() != 65535) ++ { ++ ScViewData* pViewData = rDocShell.GetViewData(); ++ ScTabViewShell* pViewShell = pViewData->GetViewShell(); ++ pViewShell->GetDBData( TRUE, SC_DB_OLD ); ++ const ScMarkData& rMark1 = pViewData->GetMarkData(); ++ SCCOL nStartCol; ++ SCROW nStartRow; ++ SCTAB nStartTab; ++ SCCOL nEndCol; ++ SCROW nEndRow; ++ SCTAB nEndTab; ++ ++ rDocShell.GetViewData()->GetSimpleArea( nStartCol,nStartRow,nStartTab,nEndCol,nEndRow,nEndTab ); ++ ScRange Outrange = pNewObj->GetOutRange(); ++ if (( (Outrange.aStart.Col() <= nStartCol) && (nStartCol <= Outrange.aEnd.Col() )&& (nStartTab == Outrange.aStart.Tab())) ++ && ( (Outrange.aStart.Row() <= nStartRow) && (nStartRow <= Outrange.aEnd.Row() )) ) ++ { ++ ++ if ( !rMark1.IsMarked() && !rMark1.IsMultiMarked() ) ++ pViewShell->MarkDataArea( TRUE ); ++ //FIXME: Autoformat even when clicked from a non-dp cell. ++ pViewData->MoveNextRow(); ++ sal_uInt16 nAutoFmtIndex = pNewObj->GetAutoFormatIndex(); ++ pViewShell->AutoFormat(nAutoFmtIndex); ++ pViewShell->AutoFormatPivotTable(const_cast(pNewObj), nAutoFmtIndex); ++ pViewData->MovePrevRow(); ++ } ++ } ++ + if (bDone) + aModificator.SetDocumentModified(); + +diff --git sc/source/ui/inc/dbfunc.hxx sc/source/ui/inc/dbfunc.hxx +index bb43553..91834e1 100644 +--- sc/source/ui/inc/dbfunc.hxx ++++ sc/source/ui/inc/dbfunc.hxx +@@ -90,6 +90,8 @@ public: + const ScDPObject& rSource, BOOL bApi = FALSE ); + void DeletePivotTable(); + void RecalcPivotTable(); ++ void AutoFormatPivotTable(USHORT nIndex); ++ void AutoFormatPivotTable(ScDPObject* pDPObj, USHORT nIndex); + + BOOL HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts ); + BOOL HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo ); +diff --git sc/source/ui/inc/viewdata.hxx sc/source/ui/inc/viewdata.hxx +index 024eac3..6f0d986 100644 +--- sc/source/ui/inc/viewdata.hxx ++++ sc/source/ui/inc/viewdata.hxx +@@ -332,6 +332,10 @@ public: + ScMarkType GetSimpleArea( SCCOL& rStartCol, SCROW& rStartRow, SCTAB& rStartTab, + SCCOL& rEndCol, SCROW& rEndRow, SCTAB& rEndTab ) const; + ScMarkType GetSimpleArea( ScRange& rRange ) const; ++ ++ void MoveNextRow(); ++ void MovePrevRow(); ++ + /// May modify rNewMark using MarkToSimple(). + ScMarkType GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) const; + void GetMultiArea( ScRangeListRef& rRange ) const; +diff --git sc/source/ui/miscdlgs/makefile.mk sc/source/ui/miscdlgs/makefile.mk +index 12b2d2f..df75a88 100644 +--- sc/source/ui/miscdlgs/makefile.mk ++++ sc/source/ui/miscdlgs/makefile.mk +@@ -126,6 +124,8 @@ LIB1OBJFILES = \ + $(SLO)$/warnbox.obj \ + $(SLO)$/conflictsdlg.obj \ + $(SLO)$/sharedocdlg.obj \ ++ $(SLO)$/scuiautofmt.obj \ ++ $(SLO)$/strindlg.obj \ + $(SLO)$/protectiondlg.obj \ + $(SLO)$/retypepassdlg.obj + +diff --git sc/source/ui/src/popup.src sc/source/ui/src/popup.src +index 05d10b9..4e19349 100644 +--- sc/source/ui/src/popup.src ++++ sc/source/ui/src/popup.src +@@ -213,6 +213,84 @@ Menu RID_POPUP_PIVOT + }; + MenuItem + { ++ Identifier = SID_PIVOT_AFMT ; ++ HelpId = SID_PIVOT_AFMT ; ++ Text [ en-US ] = "~AutoFormat..." ; ++ Text [ de ] = "A~utoFormat" ; ++ Text [ af ] = "OutoFormateer..." ; ++ Text [ ar ] = "تنسيق تلقائي..." ; ++ Text [ as-IN ] = "স্বয়ংক্ৰিয় ফৰমেট ..." ; ++ Text [ be-BY ] = "Аўта-фармат..." ; ++ Text [ bg ] = "Автоформат..." ; ++ Text [ br ] = "EmVentrezhañ..." ; ++ Text [ bs ] = "AutoFormat..." ; ++ Text [ ca ] = "Formatació automàtica..." ; ++ Text [ cs ] = "Automatický formát..." ; ++ Text [ cy ] = "AwtoFformat..." ; ++ Text [ da ] = "Autoformat..." ; ++ Text [ el ] = "Αυτόματη μορφοποίηση..." ; ++ Text [ en-GB ] = "AutoFormat..." ; ++ Text [ en-ZA ] = "AutoFormat..." ; ++ Text [ eo ] = "Aŭtomate Formati..." ; ++ Text [ es ] = "Formateado automático..." ; ++ Text [ et ] = "Automaatvormindus..." ; ++ Text [ fa ] = "قالب‌بندی خودکار..." ; ++ Text [ fi ] = "Automaattinen muotoilu..." ; ++ Text [ fr ] = "AutoFormat..." ; ++ Text [ ga ] = "UathFhormáidigh..." ; ++ Text [ gu ] = "આપોઆપબંધારણ..." ; ++ Text [ gu-IN ] = "આપોઆપબંધારણ..." ; ++ Text [ hi-IN ] = "स्वचालित ढंग से रचना..." ; ++ Text [ hr ] = "SamoOblikovanje..." ; ++ Text [ hu ] = "Automatikus formázás..." ; ++ Text [ it ] = "Formattazione automatica..." ; ++ Text [ ja ] = "オートフォーマット..." ; ++ Text [ ka ] = "ავტო-ფორმატირება..." ; ++ Text [ km ] = "ទ្រង់ទ្រាយ​ស្វ័យប្រវត្តិ..." ; ++ Text [ ko ] = "자동 서식..." ; ++ Text [ ku ] = "TeşekirinaBixweber..." ; ++ Text [ lt ] = "Automatinis formatavimas..." ; ++ Text [ mk ] = "Автоматско форматирање..." ; ++ Text [ ml-IN ] = "സ്വയം രൂപപ്പെടുത്തുക..." ; ++ Text [ mr-IN ] = "स्वंयचलित रचना..." ; ++ Text [ nb ] = "Autoformatering..." ; ++ Text [ nl ] = "AutoOpmaak..." ; ++ Text [ nn ] = "Autoformatering..." ; ++ Text [ nr ] = "Fometha ngokuzenzakalela..." ; ++ Text [ ns ] = "Fomate ye e Itiragalelago..." ; ++ Text [ or-IN ] = "ସ୍ବଯଂଚାଳିତଫର୍ମାଟ..." ; ++ Text [ pa-IN ] = "ਸਵੈ-ਫਾਰਮਿਟ..." ; ++ Text [ pl ] = "Autoformatowanie..." ; ++ Text [ pt ] = "Formatação automática..." ; ++ Text [ pt-BR ] = "AutoFormatar..." ; ++ Text [ ru ] = "Автоформат..." ; ++ Text [ rw ] = "Nyamwihamiterere..." ; ++ Text [ sh-YU ] = "Automatsko formatiranje..." ; ++ Text [ sk ] = "Automatický formát..." ; ++ Text [ sl ] = "Samooblikovanje..." ; ++ Text [ sr-CS ] = "Аутоматско форматирање..." ; ++ Text [ ss ] = "Kutifomethekela..." ; ++ Text [ st ] = "Fomate e iketsahallang..." ; ++ Text [ sv ] = "Autoformat..." ; ++ Text [ sw-TZ ] = "AutoFormat..." ; ++ Text [ ta ] = "தானியக்க வடிவம்..." ; ++ Text [ ta-IN ] = "தானியக்க வடிவம்..." ; ++ Text [ te-IN ] = "స్వయంరూపలావణ్యం..." ; ++ Text [ tg ] = "Автоформат..." ; ++ Text [ th ] = "AutoFormat..." ; ++ Text [ tr ] = "Otomatik Biçimlendirme..." ; ++ Text [ ts ] = "Fomati yo tiendlekela hi yoxe..." ; ++ Text [ uk ] = "Автоформат..." ; ++ Text [ ur-IN ] = "خودکارطریقہ..." ; ++ Text [ ve ] = "OthoFomathi..." ; ++ Text [ vi ] = "Tự định dạng..." ; ++ Text [ xh ] = "Ulungiselelo Oluzenzekelayo..." ; ++ Text [ zh-CN ] = "自动格式..." ; ++ Text [ zh-TW ] = "自動格式..." ; ++ Text [ zu ] = "Isakhiwo esizenzekelayo..." ; ++ }; ++ MenuItem ++ { + Identifier = SID_PIVOT_RECALC ; + HelpId = SID_PIVOT_RECALC ; + Text [ en-US ] = "~Refresh" ; +diff --git sc/source/ui/view/dbfunc3.cxx sc/source/ui/view/dbfunc3.cxx +index 86fc703..1e5ff2c 100644 +--- sc/source/ui/view/dbfunc3.cxx ++++ sc/source/ui/view/dbfunc3.cxx +@@ -2296,6 +2296,28 @@ void ScDBFunc::RepeatDB( BOOL bRecord ) + ErrorMessage(STR_MSSG_REPEATDB_0); + } + ++void ScDBFunc::AutoFormatPivotTable(USHORT nIndex) ++{ ++ ScDocument* pDoc = GetViewData()->GetDocument(); ++ ++ // old pivot not used any more ++ ++ ScDPObject* pDPObj = pDoc->GetDPAtCursor( ++ GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); ++ ++ if ( pDPObj ) ++ { ++ pDPObj->SetAutoFormatIndex(nIndex); ++ } ++ else ++ ErrorMessage(STR_PIVOT_NOTFOUND); ++ ++} ++ ++void ScDBFunc::AutoFormatPivotTable(ScDPObject* pDPObj, USHORT nIndex) ++{ ++ pDPObj->SetAutoFormatIndex(nIndex); ++} + + + +diff --git sc/source/ui/view/pivotsh.cxx sc/source/ui/view/pivotsh.cxx +index 5af6f2e..cd33bde 100644 +--- sc/source/ui/view/pivotsh.cxx ++++ sc/source/ui/view/pivotsh.cxx +@@ -56,6 +56,12 @@ + #include "uiitems.hxx" + //CHINA001 #include "pfiltdlg.hxx" + #include "scabstdlg.hxx" //CHINA001 ++ ++#include "autoform.hxx" ++#include "scuiautofmt.hxx" ++#include "editable.hxx" ++ ++ + //------------------------------------------------------------------------ + + #define ScPivotShell +@@ -102,7 +108,45 @@ void ScPivotShell::Execute( SfxRequest& rReq ) + case SID_PIVOT_RECALC: + pViewShell->RecalcPivotTable(); + break; ++ case SID_PIVOT_AFMT: ++ { ++ ScViewData* pViewData = pViewShell->GetViewData(); ++ ++ pViewShell->GetDBData( TRUE, SC_DB_OLD ); ++ const ScMarkData& rMark1 = pViewData->GetMarkData(); ++ if ( !rMark1.IsMarked() && !rMark1.IsMultiMarked() ) ++ pViewShell->MarkDataArea( TRUE ); ++ ++ Window* pDlgParent = pViewShell->GetDialogParent(); ++ ++ pViewData->MoveNextRow(); ++ ++ ScGlobal::ClearAutoFormat(); ++ ScAutoFormatData* pNewEntry = pViewShell->CreateAutoFormatData(); ++ ScAutoFormatDlg* pDlg = new ScAutoFormatDlg( ++ pDlgParent, ScGlobal::GetAutoFormat(), pNewEntry, pViewData->GetDocument() ); ++ ++ if ( pDlg->Execute() == RET_OK ) ++ { ++ ScEditableTester aTester( pViewShell ); ++ if ( !aTester.IsEditable() ) ++ { ++ pViewShell->ErrorMessage(aTester.GetMessageId()); ++ } ++ else ++ { ++ /* AutoFormat and Store the index */ ++ pViewShell->AutoFormat( pDlg->GetIndex() ); ++ pViewShell->AutoFormatPivotTable( pDlg->GetIndex() ); ++ } ++ } ++ delete pDlg; ++ delete pNewEntry; + ++ //pViewShell->DeletePivotTable(); ++ //pViewShell->RecalcPivotTable(); ++ } ++ break; + case SID_PIVOT_KILL: + pViewShell->DeletePivotTable(); + break; +diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx +index fbb1306..df48982 100644 +--- sc/source/ui/view/viewdata.cxx ++++ sc/source/ui/view/viewdata.cxx +@@ -670,6 +670,22 @@ void ScViewData::RefreshZoom() + aLogicMode.SetScaleY( GetZoomY() ); + } + ++void ScViewData::MoveNextRow() ++{ ++ ScRange aMarkRange; ++ aMarkData.GetMarkArea(aMarkRange); ++ aMarkRange.aStart.Set(aMarkRange.aStart.Col(), aMarkRange.aStart.Row() +1, aMarkRange.aStart.Tab()); ++ aMarkData.SetMarkArea(aMarkRange); ++} ++ ++void ScViewData::MovePrevRow() ++{ ++ ScRange aMarkRange; ++ aMarkData.GetMarkArea(aMarkRange); ++ aMarkRange.aStart.Set(aMarkRange.aStart.Col(), aMarkRange.aStart.Row() -1, aMarkRange.aStart.Tab()); ++ aMarkData.SetMarkArea(aMarkRange); ++} ++ + void ScViewData::SetPagebreakMode( BOOL bSet ) + { + bPagebreak = bSet; diff --git a/applied_patches/0122-sc-dp-gridlayout.diff b/applied_patches/0122-sc-dp-gridlayout.diff dissimilarity index 88% index 76a35d8b3..a5968c7c9 100644 --- a/applied_patches/0122-sc-dp-gridlayout.diff +++ b/applied_patches/0122-sc-dp-gridlayout.diff @@ -1,506 +1,110 @@ ---- sc/inc/dpobject.hxx -+++ sc/inc/dpobject.hxx -@@ -110,6 +110,7 @@ private: - USHORT nAutoFormatIndex; - BOOL bAllowMove; - long nHeaderRows; // page fields plus filter button -+ bool bHeaderLayout; // TRUE : grid, FALSE : standard - - - SC_DLLPRIVATE void CreateObjects(); -@@ -141,6 +142,9 @@ public: - void SetAutoFormatIndex (const USHORT nIndex); - USHORT GetAutoFormatIndex () { if (this == NULL) return 65535; else return nAutoFormatIndex; } - -+ void SetHeaderLayout (bool bUseGrid); -+ bool GetHeaderLayout () const { return bHeaderLayout; } -+ - void SetSheetDesc(const ScSheetSourceDesc& rDesc); - void SetImportDesc(const ScImportSourceDesc& rDesc); - void SetServiceData(const ScDPServiceDesc& rDesc); ---- sc/inc/dpoutput.hxx.old 2009-04-02 10:45:43.000000000 +0000 -+++ sc/inc/dpoutput.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -109,6 +109,7 @@ private: - long nColCount; - long nRowCount; - long nHeaderSize; -+ bool bHeaderLayout; // TRUE : grid, FALSE : standard - SCCOL nTabStartCol; - SCROW nTabStartRow; - SCCOL nMemberStartCol; -@@ -162,6 +163,9 @@ public: - - void GetMemberResultNames( ScStrCollection& rNames, long nDimension ); - -+ void SetHeaderLayout (bool bUseGrid); -+ bool GetHeaderLayout () const { return bHeaderLayout; } -+ - static void GetDataDimensionNames( String& rSourceName, String& rGivenName, - const com::sun::star::uno::Reference< - com::sun::star::uno::XInterface>& xDim ); ---- sc/source/core/data/dpobject.cxx -+++ sc/source/core/data/dpobject.cxx -@@ -168,7 +168,8 @@ ScDPObject::ScDPObject( ScDocument* pD ) - bAlive( FALSE ), - nAutoFormatIndex( 65535 ), - bAllowMove( FALSE ), -- nHeaderRows( 0 ) -+ nHeaderRows( 0 ), -+ bHeaderLayout( false ) - { - } - -@@ -188,7 +189,8 @@ ScDPObject::ScDPObject(const ScDPObject& - bAlive( FALSE ), - nAutoFormatIndex( r.nAutoFormatIndex ), - bAllowMove( FALSE ), -- nHeaderRows( r.nHeaderRows ) -+ nHeaderRows( r.nHeaderRows ), -+ bHeaderLayout( r.bHeaderLayout ) - { - if (r.pSaveData) - pSaveData = new ScDPSaveData(*r.pSaveData); -@@ -241,6 +243,11 @@ void ScDPObject::SetAutoFormatIndex(cons - nAutoFormatIndex = nIndex; - } - -+void ScDPObject::SetHeaderLayout (bool bUseGrid) -+{ -+ bHeaderLayout = bUseGrid; -+} -+ - void ScDPObject::SetOutRange(const ScRange& rRange) - { - aOutRange = rRange; -@@ -348,6 +355,7 @@ void ScDPObject::CreateOutput() - { - BOOL bFilterButton = IsSheetData() && pSaveData && pSaveData->GetFilterButton(); - pOutput = new ScDPOutput( pDoc, xSource, aOutRange.aStart, bFilterButton ); -+ pOutput->SetHeaderLayout ( bHeaderLayout ); - - long nOldRows = nHeaderRows; - nHeaderRows = pOutput->GetHeaderRows(); ---- sc/source/core/data/dpoutput.cxx.old 2009-04-02 10:45:01.000000000 +0000 -+++ sc/source/core/data/dpoutput.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -376,7 +376,8 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference* pRowAry = aData.getConstArray(); - nColCount = nRowCount ? ( pRowAry[0].getLength() ) : 0; -- nHeaderSize = 1; // one row for field names -+ -+ nHeaderSize = 1; -+ if (GetHeaderLayout() && nColFieldCount == 0) -+ // Insert an extra header row only when there is no column field. -+ nHeaderSize = 2; - - // calculate output positions and sizes - -@@ -1185,6 +1190,12 @@ bool ScDPOutput::GetDataResultPositionDa - return true; - } - -+void ScDPOutput::SetHeaderLayout (bool bLayout) -+{ -+ bHeaderLayout = bLayout; -+ bSizesValid = FALSE; -+} -+ - // - // helper functions for ScDPOutput::GetPivotData - // ---- sc/source/filter/excel/read.cxx.old 2009-04-02 10:44:55.000000000 +0000 -+++ sc/source/filter/excel/read.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -1152,6 +1152,7 @@ FltError ImportExcel8::Read( void ) - case EXC_ID_SXDI: rPTableMgr.ReadSxdi( maStrm ); break; - case EXC_ID_SXVDEX: rPTableMgr.ReadSxvdex( maStrm ); break; - case EXC_ID_SXEX: rPTableMgr.ReadSxex( maStrm ); break; -+ case EXC_ID_SXVIEWEX9: rPTableMgr.ReadSxViewEx9( maStrm ); break; - } - } - break; ---- sc/source/filter/excel/xepivot.cxx.old 2009-04-02 10:44:55.000000000 +0000 -+++ sc/source/filter/excel/xepivot.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -1220,6 +1220,8 @@ XclExpPivotTable::XclExpPivotTable( cons - maPTInfo.maDataName = ScGlobal::GetRscString( STR_PIVOT_DATA ); - maPTInfo.mnCacheIdx = mrPCache.GetCacheIndex(); - -+ maPTAutoFormat.Init( rDPObj ); -+ - if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) - { - // additional properties from ScDPSaveData -@@ -1299,6 +1301,8 @@ void XclExpPivotTable::Save( XclExpStrea - WriteSxli( rStrm, maPTInfo.mnDataCols, maPTInfo.mnColFields ); - // SXEX - WriteSxex( rStrm ); -+ // SX_AUTOFORMAT -+ WriteSxAutoformat( rStrm ); - } - } - -@@ -1439,6 +1443,8 @@ void XclExpPivotTable::Finalize() - rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1; - if( maDataFields.empty() ) - ++rnDataXclRow; -+ if( 0 == maPTAutoFormat.mnGridLayout ) -+ ++rnDataXclRow; - rnXclCol2 = ::std::max( rnXclCol2, rnDataXclCol ); - rnXclRow2 = ::std::max( rnXclRow2, rnDataXclRow ); - maPTInfo.mnDataCols = rnXclCol2 - rnDataXclCol + 1; -@@ -1446,6 +1452,8 @@ void XclExpPivotTable::Finalize() - - // first heading - maPTInfo.mnFirstHeadRow = rnXclRow1 + 1; -+ if( 0 == maPTAutoFormat.mnGridLayout ) -+ maPTInfo.mnFirstHeadRow++; - } - - // records ---------------------------------------------------------------- -@@ -1521,6 +1529,18 @@ void XclExpPivotTable::WriteSxex( XclExp - rStrm.EndRecord(); - } - -+void XclExpPivotTable::WriteSxAutoformat( XclExpStream& rStrm ) const -+{ -+ // Until we sync the autoformat ids only export if using grid header layout -+ // That could only have been set via xls import so far. -+ if ( 0 == maPTAutoFormat.mnGridLayout ) -+ { -+ rStrm.StartRecord( EXC_ID_SXVIEWEX9, 17 ); -+ rStrm << maPTAutoFormat; -+ rStrm.EndRecord(); -+ } -+} -+ - // ============================================================================ - - namespace { ---- sc/source/filter/excel/xipivot.cxx.old 2009-04-02 10:44:55.000000000 +0000 -+++ sc/source/filter/excel/xipivot.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -1296,6 +1296,11 @@ void XclImpPivotTable::ReadSxex( XclImpS - rStrm >> maPTExtInfo; - } - -+void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm ) -+{ -+ rStrm >> maPTAutoFormat; -+} -+ - // ---------------------------------------------------------------------------- - - void XclImpPivotTable::Convert() -@@ -1363,6 +1368,7 @@ void XclImpPivotTable::Convert() - pDPObj->SetSheetDesc( aDesc ); - pDPObj->SetOutRange( aOutRange ); - pDPObj->SetAlive( TRUE ); -+ pDPObj->SetHeaderLayout( maPTAutoFormat.mnGridLayout == 0 ); - GetDoc().GetDPCollection()->Insert( pDPObj ); - } - -@@ -1458,6 +1464,12 @@ void XclImpPivotTableManager::ReadSxex( - maPTables.back()->ReadSxex( rStrm ); - } - -+void XclImpPivotTableManager::ReadSxViewEx9( XclImpStream& rStrm ) -+{ -+ if( !maPTables.empty() ) -+ maPTables.back()->ReadSxViewEx9( rStrm ); -+} -+ - // ---------------------------------------------------------------------------- - - void XclImpPivotTableManager::ReadPivotCaches( XclImpStream& rStrm ) -@@ -1473,4 +1485,85 @@ void XclImpPivotTableManager::ConvertPiv - } - - // ============================================================================ -+ -+// Pivot table autoformat settings ============================================ -+ -+/** -+classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 -+default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 -+report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 -+report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 -+report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 -+report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 -+report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 -+report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 -+report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 -+report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 -+report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 -+report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 -+table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 -+table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 -+table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 -+table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 -+table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 -+table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 -+table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 -+table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 -+table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 -+table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 -+none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 -+**/ -+ -+XclPTAutoFormat::XclPTAutoFormat() : -+ mbReport( 0 ), -+ mnAutoFormat( 0 ), -+ mnGridLayout( 0x10 ) -+{ -+} -+ -+void XclPTAutoFormat::Init( const ScDPObject& rDPObj ) -+{ -+ if( rDPObj.GetHeaderLayout() ) -+ { -+ mbReport = 0; -+ mnAutoFormat = 1; -+ mnGridLayout = 0; -+ } -+ else -+ { -+ // Report1 for now -+ // TODO : sync with autoformat indicies -+ mbReport = 2; -+ mnAutoFormat = 1; -+ mnGridLayout = 0x10; -+ } -+} -+ -+XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ) -+{ -+ rStrm.Ignore( 2 ); -+ rStrm >> rInfo.mbReport; /// 2 for report* fmts ? -+ rStrm.Ignore( 6 ); -+ sal_uInt8 nDummy; -+ return rStrm -+ >> rInfo.mnAutoFormat -+ >> rInfo.mnGridLayout -+ >> nDummy >> nDummy >> nDummy; -+} -+ -+XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ) -+{ -+ return rStrm -+ << EXC_PT_AUTOFMT_HEADER -+ << rInfo.mbReport -+ << EXC_PT_AUTOFMT_ZERO -+ << EXC_PT_AUTOFMT_FLAGS -+ << rInfo.mnAutoFormat -+ << rInfo.mnGridLayout -+ << static_cast(0x00) -+ << static_cast(0x00) -+ << static_cast(0x00); -+} -+ -+// ============================================================================ - ---- sc/source/filter/inc/xepivot.hxx.old 2009-04-02 10:44:58.000000000 +0000 -+++ sc/source/filter/inc/xepivot.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -412,6 +412,8 @@ private: - void WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount ) const; - /** Writes the SXEX records containing additional pivot table info. */ - void WriteSxex( XclExpStream& rStrm ) const; -+ /** Writes the SX_AUTOFORMAT records with the autoformat id and header layout */ -+ void WriteSxAutoformat( XclExpStream& rStrm ) const; - - // ------------------------------------------------------------------------ - private: -@@ -422,6 +424,7 @@ private: - const XclExpPivotCache& mrPCache; /// The pivot cache this pivot table bases on. - XclPTInfo maPTInfo; /// Info about the pivot table (SXVIEW record). - XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). -+ XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SXVIEWEX9) - XclExpPTFieldList maFieldList; /// All fields in pivot cache order. - ScfUInt16Vec maRowFields; /// Row field indexes. - ScfUInt16Vec maColFields; /// Column field indexes. ---- sc/source/filter/inc/xipivot.hxx.old 2009-04-02 10:44:58.000000000 +0000 -+++ sc/source/filter/inc/xipivot.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -350,6 +350,9 @@ public: - void ReadSxdi( XclImpStream& rStrm ); - /** Reads an SXEX record containing additional settings for the pivot table. */ - void ReadSxex( XclImpStream& rStrm ); -+ /** Reads an SXVIEWEX9 record that specifies the pivot tables -+ * autoformat. */ -+ void ReadSxViewEx9( XclImpStream& rStrm ); - - // ------------------------------------------------------------------------ - -@@ -364,6 +367,7 @@ private: - - XclPTInfo maPTInfo; /// General info about the pivot table (SXVIEW record). - XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). -+ XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SX_AUTOFORMAT) - XclImpPTFieldVec maFields; /// Vector containing all fields. - XclImpPTFieldRef mxCurrField; /// Current field for importing additional info. - ScfStringVec maVisFieldNames; /// Vector containing all visible field names. -@@ -422,6 +426,9 @@ public: - void ReadSxvi( XclImpStream& rStrm ); - /** Reads an SXEX record containing additional settings for a pivot table. */ - void ReadSxex( XclImpStream& rStrm ); -+ /** Reads an SXVIEWEX9 record that specifies the pivot tables -+ * autoformat. */ -+ void ReadSxViewEx9( XclImpStream& rStrm ); - - // ------------------------------------------------------------------------ - ---- sc/source/filter/inc/xlpivot.hxx.old 2009-04-02 10:44:58.000000000 +0000 -+++ sc/source/filter/inc/xlpivot.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -41,6 +41,7 @@ - #include - #include "ftools.hxx" - #include "xladdress.hxx" -+#include "dpobject.hxx" - - class XclImpStream; - class XclExpStream; -@@ -73,6 +74,10 @@ const sal_uInt16 EXC_PT_MAXDATACOUNT - // pivot table items - const sal_uInt16 EXC_PT_MAXITEMCOUNT = 32500; - -+const sal_uInt16 EXC_PT_AUTOFMT_HEADER = 0x810; -+const sal_uInt16 EXC_PT_AUTOFMT_ZERO = 0; -+const sal_uInt32 EXC_PT_AUTOFMT_FLAGS = 0x20; -+ - /** Data type of a pivot cache item. */ - enum XclPCItemType - { -@@ -396,6 +401,9 @@ const double EXC_SXDBEX_CREATION_DATE - const sal_uInt16 EXC_ID_SXFDBTYPE = 0x01BB; - const sal_uInt16 EXC_SXFDBTYPE_DEFAULT = 0x0000; - -+// (0x0810) SXVIEWEX9 --------------------------------------------------------- -+const sal_uInt16 EXC_ID_SXVIEWEX9 = 0x0810; -+ - // ============================================================================ - // Pivot cache - // ============================================================================ -@@ -786,5 +794,22 @@ XclExpStream& operator<<( XclExpStream& - - // ============================================================================ - -+// Pivot table autoformat settings ============================================== -+ -+/** Pivot table autoformat settings (SX_AUTOFORMAT record). */ -+struct XclPTAutoFormat -+{ -+ sal_uInt32 mbReport; /// 2 for report* fmts ? -+ sal_uInt8 mnAutoFormat; /// AutoFormat ID -+ sal_uInt8 mnGridLayout; /// 0 == gridlayout, 0x10 == modern -+ -+ explicit XclPTAutoFormat(); -+ void Init( const ScDPObject& rDPObj ); -+}; -+ -+XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ); -+XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ); -+ -+// ============================================================================ - #endif - ---- sc/source/filter/xml/XMLExportDataPilot.cxx.old 2009-04-06 16:41:48.000000000 +0000 -+++ sc/source/filter/xml/XMLExportDataPilot.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -781,6 +781,8 @@ void ScXMLExportDataPilot::WriteDataPilo - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_FALSE); - if (!pDPSave->GetDrillDown()) - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE); -+ if ((*pDPs)[i]->GetHeaderLayout ()) -+ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TRUE); - SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True); - rExport.CheckAttrList(); - if ((*pDPs)[i]->IsSheetData()) ---- sc/source/filter/xml/xmldpimp.cxx.old 2009-04-02 10:44:57.000000000 +0000 -+++ sc/source/filter/xml/xmldpimp.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -132,7 +132,8 @@ ScXMLDataPilotTableContext::ScXMLDataPil - bTargetRangeAddress(sal_False), - bSourceCellRange(sal_False), - bShowFilter(sal_True), -- bDrillDown(sal_True) -+ bDrillDown(sal_True), -+ bHeaderGridLayout(sal_False) - { - sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; - const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotTableAttrTokenMap(); -@@ -192,6 +193,11 @@ ScXMLDataPilotTableContext::ScXMLDataPil - bDrillDown = IsXMLToken(sValue, XML_TRUE); - } - break; -+ case XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT : -+ { -+ bHeaderGridLayout = IsXMLToken(sValue, XML_TRUE); -+ } -+ break; - } - } - -@@ -313,6 +319,7 @@ void ScXMLDataPilotTableContext::EndElem - pDPObject->SetName(sDataPilotTableName); - pDPObject->SetTag(sApplicationData); - pDPObject->SetOutRange(aTargetRangeAddress); -+ pDPObject->SetHeaderLayout(bHeaderGridLayout); - switch (nSourceType) - { - case SQL : ---- sc/source/filter/xml/xmldpimp.hxx.old 2009-04-02 10:44:57.000000000 +0000 -+++ sc/source/filter/xml/xmldpimp.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -111,6 +111,7 @@ class ScXMLDataPilotTableContext : publi - sal_Bool bSourceCellRange; - sal_Bool bShowFilter; - sal_Bool bDrillDown; -+ sal_Bool bHeaderGridLayout; - - const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } - ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } ---- sc/source/filter/xml/xmlimprt.cxx.old 2009-04-02 10:44:57.000000000 +0000 -+++ sc/source/filter/xml/xmlimprt.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -1327,6 +1327,7 @@ const SvXMLTokenMap& ScXMLImport::GetDat - { XML_NAMESPACE_TABLE, XML_BUTTONS, XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS }, - { XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON }, - { XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN }, -+ { XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT }, - XML_TOKEN_MAP_END - }; - ---- sc/source/filter/xml/xmlimprt.hxx.old 2009-04-02 10:44:57.000000000 +0000 -+++ sc/source/filter/xml/xmlimprt.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -482,7 +482,8 @@ enum ScXMLDataPilotTableAttrTokens - XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS, - XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS, - XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON, -- XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN -+ XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN, -+ XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT - }; - - enum ScXMLDataPilotTableElemTokens ---- xmloff/inc/xmloff/xmltoken.hxx.old 2009-04-06 16:41:48.000000000 +0000 -+++ xmloff/inc/xmloff/xmltoken.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -2508,6 +2508,7 @@ namespace xmloff { namespace token { - - XML_SHOW_FILTER_BUTTON, - XML_DRILL_DOWN_ON_DOUBLE_CLICK, -+ XML_HEADER_GRID_LAYOUT, - XML_GROUPED_BY, - XML_DAYS, - XML_MONTHS, ---- xmloff/source/core/xmltoken.cxx.old 2009-04-06 16:41:48.000000000 +0000 -+++ xmloff/source/core/xmltoken.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -2513,6 +2513,7 @@ namespace xmloff { namespace token { - - TOKEN( "show-filter-button", XML_SHOW_FILTER_BUTTON ), - TOKEN( "drill-down-on-double-click", XML_DRILL_DOWN_ON_DOUBLE_CLICK ), -+ TOKEN( "header-grid-layout", XML_HEADER_GRID_LAYOUT ), - TOKEN( "grouped-by", XML_GROUPED_BY ), - TOKEN( "days", XML_DAYS ), - TOKEN( "months", XML_MONTHS ), +diff --git sc/source/filter/xml/XMLExportDataPilot.cxx sc/source/filter/xml/XMLExportDataPilot.cxx +index eeecd3b..135a6d1 100644 +--- sc/source/filter/xml/XMLExportDataPilot.cxx ++++ sc/source/filter/xml/XMLExportDataPilot.cxx +@@ -797,6 +797,9 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference GetDrillDown()) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE); ++ if ((*pDPs)[i]->GetHeaderLayout()) ++ rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TRUE); ++ + SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True); + + // grand total elements. +diff --git sc/source/filter/xml/xmldpimp.cxx sc/source/filter/xml/xmldpimp.cxx +index 070fbc2..0d4d467 100644 +--- sc/source/filter/xml/xmldpimp.cxx ++++ sc/source/filter/xml/xmldpimp.cxx +@@ -142,7 +142,8 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, + bTargetRangeAddress(sal_False), + bSourceCellRange(sal_False), + bShowFilter(sal_True), +- bDrillDown(sal_True) ++ bDrillDown(sal_True), ++ bHeaderGridLayout(sal_False) + { + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotTableAttrTokenMap(); +@@ -215,6 +216,11 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, + bDrillDown = IsXMLToken(sValue, XML_TRUE); + } + break; ++ case XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT : ++ { ++ bHeaderGridLayout = IsXMLToken(sValue, XML_TRUE); ++ } ++ break; + } + } + +@@ -392,6 +398,7 @@ void ScXMLDataPilotTableContext::EndElement() + pDPObject->SetName(sDataPilotTableName); + pDPObject->SetTag(sApplicationData); + pDPObject->SetOutRange(aTargetRangeAddress); ++ pDPObject->SetHeaderLayout(bHeaderGridLayout); + switch (nSourceType) + { + case SQL : +diff --git sc/source/filter/xml/xmldpimp.hxx sc/source/filter/xml/xmldpimp.hxx +index b4df6b1..0f604a4 100644 +--- sc/source/filter/xml/xmldpimp.hxx ++++ sc/source/filter/xml/xmldpimp.hxx +@@ -128,6 +128,7 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext + sal_Bool bSourceCellRange; + sal_Bool bShowFilter; + sal_Bool bDrillDown; ++ sal_Bool bHeaderGridLayout; + + const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } + ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } +diff --git sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx +index 7d9e882..bc43180 100644 +--- sc/source/filter/xml/xmlimprt.cxx ++++ sc/source/filter/xml/xmlimprt.cxx +@@ -1328,6 +1328,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableAttrTokenMap() + { XML_NAMESPACE_TABLE, XML_BUTTONS, XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS }, + { XML_NAMESPACE_TABLE, XML_SHOW_FILTER_BUTTON, XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON }, + { XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN }, ++ { XML_NAMESPACE_TABLE, XML_HEADER_GRID_LAYOUT, XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT }, + XML_TOKEN_MAP_END + }; + +diff --git sc/source/filter/xml/xmlimprt.hxx sc/source/filter/xml/xmlimprt.hxx +index 139acf5..1e18bd8 100644 +--- sc/source/filter/xml/xmlimprt.hxx ++++ sc/source/filter/xml/xmlimprt.hxx +@@ -482,7 +482,8 @@ enum ScXMLDataPilotTableAttrTokens + XML_TOK_DATA_PILOT_TABLE_ATTR_TARGET_RANGE_ADDRESS, + XML_TOK_DATA_PILOT_TABLE_ATTR_BUTTONS, + XML_TOK_DATA_PILOT_TABLE_ATTR_SHOW_FILTER_BUTTON, +- XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN ++ XML_TOK_DATA_PILOT_TABLE_ATTR_DRILL_DOWN, ++ XML_TOK_DATA_PILOT_TABLE_ATTR_HEADER_GRID_LAYOUT + }; + + enum ScXMLDataPilotTableElemTokens +diff --git xmloff/inc/xmloff/xmltoken.hxx xmloff/inc/xmloff/xmltoken.hxx +index dacfd53..741a120 100644 +--- xmloff/inc/xmloff/xmltoken.hxx ++++ xmloff/inc/xmloff/xmltoken.hxx +@@ -2507,6 +2507,7 @@ namespace xmloff { namespace token { + + XML_SHOW_FILTER_BUTTON, + XML_DRILL_DOWN_ON_DOUBLE_CLICK, ++ XML_HEADER_GRID_LAYOUT, + XML_GROUPED_BY, + XML_DAYS, + XML_MONTHS, +diff --git xmloff/source/core/xmltoken.cxx xmloff/source/core/xmltoken.cxx +index 0aea4f9..a4a43bb 100644 +--- xmloff/source/core/xmltoken.cxx ++++ xmloff/source/core/xmltoken.cxx +@@ -2512,6 +2512,7 @@ namespace xmloff { namespace token { + + TOKEN( "show-filter-button", XML_SHOW_FILTER_BUTTON ), + TOKEN( "drill-down-on-double-click", XML_DRILL_DOWN_ON_DOUBLE_CLICK ), ++ TOKEN( "header-grid-layout", XML_HEADER_GRID_LAYOUT ), + TOKEN( "grouped-by", XML_GROUPED_BY ), + TOKEN( "days", XML_DAYS ), + TOKEN( "months", XML_MONTHS ), diff --git a/applied_patches/0128-sc-natural-sort.diff b/applied_patches/0128-sc-natural-sort.diff dissimilarity index 61% index 78c1caa76..de2fe8933 100644 --- a/applied_patches/0128-sc-natural-sort.diff +++ b/applied_patches/0128-sc-natural-sort.diff @@ -1,597 +1,611 @@ ---- sc/inc/dbcolect.hxx.old 2009-04-02 10:45:43.000000000 +0000 -+++ sc/inc/dbcolect.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -65,6 +65,7 @@ private: - BOOL bStripData; - // SortParam - BOOL bSortCaseSens; -+ BOOL bSortNaturalSort; - BOOL bIncludePattern; - BOOL bSortInplace; - BOOL bSortUserDef; ---- sc/inc/global.hxx.old 2009-04-06 16:41:48.000000000 +0000 -+++ sc/inc/global.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -828,6 +828,7 @@ struct SC_DLLPUBLIC ScQueryParam - BOOL bByRow; - BOOL bInplace; - BOOL bCaseSens; -+ BOOL bNaturalSort; - BOOL bRegExp; - BOOL bMixedComparison; // whether numbers are smaller than strings - BOOL bDuplicate; ---- sc/inc/sc.hrc.old 2009-04-06 16:41:48.000000000 +0000 -+++ sc/inc/sc.hrc 2009-04-06 16:41:48.000000000 +0000 -@@ -1126,6 +1126,7 @@ - #define SID_SORT_CASESENS (SC_PARAM_START+2) - #define SID_SORT_ATTRIBS (SC_PARAM_START+3) - #define SID_SORT_USERDEF (SC_PARAM_START+4) -+#define SID_SORT_NATURALSORT (SC_PARAM_START+5) - - // Resourcen ------------------------------------------------------------- - ---- sc/inc/sortparam.hxx.old 2009-04-02 10:45:43.000000000 +0000 -+++ sc/inc/sortparam.hxx 2009-04-06 16:41:48.000000000 +0000 -@@ -52,6 +52,7 @@ struct SC_DLLPUBLIC ScSortParam - BOOL bHasHeader; - BOOL bByRow; - BOOL bCaseSens; -+ BOOL bNaturalSort; - BOOL bUserDef; - USHORT nUserIndex; - BOOL bIncludePattern; ---- sc/sdi/scalc.sdi.old 2009-04-06 16:41:48.000000000 +0000 -+++ sc/sdi/scalc.sdi 2009-04-06 16:41:48.000000000 +0000 -@@ -1577,7 +1577,7 @@ SfxVoidItem DataSelect SID_DATA_SELECT - - //-------------------------------------------------------------------------- - SfxVoidItem DataSort SID_SORT --(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6) -+(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem NaturalSort SID_SORT_NATURALSORT,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6) - [ - /* flags: */ - AutoUpdate = FALSE, ---- sc/source/core/data/sortparam.cxx.old 2009-04-02 10:45:01.000000000 +0000 -+++ sc/source/core/data/sortparam.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -50,7 +50,7 @@ ScSortParam::ScSortParam() - - ScSortParam::ScSortParam( const ScSortParam& r ) : - nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2), -- bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens), -+ bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),bNaturalSort(r.bNaturalSort), - bUserDef(r.bUserDef),nUserIndex(r.nUserIndex),bIncludePattern(r.bIncludePattern), - bInplace(r.bInplace), - nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow), -@@ -73,7 +73,7 @@ void ScSortParam::Clear() - nCompatHeader = 2; - nDestTab = 0; - nUserIndex = 0; -- bHasHeader=bCaseSens=bUserDef = FALSE; -+ bHasHeader=bCaseSens=bUserDef=bNaturalSort = FALSE; - bByRow=bIncludePattern=bInplace = TRUE; - aCollatorLocale = ::com::sun::star::lang::Locale(); - aCollatorAlgorithm.Erase(); -@@ -96,6 +96,7 @@ ScSortParam& ScSortParam::operator=( con - nRow2 = r.nRow2; - bHasHeader = r.bHasHeader; - bCaseSens = r.bCaseSens; -+ bNaturalSort = r.bNaturalSort; - bByRow = r.bByRow; - bUserDef = r.bUserDef; - nUserIndex = r.nUserIndex; -@@ -137,6 +138,7 @@ BOOL ScSortParam::operator==( const ScSo - && (bHasHeader == rOther.bHasHeader) - && (bByRow == rOther.bByRow) - && (bCaseSens == rOther.bCaseSens) -+ && (bNaturalSort == rOther.bNaturalSort) - && (bUserDef == rOther.bUserDef) - && (nUserIndex == rOther.nUserIndex) - && (bIncludePattern == rOther.bIncludePattern) ---- sc/source/core/data/table3.cxx.old 2009-04-06 16:41:48.000000000 +0000 -+++ sc/source/core/data/table3.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -64,6 +64,143 @@ - - #include - -+using namespace ::com::sun::star; -+ -+namespace naturalsort { -+ -+using namespace ::com::sun::star::i18n; -+ -+/** Splits a given string into three parts: the prefix, number string, and -+ the suffix. -+ -+ @param sWhole -+ Original string to be split into pieces -+ -+ @param sPrefix -+ Prefix string that consists of the part before the first number token -+ -+ @param sSuffix -+ String after the last number token. This may still contain number strings. -+ -+ @param fNum -+ Number converted from the middle number string -+ -+ @return Returns TRUE if a numeral element is found in a given string, or -+ FALSE if no numeral element is found. -+*/ -+BOOL SplitString( const rtl::OUString &sWhole, -+ rtl::OUString &sPrefix, rtl::OUString &sSuffix, double &fNum ) -+{ -+ i18n::LocaleDataItem aLocaleItem = ScGlobal::pLocaleData->getLocaleItem(); -+ -+ // Get prefix element -+ rtl::OUString sEmpty, sUser = rtl::OUString::createFromAscii( "-" ); -+ ParseResult aPRPre = ScGlobal::pCharClass->parsePredefinedToken( -+ KParseType::IDENTNAME, sWhole, 0, -+ KParseTokens::ANY_LETTER, sUser, KParseTokens::ANY_LETTER, sUser ); -+ sPrefix = sWhole.copy( 0, aPRPre.EndPos ); -+ -+ // Return FALSE if no numeral element is found -+ if ( aPRPre.EndPos == sWhole.getLength() ) -+ return FALSE; -+ -+ // Get numeral element -+ sUser = aLocaleItem.decimalSeparator; -+ ParseResult aPRNum = ScGlobal::pCharClass->parsePredefinedToken( -+ KParseType::ANY_NUMBER, sWhole, aPRPre.EndPos, -+ KParseTokens::ANY_NUMBER, sEmpty, KParseTokens::ANY_NUMBER, sUser ); -+ -+ if ( aPRNum.EndPos == aPRPre.EndPos ) -+ return FALSE; -+ -+ fNum = aPRNum.Value; -+ sSuffix = sWhole.copy( aPRNum.EndPos ); -+ -+ return TRUE; -+} -+ -+/** Naturally compares two given strings. -+ -+ This is the main function that should be called externally. It returns -+ either 1, 0, or -1 depending on the comparison result of given two strings. -+ -+ @param sInput1 -+ Input string 1 -+ -+ @param sInput2 -+ Input string 2 -+ -+ @param bCaseSens -+ Boolean value for case sensitivity -+ -+ @param pData -+ Pointer to user defined sort list -+ -+ @param pCW -+ Pointer to collator wrapper for normal string comparison -+ -+ @return Returnes 1 if sInput1 is greater, 0 if sInput1 == sInput2, and -1 if -+ sInput2 is greater. -+*/ -+short Compare( const String &sInput1, const String &sInput2, -+ const BOOL bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW ) -+{ -+ rtl::OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2; -+ -+ do -+ { -+ double nNum1, nNum2; -+ BOOL bNumFound1 = SplitString( sStr1, sPre1, sSuf1, nNum1 ); -+ BOOL bNumFound2 = SplitString( sStr2, sPre2, sSuf2, nNum2 ); -+ -+ short nPreRes; // Prefix comparison result -+ if ( pData ) -+ { -+ if ( bCaseSens ) -+ { -+ if ( !bNumFound1 || !bNumFound2 ) -+ return static_cast(pData->Compare( sStr1, sStr2 )); -+ else -+ nPreRes = pData->Compare( sPre1, sPre2 ); -+ } -+ else -+ { -+ if ( !bNumFound1 || !bNumFound2 ) -+ return static_cast(pData->ICompare( sStr1, sStr2 )); -+ else -+ nPreRes = pData->ICompare( sPre1, sPre2 ); -+ } -+ } -+ else -+ { -+ if ( !bNumFound1 || !bNumFound2 ) -+ return static_cast(pCW->compareString( sStr1, sStr2 )); -+ else -+ nPreRes = static_cast(pCW->compareString( sPre1, sPre2 )); -+ } -+ -+ // Prefix strings differ. Return immediately. -+ if ( nPreRes != 0 ) return nPreRes; -+ -+ if ( nNum1 != nNum2 ) -+ { -+ if ( nNum1 < nNum2 ) return -1; -+ return static_cast( nNum1 > nNum2 ); -+ } -+ -+ // The prefix and the first numerical elements are equal, but the suffix -+ // strings may still differ. Stay in the loop. -+ -+ sStr1 = sSuf1; -+ sStr2 = sSuf2; -+ -+ } while ( true ); -+ -+ return 0; -+} -+ -+} -+ - // STATIC DATA ----------------------------------------------------------- - - const USHORT nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam -@@ -285,25 +422,40 @@ short ScTable::CompareCell( USHORT nSort - ((ScStringCell*)pCell2)->GetString(aStr2); - else - GetString(nCell2Col, nCell2Row, aStr2); -- BOOL bUserDef = aSortParam.bUserDef; -+ -+ BOOL bUserDef = aSortParam.bUserDef; // custom sort order -+ BOOL bNaturalSort = aSortParam.bNaturalSort; // natural sort -+ BOOL bCaseSens = aSortParam.bCaseSens; // case sensitivity -+ - if (bUserDef) - { - ScUserListData* pData = -- (ScUserListData*)(ScGlobal::GetUserList()->At( -- aSortParam.nUserIndex)); -+ static_cast( (ScGlobal::GetUserList()->At( -+ aSortParam.nUserIndex)) ); -+ - if (pData) - { -- if ( aSortParam.bCaseSens ) -- nRes = sal::static_int_cast( pData->Compare(aStr1, aStr2) ); -+ if ( bNaturalSort ) -+ nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, pData, pSortCollator ); - else -- nRes = sal::static_int_cast( pData->ICompare(aStr1, aStr2) ); -+ { -+ if ( bCaseSens ) -+ nRes = sal::static_int_cast( pData->Compare(aStr1, aStr2) ); -+ else -+ nRes = sal::static_int_cast( pData->ICompare(aStr1, aStr2) ); -+ } - } - else - bUserDef = FALSE; - - } - if (!bUserDef) -- nRes = (short) pSortCollator->compareString( aStr1, aStr2 ); -+ { -+ if ( bNaturalSort ) -+ nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, NULL, pSortCollator ); -+ else -+ nRes = static_cast( pSortCollator->compareString( aStr1, aStr2 ) ); -+ } - } - else if ( bStr1 ) // String <-> Zahl - nRes = 1; // Zahl vorne ---- sc/source/core/tool/dbcolect.cxx.old 2009-04-02 10:45:03.000000000 +0000 -+++ sc/source/core/tool/dbcolect.cxx 2009-04-06 16:41:48.000000000 +0000 -@@ -104,6 +104,7 @@ ScDBData::ScDBData( const ScDBData& rDat - bKeepFmt (rData.bKeepFmt), - bStripData (rData.bStripData), - bSortCaseSens (rData.bSortCaseSens), -+ bSortNaturalSort (rData.bSortNaturalSort), - bIncludePattern (rData.bIncludePattern), - bSortInplace (rData.bSortInplace), - bSortUserDef (rData.bSortUserDef), -@@ -197,6 +198,7 @@ ScDBData& ScDBData::operator= (const ScD - bKeepFmt = rData.bKeepFmt; - bStripData = rData.bStripData; - bSortCaseSens = rData.bSortCaseSens; -+ bSortNaturalSort = rData.bSortNaturalSort; - bIncludePattern = rData.bIncludePattern; - bSortInplace = rData.bSortInplace; - nSortDestTab = rData.nSortDestTab; -@@ -448,6 +450,7 @@ void ScDBData::GetSortParam( ScSortParam - rSortParam.bByRow = bByRow; - rSortParam.bHasHeader = bHasHeader; - rSortParam.bCaseSens = bSortCaseSens; -+ rSortParam.bNaturalSort = bSortNaturalSort; - rSortParam.bInplace = bSortInplace; - rSortParam.nDestTab = nSortDestTab; - rSortParam.nDestCol = nSortDestCol; -@@ -468,6 +471,7 @@ void ScDBData::GetSortParam( ScSortParam - void ScDBData::SetSortParam( const ScSortParam& rSortParam ) - { - bSortCaseSens = rSortParam.bCaseSens; -+ bSortNaturalSort = rSortParam.bNaturalSort; - bIncludePattern = rSortParam.bIncludePattern; - bSortInplace = rSortParam.bInplace; - nSortDestTab = rSortParam.nDestTab; ---- sc/source/ui/dbgui/tpsort.cxx -+++ sc/source/ui/dbgui/tpsort.cxx -@@ -555,6 +555,7 @@ ScTabPageSortOptions::ScTabPageSortOptio - aBtnHeader ( this, ScResId( BTN_LABEL ) ), - aBtnFormats ( this, ScResId( BTN_FORMATS ) ), - aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ), -+ aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ), - aLbOutPos ( this, ScResId( LB_OUTAREA ) ), - aEdOutPos ( this, ScResId( ED_OUTAREA ) ), - aBtnSortUser ( this, ScResId( BTN_SORT_USER ) ), -@@ -566,7 +567,7 @@ ScTabPageSortOptions::ScTabPageSortOptio - aLineDirection ( this, ScResId( FL_DIRECTION ) ), - aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ), - aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ), -- aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), -+// aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), - // aFtArea ( this, ScResId( FT_AREA ) ), - // - #if ENABLE_LAYOUT_EXPERIMENTAL -@@ -605,8 +606,8 @@ __EXPORT ScTabPageSortOptions::~ScTabPag - - void ScTabPageSortOptions::Init() - { -- aStrAreaLabel = aFtAreaLabel.GetText(); -- aStrAreaLabel.Append( (sal_Unicode) ' ' ); -+// aStrAreaLabel = aFtAreaLabel.GetText(); -+// aStrAreaLabel.Append( (sal_Unicode) ' ' ); - - // CollatorRessource has user-visible names for sort algorithms - pColRes = new CollatorRessource(); -@@ -685,8 +686,8 @@ void ScTabPageSortOptions::Init() - theArea += ')'; - - //aFtArea.SetText( theArea ); -- theArea.Insert( aStrAreaLabel, 0 ); -- aFtAreaLabel.SetText( theArea ); -+ //theArea.Insert( aStrAreaLabel, 0 ); -+ //aFtAreaLabel.SetText( theArea ); - - aBtnHeader.SetText( aStrColLabel ); - } -@@ -732,9 +733,10 @@ void __EXPORT ScTabPageSortOptions::Rese - aLbSortUser.SelectEntryPos( 0 ); - } - -- aBtnCase.Check ( rSortData.bCaseSens ); -- aBtnFormats.Check ( rSortData.bIncludePattern ); -- aBtnHeader.Check ( rSortData.bHasHeader ); -+ aBtnCase.Check ( rSortData.bCaseSens ); -+ aBtnFormats.Check ( rSortData.bIncludePattern ); -+ aBtnHeader.Check ( rSortData.bHasHeader ); -+ aBtnNaturalSort.Check ( rSortData.bNaturalSort ); - - if ( rSortData.bByRow ) - { -@@ -800,6 +802,7 @@ BOOL __EXPORT ScTabPageSortOptions::Fill - theSortData.bByRow = aBtnTopDown.IsChecked(); - theSortData.bHasHeader = aBtnHeader.IsChecked(); - theSortData.bCaseSens = aBtnCase.IsChecked(); -+ theSortData.bNaturalSort = aBtnNaturalSort.IsChecked(); - theSortData.bIncludePattern = aBtnFormats.IsChecked(); - theSortData.bInplace = !aBtnCopyResult.IsChecked(); - theSortData.nDestCol = theOutPos.Col(); ---- sc/source/ui/inc/sortdlg.hrc -+++ sc/source/ui/inc/sortdlg.hrc -@@ -64,7 +64,7 @@ - #define LB_SORT_USER 2 - #define LB_OUTAREA 3 - #define ED_OUTAREA 4 --#define FT_AREA_LABEL 5 -+//#define FT_AREA_LABEL 5 - //#define FT_AREA 6 - #define BTN_SORT_USER 7 - #define BTN_CASESENSITIVE 8 -@@ -79,6 +79,7 @@ - #define LB_LANGUAGE 17 - #define FT_ALGORITHM 18 - #define LB_ALGORITHM 19 -+#define BTN_NATURALSORT 20 - - //#define RID_SCDLG_SORT_WARNING - #define FT_TEXT 1 ---- sc/source/ui/inc/tpsort.hxx -+++ sc/source/ui/inc/tpsort.hxx -@@ -53,7 +53,7 @@ class ScSortDlg; - struct ScSortParam; - - //======================================================================== --// Kriterien -+// Kriterien (Sort Criteria) - - class ScTabPageSortFields : public SfxTabPage - { -@@ -125,7 +125,7 @@ private: - }; - - //======================================================================== --// Sortieroptionen: -+// Sortieroptionen (Sort Options) - - class ScDocument; - class ScRangeData; -@@ -158,6 +158,7 @@ private: - CheckBox aBtnCase; - CheckBox aBtnHeader; - CheckBox aBtnFormats; -+ CheckBox aBtnNaturalSort; - - CheckBox aBtnCopyResult; - ListBox aLbOutPos; -@@ -175,7 +176,7 @@ private: - RadioButton aBtnTopDown; - RadioButton aBtnLeftRight; - -- FixedText aFtAreaLabel; -+// FixedText aFtAreaLabel; - // FixedInfo aFtArea; - LocalizedString aStrRowLabel; - LocalizedString aStrColLabel; ---- sc/source/ui/src/sortdlg.src.old 2009-04-02 10:45:23.000000000 +0000 -+++ sc/source/ui/src/sortdlg.src 2009-04-06 16:41:48.000000000 +0000 -@@ -154,9 +154,20 @@ TabPage RID_SCPAGE_SORT_OPTIONS - Text [ en-US ] = "Include ~formats" ; - TabStop = TRUE ; - }; -+ CheckBox BTN_NATURALSORT -+ { -+ Pos = MAP_APPFONT ( 12 , 48 ) ; -+ Size = MAP_APPFONT ( 242 , 10 ) ; -+ Text [ de ] = "Enable ~natural sort" ; -+ Text [ en-US ] = "Enable ~natural sort" ; -+ Text [ cs ] = "Aktivovat přirozené třídění" ; -+ Text [ sk ] = "Aktivovať prirodzené triedenie" ; -+ TabStop = TRUE ; -+ Text [ x-comment ] = " " ; -+ }; - CheckBox BTN_COPYRESULT - { -- Pos = MAP_APPFONT ( 12 , 48 ) ; -+ Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "~Copy sort results to:" ; - TabStop = TRUE ; -@@ -164,7 +175,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS - ListBox LB_OUTAREA - { - Border = TRUE ; -- Pos = MAP_APPFONT ( 20 , 59 ) ; -+ Pos = MAP_APPFONT ( 20 , 73 ) ; - Size = MAP_APPFONT ( 93 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; -@@ -173,13 +184,13 @@ TabPage RID_SCPAGE_SORT_OPTIONS - { - Disable = TRUE ; - Border = TRUE ; -- Pos = MAP_APPFONT ( 119 , 59 ) ; -+ Pos = MAP_APPFONT ( 119 , 73 ) ; - Size = MAP_APPFONT ( 132 , 12 ) ; - TabStop = TRUE ; - }; - CheckBox BTN_SORT_USER - { -- Pos = MAP_APPFONT ( 12 , 75 ) ; -+ Pos = MAP_APPFONT ( 12 , 89 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "Custom sort ~order" ; - TabStop = TRUE ; -@@ -188,21 +199,21 @@ TabPage RID_SCPAGE_SORT_OPTIONS - { - Disable = TRUE ; - Border = TRUE ; -- Pos = MAP_APPFONT ( 20 , 86 ) ; -+ Pos = MAP_APPFONT ( 20 , 100 ) ; - Size = MAP_APPFONT ( 231 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_LANGUAGE - { -- Pos = MAP_APPFONT ( 12 , 104 ) ; -+ Pos = MAP_APPFONT ( 12 , 118 ) ; - Size = MAP_APPFONT ( 101 , 8 ) ; - Text [ en-US ] = "~Language"; - }; - ListBox LB_LANGUAGE - { - Border = TRUE ; -- Pos = MAP_APPFONT ( 12 , 115 ) ; -+ Pos = MAP_APPFONT ( 12 , 129 ) ; - Size = MAP_APPFONT ( 101 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; -@@ -210,44 +221,46 @@ TabPage RID_SCPAGE_SORT_OPTIONS - }; - FixedText FT_ALGORITHM - { -- Pos = MAP_APPFONT ( 119 , 104 ) ; -+ Pos = MAP_APPFONT ( 119 , 118 ) ; - Size = MAP_APPFONT ( 132 , 8 ) ; - Text [ en-US ] = "O~ptions"; - }; - ListBox LB_ALGORITHM - { - Border = TRUE ; -- Pos = MAP_APPFONT ( 119 , 115 ) ; -+ Pos = MAP_APPFONT ( 119 , 129 ) ; - Size = MAP_APPFONT ( 132 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedLine FL_DIRECTION - { -- Pos = MAP_APPFONT ( 6 , 133 ) ; -+ Pos = MAP_APPFONT ( 6 , 147 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Direction" ; - }; - RadioButton BTN_TOP_DOWN - { -- Pos = MAP_APPFONT ( 12 , 144 ) ; -+ Pos = MAP_APPFONT ( 12 , 158 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "~Top to bottom (sort rows)" ; - TabStop = TRUE ; - }; - RadioButton BTN_LEFT_RIGHT - { -- Pos = MAP_APPFONT ( 12 , 158 ) ; -+ Pos = MAP_APPFONT ( 12 , 172 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "L~eft to right (sort columns)" ; - TabStop = TRUE ; - }; -+/* - FixedText FT_AREA_LABEL - { - Pos = MAP_APPFONT ( 6 , 171 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Data area:" ; - }; -+*/ - }; - TabDialog RID_SCDLG_SORT - { ---- sc/source/ui/view/cellsh2.cxx -+++ sc/source/ui/view/cellsh2.cxx -@@ -366,6 +366,7 @@ void ScCellShell::ExecuteDB( SfxRequest& - aSortParam.bHasHeader = bHasHeader; - aSortParam.bByRow = TRUE; - aSortParam.bCaseSens = FALSE; -+ aSortParam.bNaturalSort = FALSE; - aSortParam.bIncludePattern = TRUE; - aSortParam.bInplace = TRUE; - aSortParam.bDoSort[0] = TRUE; -@@ -401,6 +402,8 @@ void ScCellShell::ExecuteDB( SfxRequest& - aSortParam.bHasHeader = ((const SfxBoolItem*)pItem)->GetValue(); - if ( pArgs->GetItemState( SID_SORT_CASESENS, TRUE, &pItem ) == SFX_ITEM_SET ) - aSortParam.bCaseSens = ((const SfxBoolItem*)pItem)->GetValue(); -+ if ( pArgs->GetItemState( SID_SORT_NATURALSORT, TRUE, &pItem ) == SFX_ITEM_SET ) -+ aSortParam.bNaturalSort = ((const SfxBoolItem*)pItem)->GetValue(); - if ( pArgs->GetItemState( SID_SORT_ATTRIBS, TRUE, &pItem ) == SFX_ITEM_SET ) - aSortParam.bIncludePattern = ((const SfxBoolItem*)pItem)->GetValue(); - if ( pArgs->GetItemState( SID_SORT_USERDEF, TRUE, &pItem ) == SFX_ITEM_SET ) -@@ -454,7 +457,7 @@ void ScCellShell::ExecuteDB( SfxRequest& - - pDlg = pFact->CreateScSortDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SORT ); - DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001 -- pDlg->SetCurPageId(1); -+ pDlg->SetCurPageId(1); // 1=sort field tab 2=sort options tab - - if ( pDlg->Execute() == RET_OK ) - { -@@ -473,6 +476,8 @@ void ScCellShell::ExecuteDB( SfxRequest& - rOutParam.bHasHeader ) ); - rReq.AppendItem( SfxBoolItem( SID_SORT_CASESENS, - rOutParam.bCaseSens ) ); -+ rReq.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT, -+ rOutParam.bNaturalSort ) ); - rReq.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, - rOutParam.bIncludePattern ) ); - USHORT nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0; +diff --git sc/inc/dbcolect.hxx sc/inc/dbcolect.hxx +index 543904e..48d314e 100644 +--- sc/inc/dbcolect.hxx ++++ sc/inc/dbcolect.hxx +@@ -63,6 +63,7 @@ private: + BOOL bStripData; + // SortParam + BOOL bSortCaseSens; ++ BOOL bSortNaturalSort; + BOOL bIncludePattern; + BOOL bSortInplace; + BOOL bSortUserDef; +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index 33d0240..85621ce 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -1127,6 +1127,7 @@ + #define SID_SORT_CASESENS (SC_PARAM_START+2) + #define SID_SORT_ATTRIBS (SC_PARAM_START+3) + #define SID_SORT_USERDEF (SC_PARAM_START+4) ++#define SID_SORT_NATURALSORT (SC_PARAM_START+5) + + // Resourcen ------------------------------------------------------------- + +diff --git sc/inc/sortparam.hxx sc/inc/sortparam.hxx +index 7ef0a80..bc0f863 100644 +--- sc/inc/sortparam.hxx ++++ sc/inc/sortparam.hxx +@@ -52,6 +52,7 @@ struct SC_DLLPUBLIC ScSortParam + BOOL bHasHeader; + BOOL bByRow; + BOOL bCaseSens; ++ BOOL bNaturalSort; + BOOL bUserDef; + USHORT nUserIndex; + BOOL bIncludePattern; +diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi +index ad21670..0687d1f 100644 +--- sc/sdi/scalc.sdi ++++ sc/sdi/scalc.sdi +@@ -1577,7 +1577,7 @@ SfxVoidItem DataSelect SID_DATA_SELECT + + //-------------------------------------------------------------------------- + SfxVoidItem DataSort SID_SORT +-(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6) ++(SfxBoolItem ByRows SID_SORT_BYROW,SfxBoolItem HasHeader SID_SORT_HASHEADER,SfxBoolItem CaseSensitive SID_SORT_CASESENS,SfxBoolItem NaturalSort SID_SORT_NATURALSORT,SfxBoolItem IncludeAttribs SID_SORT_ATTRIBS,SfxUInt16Item UserDefIndex SID_SORT_USERDEF,SfxInt32Item Col1 FN_PARAM_1,SfxBoolItem Ascending1 FN_PARAM_2,SfxInt32Item Col2 FN_PARAM_3,SfxBoolItem Ascending2 FN_PARAM_4,SfxInt32Item Col3 FN_PARAM_5,SfxBoolItem Ascending3 FN_PARAM_6) + [ + /* flags: */ + AutoUpdate = FALSE, +diff --git sc/source/core/data/sortparam.cxx sc/source/core/data/sortparam.cxx +index dfab465..332772e 100644 +--- sc/source/core/data/sortparam.cxx ++++ sc/source/core/data/sortparam.cxx +@@ -51,7 +51,7 @@ ScSortParam::ScSortParam() + + ScSortParam::ScSortParam( const ScSortParam& r ) : + nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2), +- bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens), ++ bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),bNaturalSort(r.bNaturalSort), + bUserDef(r.bUserDef),nUserIndex(r.nUserIndex),bIncludePattern(r.bIncludePattern), + bInplace(r.bInplace), + nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow), +@@ -74,7 +74,7 @@ void ScSortParam::Clear() + nCompatHeader = 2; + nDestTab = 0; + nUserIndex = 0; +- bHasHeader=bCaseSens=bUserDef = FALSE; ++ bHasHeader=bCaseSens=bUserDef=bNaturalSort = FALSE; + bByRow=bIncludePattern=bInplace = TRUE; + aCollatorLocale = ::com::sun::star::lang::Locale(); + aCollatorAlgorithm.Erase(); +@@ -97,6 +97,7 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r ) + nRow2 = r.nRow2; + bHasHeader = r.bHasHeader; + bCaseSens = r.bCaseSens; ++ bNaturalSort = r.bNaturalSort; + bByRow = r.bByRow; + bUserDef = r.bUserDef; + nUserIndex = r.nUserIndex; +@@ -138,6 +139,7 @@ BOOL ScSortParam::operator==( const ScSortParam& rOther ) const + && (bHasHeader == rOther.bHasHeader) + && (bByRow == rOther.bByRow) + && (bCaseSens == rOther.bCaseSens) ++ && (bNaturalSort == rOther.bNaturalSort) + && (bUserDef == rOther.bUserDef) + && (nUserIndex == rOther.nUserIndex) + && (bIncludePattern == rOther.bIncludePattern) +diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx +index 2d8f0d3..390f6b1 100644 +--- sc/source/core/data/table3.cxx ++++ sc/source/core/data/table3.cxx +@@ -64,6 +64,143 @@ + + #include + ++using namespace ::com::sun::star; ++ ++namespace naturalsort { ++ ++using namespace ::com::sun::star::i18n; ++ ++/** Splits a given string into three parts: the prefix, number string, and ++ the suffix. ++ ++ @param sWhole ++ Original string to be split into pieces ++ ++ @param sPrefix ++ Prefix string that consists of the part before the first number token ++ ++ @param sSuffix ++ String after the last number token. This may still contain number strings. ++ ++ @param fNum ++ Number converted from the middle number string ++ ++ @return Returns TRUE if a numeral element is found in a given string, or ++ FALSE if no numeral element is found. ++*/ ++bool SplitString( const rtl::OUString &sWhole, ++ rtl::OUString &sPrefix, rtl::OUString &sSuffix, double &fNum ) ++{ ++ i18n::LocaleDataItem aLocaleItem = ScGlobal::pLocaleData->getLocaleItem(); ++ ++ // Get prefix element ++ rtl::OUString sEmpty, sUser = rtl::OUString::createFromAscii( "-" ); ++ ParseResult aPRPre = ScGlobal::pCharClass->parsePredefinedToken( ++ KParseType::IDENTNAME, sWhole, 0, ++ KParseTokens::ANY_LETTER, sUser, KParseTokens::ANY_LETTER, sUser ); ++ sPrefix = sWhole.copy( 0, aPRPre.EndPos ); ++ ++ // Return FALSE if no numeral element is found ++ if ( aPRPre.EndPos == sWhole.getLength() ) ++ return false; ++ ++ // Get numeral element ++ sUser = aLocaleItem.decimalSeparator; ++ ParseResult aPRNum = ScGlobal::pCharClass->parsePredefinedToken( ++ KParseType::ANY_NUMBER, sWhole, aPRPre.EndPos, ++ KParseTokens::ANY_NUMBER, sEmpty, KParseTokens::ANY_NUMBER, sUser ); ++ ++ if ( aPRNum.EndPos == aPRPre.EndPos ) ++ return false; ++ ++ fNum = aPRNum.Value; ++ sSuffix = sWhole.copy( aPRNum.EndPos ); ++ ++ return true; ++} ++ ++/** Naturally compares two given strings. ++ ++ This is the main function that should be called externally. It returns ++ either 1, 0, or -1 depending on the comparison result of given two strings. ++ ++ @param sInput1 ++ Input string 1 ++ ++ @param sInput2 ++ Input string 2 ++ ++ @param bCaseSens ++ Boolean value for case sensitivity ++ ++ @param pData ++ Pointer to user defined sort list ++ ++ @param pCW ++ Pointer to collator wrapper for normal string comparison ++ ++ @return Returnes 1 if sInput1 is greater, 0 if sInput1 == sInput2, and -1 if ++ sInput2 is greater. ++*/ ++short Compare( const String &sInput1, const String &sInput2, ++ const BOOL bCaseSens, const ScUserListData* pData, const CollatorWrapper *pCW ) ++{ ++ rtl::OUString sStr1( sInput1 ), sStr2( sInput2 ), sPre1, sSuf1, sPre2, sSuf2; ++ ++ do ++ { ++ double nNum1, nNum2; ++ BOOL bNumFound1 = SplitString( sStr1, sPre1, sSuf1, nNum1 ); ++ BOOL bNumFound2 = SplitString( sStr2, sPre2, sSuf2, nNum2 ); ++ ++ short nPreRes; // Prefix comparison result ++ if ( pData ) ++ { ++ if ( bCaseSens ) ++ { ++ if ( !bNumFound1 || !bNumFound2 ) ++ return static_cast(pData->Compare( sStr1, sStr2 )); ++ else ++ nPreRes = pData->Compare( sPre1, sPre2 ); ++ } ++ else ++ { ++ if ( !bNumFound1 || !bNumFound2 ) ++ return static_cast(pData->ICompare( sStr1, sStr2 )); ++ else ++ nPreRes = pData->ICompare( sPre1, sPre2 ); ++ } ++ } ++ else ++ { ++ if ( !bNumFound1 || !bNumFound2 ) ++ return static_cast(pCW->compareString( sStr1, sStr2 )); ++ else ++ nPreRes = static_cast(pCW->compareString( sPre1, sPre2 )); ++ } ++ ++ // Prefix strings differ. Return immediately. ++ if ( nPreRes != 0 ) return nPreRes; ++ ++ if ( nNum1 != nNum2 ) ++ { ++ if ( nNum1 < nNum2 ) return -1; ++ return static_cast( nNum1 > nNum2 ); ++ } ++ ++ // The prefix and the first numerical elements are equal, but the suffix ++ // strings may still differ. Stay in the loop. ++ ++ sStr1 = sSuf1; ++ sStr2 = sSuf2; ++ ++ } while (true); ++ ++ return 0; ++} ++ ++} ++ + // STATIC DATA ----------------------------------------------------------- + + const USHORT nMaxSorts = 3; // maximale Anzahl Sortierkriterien in aSortParam +@@ -285,25 +422,40 @@ short ScTable::CompareCell( USHORT nSort, + ((ScStringCell*)pCell2)->GetString(aStr2); + else + GetString(nCell2Col, nCell2Row, aStr2); +- BOOL bUserDef = aSortParam.bUserDef; ++ ++ BOOL bUserDef = aSortParam.bUserDef; // custom sort order ++ BOOL bNaturalSort = aSortParam.bNaturalSort; // natural sort ++ BOOL bCaseSens = aSortParam.bCaseSens; // case sensitivity ++ + if (bUserDef) + { + ScUserListData* pData = +- (ScUserListData*)(ScGlobal::GetUserList()->At( +- aSortParam.nUserIndex)); ++ static_cast( (ScGlobal::GetUserList()->At( ++ aSortParam.nUserIndex)) ); ++ + if (pData) + { +- if ( aSortParam.bCaseSens ) +- nRes = sal::static_int_cast( pData->Compare(aStr1, aStr2) ); ++ if ( bNaturalSort ) ++ nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, pData, pSortCollator ); + else +- nRes = sal::static_int_cast( pData->ICompare(aStr1, aStr2) ); ++ { ++ if ( bCaseSens ) ++ nRes = sal::static_int_cast( pData->Compare(aStr1, aStr2) ); ++ else ++ nRes = sal::static_int_cast( pData->ICompare(aStr1, aStr2) ); ++ } + } + else + bUserDef = FALSE; + + } + if (!bUserDef) +- nRes = (short) pSortCollator->compareString( aStr1, aStr2 ); ++ { ++ if ( bNaturalSort ) ++ nRes = naturalsort::Compare( aStr1, aStr2, bCaseSens, NULL, pSortCollator ); ++ else ++ nRes = static_cast( pSortCollator->compareString( aStr1, aStr2 ) ); ++ } + } + else if ( bStr1 ) // String <-> Zahl + nRes = 1; // Zahl vorne +diff --git sc/source/core/tool/dbcolect.cxx sc/source/core/tool/dbcolect.cxx +index a47a669..22642f4 100644 +--- sc/source/core/tool/dbcolect.cxx ++++ sc/source/core/tool/dbcolect.cxx +@@ -105,6 +105,7 @@ ScDBData::ScDBData( const ScDBData& rData ) : + bKeepFmt (rData.bKeepFmt), + bStripData (rData.bStripData), + bSortCaseSens (rData.bSortCaseSens), ++ bSortNaturalSort (rData.bSortNaturalSort), + bIncludePattern (rData.bIncludePattern), + bSortInplace (rData.bSortInplace), + bSortUserDef (rData.bSortUserDef), +@@ -198,6 +199,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData) + bKeepFmt = rData.bKeepFmt; + bStripData = rData.bStripData; + bSortCaseSens = rData.bSortCaseSens; ++ bSortNaturalSort = rData.bSortNaturalSort; + bIncludePattern = rData.bIncludePattern; + bSortInplace = rData.bSortInplace; + nSortDestTab = rData.nSortDestTab; +@@ -449,6 +451,7 @@ void ScDBData::GetSortParam( ScSortParam& rSortParam ) const + rSortParam.bByRow = bByRow; + rSortParam.bHasHeader = bHasHeader; + rSortParam.bCaseSens = bSortCaseSens; ++ rSortParam.bNaturalSort = bSortNaturalSort; + rSortParam.bInplace = bSortInplace; + rSortParam.nDestTab = nSortDestTab; + rSortParam.nDestCol = nSortDestCol; +@@ -469,6 +472,7 @@ void ScDBData::GetSortParam( ScSortParam& rSortParam ) const + void ScDBData::SetSortParam( const ScSortParam& rSortParam ) + { + bSortCaseSens = rSortParam.bCaseSens; ++ bSortNaturalSort = rSortParam.bNaturalSort; + bIncludePattern = rSortParam.bIncludePattern; + bSortInplace = rSortParam.bInplace; + nSortDestTab = rSortParam.nDestTab; +diff --git sc/source/ui/dbgui/tpsort.cxx sc/source/ui/dbgui/tpsort.cxx +index 5219593..d06627a 100644 +--- sc/source/ui/dbgui/tpsort.cxx ++++ sc/source/ui/dbgui/tpsort.cxx +@@ -567,6 +567,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, + aBtnHeader ( this, ScResId( BTN_LABEL ) ), + aBtnFormats ( this, ScResId( BTN_FORMATS ) ), + aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ), ++ aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ), + aLbOutPos ( this, ScResId( LB_OUTAREA ) ), + aEdOutPos ( this, ScResId( ED_OUTAREA ) ), + aBtnSortUser ( this, ScResId( BTN_SORT_USER ) ), +@@ -578,7 +579,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, + aLineDirection ( this, ScResId( FL_DIRECTION ) ), + aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ), + aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ), +- aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), ++// aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), + // aFtArea ( this, ScResId( FT_AREA ) ), + // + #if ENABLE_LAYOUT_EXPERIMENTAL +@@ -622,8 +623,8 @@ __EXPORT ScTabPageSortOptions::~ScTabPageSortOptions() + + void ScTabPageSortOptions::Init() + { +- aStrAreaLabel = aFtAreaLabel.GetText(); +- aStrAreaLabel.Append( (sal_Unicode) ' ' ); ++// aStrAreaLabel = aFtAreaLabel.GetText(); ++// aStrAreaLabel.Append( (sal_Unicode) ' ' ); + + // CollatorRessource has user-visible names for sort algorithms + pColRes = new CollatorRessource(); +@@ -702,8 +703,8 @@ void ScTabPageSortOptions::Init() + theArea += ')'; + + //aFtArea.SetText( theArea ); +- theArea.Insert( aStrAreaLabel, 0 ); +- aFtAreaLabel.SetText( theArea ); ++ //theArea.Insert( aStrAreaLabel, 0 ); ++ //aFtAreaLabel.SetText( theArea ); + + aBtnHeader.SetText( aStrColLabel ); + } +@@ -752,9 +753,10 @@ void __EXPORT ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) + aLbSortUser.SelectEntryPos( 0 ); + } + +- aBtnCase.Check ( rSortData.bCaseSens ); +- aBtnFormats.Check ( rSortData.bIncludePattern ); +- aBtnHeader.Check ( rSortData.bHasHeader ); ++ aBtnCase.Check ( rSortData.bCaseSens ); ++ aBtnFormats.Check ( rSortData.bIncludePattern ); ++ aBtnHeader.Check ( rSortData.bHasHeader ); ++ aBtnNaturalSort.Check ( rSortData.bNaturalSort ); + + if ( rSortData.bByRow ) + { +@@ -820,6 +822,7 @@ BOOL __EXPORT ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) + theSortData.bByRow = aBtnTopDown.IsChecked(); + theSortData.bHasHeader = aBtnHeader.IsChecked(); + theSortData.bCaseSens = aBtnCase.IsChecked(); ++ theSortData.bNaturalSort = aBtnNaturalSort.IsChecked(); + theSortData.bIncludePattern = aBtnFormats.IsChecked(); + theSortData.bInplace = !aBtnCopyResult.IsChecked(); + theSortData.nDestCol = theOutPos.Col(); +diff --git sc/source/ui/inc/sortdlg.hrc sc/source/ui/inc/sortdlg.hrc +index f67927c..8d08628 100644 +--- sc/source/ui/inc/sortdlg.hrc ++++ sc/source/ui/inc/sortdlg.hrc +@@ -66,7 +66,7 @@ + #define LB_SORT_USER 2 + #define LB_OUTAREA 3 + #define ED_OUTAREA 4 +-#define FT_AREA_LABEL 5 ++//#define FT_AREA_LABEL 5 + //#define FT_AREA 6 + #define BTN_SORT_USER 7 + #define BTN_CASESENSITIVE 8 +@@ -81,6 +81,7 @@ + #define LB_LANGUAGE 17 + #define FT_ALGORITHM 18 + #define LB_ALGORITHM 19 ++#define BTN_NATURALSORT 20 + + //#define RID_SCDLG_SORT_WARNING + #define FT_TEXT 1 +diff --git sc/source/ui/inc/tpsort.hxx sc/source/ui/inc/tpsort.hxx +index 5cb61ae..89573fa 100644 +--- sc/source/ui/inc/tpsort.hxx ++++ sc/source/ui/inc/tpsort.hxx +@@ -53,7 +53,7 @@ class ScSortDlg; + struct ScSortParam; + + //======================================================================== +-// Kriterien ++// Kriterien (Sort Criteria) + + class ScTabPageSortFields : public SfxTabPage + { +@@ -125,7 +125,7 @@ private: + }; + + //======================================================================== +-// Sortieroptionen: ++// Sortieroptionen (Sort Options) + + class ScDocument; + class ScRangeData; +@@ -167,6 +167,7 @@ private: + CheckBox aBtnCase; + CheckBox aBtnHeader; + CheckBox aBtnFormats; ++ CheckBox aBtnNaturalSort; + + CheckBox aBtnCopyResult; + ListBox aLbOutPos; +@@ -184,7 +185,7 @@ private: + RadioButton aBtnTopDown; + RadioButton aBtnLeftRight; + +- FixedText aFtAreaLabel; ++// FixedText aFtAreaLabel; + // FixedInfo aFtArea; + LocalizedString aStrRowLabel; + LocalizedString aStrColLabel; +diff --git sc/source/ui/src/sortdlg.src sc/source/ui/src/sortdlg.src +index a068f0e..edb8b1e 100644 +--- sc/source/ui/src/sortdlg.src ++++ sc/source/ui/src/sortdlg.src +@@ -154,9 +154,20 @@ TabPage RID_SCPAGE_SORT_OPTIONS + Text [ en-US ] = "Include ~formats" ; + TabStop = TRUE ; + }; ++ CheckBox BTN_NATURALSORT ++ { ++ Pos = MAP_APPFONT ( 12 , 48 ) ; ++ Size = MAP_APPFONT ( 242 , 10 ) ; ++ Text [ de ] = "Enable ~natural sort" ; ++ Text [ en-US ] = "Enable ~natural sort" ; ++ Text [ cs ] = "Aktivovat přirozené třídění" ; ++ Text [ sk ] = "Aktivovať prirodzené triedenie" ; ++ TabStop = TRUE ; ++ Text [ x-comment ] = " " ; ++ }; + CheckBox BTN_COPYRESULT + { +- Pos = MAP_APPFONT ( 12 , 48 ) ; ++ Pos = MAP_APPFONT ( 12 , 62 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "~Copy sort results to:" ; + TabStop = TRUE ; +@@ -164,7 +175,7 @@ TabPage RID_SCPAGE_SORT_OPTIONS + ListBox LB_OUTAREA + { + Border = TRUE ; +- Pos = MAP_APPFONT ( 20 , 59 ) ; ++ Pos = MAP_APPFONT ( 20 , 73 ) ; + Size = MAP_APPFONT ( 93 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; +@@ -173,13 +184,13 @@ TabPage RID_SCPAGE_SORT_OPTIONS + { + Disable = TRUE ; + Border = TRUE ; +- Pos = MAP_APPFONT ( 119 , 59 ) ; ++ Pos = MAP_APPFONT ( 119 , 73 ) ; + Size = MAP_APPFONT ( 132 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox BTN_SORT_USER + { +- Pos = MAP_APPFONT ( 12 , 75 ) ; ++ Pos = MAP_APPFONT ( 12 , 89 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "Custom sort ~order" ; + TabStop = TRUE ; +@@ -188,21 +199,21 @@ TabPage RID_SCPAGE_SORT_OPTIONS + { + Disable = TRUE ; + Border = TRUE ; +- Pos = MAP_APPFONT ( 20 , 86 ) ; ++ Pos = MAP_APPFONT ( 20 , 100 ) ; + Size = MAP_APPFONT ( 231 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + FixedText FT_LANGUAGE + { +- Pos = MAP_APPFONT ( 12 , 104 ) ; ++ Pos = MAP_APPFONT ( 12 , 118 ) ; + Size = MAP_APPFONT ( 101 , 8 ) ; + Text [ en-US ] = "~Language"; + }; + ListBox LB_LANGUAGE + { + Border = TRUE ; +- Pos = MAP_APPFONT ( 12 , 115 ) ; ++ Pos = MAP_APPFONT ( 12 , 129 ) ; + Size = MAP_APPFONT ( 101 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; +@@ -210,44 +221,46 @@ TabPage RID_SCPAGE_SORT_OPTIONS + }; + FixedText FT_ALGORITHM + { +- Pos = MAP_APPFONT ( 119 , 104 ) ; ++ Pos = MAP_APPFONT ( 119 , 118 ) ; + Size = MAP_APPFONT ( 132 , 8 ) ; + Text [ en-US ] = "O~ptions"; + }; + ListBox LB_ALGORITHM + { + Border = TRUE ; +- Pos = MAP_APPFONT ( 119 , 115 ) ; ++ Pos = MAP_APPFONT ( 119 , 129 ) ; + Size = MAP_APPFONT ( 132 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + FixedLine FL_DIRECTION + { +- Pos = MAP_APPFONT ( 6 , 133 ) ; ++ Pos = MAP_APPFONT ( 6 , 147 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Direction" ; + }; + RadioButton BTN_TOP_DOWN + { +- Pos = MAP_APPFONT ( 12 , 144 ) ; ++ Pos = MAP_APPFONT ( 12 , 158 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "~Top to bottom (sort rows)" ; + TabStop = TRUE ; + }; + RadioButton BTN_LEFT_RIGHT + { +- Pos = MAP_APPFONT ( 12 , 158 ) ; ++ Pos = MAP_APPFONT ( 12 , 172 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "L~eft to right (sort columns)" ; + TabStop = TRUE ; + }; ++/* + FixedText FT_AREA_LABEL + { + Pos = MAP_APPFONT ( 6 , 171 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Data area:" ; + }; ++*/ + }; + TabDialog RID_SCDLG_SORT + { +diff --git sc/source/ui/view/cellsh2.cxx sc/source/ui/view/cellsh2.cxx +index 90c6883..a54ea74 100644 +--- sc/source/ui/view/cellsh2.cxx ++++ sc/source/ui/view/cellsh2.cxx +@@ -443,6 +443,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) + aSortParam.bHasHeader = bHasHeader; + aSortParam.bByRow = TRUE; + aSortParam.bCaseSens = FALSE; ++ aSortParam.bNaturalSort = FALSE; + aSortParam.bIncludePattern = TRUE; + aSortParam.bInplace = TRUE; + aSortParam.bDoSort[0] = TRUE; +@@ -494,6 +495,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) + aSortParam.bHasHeader = ((const SfxBoolItem*)pItem)->GetValue(); + if ( pArgs->GetItemState( SID_SORT_CASESENS, TRUE, &pItem ) == SFX_ITEM_SET ) + aSortParam.bCaseSens = ((const SfxBoolItem*)pItem)->GetValue(); ++ if ( pArgs->GetItemState( SID_SORT_NATURALSORT, TRUE, &pItem ) == SFX_ITEM_SET ) ++ aSortParam.bNaturalSort = ((const SfxBoolItem*)pItem)->GetValue(); + if ( pArgs->GetItemState( SID_SORT_ATTRIBS, TRUE, &pItem ) == SFX_ITEM_SET ) + aSortParam.bIncludePattern = ((const SfxBoolItem*)pItem)->GetValue(); + if ( pArgs->GetItemState( SID_SORT_USERDEF, TRUE, &pItem ) == SFX_ITEM_SET ) +@@ -557,7 +560,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) + + pDlg = pFact->CreateScSortDlg( pTabViewShell->GetDialogParent(), &aArgSet, RID_SCDLG_SORT ); + DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001 +- pDlg->SetCurPageId(1); ++ pDlg->SetCurPageId(1); // 1=sort field tab 2=sort options tab + + if ( pDlg->Execute() == RET_OK ) + { +@@ -576,6 +579,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) + rOutParam.bHasHeader ) ); + rReq.AppendItem( SfxBoolItem( SID_SORT_CASESENS, + rOutParam.bCaseSens ) ); ++ rReq.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT, ++ rOutParam.bNaturalSort ) ); + rReq.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, + rOutParam.bIncludePattern ) ); + USHORT nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0; diff --git a/applied_patches/0134-sc-drwlayer-units.diff b/applied_patches/0133-sc-drwlayer-units.diff similarity index 100% rename from applied_patches/0134-sc-drwlayer-units.diff rename to applied_patches/0133-sc-drwlayer-units.diff diff --git a/applied_patches/0133-vba-sc-autoshapes-hyperlinks.diff b/applied_patches/0133-vba-sc-autoshapes-hyperlinks.diff deleted file mode 100644 index 34e87b351..000000000 --- a/applied_patches/0133-vba-sc-autoshapes-hyperlinks.diff +++ /dev/null @@ -1,893 +0,0 @@ -diff --git offapi/com/sun/star/drawing/Shape.idl offapi/com/sun/star/drawing/Shape.idl -index 536ab62..bc5a70f 100644 ---- offapi/com/sun/star/drawing/Shape.idl -+++ offapi/com/sun/star/drawing/Shape.idl -@@ -195,6 +195,10 @@ published service Shape - the z-order. - */ - [optional, property] long NavigationOrder; -+ -+ /** this property lets you get and set a hyperlink for this shape. -+ */ -+ [optional, property] string Hyperlink; - }; - - //============================================================================= -diff --git sc/inc/sc.hrc sc/inc/sc.hrc -index be881a4..152289f 100644 ---- sc/inc/sc.hrc -+++ sc/inc/sc.hrc -@@ -593,11 +593,9 @@ - // #i59082# assign macro to shape - #define SID_ASSIGNMACRO (SC_VIEW_START + 95) - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - // #i66550# hyperlinks in shapes - #define SID_DRAW_HLINK_EDIT (SC_VIEW_START + 96) - #define SID_DRAW_HLINK_DELETE (SC_VIEW_START + 97) --#endif - - // "Zoom / Synchronize sheets" in options dialog - #define SID_SC_OPT_SYNCZOOM (SC_VIEW_START + 98) -diff --git sc/inc/shapeuno.hxx sc/inc/shapeuno.hxx -index a628d28..10833bf 100644 ---- sc/inc/shapeuno.hxx -+++ sc/inc/shapeuno.hxx -@@ -53,6 +53,7 @@ namespace com { namespace sun { namespace star { - class SdrObject; - struct SvEventDescription; - class ShapeUnoEventAccessImpl; -+class ScMacroInfo; - - //------------------------------------------------------------------------ - -@@ -68,6 +69,7 @@ class ScShapeObj : public ::cppu::OWeakObject, - public ::com::sun::star::document::XEventsSupplier - { - private: -+friend ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate ); - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg; - // cached pointers to avoid repeated queryAggregation calls: - ::com::sun::star::beans::XPropertySet* pShapePropertySet; -diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx -index 7d331e1..b2c45ac 100644 ---- sc/inc/unonames.hxx -+++ sc/inc/unonames.hxx -@@ -182,6 +182,8 @@ - #define SC_UNONAME_ANCHOR "Anchor" - #define SC_UNONAME_HORIPOS "HoriOrientPosition" - #define SC_UNONAME_VERTPOS "VertOrientPosition" -+// #i66550 HLINK_FOR_SHAPES -+#define SC_UNONAME_HYPERLINK "Hyperlink" - - // other cell properties - #define SC_UNONAME_CHCOLHDR "ChartColumnAsLabel" -diff --git sc/inc/userdat.hxx sc/inc/userdat.hxx -index cba05d0..3099b87 100644 ---- sc/inc/userdat.hxx -+++ sc/inc/userdat.hxx -@@ -101,16 +101,12 @@ public: - void SetMacro( const rtl::OUString& rMacro ) { maMacro = rMacro; } - const rtl::OUString& GetMacro() const { return maMacro; } - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - void SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; } - const rtl::OUString& GetHlink() const { return maHlink; } --#endif - - private: - rtl::OUString maMacro; --#ifdef ISSUE66550_HLINK_FOR_SHAPES - rtl::OUString maHlink; --#endif - }; - - //------------------------------------------------------------------------- -diff --git sc/sdi/drawsh.sdi sc/sdi/drawsh.sdi -index b52250e..3c860f9 100644 ---- sc/sdi/drawsh.sdi -+++ sc/sdi/drawsh.sdi -@@ -229,9 +229,9 @@ interface TableDraw - SID_FONTWORK_CHARACTER_SPACING_DIALOG [ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ] - - // ISSUE66550_HLINK_FOR_SHAPES --// SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] --// SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] --// SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -+ SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -+ SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -+ SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] - } - - -diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi -index cca4416..9bf0630 100644 ---- sc/sdi/scalc.sdi -+++ sc/sdi/scalc.sdi -@@ -6397,55 +6397,55 @@ SfxVoidItem StandardFonts SID_STANDARD_FONTS - - //-------------------------------------------------------------------------- - // ISSUE66550_HLINK_FOR_SHAPES --//SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT --//() --//[ --// /* flags: */ --// AutoUpdate = FALSE, --// Cachable = Cachable, --// FastCall = TRUE, --// HasCoreId = FALSE, --// HasDialog = TRUE, --// ReadOnlyDoc = TRUE, --// Toggle = FALSE, --// Container = FALSE, --// RecordAbsolute = FALSE, --// RecordPerSet; --// Synchron; --// -+SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT -+() -+[ -+ /* flags: */ -+ AutoUpdate = FALSE, -+ Cachable = Cachable, -+ FastCall = TRUE, -+ HasCoreId = FALSE, -+ HasDialog = TRUE, -+ ReadOnlyDoc = TRUE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ - // /* config: */ --// AccelConfig = TRUE, --// MenuConfig = FALSE, --// StatusBarConfig = FALSE, --// ToolBoxConfig = FALSE, --// GroupId = GID_DRAWING; --//] -+ AccelConfig = TRUE, -+ MenuConfig = FALSE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_DRAWING; -+] - - //-------------------------------------------------------------------------- - // ISSUE66550_HLINK_FOR_SHAPES --//SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE --//() --//[ --// /* flags: */ --// AutoUpdate = TRUE, --// Cachable = Cachable, --// FastCall = TRUE, --// HasCoreId = FALSE, --// HasDialog = FALSE, --// ReadOnlyDoc = TRUE, --// Toggle = FALSE, --// Container = FALSE, --// RecordAbsolute = FALSE, --// RecordPerSet; --// Synchron; --// --// /* config: */ --// AccelConfig = TRUE, --// MenuConfig = FALSE, --// StatusBarConfig = FALSE, --// ToolBoxConfig = FALSE, --// GroupId = GID_DRAWING; --//] -+SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE -+() -+[ -+ /* flags: */ -+ AutoUpdate = TRUE, -+ Cachable = Cachable, -+ FastCall = TRUE, -+ HasCoreId = FALSE, -+ HasDialog = FALSE, -+ ReadOnlyDoc = TRUE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ -+ /* config: */ -+ AccelConfig = TRUE, -+ MenuConfig = FALSE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_DRAWING; -+] - - //-------------------------------------------------------------------------- - SfxVoidItem StandardTextAttributes SID_TEXT_STANDARD -diff --git sc/source/filter/excel/xiescher.cxx sc/source/filter/excel/xiescher.cxx -index 4d6fddf..7b8f936 100644 ---- sc/source/filter/excel/xiescher.cxx.old 2009-04-03 20:33:34.000000000 +0200 -+++ sc/source/filter/excel/xiescher.cxx 2009-04-03 20:40:50.000000000 +0200 -@@ -483,8 +483,8 @@ void XclImpDrawObjBase::ProcessSdrObject - } - - // macro and hyperlink --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if( mbSimpleMacro && ((maMacroName.Len() > 0) || (maHyperlink.getLength() > 0)) ) -+ if( mbSimpleMacro && ((maMacroName.Len() > 0) || -+ (maHyperlink.Len() > 0)) ) - { - if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) ) - { -@@ -492,11 +492,6 @@ void XclImpDrawObjBase::ProcessSdrObject - pInfo->SetHlink( maHyperlink ); - } - } --#else -- if( mbSimpleMacro && (maMacroName.Len() > 0) ) -- if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) ) -- pInfo->SetMacro( XclControlHelper::GetScMacroName( maMacroName ) ); --#endif - - // call virtual function for object type specific processing - DoProcessSdrObj( rSdrObj ); -diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx -index 495b35a..b06fbdd 100644 ---- sc/source/filter/xml/xmlexprt.cxx -+++ sc/source/filter/xml/xmlexprt.cxx -@@ -2514,7 +2514,34 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, - } - } - if (!bIsChart) -+ { -+ // #i66550 HLINK_FOR_SHAPES -+ rtl::OUString sHlink; -+ uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); -+ if ( xProps.is() ) -+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink; -+ -+ std::auto_ptr< SvXMLElementExport > pDrawA; -+ // enlose shapes with element only if sHlink contains something -+ if ( sHlink.getLength() > 0 ) -+ { -+ // need to get delete the attributes that are pre-loaded -+ // for the shape export ( otherwise they will become -+ // attributes of the draw:a element ) This *shouldn't* -+ // affect performance adversely as there are only a -+ // couple of attributes involved -+ uno::Reference< xml::sax::XAttributeList > xSaveAttribs( new SvXMLAttributeList( GetAttrList() ) ); -+ ClearAttrList(); -+ // Add Hlink -+ AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); -+ AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sHlink); -+ pDrawA.reset( new SvXMLElementExport( *this, XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ) ); -+ // Attribute list has been cleared by previous operation -+ // re-add pre-loaded attributes -+ AddAttributeList( xSaveAttribs ); -+ } - GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint); -+ } - IncrementProgressBar(sal_False); - } - -diff --git sc/source/ui/drawfunc/drawsh.cxx sc/source/ui/drawfunc/drawsh.cxx -index 39c3d76..c657abf 100644 ---- sc/source/ui/drawfunc/drawsh.cxx -+++ sc/source/ui/drawfunc/drawsh.cxx -@@ -210,7 +210,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) - ExecuteTextAttrDlg( rReq ); - break; - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - case SID_DRAW_HLINK_EDIT: - if ( pSingleSelectedObj ) - pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG ); -@@ -238,7 +237,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) - ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() ); - } - break; --#endif - - case SID_ATTR_TRANSFORM: - { -@@ -490,7 +488,6 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, USHORT /* nTabPage */ ) - delete( pDlg ); - } - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk ) - { - if ( pObj ) -@@ -500,5 +497,4 @@ void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk - lcl_setModified( GetObjectShell() ); - } - } --#endif - -diff --git sc/source/ui/drawfunc/drawsh2.cxx sc/source/ui/drawfunc/drawsh2.cxx -index bd6f2a1..27bfc44 100644 ---- sc/source/ui/drawfunc/drawsh2.cxx -+++ sc/source/ui/drawfunc/drawsh2.cxx -@@ -199,24 +199,20 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disablen - BOOL bCanRename = FALSE; - if ( nMarkCount > 1 ) - { --#ifdef ISSUE66550_HLINK_FOR_SHAPES - // no hypelink options for a selected group - rSet.DisableItem( SID_DRAW_HLINK_EDIT ); - rSet.DisableItem( SID_DRAW_HLINK_DELETE ); - rSet.DisableItem( SID_OPEN_HYPERLINK ); --#endif - } - else if ( nMarkCount == 1 ) - { - SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); - if ( !pInfo || (pInfo->GetHlink().getLength() == 0) ) - { - rSet.DisableItem( SID_DRAW_HLINK_DELETE ); - rSet.DisableItem( SID_OPEN_HYPERLINK ); - } --#endif - SdrLayerID nLayerID = pObj->GetLayer(); - if ( nLayerID != SC_LAYER_INTERN ) - bCanRename = TRUE; // #i51351# anything except internal objects can be renamed -diff --git sc/source/ui/drawfunc/drawsh5.cxx sc/source/ui/drawfunc/drawsh5.cxx -index 16e20a9..4fd06bf 100644 ---- sc/source/ui/drawfunc/drawsh5.cxx -+++ sc/source/ui/drawfunc/drawsh5.cxx -@@ -95,14 +95,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink - if ( nMarkCount == 1 ) // URL-Button markiert ? - { - SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); - if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) - { - aHLinkItem.SetURL( pInfo->GetHlink() ); - aHLinkItem.SetInsertMode(HLINK_FIELD); - } --#endif - SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj); - if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor()) - { -@@ -245,13 +243,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq ) - bDone = TRUE; - } - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES - else - { - SetHlinkForObject( pObj, rURL ); - bDone = TRUE; - } --#endif - } - } - -diff --git sc/source/ui/drawfunc/fudraw.cxx sc/source/ui/drawfunc/fudraw.cxx -index 5c0460f..d060c2f 100644 ---- sc/source/ui/drawfunc/fudraw.cxx -+++ sc/source/ui/drawfunc/fudraw.cxx -@@ -891,11 +891,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) - SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ???? - pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) ); - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES - else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) ) --#else -- else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) ) --#endif - pWindow->SetPointer( Pointer( POINTER_REFHAND ) ); - else if ( IsDetectiveHit( aPnt ) ) - pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) ); -diff --git sc/source/ui/drawfunc/fusel.cxx sc/source/ui/drawfunc/fusel.cxx -index 41c3e60..57bb6ba 100644 ---- sc/source/ui/drawfunc/fusel.cxx -+++ sc/source/ui/drawfunc/fusel.cxx -@@ -205,7 +205,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt) - } - - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - // For interoperability favour links over macros if both are defined - if ( pInfo->GetHlink().getLength() > 0 ) - { -@@ -213,9 +212,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt) - sURL = pInfo->GetHlink(); - } - else if ( pInfo->GetMacro().getLength() > 0 ) --#else -- if ( pInfo->GetMacro().getLength() > 0 ) --#endif - { - SfxObjectShell* pObjSh = SfxObjectShell::Current(); - if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) ) -diff --git sc/source/ui/drawfunc/objdraw.src sc/source/ui/drawfunc/objdraw.src -index 53d70c1..a1986b1 100644 ---- sc/source/ui/drawfunc/objdraw.src -+++ sc/source/ui/drawfunc/objdraw.src -@@ -185,7 +185,6 @@ - ITEM_FORMAT_PARA_DLG\ - }; - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - #define MN_EDITLNK \ - MenuItem\ - {\ -@@ -201,7 +200,6 @@ - HelpID = SID_DRAW_HLINK_DELETE ; \ - Text [ en-US ] = "~Remove Hyperlink" ; \ - }; --#endif - - #define MN_DRWTXTATTR \ - MenuItem\ -@@ -1294,14 +1292,12 @@ Menu RID_POPUP_DRAW - MenuItem { Separator = TRUE ; }; - //------------------------------ - ITEM_GROUP_MENU --#ifdef ISSUE66550_HLINK_FOR_SHAPES - //------------------------------ - MenuItem { Separator = TRUE ; }; - //------------------------------ - MN_EDITLNK - MN_DELLNK - MenuItem { ITEM_OPEN_HYPERLINK }; --#endif - }; - }; - -@@ -1371,14 +1367,12 @@ Menu RID_POPUP_GRAPHIC - MenuItem { Separator = TRUE ; }; - //------------------------------ - ITEM_GROUP_MENU --#ifdef ISSUE66550_HLINK_FOR_SHAPES - //------------------------------ - MenuItem { Separator = TRUE ; }; - //------------------------------ - MN_EDITLNK - MN_DELLNK - MenuItem { ITEM_OPEN_HYPERLINK }; --#endif - }; - }; - -diff --git sc/source/ui/inc/drawsh.hxx sc/source/ui/inc/drawsh.hxx -index 20b150f..9435ec8 100644 ---- sc/source/ui/inc/drawsh.hxx -+++ sc/source/ui/inc/drawsh.hxx -@@ -47,9 +47,7 @@ class ScDrawShell : public SfxShell - - DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* ); - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk ); --#endif - - protected: - ScViewData* GetViewData() { return pViewData; } -diff --git sc/source/ui/unoobj/shapeuno.cxx sc/source/ui/unoobj/shapeuno.cxx -index 151acf8..1d8a944 100644 ---- sc/source/ui/unoobj/shapeuno.cxx -+++ sc/source/ui/unoobj/shapeuno.cxx -@@ -72,6 +72,8 @@ const SfxItemPropertyMap* lcl_GetShapeMap() - {MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP), 0, &getCppuType((uno::Reference*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 }, -+ // #i66550 HLINK_FOR_SHAPES -+ {MAP_CHAR_LEN(SC_UNONAME_HYPERLINK), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, - {0,0,0,0,0,0} - }; - return aShapeMap_Impl; -@@ -86,6 +88,14 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems() - }; - return aMacroDescriptionsImpl; - } -+// #i66550 HLINK_FOR_SHAPES -+ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate = FALSE ) -+{ -+ if( pShape ) -+ if( SdrObject* pObj = pShape->GetSdrObject() ) -+ return ScDrawLayer::GetMacroInfo( pObj, bCreate ); -+ return 0; -+} - - //------------------------------------------------------------------------ - -@@ -627,6 +637,13 @@ void SAL_CALL ScShapeObj::setPropertyValue( - } - } - } -+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ) -+ { -+ rtl::OUString sHlink; -+ ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, TRUE); -+ if ( ( aValue >>= sHlink ) && pInfo ) -+ pInfo->SetHlink( sHlink ); -+ } - else - { - GetShapePropertySet(); -@@ -808,6 +825,13 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa - } - } - } -+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ) -+ { -+ rtl::OUString sHlink; -+ if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) ) -+ sHlink = pInfo->GetHlink(); -+ aAny <<= sHlink; -+ } - else - { - GetShapePropertySet(); -@@ -1320,11 +1344,6 @@ SdrObject* ScShapeObj::GetSdrObject() const throw() - } - - #define SC_EVENTACC_ONCLICK ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ) --#ifdef ISSUE66550_HLINK_FOR_SHAPES --#define SC_EVENTACC_ONACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) ) --#define SC_EVENTACC_URL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) --#define SC_EVENTACC_ACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) ) --#endif - #define SC_EVENTACC_SCRIPT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) ) - #define SC_EVENTACC_EVENTTYPE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) ) - -@@ -1336,10 +1355,7 @@ private: - - ScMacroInfo* getInfo( BOOL bCreate = FALSE ) - { -- if( mpShape ) -- if( SdrObject* pObj = mpShape->GetSdrObject() ) -- return ScDrawLayer::GetMacroInfo( pObj, bCreate ); -- return 0; -+ return lcl_getShapeHyperMacroInfo( mpShape, bCreate ); - } - - public: -@@ -1365,11 +1381,7 @@ public: - isEventType = true; - continue; - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if ( isEventType && ((pProperties->Name == SC_EVENTACC_SCRIPT) || (pProperties->Name == SC_EVENTACC_URL)) ) --#else - if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) ) --#endif - { - rtl::OUString sValue; - if ( pProperties->Value >>= sValue ) -@@ -1380,10 +1392,8 @@ public: - break; - if ( pProperties->Name == SC_EVENTACC_SCRIPT ) - pInfo->SetMacro( sValue ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - else - pInfo->SetHlink( sValue ); --#endif - } - } - } -@@ -1406,19 +1416,6 @@ public: - aProperties[ 1 ].Value <<= pInfo->GetMacro(); - } - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- else if( aName == SC_EVENTACC_ONACTION ) -- { -- if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) -- { -- aProperties.realloc( 2 ); -- aProperties[ 0 ].Name = SC_EVENTACC_EVENTTYPE; -- aProperties[ 0 ].Value <<= SC_EVENTACC_ACTION; -- aProperties[ 1 ].Name = SC_EVENTACC_URL; -- aProperties[ 1 ].Value <<= pInfo->GetHlink(); -- } -- } --#endif - else - { - throw container::NoSuchElementException(); -@@ -1429,25 +1426,14 @@ public: - - virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException) - { --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- uno::Sequence< rtl::OUString > aSeq( 2 ); --#else - uno::Sequence< rtl::OUString > aSeq( 1 ); --#endif - aSeq[ 0 ] = SC_EVENTACC_ONCLICK; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- aSeq[ 1 ] = SC_EVENTACC_ONACTION; --#endif - return aSeq; - } - - virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException) - { --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- return (aName == SC_EVENTACC_ONCLICK) || (aName == SC_EVENTACC_ONACTION); --#else - return aName == SC_EVENTACC_ONCLICK; --#endif - } - - // XElementAccess -diff --git sc/source/ui/view/gridwin5.cxx sc/source/ui/view/gridwin5.cxx -index 81ef0df..57797eb 100644 ---- sc/source/ui/view/gridwin5.cxx -+++ sc/source/ui/view/gridwin5.cxx -@@ -345,14 +345,12 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) - if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) ) - pObj = pHit; - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); - if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) - { - aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect()); - aHelpText = pInfo->GetHlink(); - } --#endif - } - } - } -diff --git xmloff/inc/xmloff/shapeexport.hxx xmloff/inc/xmloff/shapeexport.hxx -index bb3b369..bc331e8 100644 ---- xmloff/inc/xmloff/shapeexport.hxx -+++ xmloff/inc/xmloff/shapeexport.hxx -@@ -197,11 +197,6 @@ private: - const rtl::OUString msStartShape; - const rtl::OUString msEndShape; - const rtl::OUString msOnClick; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- const rtl::OUString msOnAction; -- const rtl::OUString msAction; -- const rtl::OUString msURL; --#endif - const rtl::OUString msEventType; - const rtl::OUString msPresentation; - const rtl::OUString msMacroName; -diff --git xmloff/source/draw/eventimp.cxx xmloff/source/draw/eventimp.cxx -index 54c0683..57c8dee 100644 ---- xmloff/source/draw/eventimp.cxx -+++ xmloff/source/draw/eventimp.cxx -@@ -104,9 +104,6 @@ public: - - sal_Bool mbValid; - sal_Bool mbScript; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- sal_Bool mbActionEvent; --#endif - ClickAction meClickAction; - XMLEffect meEffect; - XMLEffectDirection meDirection; -@@ -118,9 +115,6 @@ public: - OUString msMacroName; - OUString msBookmark; - OUString msLanguage; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- OUString msHyperURL; --#endif - }; - - /////////////////////////////////////////////////////////////////////// -@@ -179,18 +173,11 @@ TYPEINIT1( SdXMLEventContext, SvXMLImportContext ); - - SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape ) - : SvXMLImportContext(rImp, nPrfx, rLocalName), --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- mxShape( rxShape ), mbScript( sal_False ), mbActionEvent( sal_False ), meClickAction( ClickAction_NONE ), --#else - mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ), --#endif - meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ), - meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False ) - { - static const OUString sXMLClickName( RTL_CONSTASCII_USTRINGPARAM( "click" ) ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- static const OUString sXMLActionName( RTL_CONSTASCII_USTRINGPARAM( "action" ) ); --#endif - - if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) ) - { -@@ -261,12 +248,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons - sEventName = sValue; - sal_uInt16 nScriptPrefix = - GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- mbValid = XML_NAMESPACE_DOM == nScriptPrefix && ( sEventName == sXMLClickName || sEventName == sXMLActionName ); -- mbActionEvent = mbValid && (sEventName == sXMLActionName); --#else - mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == sXMLClickName; --#endif - } - else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) ) - { -@@ -295,12 +277,6 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons - { - msMacroName = sValue; - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- else if ( mbActionEvent ) -- { -- msHyperURL = sValue; -- } --#endif - else - { - const rtl::OUString &rTmp = -@@ -346,26 +322,6 @@ void SdXMLEventContext::EndElement() - OUString sAPIEventName; - uno::Sequence< beans::PropertyValue > aProperties; - --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if( mbActionEvent ) -- { -- sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) ); -- aProperties.realloc( 2 ); -- beans::PropertyValue* pProperty = aProperties.getArray(); -- -- pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) ); -- pProperty->Handle = -1; -- pProperty->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) ); -- pProperty->State = beans::PropertyState_DIRECT_VALUE; -- ++pProperty; -- pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); -- pProperty->Handle = -1; -- pProperty->Value <<= msHyperURL; -- pProperty->State = beans::PropertyState_DIRECT_VALUE; -- } -- else --#endif -- { - sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ); - - if( mbScript ) -@@ -550,8 +506,6 @@ void SdXMLEventContext::EndElement() - break; - } - } -- } -- - xEvents->replaceByName( sAPIEventName, uno::Any( aProperties ) ); - - } while(0); -diff --git xmloff/source/draw/shapeexport.cxx xmloff/source/draw/shapeexport.cxx -index 4691d72..0bfa0cb 100644 ---- xmloff/source/draw/shapeexport.cxx -+++ xmloff/source/draw/shapeexport.cxx -@@ -87,11 +87,6 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, - msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ), - msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ), - msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ), --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- msOnAction( RTL_CONSTASCII_USTRINGPARAM("OnAction") ), -- msAction( RTL_CONSTASCII_USTRINGPARAM("Action") ), -- msURL( RTL_CONSTASCII_USTRINGPARAM("URL") ), --#endif - msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ), - msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ), - msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ), -diff --git xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport2.cxx -index c3594a6..d7005be 100644 ---- xmloff/source/draw/shapeexport2.cxx -+++ xmloff/source/draw/shapeexport2.cxx -@@ -296,9 +296,6 @@ const sal_Int32 FOUND_CLICKEVENTTYPE = 0x00000080; - const sal_Int32 FOUND_MACRO = 0x00000100; - const sal_Int32 FOUND_LIBRARY = 0x00000200; - const sal_Int32 FOUND_ACTIONEVENTTYPE = 0x00000400; --#ifdef ISSUE66550_HLINK_FOR_SHAPES --const sal_Int32 FOUND_URL = 0x00000800; --#endif - - } // namespace - -@@ -388,33 +385,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x - } - } - --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- // extract properties from "OnAction" event ------------------------------- -- -- OUString aActionEventType; -- OUString aHyperURL; -- -- uno::Sequence< beans::PropertyValue > aActionProperties; -- if( xEvents->hasByName( msOnAction ) && (xEvents->getByName( msOnAction ) >>= aActionProperties) ) -- { -- const beans::PropertyValue* pProperty = aActionProperties.getConstArray(); -- const beans::PropertyValue* pPropertyEnd = pProperty + aActionProperties.getLength(); -- for( ; pProperty != pPropertyEnd; ++pProperty ) -- { -- if( ( ( nFound & FOUND_ACTIONEVENTTYPE ) == 0 ) && pProperty->Name == msEventType ) -- { -- if( pProperty->Value >>= aActionEventType ) -- nFound |= FOUND_ACTIONEVENTTYPE; -- } -- else if( ( ( nFound & FOUND_URL ) == 0 ) && ( pProperty->Name == msURL ) ) -- { -- if( pProperty->Value >>= aHyperURL ) -- nFound |= FOUND_URL; -- } -- } -- } --#endif -- - // create the XML elements - - if( aClickEventType == msPresentation ) -@@ -566,15 +536,9 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x - SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True); - } - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- else if( aClickEventType == msScript || aActionEventType == msAction ) -- { -- if( nFound & ( FOUND_MACRO | FOUND_URL ) ) --#else - else if( aClickEventType == msScript ) - { - if( nFound & FOUND_MACRO ) --#endif - { - SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True); - if ( nFound & FOUND_MACRO ) -@@ -589,18 +553,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x - - SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True); - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if ( nFound & FOUND_URL ) -- { -- OUString aEventQName( -- mrExport.GetNamespaceMap().GetQNameByKey( -- XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "action" ) ) ) ); -- mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName ); -- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aHyperURL ); -- -- SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True); -- } --#endif - } - } - } -diff --git xmloff/source/draw/ximpshap.cxx xmloff/source/draw/ximpshap.cxx -index 5d1d0da..c461d59 100644 ---- xmloff/source/draw/ximpshap.cxx -+++ xmloff/source/draw/ximpshap.cxx -@@ -375,6 +375,11 @@ void SdXMLShapeContext::EndElement() - - if( msHyperlink.getLength() != 0 ) try - { -+ uno::Reference< beans::XPropertySet > xProp( mxShape, uno::UNO_QUERY ); -+ -+ rtl::OUString sLink( RTL_CONSTASCII_USTRINGPARAM( "Hyperlink" ) ); -+ if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( sLink ) ) -+ xProp->setPropertyValue( sLink, uno::Any( msHyperlink ) ); - Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW ); - Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW ); - -@@ -3230,9 +3235,16 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( USHORT nPrefix, - - if( !mxImplContext.Is() ) - { -- pContext = GetImport().GetShapeImport()->CreateFrameChildContext( -+ -+ SvXMLShapeContext* pShapeContext= GetImport().GetShapeImport()->CreateFrameChildContext( - GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList ); - -+ pContext = pShapeContext; -+ -+ // propagate the hyperlink to child context -+ if ( msHyperlink.getLength() > 0 ) -+ pShapeContext->setHyperlink( msHyperlink ); -+ - mxImplContext = pContext; - mbSupportsReplacement = IsXMLToken( rLocalName, XML_OBJECT ) || - IsXMLToken( rLocalName, XML_OBJECT_OLE ); diff --git a/applied_patches/0135-sc-overwrite-char-font-attrs.diff b/applied_patches/0134-sc-overwrite-char-font-attrs.diff similarity index 100% rename from applied_patches/0135-sc-overwrite-char-font-attrs.diff rename to applied_patches/0134-sc-overwrite-char-font-attrs.diff diff --git a/applied_patches/0135-calc-filter-by-date-strip-time.diff b/applied_patches/0135-calc-filter-by-date-strip-time.diff new file mode 100644 index 000000000..53fc5b3db --- /dev/null +++ b/applied_patches/0135-calc-filter-by-date-strip-time.diff @@ -0,0 +1,498 @@ +diff --git sc/inc/column.hxx sc/inc/column.hxx +index 47417c3..11f2955 100644 +--- sc/inc/column.hxx ++++ sc/inc/column.hxx +@@ -379,7 +379,7 @@ public: + /// Including current, may return -1 + SCsROW GetNextUnprotected( SCROW nRow, BOOL bUp ) const; + +- void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings); ++ void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates); + BOOL GetDataEntries(SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit); + + //UNUSED2008-05 SCROW NoteCount( SCROW nMaxRow = MAXROW ) const; +diff --git sc/inc/dbcolect.hxx sc/inc/dbcolect.hxx +index 1346b12..edd5a09 100644 +--- sc/inc/dbcolect.hxx ++++ sc/inc/dbcolect.hxx +@@ -88,6 +88,7 @@ private: + SCCOLROW nQueryField[MAXQUERY]; + ScQueryOp eQueryOp[MAXQUERY]; + BOOL bQueryByString[MAXQUERY]; ++ bool bQueryByDate[MAXQUERY]; + String* pQueryStr[MAXQUERY]; + double nQueryVal[MAXQUERY]; + ScQueryConnect eQueryConnect[MAXQUERY]; +diff --git sc/inc/document.hxx sc/inc/document.hxx +index 06b3fbe..ddb87fa 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -1379,9 +1379,9 @@ public: + void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr); + + BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, +- TypedScStrCollection& rStrings, bool bFilter = false ); ++ bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates); + SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, +- SCTAB nTab, TypedScStrCollection& rStrings ); ++ SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates ); + BOOL GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, + TypedScStrCollection& rStrings, BOOL bLimit = FALSE ); + BOOL GetFormulaEntries( TypedScStrCollection& rStrings ); +diff --git sc/inc/global.hxx sc/inc/global.hxx +index cc2e078..de5be83 100644 +--- sc/inc/global.hxx ++++ sc/inc/global.hxx +@@ -791,6 +791,7 @@ struct ScQueryEntry + { + BOOL bDoQuery; + BOOL bQueryByString; ++ bool bQueryByDate; + SCCOLROW nField; + ScQueryOp eOp; + ScQueryConnect eConnect; +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 597baf3..d623a9c 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -638,8 +638,8 @@ public: + SCSIZE Query(ScQueryParam& rQueryParam, BOOL bKeepSub); + BOOL CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam); + +- void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings); +- void GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings ); ++ void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates); ++ void GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings, bool& rHasDates ); + BOOL GetDataEntries(SCCOL nCol, SCROW nRow, TypedScStrCollection& rStrings, BOOL bLimit); + + BOOL HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ); +diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx +index 242c5c0..560801d 100644 +--- sc/source/core/data/column3.cxx ++++ sc/source/core/data/column3.cxx +@@ -1470,8 +1470,9 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + } + + +-void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings) ++void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollection& rStrings, bool& rHasDates) + { ++ bool bHasDates = false; + SvNumberFormatter* pFormatter = pDocument->GetFormatTable(); + String aString; + SCROW nRow = 0; +@@ -1507,6 +1508,18 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec + nValue = 0.0; + } + ++ if (pFormatter) ++ { ++ short nType = pFormatter->GetType(nFormat); ++ if ((nType & NUMBERFORMAT_DATE) && !(nType & NUMBERFORMAT_TIME)) ++ { ++ // special case for date values. Disregard the time ++ // element if the number format is of date type. ++ nValue = ::rtl::math::approxFloor(nValue); ++ bHasDates = true; ++ } ++ } ++ + pData = new TypedStrData( aString, nValue, SC_STRTYPE_VALUE ); + } + #if 0 // DR +@@ -1525,6 +1538,8 @@ void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, TypedScStrCollec + + ++nIndex; + } ++ ++ rHasDates = bHasDates; + } + + // +diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx +index a0b524f..68e4383 100644 +--- sc/source/core/data/documen3.cxx ++++ sc/source/core/data/documen3.cxx +@@ -1255,7 +1255,8 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, + // GetFilterEntries - Eintraege fuer AutoFilter-Listbox + // + +-BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScStrCollection& rStrings, bool bFilter ) ++BOOL ScDocument::GetFilterEntries( ++ SCCOL nCol, SCROW nRow, SCTAB nTab, bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates) + { + if ( ValidTab(nTab) && pTab[nTab] && pDBCollection ) + { +@@ -1292,11 +1293,11 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt + + if ( bFilter ) + { +- pTab[nTab]->GetFilteredFilterEntries( nCol, nStartRow, nEndRow, aParam, rStrings ); ++ pTab[nTab]->GetFilteredFilterEntries( nCol, nStartRow, nEndRow, aParam, rStrings, rHasDates ); + } + else + { +- pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings ); ++ pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates ); + } + + return TRUE; +@@ -1311,11 +1312,11 @@ BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScSt + // + + BOOL ScDocument::GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, +- SCTAB nTab, TypedScStrCollection& rStrings ) ++ SCTAB nTab, TypedScStrCollection& rStrings, bool& rHasDates ) + { + if ( ValidTab(nTab) && pTab[nTab] ) + { +- pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings ); ++ pTab[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rStrings, rHasDates ); + return TRUE; + } + +diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx +index f71b842..c9b2e3e 100644 +--- sc/source/core/data/global2.cxx ++++ sc/source/core/data/global2.cxx +@@ -145,30 +145,32 @@ BOOL ScImportParam::operator==( const ScImportParam& rOther ) const + //------------------------------------------------------------------------ + // struct ScQueryParam: + +-ScQueryEntry::ScQueryEntry() ++ScQueryEntry::ScQueryEntry() : ++ bDoQuery(FALSE), ++ bQueryByString(FALSE), ++ bQueryByDate(false), ++ nField(0), ++ eOp(SC_EQUAL), ++ eConnect(SC_AND), ++ pStr(new String), ++ nVal(0.0), ++ pSearchParam(NULL), ++ pSearchText(NULL) ++{ ++} ++ ++ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) : ++ bDoQuery(r.bDoQuery), ++ bQueryByString(r.bQueryByString), ++ bQueryByDate(r.bQueryByDate), ++ nField(r.nField), ++ eOp(r.eOp), ++ eConnect(r.eConnect), ++ pStr(new String(*r.pStr)), ++ nVal(r.nVal), ++ pSearchParam(NULL), ++ pSearchText(NULL) + { +- bDoQuery = FALSE; +- bQueryByString = FALSE; +- eOp = SC_EQUAL; +- eConnect = SC_AND; +- nField = 0; +- nVal = 0.0; +- pStr = new String; +- pSearchParam = NULL; +- pSearchText = NULL; +-} +- +-ScQueryEntry::ScQueryEntry(const ScQueryEntry& r) +-{ +- bDoQuery = r.bDoQuery; +- bQueryByString = r.bQueryByString; +- eOp = r.eOp; +- eConnect = r.eConnect; +- nField = r.nField; +- nVal = r.nVal; +- pStr = new String(*r.pStr); +- pSearchParam = NULL; +- pSearchText = NULL; + } + + ScQueryEntry::~ScQueryEntry() +@@ -185,6 +187,7 @@ ScQueryEntry& ScQueryEntry::operator=( const ScQueryEntry& r ) + { + bDoQuery = r.bDoQuery; + bQueryByString = r.bQueryByString; ++ bQueryByDate = r.bQueryByDate; + eOp = r.eOp; + eConnect = r.eConnect; + nField = r.nField; +@@ -205,6 +208,7 @@ void ScQueryEntry::Clear() + { + bDoQuery = FALSE; + bQueryByString = FALSE; ++ bQueryByDate = false; + eOp = SC_EQUAL; + eConnect = SC_AND; + nField = 0; +@@ -223,6 +227,7 @@ BOOL ScQueryEntry::operator==( const ScQueryEntry& r ) const + { + return bDoQuery == r.bDoQuery + && bQueryByString == r.bQueryByString ++ && bQueryByDate == r.bQueryByDate + && eOp == r.eOp + && eConnect == r.eConnect + && nField == r.nField +diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx +index 7dffb3d..7067799 100644 +--- sc/source/core/data/table3.cxx ++++ sc/source/core/data/table3.cxx +@@ -60,7 +60,8 @@ + #include "progress.hxx" + #include "cellform.hxx" + #include "postit.hxx" + #include "queryparam.hxx" ++#include "svtools/zformat.hxx" + + #include + +@@ -1143,6 +1144,20 @@ BOOL ScTable::ValidQuery(SCROW nRow, const ScQueryParam& rParam, + } + else + nCellVal = GetValue( static_cast(rEntry.nField), nRow ); ++ ++ if (rEntry.bQueryByDate) ++ { ++ sal_uInt32 nNumFmt = GetNumberFormat(static_cast(rEntry.nField), nRow); ++ const SvNumberformat* pEntry = pDocument->GetFormatTable()->GetEntry(nNumFmt); ++ if (pEntry) ++ { ++ short nNumFmtType = pEntry->GetType(); ++ if ((nNumFmtType & NUMBERFORMAT_DATE) && !(nNumFmtType & NUMBERFORMAT_TIME)) ++ // The format is of date type. Strip off the time element. ++ nCellVal = ::rtl::math::approxFloor(nCellVal); ++ } ++ } ++ + switch (rEntry.eOp) + { + case SC_EQUAL : +@@ -1930,12 +1945,13 @@ BOOL ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol * + return TRUE; + } + +-void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings) ++void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, TypedScStrCollection& rStrings, bool& rHasDates) + { +- aCol[nCol].GetFilterEntries( nRow1, nRow2, rStrings ); ++ aCol[nCol].GetFilterEntries( nRow1, nRow2, rStrings, rHasDates ); + } + +-void ScTable::GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings ) ++void ScTable::GetFilteredFilterEntries( ++ SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, TypedScStrCollection& rStrings, bool& rHasDates ) + { + // remove the entry for this column from the query parameter + ScQueryParam aParam( rParam ); +@@ -1953,15 +1969,18 @@ void ScTable::GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, co + + BOOL* pSpecial = new BOOL[nEntryCount]; + lcl_PrepareQuery( pDocument, this, aParam, pSpecial ); +- ++ bool bHasDates = false; + for ( SCROW j = nRow1; j <= nRow2; ++j ) + { + if ( ValidQuery( j, aParam, pSpecial ) ) + { +- aCol[nCol].GetFilterEntries( j, j, rStrings ); ++ bool bThisHasDates = false; ++ aCol[nCol].GetFilterEntries( j, j, rStrings, bThisHasDates ); ++ bHasDates |= bThisHasDates; + } + } + ++ rHasDates = bHasDates; + delete[] pSpecial; + } + +diff --git sc/source/core/tool/dbcolect.cxx sc/source/core/tool/dbcolect.cxx +index 162fcbd..9ed2645 100644 +--- sc/source/core/tool/dbcolect.cxx ++++ sc/source/core/tool/dbcolect.cxx +@@ -158,6 +158,7 @@ ScDBData::ScDBData( const ScDBData& rData ) : + nQueryField[i] = rData.nQueryField[i]; + eQueryOp[i] = rData.eQueryOp[i]; + bQueryByString[i] = rData.bQueryByString[i]; ++ bQueryByDate[i] = rData.bQueryByDate[i]; + pQueryStr[i] = new String( *(rData.pQueryStr[i]) ); + nQueryVal[i] = rData.nQueryVal[i]; + eQueryConnect[i] = rData.eQueryConnect[i]; +@@ -248,6 +249,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData) + nQueryField[i] = rData.nQueryField[i]; + eQueryOp[i] = rData.eQueryOp[i]; + bQueryByString[i] = rData.bQueryByString[i]; ++ bQueryByDate[i] = rData.bQueryByDate[i]; + *pQueryStr[i] = *rData.pQueryStr[i]; + nQueryVal[i] = rData.nQueryVal[i]; + eQueryConnect[i] = rData.eQueryConnect[i]; +@@ -518,6 +520,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const + rEntry.nField = nQueryField[i]; + rEntry.eOp = eQueryOp[i]; + rEntry.bQueryByString = bQueryByString[i]; ++ rEntry.bQueryByDate = bQueryByDate[i]; + *rEntry.pStr = *pQueryStr[i]; + rEntry.nVal = nQueryVal[i]; + rEntry.eConnect = eQueryConnect[i]; +@@ -549,6 +552,7 @@ void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam) + nQueryField[i] = rEntry.nField; + eQueryOp[i] = rEntry.eOp; + bQueryByString[i] = rEntry.bQueryByString; ++ bQueryByDate[i] = rEntry.bQueryByDate; + *pQueryStr[i] = *rEntry.pStr; + nQueryVal[i] = rEntry.nVal; + eQueryConnect[i] = rEntry.eConnect; +diff --git sc/source/ui/dbgui/filtdlg.cxx sc/source/ui/dbgui/filtdlg.cxx +index 4a2d4d4..4f56adb 100644 +--- sc/source/ui/dbgui/filtdlg.cxx ++++ sc/source/ui/dbgui/filtdlg.cxx +@@ -451,24 +451,27 @@ void ScFilterDlg::UpdateValueList( USHORT nList ) + SCCOL nColumn = theQueryData.nCol1 + static_cast(nFieldSelPos) - 1; + if (!pEntryLists[nColumn]) + { ++ USHORT nOffset = GetSliderPos(); + SCTAB nTab = nSrcTab; + SCROW nFirstRow = theQueryData.nRow1; + SCROW nLastRow = theQueryData.nRow2; ++ mbHasDates[nOffset+nList-1] = false; + + // erstmal ohne die erste Zeile + + pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 ); + pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() ); + pDoc->GetFilterEntriesArea( nColumn, nFirstRow+1, nLastRow, +- nTab, *pEntryLists[nColumn] ); ++ nTab, *pEntryLists[nColumn], mbHasDates[nOffset+nList-1] ); + + // Eintrag fuer die erste Zeile + //! Eintrag (pHdrEntry) ohne Collection erzeugen? + + nHeaderPos[nColumn] = USHRT_MAX; + TypedScStrCollection aHdrColl( 1, 1 ); ++ bool bDummy = false; + pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nFirstRow, +- nTab, aHdrColl ); ++ nTab, aHdrColl, bDummy ); + TypedStrData* pHdrEntry = aHdrColl[0]; + if ( pHdrEntry ) + { +@@ -1064,7 +1067,8 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) + static_cast(nField) - 1) : static_cast(0); + + ScQueryOp eOp = (ScQueryOp)pLbCond->GetSelectEntryPos(); +- rEntry.eOp = eOp; ++ rEntry.eOp = eOp; ++ rEntry.bQueryByDate = mbHasDates[nQE]; + + } + } +diff --git sc/source/ui/dbgui/pfiltdlg.cxx sc/source/ui/dbgui/pfiltdlg.cxx +index 35bfc35..42c2c26 100644 +--- sc/source/ui/dbgui/pfiltdlg.cxx ++++ sc/source/ui/dbgui/pfiltdlg.cxx +@@ -352,11 +352,12 @@ void ScPivotFilterDlg::UpdateValueList( USHORT nList ) + SCROW nFirstRow = theQueryData.nRow1; + SCROW nLastRow = theQueryData.nRow2; + nFirstRow++; ++ bool bHasDates = false; + + pEntryLists[nColumn] = new TypedScStrCollection( 128, 128 ); + pEntryLists[nColumn]->SetCaseSensitive( aBtnCase.IsChecked() ); + pDoc->GetFilterEntriesArea( nColumn, nFirstRow, nLastRow, +- nTab, *pEntryLists[nColumn] ); ++ nTab, *pEntryLists[nColumn], bHasDates ); + } + + TypedScStrCollection* pColl = pEntryLists[nColumn]; +diff --git sc/source/ui/inc/filtdlg.hxx sc/source/ui/inc/filtdlg.hxx +index c418e82..7409b5a 100644 +--- sc/source/ui/inc/filtdlg.hxx ++++ sc/source/ui/inc/filtdlg.hxx +@@ -167,6 +167,7 @@ private: + ListBox* aFieldLbArr[4]; + ListBox* aCondLbArr[4]; + ListBox* aConnLbArr[4]; ++ bool mbHasDates[MAXQUERY]; + BOOL bRefreshExceptQuery[MAXQUERY]; + USHORT nFieldCount; + BOOL bRefInputMode; +diff --git sc/source/ui/inc/gridwin.hxx sc/source/ui/inc/gridwin.hxx +index 4013e1a..aae0353 100644 +--- sc/source/ui/inc/gridwin.hxx ++++ sc/source/ui/inc/gridwin.hxx +@@ -218,7 +218,7 @@ private: + + BOOL IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab ); + void ExecFilter( ULONG nSel, SCCOL nCol, SCROW nRow, +- const String& aValue ); ++ const String& aValue, bool bCheckForDates ); + void FilterSelect( ULONG nSel ); + + void ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr ); +diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx +index b547e2c..6fc33d5 100644 +--- sc/source/ui/view/gridwin.cxx ++++ sc/source/ui/view/gridwin.cxx +@@ -170,6 +170,7 @@ private: + BOOL bInit; + BOOL bCancelled; + BOOL bInSelect; ++ bool mbListHasDates; + ULONG nSel; + ScFilterBoxMode eMode; + +@@ -193,6 +194,8 @@ public: + BOOL IsInInit() const { return bInit; } + void SetCancelled() { bCancelled = TRUE; } + BOOL IsInSelect() const { return bInSelect; } ++ void SetListHasDates(bool b) { mbListHasDates = b; } ++ bool HasDates() const { return mbListHasDates; } + }; + + //------------------------------------------------------------------- +@@ -208,6 +211,7 @@ ScFilterListBox::ScFilterListBox( Window* pParent, ScGridWindow* pGrid, + bInit( TRUE ), + bCancelled( FALSE ), + bInSelect( FALSE ), ++ mbListHasDates(false), + nSel( 0 ), + eMode( eNewMode ) + { +@@ -912,7 +916,9 @@ void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, BOOL bDataSelect ) + pFilterBox->SetSeparatorPos( nDefCount - 1 ); + + // get list entries +- pDoc->GetFilterEntries( nCol, nRow, nTab, aStrings, true ); ++ bool bHasDates = false; ++ pDoc->GetFilterEntries( nCol, nRow, nTab, true, aStrings, bHasDates); ++ pFilterBox->SetListHasDates(bHasDates); + + // check widths of numerical entries (string entries are not included) + // so all numbers are completely visible +@@ -1122,7 +1128,7 @@ void ScGridWindow::FilterSelect( ULONG nSel ) + ExecDataSelect( nCol, nRow, aString ); + break; + case SC_FILTERBOX_FILTER: +- ExecFilter( nSel, nCol, nRow, aString ); ++ ExecFilter( nSel, nCol, nRow, aString, pFilterBox->HasDates() ); + break; + case SC_FILTERBOX_SCENARIO: + pViewData->GetView()->UseScenario( aString ); +@@ -1155,7 +1161,7 @@ void ScGridWindow::ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr ) + + void ScGridWindow::ExecFilter( ULONG nSel, + SCCOL nCol, SCROW nRow, +- const String& aValue ) ++ const String& aValue, bool bCheckForDates ) + { + SCTAB nTab = pViewData->GetTabNo(); + ScDocument* pDoc = pViewData->GetDocument(); +@@ -1227,6 +1233,7 @@ void ScGridWindow::ExecFilter( ULONG nSel, + rNewEntry.bDoQuery = TRUE; + rNewEntry.bQueryByString = TRUE; + rNewEntry.nField = nCol; ++ rNewEntry.bQueryByDate = bCheckForDates; + if ( nSel == SC_AUTOFILTER_TOP10 ) + { + rNewEntry.eOp = SC_TOPVAL; diff --git a/applied_patches/0139-sc-paste-on-enter.diff b/applied_patches/0139-sc-paste-on-enter.diff dissimilarity index 80% index 6b3bb2493..295a7fdb7 100644 --- a/applied_patches/0139-sc-paste-on-enter.diff +++ b/applied_patches/0139-sc-paste-on-enter.diff @@ -1,314 +1,189 @@ -Index: sc/source/ui/inc/cellsh.hxx -=================================================================== -RCS file: /cvs/sc/sc/source/ui/inc/cellsh.hxx,v -retrieving revision 1.9 -diff -u -p -r1.9 cellsh.hxx ---- sc/source/ui/inc/cellsh.hxx 10 Apr 2008 22:43:12 -0000 1.9 -+++ sc/source/ui/inc/cellsh.hxx 1 May 2008 20:04:42 -0000 -@@ -42,6 +42,7 @@ class SvxClipboardFmtItem; - class TransferableDataHelper; - class TransferableClipboardListener; - class AbstractScLinkedAreaDlg; -+class ScTabViewShell; - - struct CellShell_Impl - { -@@ -102,6 +103,7 @@ public: - void ExecutePageSel( SfxRequest& rReq ); - void ExecuteMove( SfxRequest& rReq ); - void GetStateCursor( SfxItemSet& rSet ); -+ static void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, BOOL bShowDialog ); - }; - - #endif -Index: sc/source/ui/inc/viewdata.hxx -=================================================================== -RCS file: /cvs/sc/sc/source/ui/inc/viewdata.hxx,v -retrieving revision 1.24 -diff -u -p -r1.24 viewdata.hxx ---- sc/source/ui/inc/viewdata.hxx 18 Apr 2008 11:36:48 -0000 1.24 -+++ sc/source/ui/inc/viewdata.hxx 1 May 2008 20:04:42 -0000 -@@ -89,6 +89,13 @@ enum ScMarkType - #endif - }; - -+enum ScPasteFlags -+{ -+ SC_PASTE_NONE = 0, // No flags specified -+ SC_PASTE_MODE = 1, // Enable paste-mode -+ SC_PASTE_BORDER = 2, // Show a border around the source cells -+}; -+ - class ScDocShell; - class ScDocument; - class ScDBFunc; -@@ -210,6 +219,8 @@ private: - SCCOL nTabStartCol; // fuer Enter nach Tab - ScRange aDelRange; // fuer AutoFill-Loeschen - -+ ScPasteFlags nPasteFlags; -+ - ScSplitPos eEditActivePart; // the part that was active when edit mode was started - BOOL bEditActive[4]; // aktiv? - BOOL bActive; // aktives Fenster ? -@@ -295,6 +306,8 @@ public: - SCCOL GetFixPosX() const { return pThisTab->nFixPosX; } - SCROW GetFixPosY() const { return pThisTab->nFixPosY; } - BOOL IsPagebreakMode() const { return bPagebreak; } -+ BOOL IsPasteMode() const { return nPasteFlags & SC_PASTE_MODE; } -+ BOOL ShowPasteSource() const { return nPasteFlags & SC_PASTE_BORDER; } - - void SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX ); - void SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ); -@@ -309,6 +322,7 @@ public: - void SetFixPosX( SCCOL nPos ) { pThisTab->nFixPosX = nPos; } - void SetFixPosY( SCROW nPos ) { pThisTab->nFixPosY = nPos; } - void SetPagebreakMode( BOOL bSet ); -+ void SetPasteMode ( ScPasteFlags nFlags ) { nPasteFlags = nFlags; } - - void SetZoomType( SvxZoomType eNew, BOOL bAll ); - void SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll ); -Index: sc/source/ui/view/cellsh1.cxx -=================================================================== -RCS file: /cvs/sc/sc/source/ui/view/cellsh1.cxx,v -retrieving revision 1.51 -diff -u -p -r1.51 cellsh1.cxx ---- sc/source/ui/view/cellsh1.cxx 18 Apr 2008 11:40:55 -0000 1.51 -+++ sc/source/ui/view/cellsh1.cxx 1 May 2008 20:04:42 -0000 -@@ -1168,6 +1178,8 @@ void ScCellShell::ExecuteEdit( SfxReques - WaitObject aWait( GetViewData()->GetDialogParent() ); - pTabViewShell->CopyToClip( NULL, FALSE, FALSE, TRUE ); - rReq.Done(); -+ GetViewData()->SetPasteMode( (ScPasteFlags) (SC_PASTE_MODE | SC_PASTE_BORDER) ); -+ pTabViewShell->ShowCursor(); - } - break; - -@@ -1176,46 +1188,15 @@ void ScCellShell::ExecuteEdit( SfxReques - WaitObject aWait( GetViewData()->GetDialogParent() ); - pTabViewShell->CutToClip( NULL, TRUE ); - rReq.Done(); -+ GetViewData()->SetPasteMode( SC_PASTE_MODE ); - } - break; - - case SID_PASTE: - { -- Window* pWin = GetViewData()->GetActiveWin(); -- ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); -- ScDocument* pThisDoc = GetViewData()->GetDocument(); -- ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( GetViewData()->GetCurX(), -- GetViewData()->GetCurY(), GetViewData()->GetTabNo() ); -- if ( pOwnClip && pDPObj ) -- { -- // paste from Calc into DataPilot table: sort (similar to drag & drop) -- -- ScDocument* pClipDoc = pOwnClip->GetDocument(); -- SCTAB nSourceTab = pOwnClip->GetVisibleTab(); -- -- SCCOL nClipStartX; -- SCROW nClipStartY; -- SCCOL nClipEndX; -- SCROW nClipEndY; -- pClipDoc->GetClipStart( nClipStartX, nClipStartY ); -- pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE ); -- nClipEndX = nClipEndX + nClipStartX; -- nClipEndY = nClipEndY + nClipStartY; // GetClipArea returns the difference -- -- ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab ); -- BOOL bDone = pTabViewShell->DataPilotMove( aSource, GetViewData()->GetCurPos() ); -- if ( !bDone ) -- pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT ); -- } -- else -- { -- // normal paste -- WaitObject aWait( GetViewData()->GetDialogParent() ); -- pTabViewShell->PasteFromSystem(); -- } -+ PasteFromClipboard ( GetViewData(), pTabViewShell, TRUE ); - rReq.Done(); - } -- pTabViewShell->CellContentChanged(); // => PasteFromSystem() ??? - break; - - case SID_CLIPBOARD_FORMAT_ITEMS: -@@ -2264,3 +2245,47 @@ IMPL_LINK( ScCellShell, DialogClosed, Ab - return 0; - } - -+void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, BOOL bShowDialog ) -+{ -+ Window* pWin = pViewData->GetActiveWin(); -+ ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin ); -+ ScDocument* pThisDoc = pViewData->GetDocument(); -+ ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( pViewData->GetCurX(), -+ pViewData->GetCurY(), pViewData->GetTabNo() ); -+ if ( pOwnClip && pDPObj ) -+ { -+ // paste from Calc into DataPilot table: sort (similar to drag & drop) -+ -+ ScDocument* pClipDoc = pOwnClip->GetDocument(); -+ SCTAB nSourceTab = pOwnClip->GetVisibleTab(); -+ -+ SCCOL nClipStartX; -+ SCROW nClipStartY; -+ SCCOL nClipEndX; -+ SCROW nClipEndY; -+ pClipDoc->GetClipStart( nClipStartX, nClipStartY ); -+ pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE ); -+ nClipEndX = nClipEndX + nClipStartX; -+ nClipEndY = nClipEndY + nClipStartY; // GetClipArea returns the difference -+ -+ ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab ); -+ BOOL bDone = pTabViewShell->DataPilotMove( aSource, pViewData->GetCurPos() ); -+ if ( !bDone ) -+ pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT ); -+ } -+ else -+ { -+ // normal paste -+ WaitObject aWait( pViewData->GetDialogParent() ); -+ if (!pOwnClip) -+ pTabViewShell->PasteFromSystem(); -+ else -+ { -+ pTabViewShell->PasteFromClip( IDF_ALL, pOwnClip->GetDocument(), -+ PASTE_NOFUNC, FALSE, FALSE, FALSE, INS_NONE, IDF_NONE, -+ bShowDialog ); // allow warning dialog -+ } -+ } -+ pTabViewShell->CellContentChanged(); // => PasteFromSystem() ??? -+} -+ -Index: sc/source/ui/view/viewdata.cxx -=================================================================== -RCS file: /cvs/sc/sc/source/ui/view/viewdata.cxx,v -retrieving revision 1.65 -diff -u -p -r1.65 viewdata.cxx ---- sc/source/ui/view/viewdata.cxx 18 Apr 2008 12:01:29 -0000 1.65 -+++ sc/source/ui/view/viewdata.cxx 1 May 2008 20:04:43 -0000 -@@ -306,6 +306,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) - eRefType ( SC_REFTYPE_NONE ), - nTabNo ( 0 ), - nRefTabNo ( 0 ), -+ nPasteFlags ( SC_PASTE_NONE ), - eEditActivePart( SC_SPLIT_BOTTOMLEFT ), - bActive ( TRUE ), //! wie initialisieren? - bIsRefMode ( FALSE ), -@@ -441,6 +450,7 @@ void ScViewData::InitFrom( const ScViewD - //UNUSED2008-05 aDefPageZoomX = pRef->aDefPageZoomX; - //UNUSED2008-05 aDefPageZoomY = pRef->aDefPageZoomY; - //UNUSED2008-05 bPagebreak = pRef->bPagebreak; -+//UNUSED2008-05 nPasteFlags = pRef->nPasteFlags; - //UNUSED2008-05 aLogicMode = pRef->aLogicMode; - //UNUSED2008-05 - //UNUSED2008-05 SetGridMode ( pRef->IsGridMode() ); ---- sc/source/ui/view/gridwin.cxx -+++ sc/source/ui/view/gridwin.cxx -@@ -118,6 +118,7 @@ - #include "userdat.hxx" - #include "drwlayer.hxx" - #include "attrib.hxx" -+#include "cellsh.hxx" - #include "validat.hxx" - #include "tabprotection.hxx" - #include "postit.hxx" -@@ -2934,12 +2935,30 @@ void ScGridWindow::SelectForContextMenu( - } - } - -+static void ClearSingleSelection( ScViewData* pViewData ) -+{ -+ SCCOL nX; -+ SCROW nY; -+ ScTransferObj* pTransObj = ScTransferObj::GetOwnClipboard( -+ pViewData->GetActiveWin() ); -+ if (!pTransObj) -+ return; -+ -+ ScDocument* pClipDoc = pTransObj->GetDocument(); -+ pClipDoc->GetClipArea( nX, nY, TRUE ); -+ if (nX == 0 && nY == 0) -+ { -+ ScTabView* pView = pViewData->GetView(); -+ pView->Unmark(); -+ } -+} -+ - void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt) - { - // #96965# Cursor control for ref input dialog -+ const KeyCode& rKeyCode = rKEvt.GetKeyCode(); - if( SC_MOD()->IsRefDialogOpen() ) - { -- const KeyCode& rKeyCode = rKEvt.GetKeyCode(); - if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) ) - { - SC_MOD()->EndReference(); -@@ -2954,9 +2973,35 @@ void __EXPORT ScGridWindow::KeyInput(con - return; - } - } -+ else if( rKeyCode.GetCode() == KEY_RETURN && pViewData->IsPasteMode() ) -+ { -+ ScTabViewShell* pTabViewShell = pViewData->GetViewShell(); -+ -+ ScCellShell::PasteFromClipboard( pViewData, pTabViewShell, FALSE ); -+ ClearSingleSelection( pViewData ); -+ -+ uno::Reference xSystemClipboard = -+ TransferableHelper::GetSystemClipboard(); -+ if (xSystemClipboard.is()) -+ { -+ xSystemClipboard->setContents( -+ uno::Reference(), -+ uno::Reference()); -+ } -+ -+ // hide the border around the copy source -+ pViewData->SetPasteMode( SC_PASTE_NONE ); -+ UpdateCursorOverlay(); -+ return; -+ } - // wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs: - else if( !pViewData->IsAnyFillMode() ) - { -+ if (rKeyCode.GetCode() == KEY_ESCAPE) -+ { -+ pViewData->SetPasteMode( SC_PASTE_NONE ); -+ UpdateCursorOverlay(); -+ } - // query for existing note marker before calling ViewShell's keyboard handling - // which may remove the marker - BOOL bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() ); -Index: sc/source/ui/app/inputhdl.cxx -=================================================================== -RCS file: /cvs/sc/sc/source/ui/app/inputhdl.cxx,v -retrieving revision 1.77 -diff -u -p -r1.77 inputhdl.cxx ---- sc/source/ui/app/inputhdl.cxx 10 Apr 2008 21:45:27 -0000 1.77 -+++ sc/source/ui/app/inputhdl.cxx 1 May 2008 20:04:44 -0000 -@@ -1699,6 +1699,7 @@ IMPL_LINK( ScInputHandler, ModifyHdl, vo - - BOOL ScInputHandler::DataChanging( sal_Unicode cTyped, BOOL bFromCommand ) // return TRUE = new view created - { -+ pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE ); - bInOwnChange = TRUE; // disable ModifyHdl (reset in DataChanged) - - if ( eMode == SC_INPUT_NONE ) -Index: sc/source/ui/view/viewfunc.cxx -=================================================================== -RCS file: /cvs/sc/sc/source/ui/view/viewfunc.cxx,v -retrieving revision 1.44 -diff -u -p -r1.44 viewfunc.cxx ---- sc/source/ui/view/viewfunc.cxx 18 Apr 2008 11:50:48 -0000 1.44 -+++ sc/source/ui/view/viewfunc.cxx 1 May 2008 20:04:44 -0000 -@@ -1785,6 +1799,7 @@ void ScViewFunc::DeleteMulti( BOOL bRows - - void ScViewFunc::DeleteContents( USHORT nFlags, BOOL bRecord ) - { -+ GetViewData()->SetPasteMode( SC_PASTE_NONE ); - // nur wegen Matrix nicht editierbar? Attribute trotzdem ok - BOOL bOnlyNotBecauseOfMatrix; - BOOL bEditable = SelectionEditable( &bOnlyNotBecauseOfMatrix ); +diff --git sc/source/ui/app/inputhdl.cxx sc/source/ui/app/inputhdl.cxx +index 98aac39..6ac26bc 100644 +--- sc/source/ui/app/inputhdl.cxx ++++ sc/source/ui/app/inputhdl.cxx +@@ -2055,6 +2055,7 @@ IMPL_LINK( ScInputHandler, ModifyHdl, void *, EMPTYARG ) + + BOOL ScInputHandler::DataChanging( sal_Unicode cTyped, BOOL bFromCommand ) // return TRUE = new view created + { ++ pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE ); + bInOwnChange = TRUE; // disable ModifyHdl (reset in DataChanged) + + if ( eMode == SC_INPUT_NONE ) +diff --git sc/source/ui/inc/viewdata.hxx sc/source/ui/inc/viewdata.hxx +index 6f0d986..19583a8 100644 +--- sc/source/ui/inc/viewdata.hxx ++++ sc/source/ui/inc/viewdata.hxx +@@ -89,6 +89,13 @@ enum ScMarkType + #endif + }; + ++enum ScPasteFlags ++{ ++ SC_PASTE_NONE = 0, // No flags specified ++ SC_PASTE_MODE = 1, // Enable paste-mode ++ SC_PASTE_BORDER = 2, // Show a border around the source cells ++}; ++ + class ScDocShell; + class ScDocument; + class ScDBFunc; +@@ -210,6 +217,8 @@ private: + SCCOL nTabStartCol; // fuer Enter nach Tab + ScRange aDelRange; // fuer AutoFill-Loeschen + ++ ScPasteFlags nPasteFlags; ++ + ScSplitPos eEditActivePart; // the part that was active when edit mode was started + BOOL bEditActive[4]; // aktiv? + BOOL bActive; // aktives Fenster ? +@@ -295,6 +304,8 @@ public: + SCCOL GetFixPosX() const { return pThisTab->nFixPosX; } + SCROW GetFixPosY() const { return pThisTab->nFixPosY; } + BOOL IsPagebreakMode() const { return bPagebreak; } ++ BOOL IsPasteMode() const { return nPasteFlags & SC_PASTE_MODE; } ++ BOOL ShowPasteSource() const { return nPasteFlags & SC_PASTE_BORDER; } + + void SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX ); + void SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ); +@@ -309,6 +320,7 @@ public: + void SetFixPosX( SCCOL nPos ) { pThisTab->nFixPosX = nPos; } + void SetFixPosY( SCROW nPos ) { pThisTab->nFixPosY = nPos; } + void SetPagebreakMode( BOOL bSet ); ++ void SetPasteMode ( ScPasteFlags nFlags ) { nPasteFlags = nFlags; } + + void SetZoomType( SvxZoomType eNew, BOOL bAll ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll ); +diff --git sc/source/ui/view/cellsh1.cxx sc/source/ui/view/cellsh1.cxx +index ba66243..0cd4007 100644 +--- sc/source/ui/view/cellsh1.cxx ++++ sc/source/ui/view/cellsh1.cxx +@@ -1170,6 +1170,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) + WaitObject aWait( GetViewData()->GetDialogParent() ); + pTabViewShell->CopyToClip( NULL, FALSE, FALSE, TRUE ); + rReq.Done(); ++ GetViewData()->SetPasteMode( (ScPasteFlags) (SC_PASTE_MODE | SC_PASTE_BORDER) ); ++ pTabViewShell->ShowCursor(); + } + break; + +@@ -1178,6 +1180,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) + WaitObject aWait( GetViewData()->GetDialogParent() ); + pTabViewShell->CutToClip( NULL, TRUE ); + rReq.Done(); ++ GetViewData()->SetPasteMode( SC_PASTE_MODE ); + } + break; + +diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx +index 6fc33d5..6e0280a 100644 +--- sc/source/ui/view/gridwin.cxx ++++ sc/source/ui/view/gridwin.cxx +@@ -118,6 +118,7 @@ + #include "userdat.hxx" + #include "drwlayer.hxx" + #include "attrib.hxx" ++#include "cellsh.hxx" + #include "validat.hxx" + #include "tabprotection.hxx" + #include "postit.hxx" +@@ -2969,12 +2970,30 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel ) + } + } + ++static void ClearSingleSelection( ScViewData* pViewData ) ++{ ++ SCCOL nX; ++ SCROW nY; ++ ScTransferObj* pTransObj = ScTransferObj::GetOwnClipboard( ++ pViewData->GetActiveWin() ); ++ if (!pTransObj) ++ return; ++ ++ ScDocument* pClipDoc = pTransObj->GetDocument(); ++ pClipDoc->GetClipArea( nX, nY, TRUE ); ++ if (nX == 0 && nY == 0) ++ { ++ ScTabView* pView = pViewData->GetView(); ++ pView->Unmark(); ++ } ++} ++ + void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt) + { + // #96965# Cursor control for ref input dialog ++ const KeyCode& rKeyCode = rKEvt.GetKeyCode(); + if( SC_MOD()->IsRefDialogOpen() ) + { +- const KeyCode& rKeyCode = rKEvt.GetKeyCode(); + if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) ) + { + SC_MOD()->EndReference(); +@@ -2989,9 +3008,35 @@ void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt) + return; + } + } ++ else if( rKeyCode.GetCode() == KEY_RETURN && pViewData->IsPasteMode() ) ++ { ++ ScTabViewShell* pTabViewShell = pViewData->GetViewShell(); ++ ++ ScCellShell::PasteFromClipboard( pViewData, pTabViewShell, FALSE ); ++ ClearSingleSelection( pViewData ); ++ ++ uno::Reference xSystemClipboard = ++ TransferableHelper::GetSystemClipboard(); ++ if (xSystemClipboard.is()) ++ { ++ xSystemClipboard->setContents( ++ uno::Reference(), ++ uno::Reference()); ++ } ++ ++ // hide the border around the copy source ++ pViewData->SetPasteMode( SC_PASTE_NONE ); ++ UpdateCursorOverlay(); ++ return; ++ } + // wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs: + else if( !pViewData->IsAnyFillMode() ) + { ++ if (rKeyCode.GetCode() == KEY_ESCAPE) ++ { ++ pViewData->SetPasteMode( SC_PASTE_NONE ); ++ UpdateCursorOverlay(); ++ } + // query for existing note marker before calling ViewShell's keyboard handling + // which may remove the marker + BOOL bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() ); +diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx +index df48982..e75b864 100644 +--- sc/source/ui/view/viewdata.cxx ++++ sc/source/ui/view/viewdata.cxx +@@ -306,6 +306,7 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) + eRefType ( SC_REFTYPE_NONE ), + nTabNo ( 0 ), + nRefTabNo ( 0 ), ++ nPasteFlags ( SC_PASTE_NONE ), + eEditActivePart( SC_SPLIT_BOTTOMLEFT ), + bActive ( TRUE ), //! wie initialisieren? + bIsRefMode ( FALSE ), +@@ -432,6 +433,7 @@ void ScViewData::InitData( ScDocument* pDocument ) + //UNUSED2008-05 aDefPageZoomX = pRef->aDefPageZoomX; + //UNUSED2008-05 aDefPageZoomY = pRef->aDefPageZoomY; + //UNUSED2008-05 bPagebreak = pRef->bPagebreak; ++//UNUSED2008-05 nPasteFlags = pRef->nPasteFlags; + //UNUSED2008-05 aLogicMode = pRef->aLogicMode; + //UNUSED2008-05 + //UNUSED2008-05 SetGridMode ( pRef->IsGridMode() ); +diff --git sc/source/ui/view/viewfunc.cxx sc/source/ui/view/viewfunc.cxx +index 8155a80..61670e7 100644 +--- sc/source/ui/view/viewfunc.cxx ++++ sc/source/ui/view/viewfunc.cxx +@@ -1910,6 +1910,7 @@ void ScViewFunc::DeleteMulti( BOOL bRows, BOOL bRecord ) + + void ScViewFunc::DeleteContents( USHORT nFlags, BOOL bRecord ) + { ++ GetViewData()->SetPasteMode( SC_PASTE_NONE ); + // nur wegen Matrix nicht editierbar? Attribute trotzdem ok + BOOL bOnlyNotBecauseOfMatrix; + BOOL bEditable = SelectionEditable( &bOnlyNotBecauseOfMatrix ); diff --git a/applied_patches/0140-calc-multi-range-copy-paste.diff b/applied_patches/0140-calc-multi-range-copy-paste.diff deleted file mode 100644 index c17efcf41..000000000 --- a/applied_patches/0140-calc-multi-range-copy-paste.diff +++ /dev/null @@ -1,2036 +0,0 @@ -diff --git sc/inc/cell.hxx sc/inc/cell.hxx -index 5454907..b460a31 100644 ---- sc/inc/cell.hxx -+++ sc/inc/cell.hxx -@@ -40,6 +40,7 @@ - #include - #include - #include "global.hxx" -+#include "rangenam.hxx" - #include "formula/grammar.hxx" - #include "tokenarray.hxx" - #include "formularesult.hxx" -@@ -462,6 +463,7 @@ public: - BOOL IsRangeNameInUse(USHORT nIndex) const; - void FindRangeNamesInUse(std::set& rIndexes) const; - void ReplaceRangeNamesInUse( const ScIndexMap& rMap ); -+ void ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap ); - BOOL IsSubTotal() const { return bSubTotal; } - BOOL IsChanged() const { return bChanged; } - void ResetChanged() { bChanged = FALSE; } -diff --git sc/inc/clipparam.hxx sc/inc/clipparam.hxx -new file mode 100644 -index 0000000..1a46f4c ---- /dev/null -+++ sc/inc/clipparam.hxx -@@ -0,0 +1,90 @@ -+/************************************************************************* -+ * -+ * 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: document.hxx,v $ -+ * $Revision: 1.115.36.9 $ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef SC_CLIPPARAM_HXX -+#define SC_CLIPPARAM_HXX -+ -+#include "rangelst.hxx" -+#include "rangenam.hxx" -+ -+#include -+ -+/** -+ * This struct stores general clipboard parameters associated with a -+ * ScDocument instance created in clipboard mode. -+ */ -+struct ScClipParam -+{ -+ enum Direction { Unspecified, Column, Row }; -+ -+ ScRangeList maRanges; -+ Direction meDirection; -+ bool mbCutMode; -+ -+ ScClipParam(); -+ explicit ScClipParam(const ScClipParam& r); -+ -+ bool isMultiRange() const; -+ -+ /** -+ * Get the column size of a pasted range. Note that when the range is -+ * non-contiguous, we first compress all individual ranges into a single -+ * range, and the size of that compressed range is returned. -+ */ -+ SCCOL getPasteColSize(); -+ -+ /** -+ * Same as the above method, but returns the row size of the compressed -+ * range. -+ */ -+ SCROW getPasteRowSize(); -+ -+ /** -+ * Return a single range that encompasses all individual ranges. -+ */ -+ ScRange getWholeRange() const; -+ -+ void transpose(); -+}; -+ -+// ============================================================================ -+ -+struct ScClipRangeNameData -+{ -+ ScRangeData::IndexMap maRangeMap; -+ ::std::vector mpRangeNames; -+ bool mbReplace; -+ -+ ScClipRangeNameData(); -+ ~ScClipRangeNameData(); -+ void insert(sal_uInt16 nOldIndex, sal_uInt16 nNewIndex); -+}; -+ -+#endif -diff --git sc/inc/column.hxx sc/inc/column.hxx -index 64ac9a0..5b17512 100644 ---- sc/inc/column.hxx -+++ sc/inc/column.hxx -@@ -35,6 +35,7 @@ - #include "global.hxx" - #include "compressedarray.hxx" - #include "address.hxx" -+#include "rangenam.hxx" - #include - - #include -@@ -301,6 +302,7 @@ public: - BOOL IsRangeNameInUse(SCROW nRow1, SCROW nRow2, USHORT nIndex) const; - void FindRangeNamesInUse(SCROW nRow1, SCROW nRow2, std::set& rIndexes) const; - void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScIndexMap& rMap ); -+ void ReplaceRangeNamesInUse( SCROW nRow1, SCROW nRow2, const ScRangeData::IndexMap& rMap ); - - const SfxPoolItem* GetAttr( SCROW nRow, USHORT nWhich ) const; - const ScPatternAttr* GetPattern( SCROW nRow ) const; ---- sc/inc/document.hxx -+++ sc/inc/document.hxx -@@ -138,6 +138,8 @@ class ScAutoNameCache; - class ScTemporaryChartLock; - class ScLookupCache; - struct ScLookupCacheMapImpl; -+struct ScClipParam; -+struct ScClipRangeNameData; - class SfxUndoManager; - class ScFormulaParserPool; - -@@ -286,6 +288,7 @@ private: - ScFieldEditEngine* pCacheFieldEditEngine; - - ::std::auto_ptr pDocProtection; -+ ::std::auto_ptr mpClipParam; - - ::std::auto_ptr pExternalRefMgr; - String aDocName; // opt: Dokumentname -@@ -307,7 +310,6 @@ private: - - sal_uInt32 nRangeOverflowType; // used in (xml) loading for overflow warnings - -- ScRange aClipRange; - ScRange aEmbedRange; - ScAddress aCurTextWidthCalcPos; - ScAddress aOnlineSpellPos; // within whole document -@@ -357,7 +359,6 @@ private: - BOOL bForcedFormulaPending; - BOOL bCalculatingFormulaTree; - BOOL bIsClip; -- BOOL bCutMode; - BOOL bIsUndo; - BOOL bIsVisible; // set from view ctor - -@@ -957,6 +958,9 @@ public: - BOOL bKeepScenarioFlags = FALSE, - BOOL bIncludeObjects = FALSE, - BOOL bCloneNoteCaptions = TRUE); -+ void CopyToClip(const ScClipParam& rClipParam, ScDocument* pClipDoc, -+ const ScMarkData* pMarks = NULL, bool bKeepScenarioFlags = false, -+ bool bIncludeObjects = false, bool bCloneNoteCaptions = true); - void CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - SCTAB nTab, ScDocument* pClipDoc = NULL); - void CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, -@@ -984,6 +988,12 @@ public: - BOOL bSkipAttrForEmpty = FALSE, - const ScRangeList * pDestRanges = NULL ); - -+ void CopyMultiRangeFromClip(const ScAddress& rDestPos, const ScMarkData& rMark, -+ sal_uInt16 nInsFlag, ScDocument* pClipDoc, -+ bool bResetCut = true, bool bAsLink = false, -+ bool bIncludeFiltered = true, -+ bool bSkipAttrForEmpty = false); -+ - void GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered); - void GetClipStart(SCCOL& nClipX, SCROW& nClipY); - -@@ -993,6 +1003,9 @@ public: - - SC_DLLPUBLIC void TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsLink ); - -+ ScClipParam& GetClipParam(); -+ void SetClipParam(const ScClipParam& rParam); -+ - void MixDocument( const ScRange& rRange, USHORT nFunction, BOOL bSkipEmpty, - ScDocument* pSrcDoc ); - -@@ -1692,6 +1705,23 @@ public: - - private: // CLOOK-Impl-Methoden - -+ /** -+ * Use this class as a locale variable to merge number formatter from -+ * another document, and set NULL pointer to pFormatExchangeList when -+ * done. -+ */ -+ class NumFmtMergeHandler -+ { -+ public: -+ explicit NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc); -+ ~NumFmtMergeHandler(); -+ -+ private: -+ ScDocument* mpDoc; -+ }; -+ -+ void MergeNumberFormatter(ScDocument* pSrcDoc); -+ - void ImplCreateOptions(); // bei Gelegenheit auf on-demand umstellen? - void ImplDeleteOptions(); - -@@ -1713,6 +1743,12 @@ private: // CLOOK-Impl-Methoden - void UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, - const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); - -+ void CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs); -+ void CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames); -+ void UpdateRangeNamesInFormulas( -+ ScClipRangeNameData& rRangeNames, const ScRangeList& rDestRanges, const ScMarkData& rMark, -+ SCCOL nXw, SCROW nYw); -+ - BOOL HasPartOfMerged( const ScRange& rRange ); - - std::map< SCTAB, ScSortParam > mSheetSortParams; -diff --git sc/inc/rangenam.hxx sc/inc/rangenam.hxx -index 8231cbd..ece1609 100644 ---- sc/inc/rangenam.hxx -+++ sc/inc/rangenam.hxx -@@ -37,6 +37,8 @@ - #include "formula/grammar.hxx" - #include "scdllapi.h" - -+#include -+ - //------------------------------------------------------------------------ - - class ScDocument; -@@ -84,6 +86,8 @@ private: - friend class ScRangeName; - ScRangeData( USHORT nIndex ); - public: -+ typedef ::std::map IndexMap; -+ - SC_DLLPUBLIC ScRangeData( ScDocument* pDoc, - const String& rName, - const String& rSymbol, -@@ -150,6 +154,7 @@ public: - void ValidateTabRefs(); - - void ReplaceRangeNamesInUse( const ScIndexMap& rMap ); -+ void ReplaceRangeNamesInUse( const IndexMap& rMap ); - - static void MakeValidName( String& rName ); - SC_DLLPUBLIC static BOOL IsNameValid( const String& rName, ScDocument* pDoc ); -diff --git sc/inc/table.hxx sc/inc/table.hxx -index 734ad3c..b32bb64 100644 ---- sc/inc/table.hxx -+++ sc/inc/table.hxx -@@ -292,6 +292,8 @@ public: - void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nDelFlag); - void CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable, - BOOL bKeepScenarioFlags, BOOL bCloneNoteCaptions); -+ void CopyToClip(const ScRangeList& rRanges, ScTable* pTable, -+ bool bKeepScenarioFlags, bool bCloneNoteCaptions); - void CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy, - USHORT nInsFlag, BOOL bAsLink, BOOL bSkipAttrForEmpty, ScTable* pTable); - void StartListeningInArea( SCCOL nCol1, SCROW nRow1, -@@ -406,6 +408,8 @@ public: - std::set& rIndexes) const; - void ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - const ScIndexMap& rMap ); -+ void ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, -+ const ScRangeData::IndexMap& rMap ); - void Fill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - ULONG nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, - double nStepValue, double nMaxValue); -diff --git sc/source/core/data/cell2.cxx sc/source/core/data/cell2.cxx -index 7e29ed7..c0c17ce 100644 ---- sc/source/core/data/cell2.cxx -+++ sc/source/core/data/cell2.cxx -@@ -1318,6 +1318,26 @@ void ScFormulaCell::ReplaceRangeNamesInUse( const ScIndexMap& rMap ) - CompileTokenArray(); - } - -+void ScFormulaCell::ReplaceRangeNamesInUse( const ScRangeData::IndexMap& rMap ) -+{ -+ for( FormulaToken* p = pCode->First(); p; p = pCode->Next() ) -+ { -+ if( p->GetOpCode() == ocName ) -+ { -+ sal_uInt16 nIndex = p->GetIndex(); -+ ScRangeData::IndexMap::const_iterator itr = rMap.find(nIndex); -+ sal_uInt16 nNewIndex = itr == rMap.end() ? nIndex : nNewIndex; -+ if ( nIndex != nNewIndex ) -+ { -+ p->SetIndex( nNewIndex ); -+ bCompile = TRUE; -+ } -+ } -+ } -+ if( bCompile ) -+ CompileTokenArray(); -+} -+ - void ScFormulaCell::CompileDBFormula() - { - for( FormulaToken* p = pCode->First(); p; p = pCode->Next() ) -diff --git sc/source/core/data/clipparam.cxx sc/source/core/data/clipparam.cxx -new file mode 100644 -index 0000000..564b04d ---- /dev/null -+++ sc/source/core/data/clipparam.cxx -@@ -0,0 +1,200 @@ -+/************************************************************************* -+ * -+ * 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: document.cxx,v $ -+ * $Revision: 1.90.36.8 $ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+#include "precompiled_sc.hxx" -+ -+// INCLUDE --------------------------------------------------------------- -+ -+#include "clipparam.hxx" -+ -+using ::std::vector; -+ -+ScClipParam::ScClipParam() : -+ meDirection(Unspecified), -+ mbCutMode(false) -+{ -+} -+ -+ScClipParam::ScClipParam(const ScClipParam& r) : -+ maRanges(r.maRanges), -+ meDirection(r.meDirection), -+ mbCutMode(r.mbCutMode) -+{ -+} -+ -+bool ScClipParam::isMultiRange() const -+{ -+ return maRanges.Count() > 1; -+} -+ -+SCCOL ScClipParam::getPasteColSize() -+{ -+ if (!maRanges.Count()) -+ return 0; -+ -+ switch (meDirection) -+ { -+ case ScClipParam::Column: -+ { -+ SCCOL nColSize = 0; -+ for (ScRangePtr p = maRanges.First(); p; p = maRanges.Next()) -+ nColSize += p->aEnd.Col() - p->aStart.Col() + 1; -+ return nColSize; -+ } -+ break; -+ case ScClipParam::Row: -+ { -+ // We assume that all ranges have identical column size. -+ const ScRange& rRange = *maRanges.First(); -+ return rRange.aEnd.Col() - rRange.aStart.Col() + 1; -+ } -+ break; -+ case ScClipParam::Unspecified: -+ default: -+ ; -+ } -+ return 0; -+} -+ -+SCROW ScClipParam::getPasteRowSize() -+{ -+ if (!maRanges.Count()) -+ return 0; -+ -+ switch (meDirection) -+ { -+ case ScClipParam::Column: -+ { -+ // We assume that all ranges have identical row size. -+ const ScRange& rRange = *maRanges.First(); -+ return rRange.aEnd.Row() - rRange.aStart.Row() + 1; -+ } -+ break; -+ case ScClipParam::Row: -+ { -+ SCROW nRowSize = 0; -+ for (ScRangePtr p = maRanges.First(); p; p = maRanges.Next()) -+ nRowSize += p->aEnd.Row() - p->aStart.Row() + 1; -+ return nRowSize; -+ } -+ break; -+ case ScClipParam::Unspecified: -+ default: -+ ; -+ } -+ return 0; -+} -+ -+ScRange ScClipParam::getWholeRange() const -+{ -+ ScRange aWhole; -+ bool bFirst = true; -+ ScRangeList aRanges = maRanges; -+ for (ScRange* p = aRanges.First(); p; p = aRanges.Next()) -+ { -+ if (bFirst) -+ { -+ aWhole = *p; -+ bFirst = false; -+ continue; -+ } -+ -+ if (aWhole.aStart.Col() > p->aStart.Col()) -+ aWhole.aStart.SetCol(p->aStart.Col()); -+ -+ if (aWhole.aStart.Row() > p->aStart.Row()) -+ aWhole.aStart.SetRow(p->aStart.Row()); -+ -+ if (aWhole.aEnd.Col() < p->aEnd.Col()) -+ aWhole.aEnd.SetCol(p->aEnd.Col()); -+ -+ if (aWhole.aEnd.Row() < p->aEnd.Row()) -+ aWhole.aEnd.SetRow(p->aEnd.Row()); -+ } -+ return aWhole; -+} -+ -+void ScClipParam::transpose() -+{ -+ switch (meDirection) -+ { -+ case Column: -+ meDirection = ScClipParam::Row; -+ break; -+ case Row: -+ meDirection = ScClipParam::Column; -+ break; -+ case Unspecified: -+ default: -+ ; -+ } -+ -+ ScRangeList aNewRanges; -+ if (maRanges.Count()) -+ { -+ ScRange* p = maRanges.First(); -+ SCCOL nColOrigin = p->aStart.Col(); -+ SCROW nRowOrigin = p->aStart.Row(); -+ for (; p; p = maRanges.Next()) -+ { -+ SCCOL nColDelta = p->aStart.Col() - nColOrigin; -+ SCROW nRowDelta = p->aStart.Row() - nRowOrigin; -+ SCCOL nCol1 = 0; -+ SCCOL nCol2 = static_cast(p->aEnd.Row() - p->aStart.Row()); -+ SCROW nRow1 = 0; -+ SCROW nRow2 = static_cast(p->aEnd.Col() - p->aStart.Col()); -+ nCol1 += static_cast(nRowDelta); -+ nCol2 += static_cast(nRowDelta); -+ nRow1 += static_cast(nColDelta); -+ nRow2 += static_cast(nColDelta); -+ ScRange aNew(nCol1, nRow1, p->aStart.Tab(), nCol2, nRow2, p->aStart.Tab()); -+ aNewRanges.Append(aNew); -+ } -+ } -+ maRanges = aNewRanges; -+} -+ -+// ============================================================================ -+ -+ScClipRangeNameData::ScClipRangeNameData() : -+ mbReplace(false) -+{ -+} -+ -+ScClipRangeNameData::~ScClipRangeNameData() -+{ -+} -+ -+void ScClipRangeNameData::insert(sal_uInt16 nOldIndex, sal_uInt16 nNewIndex) -+{ -+ maRangeMap.insert( -+ ScRangeData::IndexMap::value_type(nOldIndex, nNewIndex)); -+} -diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx -index 721a66f..555c3e8 100644 ---- sc/source/core/data/column.cxx -+++ sc/source/core/data/column.cxx -@@ -1884,6 +1884,23 @@ void ScColumn::ReplaceRangeNamesInUse(SCROW nRow1, SCROW nRow2, - } - } - -+void ScColumn::ReplaceRangeNamesInUse(SCROW nRow1, SCROW nRow2, -+ const ScRangeData::IndexMap& rMap ) -+{ -+ if (pItems) -+ for (SCSIZE i = 0; i < nCount; i++) -+ { -+ if ((pItems[i].nRow >= nRow1) && -+ (pItems[i].nRow <= nRow2) && -+ (pItems[i].pCell->GetCellType() == CELLTYPE_FORMULA)) -+ { -+ SCROW nRow = pItems[i].nRow; -+ ((ScFormulaCell*)pItems[i].pCell)->ReplaceRangeNamesInUse( rMap ); -+ if ( nRow != pItems[i].nRow ) -+ Search( nRow, i ); // Listener geloescht/eingefuegt? -+ } -+ } -+} - - void ScColumn::SetDirtyVar() - { ---- sc/source/core/data/documen2.cxx -+++ sc/source/core/data/documen2.cxx -@@ -95,6 +95,7 @@ - #include "lookupcache.hxx" - #include "externalrefmgr.hxx" - #include "tabprotection.hxx" -+#include "clipparam.hxx" - #include "formulaparserpool.hxx" - - // pImpl because including lookupcache.hxx in document.hxx isn't wanted, and -@@ -153,6 +154,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, - pScriptTypeData( NULL ), - pCacheFieldEditEngine( NULL ), - pDocProtection( NULL ), -+ mpClipParam( NULL ), - pViewOptions( NULL ), - pDocOptions( NULL ), - pExtDocOptions( NULL ), -@@ -181,7 +183,6 @@ ScDocument::ScDocument( ScDocumentMode eMode, - bForcedFormulaPending( FALSE ), - bCalculatingFormulaTree( FALSE ), - bIsClip( eMode == SCDOCMODE_CLIP ), -- bCutMode( FALSE ), - bIsUndo( eMode == SCDOCMODE_UNDO ), - bIsVisible( FALSE ), - bIsEmbedded( FALSE ), -@@ -978,23 +979,18 @@ ULONG ScDocument::TransferTab( ScDocument* pSrcDoc, SCTAB nSrcPos, - bOldAutoCalcSrc = pSrcDoc->GetAutoCalc(); - pSrcDoc->SetAutoCalc( TRUE ); // falls was berechnet werden muss - } -- SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable(); -- SvNumberFormatter* pOtherFormatter = pSrcDoc->xPoolHelper->GetFormTable(); -- if (pOtherFormatter && pOtherFormatter != pThisFormatter) -+ - { -- SvNumberFormatterIndexTable* pExchangeList = -- pThisFormatter->MergeFormatter(*(pOtherFormatter)); -- if (pExchangeList->Count() > 0) -- pFormatExchangeList = pExchangeList; -- } -- nDestPos = Min(nDestPos, (SCTAB)(GetTableCount() - 1)); -- { // scope for bulk broadcast -- ScBulkBroadcast aBulkBroadcast( pBASM); -- pSrcDoc->pTab[nSrcPos]->CopyToTable(0, 0, MAXCOL, MAXROW, -- ( bResultsOnly ? IDF_ALL & ~IDF_FORMULA : IDF_ALL), -- FALSE, pTab[nDestPos] ); -+ NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc); -+ -+ nDestPos = Min(nDestPos, (SCTAB)(GetTableCount() - 1)); -+ { // scope for bulk broadcast -+ ScBulkBroadcast aBulkBroadcast( pBASM); -+ pSrcDoc->pTab[nSrcPos]->CopyToTable(0, 0, MAXCOL, MAXROW, -+ ( bResultsOnly ? IDF_ALL & ~IDF_FORMULA : IDF_ALL), -+ FALSE, pTab[nDestPos] ); -+ } - } -- pFormatExchangeList = NULL; - pTab[nDestPos]->SetTabNo(nDestPos); - - if ( !bResultsOnly ) ---- sc/source/core/data/documen3.cxx -+++ sc/source/core/data/documen3.cxx -@@ -79,6 +79,7 @@ - #include "listenercalls.hxx" - #include "svtools/PasswordHelper.hxx" - #include "tabprotection.hxx" -+#include "clipparam.hxx" - #include "formulaparserpool.hxx" - - #include -@@ -890,7 +891,7 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode, - { - ScDocument* pClipDoc = SC_MOD()->GetClipDoc(); - if (pClipDoc) -- pClipDoc->bCutMode = FALSE; -+ pClipDoc->GetClipParam().mbCutMode = false; - } - } - } -@@ -900,7 +901,10 @@ void ScDocument::UpdateTranspose( const ScAddress& rDestPos, ScDocument* pClipDo - { - DBG_ASSERT(pClipDoc->bIsClip, "UpdateTranspose: kein Clip"); - -- ScRange aSource = pClipDoc->aClipRange; // Tab wird noch angepasst -+ ScRange aSource; -+ ScClipParam& rClipParam = GetClipParam(); -+ if (rClipParam.maRanges.Count()) -+ aSource = *rClipParam.maRanges.First(); - ScAddress aDest = rDestPos; - - SCTAB nClipTab = 0; -diff --git sc/source/core/data/documen8.cxx sc/source/core/data/documen8.cxx -index 2e617d7..8cd34a1 100644 ---- sc/source/core/data/documen8.cxx -+++ sc/source/core/data/documen8.cxx -@@ -318,20 +318,8 @@ void ScDocument::ModifyStyleSheet( SfxStyleSheetBase& rStyleSheet, - void ScDocument::CopyStdStylesFrom( ScDocument* pSrcDoc ) - { - // #b5017505# number format exchange list has to be handled here, too -- -- SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable(); -- SvNumberFormatter* pOtherFormatter = pSrcDoc->xPoolHelper->GetFormTable(); -- if (pOtherFormatter && pOtherFormatter != pThisFormatter) -- { -- SvNumberFormatterIndexTable* pExchangeList = -- pThisFormatter->MergeFormatter(*(pOtherFormatter)); -- if (pExchangeList->Count() > 0) -- pFormatExchangeList = pExchangeList; -- } -- -+ NumFmtMergeHandler aNumFmtMergeHdl(this, pSrcDoc); - xPoolHelper->GetStylePool()->CopyStdStylesFrom( pSrcDoc->xPoolHelper->GetStylePool() ); -- -- pFormatExchangeList = NULL; - } - - //------------------------------------------------------------------------ -diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx -index 4366571..e477781 100644 ---- sc/source/core/data/document.cxx -+++ sc/source/core/data/document.cxx -@@ -94,6 +94,9 @@ - #include "postit.hxx" - #include "externalrefmgr.hxx" - #include "tabprotection.hxx" -+#include "clipparam.hxx" -+ -+#include - - namespace WritingMode2 = ::com::sun::star::text::WritingMode2; - -@@ -1214,7 +1217,7 @@ void ScDocument::AddUndoTab( SCTAB nTab1, SCTAB nTab2, BOOL bColInfo, BOOL bRowI - void ScDocument::SetCutMode( BOOL bVal ) - { - if (bIsClip) -- bCutMode = bVal; -+ GetClipParam().mbCutMode = bVal; - else - { - DBG_ERROR("SetCutMode without bIsClip"); -@@ -1225,7 +1228,7 @@ void ScDocument::SetCutMode( BOOL bVal ) - BOOL ScDocument::IsCutMode() - { - if (bIsClip) -- return bCutMode; -+ return GetClipParam().mbCutMode; - else - { - DBG_ERROR("IsCutMode ohne bIsClip"); -@@ -1356,33 +1359,16 @@ void ScDocument::CopyToClip(SCCOL nCol1, SCROW nRow1, - pClipDoc = SC_MOD()->GetClipDoc(); - } - -+ ScRange aClipRange(nCol1, nRow1, 0, nCol2, nRow2, 0); -+ ScClipParam& rClipParam = pClipDoc->GetClipParam(); -+ rClipParam.maRanges.RemoveAll(); -+ rClipParam.maRanges.Append(aClipRange); - pClipDoc->aDocName = aDocName; -- pClipDoc->aClipRange = ScRange( nCol1,nRow1,0, nCol2,nRow2,0 ); - pClipDoc->ResetClip( this, pMarks ); -- USHORT i; -- SCTAB j; - -- std::set aUsedNames; // indexes of named ranges that are used in the copied cells -- for (j = 0; j <= MAXTAB; j++) -- if (pTab[j] && pClipDoc->pTab[j]) -- if ( bAllTabs || !pMarks || pMarks->GetTableSelect(j) ) -- pTab[j]->FindRangeNamesInUse( nCol1, nRow1, nCol2, nRow2, aUsedNames ); -+ CopyRangeNamesToClip(pClipDoc, aClipRange, pMarks, bAllTabs); - -- pClipDoc->pRangeName->FreeAll(); -- for (i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!! -- { -- USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex(); -- bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() ); -- if (bInUse) -- { -- ScRangeData* pData = new ScRangeData(*((*pRangeName)[i])); -- if (!pClipDoc->pRangeName->Insert(pData)) -- delete pData; -- else -- pData->SetIndex(nIndex); -- } -- } -- for (j = 0; j <= MAXTAB; j++) -+ for (SCTAB j = 0; j <= MAXTAB; j++) - if (pTab[j] && pClipDoc->pTab[j]) - if ( bAllTabs || !pMarks || pMarks->GetTableSelect(j) ) - { -@@ -1397,10 +1383,53 @@ void ScDocument::CopyToClip(SCCOL nCol1, SCROW nRow1, - } - } - -- pClipDoc->bCutMode = bCut; -+ pClipDoc->GetClipParam().mbCutMode = bCut; - } - } - -+void ScDocument::CopyToClip(const ScClipParam& rClipParam, -+ ScDocument* pClipDoc, const ScMarkData* pMarks, -+ bool bKeepScenarioFlags, bool bIncludeObjects, bool bCloneNoteCaptions) -+{ -+ if (bIsClip) -+ return; -+ -+ if (!pClipDoc) -+ { -+ DBG_ERROR("CopyToClip: no ClipDoc"); -+ pClipDoc = SC_MOD()->GetClipDoc(); -+ } -+ -+ pClipDoc->aDocName = aDocName; -+ pClipDoc->SetClipParam(rClipParam); -+ pClipDoc->ResetClip(this, pMarks); -+ -+ ScRange aClipRange = rClipParam.getWholeRange(); -+ CopyRangeNamesToClip(pClipDoc, aClipRange, pMarks, false); -+ -+ for (SCTAB i = 0; i <= MAXTAB; ++i) -+ { -+ if (!pTab[i] || !pClipDoc->pTab[i]) -+ continue; -+ -+ if (pMarks && !pMarks->GetTableSelect(i)) -+ continue; -+ -+ pTab[i]->CopyToClip(rClipParam.maRanges, pClipDoc->pTab[i], bKeepScenarioFlags, bCloneNoteCaptions); -+ -+ if (pDrawLayer && bIncludeObjects) -+ { -+ // also copy drawing objects -+ const ScRange aRange = rClipParam.getWholeRange(); -+ Rectangle aObjRect = GetMMRect( -+ aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(), i); -+ pDrawLayer->CopyToClip(pClipDoc, i, aObjRect); -+ } -+ } -+ -+ // Make sure to mark overlapped cells. -+ pClipDoc->ExtendMerge(aClipRange, true); -+} - - void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, - SCCOL nCol2, SCROW nRow2, -@@ -1416,14 +1445,16 @@ void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, - pClipDoc = SC_MOD()->GetClipDoc(); - } - -+ ScClipParam& rClipParam = pClipDoc->GetClipParam(); - pClipDoc->aDocName = aDocName; -- pClipDoc->aClipRange = ScRange( nCol1,nRow1,0, nCol2,nRow2,0 ); -+ rClipParam.maRanges.RemoveAll(); -+ rClipParam.maRanges.Append(ScRange(nCol1, nRow1, 0, nCol2, nRow2, 0)); - pClipDoc->ResetClip( this, nTab ); - - if (pTab[nTab] && pClipDoc->pTab[nTab]) - pTab[nTab]->CopyToClip(nCol1, nRow1, nCol2, nRow2, pClipDoc->pTab[nTab], FALSE, TRUE); - -- pClipDoc->bCutMode = FALSE; -+ pClipDoc->GetClipParam().mbCutMode = false; - } - } - -@@ -1453,6 +1484,7 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL - - // Daten - -+ ScRange aClipRange = GetClipParam().getWholeRange(); - if ( ValidRow(aClipRange.aEnd.Row()-aClipRange.aStart.Row()) ) - { - for (SCTAB i=0; i<=MAXTAB; i++) -@@ -1481,10 +1513,8 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL - } - } - -- pTransClip->aClipRange = ScRange( 0, 0, aClipRange.aStart.Tab(), -- static_cast(aClipRange.aEnd.Row() - aClipRange.aStart.Row()), -- static_cast(aClipRange.aEnd.Col() - aClipRange.aStart.Col()), -- aClipRange.aEnd.Tab() ); -+ pTransClip->SetClipParam(GetClipParam()); -+ pTransClip->GetClipParam().transpose(); - } - else - { -@@ -1493,9 +1523,184 @@ void ScDocument::TransposeClip( ScDocument* pTransClip, USHORT nFlags, BOOL bAsL - - // Dies passiert erst beim Einfuegen... - -- bCutMode = FALSE; -+ GetClipParam().mbCutMode = false; -+} -+ -+void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs) -+{ -+ std::set aUsedNames; // indexes of named ranges that are used in the copied cells -+ for (SCTAB i = 0; i <= MAXTAB; ++i) -+ if (pTab[i] && pClipDoc->pTab[i]) -+ if ( bAllTabs || !pMarks || pMarks->GetTableSelect(i) ) -+ pTab[i]->FindRangeNamesInUse( -+ rClipRange.aStart.Col(), rClipRange.aStart.Row(), -+ rClipRange.aEnd.Col(), rClipRange.aEnd.Row(), aUsedNames); -+ -+ pClipDoc->pRangeName->FreeAll(); -+ for (USHORT i = 0; i < pRangeName->GetCount(); i++) //! DB-Bereiche Pivot-Bereiche auch !!! -+ { -+ USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex(); -+ bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() ); -+ if (bInUse) -+ { -+ ScRangeData* pData = new ScRangeData(*((*pRangeName)[i])); -+ if (!pClipDoc->pRangeName->Insert(pData)) -+ delete pData; -+ else -+ pData->SetIndex(nIndex); -+ } -+ } -+} -+ -+ScDocument::NumFmtMergeHandler::NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc) : -+ mpDoc(pDoc) -+{ -+ mpDoc->MergeNumberFormatter(pSrcDoc); -+} -+ -+ScDocument::NumFmtMergeHandler::~NumFmtMergeHandler() -+{ -+ mpDoc->pFormatExchangeList = NULL; -+} -+ -+void ScDocument::MergeNumberFormatter(ScDocument* pSrcDoc) -+{ -+ SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable(); -+ SvNumberFormatter* pOtherFormatter = pSrcDoc->xPoolHelper->GetFormTable(); -+ if (pOtherFormatter && pOtherFormatter != pThisFormatter) -+ { -+ SvNumberFormatterIndexTable* pExchangeList = -+ pThisFormatter->MergeFormatter(*(pOtherFormatter)); -+ if (pExchangeList->Count() > 0) -+ pFormatExchangeList = pExchangeList; -+ } -+} -+ -+void ScDocument::CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames) -+{ -+ sal_uInt16 nClipRangeNameCount = pClipDoc->pRangeName->GetCount(); -+ ScClipRangeNameData aClipRangeNames; -+ -+ // array containing range names which might need update of indices -+ aClipRangeNames.mpRangeNames.resize(nClipRangeNameCount, NULL); -+ -+ for (sal_uInt16 i = 0; i < nClipRangeNameCount; ++i) //! DB-Bereiche Pivot-Bereiche auch -+ { -+ /* Copy only if the name doesn't exist in this document. -+ If it exists we use the already existing name instead, -+ another possibility could be to create new names if -+ documents differ. -+ A proper solution would ask the user how to proceed. -+ The adjustment of the indices in the formulas is done later. -+ */ -+ ScRangeData* pClipRangeData = (*pClipDoc->pRangeName)[i]; -+ USHORT k; -+ if ( pRangeName->SearchName( pClipRangeData->GetName(), k ) ) -+ { -+ aClipRangeNames.mpRangeNames[i] = NULL; // range name not inserted -+ USHORT nOldIndex = pClipRangeData->GetIndex(); -+ USHORT nNewIndex = ((*pRangeName)[k])->GetIndex(); -+ aClipRangeNames.insert(nOldIndex, nNewIndex); -+ if ( !aClipRangeNames.mbReplace ) -+ aClipRangeNames.mbReplace = ( nOldIndex != nNewIndex ); -+ } -+ else -+ { -+ ScRangeData* pData = new ScRangeData( *pClipRangeData ); -+ pData->SetDocument(this); -+ if ( pRangeName->FindIndex( pData->GetIndex() ) ) -+ pData->SetIndex(0); // need new index, done in Insert -+ if ( pRangeName->Insert( pData ) ) -+ { -+ aClipRangeNames.mpRangeNames[i] = pData; -+ USHORT nOldIndex = pClipRangeData->GetIndex(); -+ USHORT nNewIndex = pData->GetIndex(); -+ aClipRangeNames.insert(nOldIndex, nNewIndex); -+ if ( !aClipRangeNames.mbReplace ) -+ aClipRangeNames.mbReplace = ( nOldIndex != nNewIndex ); -+ } -+ else -+ { // must be an overflow -+ delete pData; -+ aClipRangeNames.mpRangeNames[i] = NULL; -+ aClipRangeNames.insert(pClipRangeData->GetIndex(), 0); -+ aClipRangeNames.mbReplace = true; -+ } -+ } -+ } -+ rRangeNames = aClipRangeNames; -+} -+ -+void ScDocument::UpdateRangeNamesInFormulas( -+ ScClipRangeNameData& rRangeNames, const ScRangeList& rDestRanges, const ScMarkData& rMark, -+ SCCOL nXw, SCROW nYw) -+{ -+ // nXw and nYw are the extra width and height of the destination range -+ // extended due to presence of merged cell(s). -+ -+ if (!rRangeNames.mbReplace) -+ return; -+ -+ // first update all inserted named formulas if they contain other -+ // range names and used indices changed -+ sal_uInt16 nRangeNameCount = rRangeNames.mpRangeNames.size(); -+ for (sal_uInt16 i = 0; i < nRangeNameCount; ++i) //! DB-Bereiche Pivot-Bereiche auch -+ { -+ if ( rRangeNames.mpRangeNames[i] ) -+ rRangeNames.mpRangeNames[i]->ReplaceRangeNamesInUse(rRangeNames.maRangeMap); -+ } -+ // then update the formulas, they might need just the updated range names -+ for (ULONG nRange = 0; nRange < rDestRanges.Count(); ++nRange) -+ { -+ const ScRange* pRange = rDestRanges.GetObject( nRange); -+ SCCOL nCol1 = pRange->aStart.Col(); -+ SCROW nRow1 = pRange->aStart.Row(); -+ SCCOL nCol2 = pRange->aEnd.Col(); -+ SCROW nRow2 = pRange->aEnd.Row(); -+ -+ SCCOL nC1 = nCol1; -+ SCROW nR1 = nRow1; -+ SCCOL nC2 = nC1 + nXw; -+ if (nC2 > nCol2) -+ nC2 = nCol2; -+ SCROW nR2 = nR1 + nYw; -+ if (nR2 > nRow2) -+ nR2 = nRow2; -+ do -+ { -+ do -+ { -+ for (SCTAB k = 0; k <= MAXTAB; k++) -+ { -+ if ( pTab[k] && rMark.GetTableSelect(k) ) -+ pTab[k]->ReplaceRangeNamesInUse(nC1, nR1, -+ nC2, nR2, rRangeNames.maRangeMap); -+ } -+ nC1 = nC2 + 1; -+ nC2 = Min((SCCOL)(nC1 + nXw), nCol2); -+ } while (nC1 <= nCol2); -+ nC1 = nCol1; -+ nC2 = nC1 + nXw; -+ if (nC2 > nCol2) -+ nC2 = nCol2; -+ nR1 = nR2 + 1; -+ nR2 = Min((SCROW)(nR1 + nYw), nRow2); -+ } while (nR1 <= nRow2); -+ } -+} -+ -+ScClipParam& ScDocument::GetClipParam() -+{ -+ if (!mpClipParam.get()) -+ mpClipParam.reset(new ScClipParam); -+ -+ return *mpClipParam; - } - -+void ScDocument::SetClipParam(const ScClipParam& rParam) -+{ -+ mpClipParam.reset(new ScClipParam(rParam)); -+} - - BOOL ScDocument::IsClipboardSource() const - { -@@ -1595,7 +1800,7 @@ void ScDocument::CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, - && ppClipTab[nClipTab + nFollow + 1] ) - ++nFollow; - -- if ( pCBFCP->pClipDoc->bCutMode ) -+ if ( pCBFCP->pClipDoc->GetClipParam().mbCutMode ) - { - BOOL bOldInserting = IsInsertingFromOtherDoc(); - SetInsertingFromOtherDoc( TRUE); -@@ -1637,7 +1842,9 @@ void ScDocument::CopyNonFilteredFromClip( SCCOL nCol1, SCROW nRow1, - pCBFCP->pClipDoc->GetRowFlagsArray( nFlagTab); - - SCROW nSourceRow = rClipStartRow; -- SCROW nSourceEnd = pCBFCP->pClipDoc->aClipRange.aEnd.Row(); -+ SCROW nSourceEnd = 0; -+ if (pCBFCP->pClipDoc->GetClipParam().maRanges.Count()) -+ nSourceEnd = pCBFCP->pClipDoc->GetClipParam().maRanges.First()->aEnd.Row(); - SCROW nDestRow = nRow1; - - while ( nSourceRow <= nSourceEnd && nDestRow <= nRow2 ) -@@ -1683,67 +1890,11 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar - BOOL bOldAutoCalc = GetAutoCalc(); - SetAutoCalc( FALSE ); // avoid multiple recalculations - -- SvNumberFormatter* pThisFormatter = xPoolHelper->GetFormTable(); -- SvNumberFormatter* pOtherFormatter = pClipDoc->xPoolHelper->GetFormTable(); -- if (pOtherFormatter && pOtherFormatter != pThisFormatter) -- { -- SvNumberFormatterIndexTable* pExchangeList = -- pThisFormatter->MergeFormatter(*(pOtherFormatter)); -- if (pExchangeList->Count() > 0) -- pFormatExchangeList = pExchangeList; -- } -+ NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc); - -- USHORT nClipRangeNames = pClipDoc->pRangeName->GetCount(); -- // array containing range names which might need update of indices -- ScRangeData** pClipRangeNames = nClipRangeNames ? new ScRangeData* [nClipRangeNames] : NULL; -- // the index mapping thereof -- ScIndexMap aClipRangeMap( nClipRangeNames ); -- BOOL bRangeNameReplace = FALSE; -+ ScClipRangeNameData aClipRangeNames; -+ CopyRangeNamesFromClip(pClipDoc, aClipRangeNames); - -- for (USHORT i = 0; i < nClipRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch -- { -- /* Copy only if the name doesn't exist in this document. -- If it exists we use the already existing name instead, -- another possibility could be to create new names if -- documents differ. -- A proper solution would ask the user how to proceed. -- The adjustment of the indices in the formulas is done later. -- */ -- ScRangeData* pClipRangeData = (*pClipDoc->pRangeName)[i]; -- USHORT k; -- if ( pRangeName->SearchName( pClipRangeData->GetName(), k ) ) -- { -- pClipRangeNames[i] = NULL; // range name not inserted -- USHORT nOldIndex = pClipRangeData->GetIndex(); -- USHORT nNewIndex = ((*pRangeName)[k])->GetIndex(); -- aClipRangeMap.SetPair( i, nOldIndex, nNewIndex ); -- if ( !bRangeNameReplace ) -- bRangeNameReplace = ( nOldIndex != nNewIndex ); -- } -- else -- { -- ScRangeData* pData = new ScRangeData( *pClipRangeData ); -- pData->SetDocument(this); -- if ( pRangeName->FindIndex( pData->GetIndex() ) ) -- pData->SetIndex(0); // need new index, done in Insert -- if ( pRangeName->Insert( pData ) ) -- { -- pClipRangeNames[i] = pData; -- USHORT nOldIndex = pClipRangeData->GetIndex(); -- USHORT nNewIndex = pData->GetIndex(); -- aClipRangeMap.SetPair( i, nOldIndex, nNewIndex ); -- if ( !bRangeNameReplace ) -- bRangeNameReplace = ( nOldIndex != nNewIndex ); -- } -- else -- { // must be an overflow -- delete pData; -- pClipRangeNames[i] = NULL; -- aClipRangeMap.SetPair( i, pClipRangeData->GetIndex(), 0 ); -- bRangeNameReplace = TRUE; -- } -- } -- } - SCCOL nAllCol1 = rDestRange.aStart.Col(); - SCROW nAllRow1 = rDestRange.aStart.Row(); - SCCOL nAllCol2 = rDestRange.aEnd.Col(); -@@ -1751,17 +1902,18 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar - - SCCOL nXw = 0; - SCROW nYw = 0; -+ ScRange aClipRange = pClipDoc->GetClipParam().getWholeRange(); - for (SCTAB nTab = 0; nTab <= MAXTAB; nTab++) // find largest merge overlap - if (pClipDoc->pTab[nTab]) // all sheets of the clipboard content - { -- SCCOL nThisEndX = pClipDoc->aClipRange.aEnd.Col(); -- SCROW nThisEndY = pClipDoc->aClipRange.aEnd.Row(); -- pClipDoc->ExtendMerge( pClipDoc->aClipRange.aStart.Col(), -- pClipDoc->aClipRange.aStart.Row(), -+ SCCOL nThisEndX = aClipRange.aEnd.Col(); -+ SCROW nThisEndY = aClipRange.aEnd.Row(); -+ pClipDoc->ExtendMerge( aClipRange.aStart.Col(), -+ aClipRange.aStart.Row(), - nThisEndX, nThisEndY, nTab ); - // only extra value from ExtendMerge -- nThisEndX = sal::static_int_cast( nThisEndX - pClipDoc->aClipRange.aEnd.Col() ); -- nThisEndY = sal::static_int_cast( nThisEndY - pClipDoc->aClipRange.aEnd.Row() ); -+ nThisEndX = sal::static_int_cast( nThisEndX - aClipRange.aEnd.Col() ); -+ nThisEndY = sal::static_int_cast( nThisEndY - aClipRange.aEnd.Row() ); - if ( nThisEndX > nXw ) - nXw = nThisEndX; - if ( nThisEndY > nYw ) -@@ -1820,10 +1972,10 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar - if (bDoDouble) - ScColumn::bDoubleAlloc = TRUE; - -- SCCOL nClipStartCol = pClipDoc->aClipRange.aStart.Col(); -- SCROW nClipStartRow = pClipDoc->aClipRange.aStart.Row(); -+ SCCOL nClipStartCol = aClipRange.aStart.Col(); -+ SCROW nClipStartRow = aClipRange.aStart.Row(); - // WaE: commented because unused: SCCOL nClipEndCol = pClipDoc->aClipRange.aEnd.Col(); -- SCROW nClipEndRow = pClipDoc->aClipRange.aEnd.Row(); -+ SCROW nClipEndRow = aClipRange.aEnd.Row(); - for (ULONG nRange = 0; nRange < pDestRanges->Count(); ++nRange) - { - const ScRange* pRange = pDestRanges->GetObject( nRange); -@@ -1874,7 +2026,7 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar - nC2 = Min((SCCOL)(nC1 + nXw), nCol2); - } while (nC1 <= nCol2); - if (nClipStartRow > nClipEndRow) -- nClipStartRow = pClipDoc->aClipRange.aStart.Row(); -+ nClipStartRow = aClipRange.aStart.Row(); - nC1 = nCol1; - nC2 = nC1 + nXw; - if (nC2 > nCol2) -@@ -1891,75 +2043,120 @@ void ScDocument::CopyFromClip( const ScRange& rDestRange, const ScMarkData& rMar - pTab[k]->DecRecalcLevel(); - - bInsertingFromOtherDoc = FALSE; -- pFormatExchangeList = NULL; -- if ( bRangeNameReplace ) -- { -- // first update all inserted named formulas if they contain other -- // range names and used indices changed -- for (USHORT i = 0; i < nClipRangeNames; i++) //! DB-Bereiche Pivot-Bereiche auch -- { -- if ( pClipRangeNames[i] ) -- pClipRangeNames[i]->ReplaceRangeNamesInUse( aClipRangeMap ); -- } -- // then update the formulas, they might need the just updated range names -- for (ULONG nRange = 0; nRange < pDestRanges->Count(); ++nRange) -- { -- const ScRange* pRange = pDestRanges->GetObject( nRange); -- SCCOL nCol1 = pRange->aStart.Col(); -- SCROW nRow1 = pRange->aStart.Row(); -- SCCOL nCol2 = pRange->aEnd.Col(); -- SCROW nRow2 = pRange->aEnd.Row(); -- -- SCCOL nC1 = nCol1; -- SCROW nR1 = nRow1; -- SCCOL nC2 = nC1 + nXw; -- if (nC2 > nCol2) -- nC2 = nCol2; -- SCROW nR2 = nR1 + nYw; -- if (nR2 > nRow2) -- nR2 = nRow2; -- do -- { -- do -- { -- for (SCTAB k = 0; k <= MAXTAB; k++) -- { -- if ( pTab[k] && rMark.GetTableSelect(k) ) -- pTab[k]->ReplaceRangeNamesInUse(nC1, nR1, -- nC2, nR2, aClipRangeMap ); -- } -- nC1 = nC2 + 1; -- nC2 = Min((SCCOL)(nC1 + nXw), nCol2); -- } while (nC1 <= nCol2); -- nC1 = nCol1; -- nC2 = nC1 + nXw; -- if (nC2 > nCol2) -- nC2 = nCol2; -- nR1 = nR2 + 1; -- nR2 = Min((SCROW)(nR1 + nYw), nRow2); -- } while (nR1 <= nRow2); -- } -- } -- if ( pClipRangeNames ) -- delete [] pClipRangeNames; -+ -+ UpdateRangeNamesInFormulas(aClipRangeNames, *pDestRanges, rMark, nXw, nYw); -+ - // Listener aufbauen nachdem alles inserted wurde - StartListeningFromClip( nAllCol1, nAllRow1, nAllCol2, nAllRow2, rMark, nInsFlag ); - // nachdem alle Listener aufgebaut wurden, kann gebroadcastet werden - BroadcastFromClip( nAllCol1, nAllRow1, nAllCol2, nAllRow2, rMark, nInsFlag ); - if (bResetCut) -- pClipDoc->bCutMode = FALSE; -+ pClipDoc->GetClipParam().mbCutMode = false; - SetAutoCalc( bOldAutoCalc ); - } - } - } - -+void ScDocument::CopyMultiRangeFromClip( -+ const ScAddress& rDestPos, const ScMarkData& rMark, sal_uInt16 nInsFlag, ScDocument* pClipDoc, -+ bool bResetCut, bool bAsLink, bool /*bIncludeFiltered*/, bool bSkipAttrForEmpty) -+{ -+ if (bIsClip) -+ return; -+ -+ if (!pClipDoc->bIsClip || !pClipDoc->GetTableCount()) -+ // There is nothing in the clip doc to copy. -+ return; -+ -+ BOOL bOldAutoCalc = GetAutoCalc(); -+ SetAutoCalc( FALSE ); // avoid multiple recalculations -+ -+ NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc); -+ -+ ScClipRangeNameData aClipRangeNames; -+ CopyRangeNamesFromClip(pClipDoc, aClipRangeNames); -+ -+ SCCOL nCol1 = rDestPos.Col(); -+ SCROW nRow1 = rDestPos.Row(); -+ ScClipParam& rClipParam = pClipDoc->GetClipParam(); -+ -+ ScCopyBlockFromClipParams aCBFCP; -+ aCBFCP.pRefUndoDoc = NULL; -+ aCBFCP.pClipDoc = pClipDoc; -+ aCBFCP.nInsFlag = nInsFlag; -+ aCBFCP.bAsLink = bAsLink; -+ aCBFCP.bSkipAttrForEmpty = bSkipAttrForEmpty; -+ aCBFCP.nTabStart = MAXTAB; -+ aCBFCP.nTabEnd = 0; -+ -+ SCCOL nCols = rClipParam.getPasteColSize(); -+ SCROW nRows = rClipParam.getPasteRowSize(); -+ for (SCTAB j = 0; j <= MAXTAB; ++j) -+ { -+ if (pTab[j] && rMark.GetTableSelect(j)) -+ { -+ if ( j < aCBFCP.nTabStart ) -+ aCBFCP.nTabStart = j; -+ aCBFCP.nTabEnd = j; -+ pTab[j]->IncRecalcLevel(); -+ } -+ } -+ -+ bInsertingFromOtherDoc = TRUE; // kein Broadcast/Listener aufbauen bei Insert -+ -+ if (!bSkipAttrForEmpty) -+ { -+ sal_uInt16 nDelFlag = IDF_CONTENTS; -+ DeleteArea(nCol1, nRow1, nCol1+nCols-1, nRow1+nRows-1, rMark, nDelFlag); -+ } -+ -+ for (ScRange* p = rClipParam.maRanges.First(); p; p = rClipParam.maRanges.Next()) -+ { -+ SCsCOL nDx = static_cast(nCol1 - p->aStart.Col()); -+ SCsROW nDy = static_cast(nRow1 - p->aStart.Row()); -+ SCCOL nCol2 = nCol1 + p->aEnd.Col() - p->aStart.Col(); -+ SCROW nRow2 = nRow1 + p->aEnd.Row() - p->aStart.Row(); -+ -+ CopyBlockFromClip(nCol1, nRow1, nCol2, nRow2, rMark, nDx, nDy, &aCBFCP); -+ -+ if (rClipParam.meDirection == ScClipParam::Column) -+ nCol1 += p->aEnd.Col() - p->aStart.Col() + 1; -+ if (rClipParam.meDirection == ScClipParam::Row) -+ nRow1 += p->aEnd.Row() - p->aStart.Row() + 1; -+ } -+ -+ for (SCTAB i = 0; i <= MAXTAB; i++) -+ if (pTab[i] && rMark.GetTableSelect(i)) -+ pTab[i]->DecRecalcLevel(); -+ -+ bInsertingFromOtherDoc = FALSE; -+ -+ ScRange aDestRange(rDestPos.Col(), rDestPos.Row(), rDestPos.Tab(), -+ rDestPos.Col()+nCols-1, rDestPos.Row()+nRows-1, rDestPos.Tab()); -+ ScRangeList aRanges; -+ aRanges.Append(aDestRange); -+ UpdateRangeNamesInFormulas(aClipRangeNames, aRanges, rMark, nCols-1, nRows-1); -+ -+ // Listener aufbauen nachdem alles inserted wurde -+ StartListeningFromClip(aDestRange.aStart.Col(), aDestRange.aStart.Row(), -+ aDestRange.aEnd.Col(), aDestRange.aEnd.Row(), rMark, nInsFlag ); -+ // nachdem alle Listener aufgebaut wurden, kann gebroadcastet werden -+ BroadcastFromClip(aDestRange.aStart.Col(), aDestRange.aStart.Row(), -+ aDestRange.aEnd.Col(), aDestRange.aEnd.Row(), rMark, nInsFlag ); -+ -+ if (bResetCut) -+ pClipDoc->GetClipParam().mbCutMode = false; -+ SetAutoCalc( bOldAutoCalc ); -+} - - void ScDocument::SetClipArea( const ScRange& rArea, BOOL bCut ) - { - if (bIsClip) - { -- aClipRange = rArea; -- bCutMode = bCut; -+ ScClipParam& rClipParam = GetClipParam(); -+ rClipParam.maRanges.RemoveAll(); -+ rClipParam.maRanges.Append(rArea); -+ rClipParam.mbCutMode = bCut; - } - else - { -@@ -1970,33 +2167,53 @@ void ScDocument::SetClipArea( const ScRange& rArea, BOOL bCut ) - - void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, BOOL bIncludeFiltered) - { -- if (bIsClip) -- { -- nClipX = aClipRange.aEnd.Col() - aClipRange.aStart.Col(); -+ if (!bIsClip) -+ { -+ DBG_ERROR("GetClipArea: kein Clip"); -+ return; -+ } - -- if ( bIncludeFiltered ) -- nClipY = aClipRange.aEnd.Row() - aClipRange.aStart.Row(); -- else -- { -- // count non-filtered rows -- // count on first used table in clipboard -- SCTAB nCountTab = 0; -- while ( nCountTab < MAXTAB && !pTab[nCountTab] ) -- ++nCountTab; -- -- SCROW nResult = GetRowFlagsArray( nCountTab).CountForCondition( -- aClipRange.aStart.Row(), aClipRange.aEnd.Row(), -- CR_FILTERED, 0); -- -- if ( nResult > 0 ) -- nClipY = nResult - 1; -- else -- nClipY = 0; // always return at least 1 row -- } -+ ScRangeList& rClipRanges = GetClipParam().maRanges; -+ if (!rClipRanges.Count()) -+ // No clip range. Bail out. -+ return; -+ -+ ScRangePtr p = rClipRanges.First(); -+ SCCOL nStartCol = p->aStart.Col(); -+ SCCOL nEndCol = p->aEnd.Col(); -+ SCROW nStartRow = p->aStart.Row(); -+ SCROW nEndRow = p->aEnd.Row(); -+ for (p = rClipRanges.Next(); p; p = rClipRanges.Next()) -+ { -+ if (p->aStart.Col() < nStartCol) -+ nStartCol = p->aStart.Col(); -+ if (p->aStart.Row() < nStartRow) -+ nStartRow = p->aStart.Row(); -+ if (p->aEnd.Col() > nEndCol) -+ nEndCol = p->aEnd.Col(); -+ if (p->aEnd.Row() < nEndRow) -+ nEndRow = p->aEnd.Row(); - } -+ -+ nClipX = nEndCol - nStartCol; -+ -+ if ( bIncludeFiltered ) -+ nClipY = nEndRow - nStartRow; - else - { -- DBG_ERROR("GetClipArea: kein Clip"); -+ // count non-filtered rows -+ // count on first used table in clipboard -+ SCTAB nCountTab = 0; -+ while ( nCountTab < MAXTAB && !pTab[nCountTab] ) -+ ++nCountTab; -+ -+ SCROW nResult = GetRowFlagsArray( nCountTab).CountForCondition( -+ nStartRow, nEndRow, CR_FILTERED, 0); -+ -+ if ( nResult > 0 ) -+ nClipY = nResult - 1; -+ else -+ nClipY = 0; // always return at least 1 row - } - } - -@@ -2005,8 +2222,12 @@ void ScDocument::GetClipStart(SCCOL& nClipX, SCROW& nClipY) - { - if (bIsClip) - { -- nClipX = aClipRange.aStart.Col(); -- nClipY = aClipRange.aStart.Row(); -+ ScRangeList& rClipRanges = GetClipParam().maRanges; -+ if (rClipRanges.Count()) -+ { -+ nClipX = rClipRanges.First()->aStart.Col(); -+ nClipY = rClipRanges.First()->aStart.Row(); -+ } - } - else - { -@@ -2022,8 +2243,12 @@ BOOL ScDocument::HasClipFilteredRows() - while ( nCountTab < MAXTAB && !pTab[nCountTab] ) - ++nCountTab; - -- return GetRowFlagsArray( nCountTab).HasCondition( aClipRange.aStart.Row(), -- aClipRange.aEnd.Row(), CR_FILTERED, CR_FILTERED); -+ ScRangeList& rClipRanges = GetClipParam().maRanges; -+ if (!rClipRanges.Count()) -+ return false; -+ -+ return GetRowFlagsArray( nCountTab).HasCondition( rClipRanges.First()->aStart.Row(), -+ rClipRanges.First()->aEnd.Row(), CR_FILTERED, CR_FILTERED); - } - - -diff --git sc/source/core/data/makefile.mk sc/source/core/data/makefile.mk -index 9dfc108..8440ee8 100644 ---- sc/source/core/data/makefile.mk -+++ sc/source/core/data/makefile.mk -@@ -56,6 +56,7 @@ SLOFILES = \ - $(SLO)$/bcaslot.obj \ - $(SLO)$/cell.obj \ - $(SLO)$/cell2.obj \ -+ $(SLO)$/clipparam.obj \ - $(SLO)$/column.obj \ - $(SLO)$/column2.obj \ - $(SLO)$/column3.obj \ -diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx -index 460abe1..3b2d3c5 100644 ---- sc/source/core/data/table1.cxx -+++ sc/source/core/data/table1.cxx -@@ -1303,6 +1303,16 @@ void ScTable::ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, - } - } - -+void ScTable::ReplaceRangeNamesInUse(SCCOL nCol1, SCROW nRow1, -+ SCCOL nCol2, SCROW nRow2, -+ const ScRangeData::IndexMap& rMap ) -+{ -+ for (SCCOL i = nCol1; i <= nCol2 && (ValidCol(i)); i++) -+ { -+ aCol[i].ReplaceRangeNamesInUse( nRow1, nRow2, rMap ); -+ } -+} -+ - void ScTable::ExtendPrintArea( OutputDevice* pDev, - SCCOL /* nStartCol */, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow ) - { -diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx -index eec97e2..0ef9cbb 100644 ---- sc/source/core/data/table2.cxx -+++ sc/source/core/data/table2.cxx -@@ -367,6 +367,16 @@ void ScTable::CopyToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - } - } - -+void ScTable::CopyToClip(const ScRangeList& rRanges, ScTable* pTable, -+ bool bKeepScenarioFlags, bool bCloneNoteCaptions) -+{ -+ ScRangeList aRanges(rRanges); -+ for (ScRangePtr p = aRanges.First(); p; p = aRanges.Next()) -+ { -+ CopyToClip(p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), -+ pTable, bKeepScenarioFlags, bCloneNoteCaptions); -+ } -+} - - void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, - SCsCOL nDx, SCsROW nDy, USHORT nInsFlag, -diff --git sc/source/core/tool/rangenam.cxx sc/source/core/tool/rangenam.cxx -index 6029663..d30a3d5 100644 ---- sc/source/core/tool/rangenam.cxx -+++ sc/source/core/tool/rangenam.cxx -@@ -585,6 +585,31 @@ void ScRangeData::ReplaceRangeNamesInUse( const ScIndexMap& rMap ) - } - } - -+void ScRangeData::ReplaceRangeNamesInUse( const IndexMap& rMap ) -+{ -+ bool bCompile = false; -+ for ( FormulaToken* p = pCode->First(); p; p = pCode->Next() ) -+ { -+ if ( p->GetOpCode() == ocName ) -+ { -+ const sal_uInt16 nOldIndex = p->GetIndex(); -+ IndexMap::const_iterator itr = rMap.find(nOldIndex); -+ const sal_uInt16 nNewIndex = itr == rMap.end() ? nOldIndex : itr->second; -+ if ( nOldIndex != nNewIndex ) -+ { -+ p->SetIndex( nNewIndex ); -+ bCompile = true; -+ } -+ } -+ } -+ if ( bCompile ) -+ { -+ ScCompiler aComp( pDoc, aPos, *pCode); -+ aComp.SetGrammar(pDoc->GetGrammar()); -+ aComp.CompileTokenArray(); -+ } -+} -+ - - void ScRangeData::ValidateTabRefs() - { -diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx -index 17ad51a..f727fb4 100644 ---- sc/source/ui/inc/viewfunc.hxx -+++ sc/source/ui/inc/viewfunc.hxx -@@ -354,6 +354,11 @@ private: - void PasteRTF( SCCOL nCol, SCROW nStartRow, - const ::com::sun::star::uno::Reference< - ::com::sun::star::datatransfer::XTransferable >& rxTransferable ); -+ bool PasteMultiRangesFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction, -+ bool bSkipEmpty, bool bTranspos, bool bAsLink, bool bAllowDialogs, -+ InsCellCmd eMoveMode, sal_uInt16 nCondFlags, sal_uInt16 nUndoFlags ); -+ void PostPasteFromClip(const ScRange& rPasteRange, const ScMarkData& rMark); -+ - USHORT GetOptimalColWidth( SCCOL nCol, SCTAB nTab, BOOL bFormula ); - - void StartFormatArea(); -diff --git sc/source/ui/view/cellsh.cxx sc/source/ui/view/cellsh.cxx -index ddfa8e9..e782dd2 100644 ---- sc/source/ui/view/cellsh.cxx -+++ sc/source/ui/view/cellsh.cxx -@@ -206,7 +206,6 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) - break; - - case SID_COPY: // Kopieren -- bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED); - // nur wegen Matrix nicht editierbar? Matrix nicht zerreissen - //! schlaegt nicht zu, wenn geschuetzt UND Matrix, aber damit - //! muss man leben.. wird in Copy-Routine abgefangen, sonst ---- sc/source/ui/view/cellsh1.cxx -+++ sc/source/ui/view/cellsh1.cxx -@@ -104,6 +104,7 @@ - #include "dpsave.hxx" - #include "dpgroup.hxx" // for ScDPNumGroupInfo - #include "spellparam.hxx" -+#include "clipparam.hxx" - #include "postit.hxx" - - #include "globstr.hrc" -@@ -2243,7 +2244,13 @@ void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTa - pTabViewShell->PasteFromSystem(); - else - { -- pTabViewShell->PasteFromClip( IDF_ALL, pOwnClip->GetDocument(), -+ ScDocument* pClipDoc = pOwnClip->GetDocument(); -+ sal_uInt16 nFlags = IDF_ALL; -+ if (pClipDoc->GetClipParam().isMultiRange()) -+ // For multi-range paste, we paste values by default. -+ nFlags &= ~IDF_FORMULA; -+ -+ pTabViewShell->PasteFromClip( nFlags, pClipDoc, - PASTE_NOFUNC, FALSE, FALSE, FALSE, INS_NONE, IDF_NONE, - bShowDialog ); // allow warning dialog - } -diff --git sc/source/ui/view/tabvwsh4.cxx sc/source/ui/view/tabvwsh4.cxx -index 4d3dfc1..0e76555 100644 ---- sc/source/ui/view/tabvwsh4.cxx -+++ sc/source/ui/view/tabvwsh4.cxx -@@ -1506,7 +1506,7 @@ BOOL ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt) - // #51889# Spezialfall: Copy/Cut bei Mehrfachselektion -> Fehlermeldung - // (Slot ist disabled, SfxViewShell::KeyInput wuerde also kommentarlos verschluckt) - KeyFuncType eFunc = aCode.GetFunction(); -- if ( eFunc == KEYFUNC_COPY || eFunc == KEYFUNC_CUT ) -+ if ( eFunc == KEYFUNC_CUT ) - { - ScRange aDummy; - ScMarkType eMarkType = GetViewData()->GetSimpleArea( aDummy ); -diff --git sc/source/ui/view/viewfun3.cxx sc/source/ui/view/viewfun3.cxx -index 0a97b2a..31fca76 100644 ---- sc/source/ui/view/viewfun3.cxx -+++ sc/source/ui/view/viewfun3.cxx -@@ -210,6 +210,7 @@ - #include "drwtrans.hxx" - #include "docuno.hxx" - #include "undodat.hxx" // Amelia Wang -+#include "clipparam.hxx" - - using namespace com::sun::star; - -@@ -310,10 +311,10 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI - - ScRange aRange; - ScMarkType eMarkType = GetViewData()->GetSimpleArea( aRange ); -+ ScDocument* pDoc = GetViewData()->GetDocument(); -+ ScMarkData& rMark = GetViewData()->GetMarkData(); - if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED ) - { -- ScDocument* pDoc = GetViewData()->GetDocument(); -- ScMarkData& rMark = GetViewData()->GetMarkData(); - if ( !pDoc->HasSelectedBlockMatrixFragment( - aRange.aStart.Col(), aRange.aStart.Row(), - aRange.aEnd.Col(), aRange.aEnd.Row(), -@@ -380,6 +381,122 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI - ErrorMessage(STR_MATRIXFRAGMENTERR); - } - } -+ else if (eMarkType == SC_MARK_MULTI) -+ { -+ bool bSuccess = false; -+ ScClipParam aClipParam; -+ aClipParam.mbCutMode = false; -+ rMark.FillRangeListWithMarks(&aClipParam.maRanges, false); -+ -+ do -+ { -+ if (bCut) -+ // We con't support cutting of multi-selections. -+ break; -+ -+ if (pClipDoc) -+ // TODO: What's this for? -+ break; -+ -+ ::std::auto_ptr pDocClip(new ScDocument(SCDOCMODE_CLIP)); -+ -+ // Check for geometrical feasibility of the ranges. -+ bool bValidRanges = true; -+ ScRangePtr p = aClipParam.maRanges.First(); -+ SCCOL nPrevColDelta = 0; -+ SCROW nPrevRowDelta = 0; -+ SCCOL nPrevCol = p->aStart.Col(); -+ SCROW nPrevRow = p->aStart.Row(); -+ SCCOL nPrevColSize = p->aEnd.Col() - p->aStart.Col() + 1; -+ SCROW nPrevRowSize = p->aEnd.Row() - p->aStart.Row() + 1; -+ for (p = aClipParam.maRanges.Next(); p; p = aClipParam.maRanges.Next()) -+ { -+ if (pDoc->HasSelectedBlockMatrixFragment( -+ p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), rMark)) -+ { -+ bValidRanges = false; -+ break; -+ } -+ -+ SCCOL nColDelta = p->aStart.Col() - nPrevCol; -+ SCROW nRowDelta = p->aStart.Row() - nPrevRow; -+ -+ if ((nColDelta && nRowDelta) || (nPrevColDelta && nRowDelta) || (nPrevRowDelta && nColDelta)) -+ { -+ bValidRanges = false; -+ break; -+ } -+ -+ if (aClipParam.meDirection == ScClipParam::Unspecified) -+ { -+ if (nColDelta) -+ aClipParam.meDirection = ScClipParam::Column; -+ if (nRowDelta) -+ aClipParam.meDirection = ScClipParam::Row; -+ } -+ -+ SCCOL nColSize = p->aEnd.Col() - p->aStart.Col() + 1; -+ SCROW nRowSize = p->aEnd.Row() - p->aStart.Row() + 1; -+ -+ if (aClipParam.meDirection == ScClipParam::Column && nRowSize != nPrevRowSize) -+ { -+ // column-oriented ranges must have identical row size. -+ bValidRanges = false; -+ break; -+ } -+ if (aClipParam.meDirection == ScClipParam::Row && nColSize != nPrevColSize) -+ { -+ // likewise, row-oriented ranges must have identical -+ // column size. -+ bValidRanges = false; -+ break; -+ } -+ -+ nPrevCol = p->aStart.Col(); -+ nPrevRow = p->aStart.Row(); -+ nPrevColDelta = nColDelta; -+ nPrevRowDelta = nRowDelta; -+ nPrevColSize = nColSize; -+ nPrevRowSize = nRowSize; -+ } -+ if (!bValidRanges) -+ break; -+ -+ pDoc->CopyToClip(aClipParam, pDocClip.get(), &rMark, false, bIncludeObjects); -+ -+ ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); -+ if ( pChangeTrack ) -+ pChangeTrack->ResetLastCut(); // kein CutMode mehr -+ -+ { -+ ScDocShell* pDocSh = GetViewData()->GetDocShell(); -+ TransferableObjectDescriptor aObjDesc; -+ pDocSh->FillTransferableObjectDescriptor( aObjDesc ); -+ aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass(); -+ // maSize is set in ScTransferObj ctor -+ -+ ScTransferObj* pTransferObj = new ScTransferObj( pDocClip.release(), aObjDesc ); -+ uno::Reference xTransferable( pTransferObj ); -+ -+ if ( ScGlobal::pDrawClipDocShellRef ) -+ { -+ SfxObjectShellRef aPersistRef( &(*ScGlobal::pDrawClipDocShellRef) ); -+ pTransferObj->SetDrawPersist( aPersistRef ); // keep persist for ole objects alive -+ } -+ -+ pTransferObj->CopyToClipboard( GetActiveWin() ); // system clipboard -+ SC_MOD()->SetClipObject( pTransferObj, NULL ); // internal clipboard -+ } -+ -+ bSuccess = true; -+ } -+ while (false); -+ -+ if (!bSuccess && !bApi) -+ ErrorMessage(STR_NOMULTISELECT); -+ -+ bDone = bSuccess; -+ } - else - { - if (!bApi) -@@ -743,6 +860,52 @@ BOOL lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, - - // internes Paste - -+namespace { -+ -+class CursorSwitcher -+{ -+public: -+ CursorSwitcher(ScViewFunc* pViewFunc) : -+ mpViewFunc(pViewFunc) -+ { -+ mpViewFunc->HideCursor(); -+ } -+ -+ ~CursorSwitcher() -+ { -+ mpViewFunc->ShowCursor(); -+ } -+private: -+ ScViewFunc* mpViewFunc; -+}; -+ -+bool lcl_checkDestRangeForOverwrite(const ScRange& rDestRange, const ScDocument* pDoc, const ScMarkData& rMark, Window* pParentWnd) -+{ -+ bool bIsEmpty = true; -+ SCTAB nTabCount = pDoc->GetTableCount(); -+ for (SCTAB nTab=0; nTab < nTabCount && bIsEmpty; ++nTab) -+ { -+ if (!rMark.GetTableSelect(nTab)) -+ continue; -+ -+ bIsEmpty = pDoc->IsBlockEmpty(nTab, rDestRange.aStart.Col(), rDestRange.aStart.Row(), -+ rDestRange.aEnd.Col(), rDestRange.aEnd.Row()); -+ } -+ -+ if (!bIsEmpty) -+ { -+ ScReplaceWarnBox aBox(pParentWnd); -+ if (aBox.Execute() != RET_YES) -+ { -+ // changing the configuration is within the ScReplaceWarnBox -+ return false; -+ } -+ } -+ return true; -+} -+ -+} -+ - BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, - USHORT nFunction, BOOL bSkipEmpty, - BOOL bTranspose, BOOL bAsLink, -@@ -768,6 +931,12 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, - // do not copy note captions into undo document - nUndoFlags |= IDF_NOCAPTIONS; - -+ ScClipParam& rClipParam = pClipDoc->GetClipParam(); -+ if (rClipParam.isMultiRange()) -+ return PasteMultiRangesFromClip( -+ nFlags, pClipDoc, nFunction, bSkipEmpty, bTranspose, bAsLink, bAllowDialogs, -+ eMoveMode, nContFlags, nUndoFlags); -+ - BOOL bCutMode = pClipDoc->IsCutMode(); // if transposing, take from original clipdoc - BOOL bIncludeFiltered = bCutMode; - -@@ -996,23 +1165,8 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, - SC_MOD()->GetInputOptions().GetReplaceCellsWarn(); - if ( bAskIfNotEmpty ) - { -- BOOL bIsEmpty = TRUE; -- SCTAB nTabCount = pDoc->GetTableCount(); -- for (SCTAB nTab=0; nTabIsBlockEmpty( nTab, aUserRange.aStart.Col(), aUserRange.aStart.Row(), -- aUserRange.aEnd.Col(), aUserRange.aEnd.Row() ) ) -- bIsEmpty = FALSE; -- -- if ( !bIsEmpty ) -- { -- ScReplaceWarnBox aBox( GetViewData()->GetDialogParent() ); -- if ( aBox.Execute() != RET_YES ) -- { -- // changing the configuration is within the ScReplaceWarnBox -- return FALSE; -- } -- } -+ if (!lcl_checkDestRangeForOverwrite(aUserRange, pDoc, aFilteredMark, GetViewData()->GetDialogParent())) -+ return false; - } - } - -@@ -1281,7 +1435,171 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, - // AdjustBlockHeight has already been called above - - aModificator.SetDocumentModified(); -- pDocSh->UpdateOle(GetViewData()); -+ PostPasteFromClip(aUserRange, rMark); -+ return TRUE; -+} -+ -+bool ScViewFunc::PasteMultiRangesFromClip( -+ sal_uInt16 nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction, -+ bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs, -+ InsCellCmd eMoveMode, sal_uInt16 /*nContFlags*/, sal_uInt16 nUndoFlags) -+{ -+ ScViewData& rViewData = *GetViewData(); -+ ScDocument* pDoc = rViewData.GetDocument(); -+ ScDocShell* pDocSh = rViewData.GetDocShell(); -+ ScMarkData aMark(rViewData.GetMarkData()); -+ const ScAddress& rCurPos = rViewData.GetCurPos(); -+ ScClipParam& rClipParam = pClipDoc->GetClipParam(); -+ SCCOL nColSize = rClipParam.getPasteColSize(); -+ SCROW nRowSize = rClipParam.getPasteRowSize(); -+ -+ if (bTranspose) -+ { -+ if (static_cast(rCurPos.Col()) + nRowSize-1 > static_cast(MAXCOL)) -+ { -+ ErrorMessage(STR_PASTE_FULL); -+ return false; -+ } -+ -+ ::std::auto_ptr pTransClip(new ScDocument(SCDOCMODE_CLIP)); -+ pClipDoc->TransposeClip(pTransClip.get(), nFlags, bAsLink); -+ pClipDoc = pTransClip.release(); -+ SCCOL nTempColSize = nColSize; -+ nColSize = static_cast(nRowSize); -+ nRowSize = static_cast(nTempColSize); -+ } -+ -+ if (!ValidCol(rCurPos.Col()+nColSize-1) || !ValidRow(rCurPos.Row()+nRowSize-1)) -+ { -+ ErrorMessage(STR_PASTE_FULL); -+ return false; -+ } -+ -+ // Determine the first and last selected sheet numbers. -+ SCTAB nTab1 = aMark.GetFirstSelected(); -+ SCTAB nTab2 = nTab1; -+ for (SCTAB i = nTab1+1; i <= MAXTAB; ++i) -+ if (aMark.GetTableSelect(i)) -+ nTab2 = i; -+ -+ ScDocShellModificator aModificator(*pDocSh); -+ -+ // For multi-selection paste, we don't support cell duplication for larger -+ // destination range. In case the destination is marked, we reset it to -+ // the clip size. -+ ScRange aMarkedRange(rCurPos.Col(), rCurPos.Row(), nTab1, -+ rCurPos.Col()+nColSize-1, rCurPos.Row()+nRowSize-1, nTab2); -+ -+ bool bAskIfNotEmpty = -+ bAllowDialogs && (nFlags & IDF_CONTENTS) && -+ nFunction == PASTE_NOFUNC && SC_MOD()->GetInputOptions().GetReplaceCellsWarn(); -+ -+ if (bAskIfNotEmpty) -+ { -+ if (!lcl_checkDestRangeForOverwrite(aMarkedRange, pDoc, aMark, rViewData.GetDialogParent())) -+ return false; -+ } -+ -+ aMark.SetMarkArea(aMarkedRange); -+ MarkRange(aMarkedRange); -+ -+ bool bInsertCells = (eMoveMode != INS_NONE); -+ if (bInsertCells) -+ { -+ if (!InsertCells(eMoveMode, pDoc->IsUndoEnabled(), true)) -+ return false; -+ } -+ -+ ::std::auto_ptr pUndoDoc; -+ if (pDoc->IsUndoEnabled()) -+ { -+ pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); -+ pUndoDoc->InitUndoSelected(pDoc, aMark, false, false); -+ pDoc->CopyToDocument(aMarkedRange, IDF_ALL, false, pUndoDoc.get(), &aMark, true); -+ } -+ -+ ::std::auto_ptr pMixDoc; -+ if ( bSkipEmpty || nFunction ) -+ { -+ if ( nFlags & IDF_CONTENTS ) -+ { -+ pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO)); -+ pMixDoc->InitUndoSelected(pDoc, aMark, false, false); -+ pDoc->CopyToDocument(aMarkedRange, IDF_CONTENTS, false, pMixDoc.get(), &aMark, true); -+ } -+ } -+ -+ /* Make draw layer and start drawing undo. -+ - Needed before AdjustBlockHeight to track moved drawing objects. -+ - Needed before pDoc->CopyFromClip to track inserted note caption objects. -+ */ -+ if (nFlags & IDF_OBJECTS) -+ pDocSh->MakeDrawLayer(); -+ if (pDoc->IsUndoEnabled()) -+ pDoc->BeginDrawUndo(); -+ -+ CursorSwitcher aCursorSwitch(this); -+ sal_uInt16 nNoObjFlags = nFlags & ~IDF_OBJECTS; -+ pDoc->CopyMultiRangeFromClip(rCurPos, aMark, nNoObjFlags, pClipDoc, -+ true, bAsLink, false, bSkipEmpty); -+ -+ if (pMixDoc.get()) -+ pDoc->MixDocument(aMarkedRange, nFunction, bSkipEmpty, pMixDoc.get()); -+ -+ AdjustBlockHeight(); // update row heights before pasting objects -+ -+ if (nFlags & IDF_OBJECTS) -+ { -+ // Paste the drawing objects after the row heights have been updated. -+ pDoc->CopyMultiRangeFromClip(rCurPos, aMark, IDF_OBJECTS, pClipDoc, -+ true, false, false, true); -+ } -+ -+ pDocSh->PostPaint(rCurPos.Col(), rCurPos.Row(), rCurPos.Tab(), -+ rCurPos.Col()+nColSize-1, rCurPos.Row()+nRowSize-1, rCurPos.Tab(), -+ PAINT_GRID); -+ -+ if (pDoc->IsUndoEnabled()) -+ { -+ SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager(); -+ String aUndo = ScGlobal::GetRscString( -+ pClipDoc->IsCutMode() ? STR_UNDO_CUT : STR_UNDO_COPY); -+ pUndoMgr->EnterListAction(aUndo, aUndo); -+ -+ ScUndoPasteOptions aOptions; // store options for repeat -+ aOptions.nFunction = nFunction; -+ aOptions.bSkipEmpty = bSkipEmpty; -+ aOptions.bTranspose = bTranspose; -+ aOptions.bAsLink = bAsLink; -+ aOptions.eMoveMode = eMoveMode; -+ -+ ScUndoPaste* pUndo = new ScUndoPaste(pDocSh, -+ aMarkedRange.aStart.Col(), -+ aMarkedRange.aStart.Row(), -+ aMarkedRange.aStart.Tab(), -+ aMarkedRange.aEnd.Col(), -+ aMarkedRange.aEnd.Row(), -+ aMarkedRange.aEnd.Tab(), -+ aMark, pUndoDoc.release(), NULL, nFlags|nUndoFlags, NULL, NULL, NULL, NULL, false, &aOptions); -+ -+ if (bInsertCells) -+ pUndoMgr->AddUndoAction(new ScUndoWrapper(pUndo), true); -+ else -+ pUndoMgr->AddUndoAction(pUndo, false); -+ -+ pUndoMgr->LeaveListAction(); -+ } -+ aModificator.SetDocumentModified(); -+ PostPasteFromClip(aMarkedRange, aMark); -+ return true; -+} -+ -+void ScViewFunc::PostPasteFromClip(const ScRange& rPasteRange, const ScMarkData& rMark) -+{ -+ ScViewData* pViewData = GetViewData(); -+ ScDocShell* pDocSh = pViewData->GetDocShell(); -+ ScDocument* pDoc = pViewData->GetDocument(); -+ pDocSh->UpdateOle(pViewData); - - SelectionChanged(); - -@@ -1295,7 +1613,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, - { - if ( rMark.GetTableSelect( i ) ) - { -- ScRange aChangeRange( aUserRange ); -+ ScRange aChangeRange(rPasteRange); - aChangeRange.aStart.SetTab( i ); - aChangeRange.aEnd.SetTab( i ); - aChangeRanges.Append( aChangeRange ); -@@ -1303,8 +1621,6 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, - } - pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cell-change" ) ), aChangeRanges ); - } -- -- return TRUE; - } - - diff --git a/applied_patches/0141-sc-print-selected-sheets.diff b/applied_patches/0140-sc-print-selected-sheets.diff similarity index 100% rename from applied_patches/0141-sc-print-selected-sheets.diff rename to applied_patches/0140-sc-print-selected-sheets.diff diff --git a/applied_patches/0143-sc-print-lines.diff b/applied_patches/0141-sc-print-lines.diff similarity index 100% rename from applied_patches/0143-sc-print-lines.diff rename to applied_patches/0141-sc-print-lines.diff diff --git a/applied_patches/0142-sc-biffdump.diff b/applied_patches/0142-sc-biffdump.diff deleted file mode 100644 index 7636210ba..000000000 --- a/applied_patches/0142-sc-biffdump.diff +++ /dev/null @@ -1,127 +0,0 @@ -Index: sc/source/filter/excel/biffdump.cxx -=================================================================== -RCS file: /cvs/sc/sc/source/filter/excel/biffdump.cxx,v -retrieving revision 1.89 -diff -u -p -r1.89 biffdump.cxx ---- sc/source/filter/excel/biffdump.cxx 3 Jul 2007 15:50:04 -0000 1.89 -+++ sc/source/filter/excel/biffdump.cxx 1 Oct 2007 20:00:49 -0000 -@@ -140,6 +140,16 @@ inline void lclAppendDec( ByteString& rS - rStr.Append( ByteString::CreateFromInt32( nData ) ); - } - -+inline void lclAppendDec( ByteString& rStr, sal_uInt64 nData ) -+{ -+ rStr.Append( ByteString::CreateFromInt64( nData ) ); -+} -+ -+inline void lclAppendDec( ByteString& rStr, sal_Int64 nData ) -+{ -+ rStr.Append( ByteString::CreateFromInt64( nData ) ); -+} -+ - inline void lclAppendDec( ByteString& rStr, float fData ) - { - rStr.Append( ByteString( ::rtl::math::doubleToString( fData, rtl_math_StringFormat_G, 15, '.', true ) ) ); -@@ -189,6 +199,17 @@ inline void lclAppendHex( ByteString& rS - lclAppendHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix ); - } - -+void lclAppendHex( ByteString& rStr, sal_uInt64 nData, bool bPrefix = true ) -+{ -+ lclAppendHex( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bPrefix ); -+ lclAppendHex( rStr, static_cast< sal_uInt32 >( nData ), false ); -+} -+ -+inline void lclAppendHex( ByteString& rStr, sal_Int64 nData, bool bPrefix = true ) -+{ -+ lclAppendHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix ); -+} -+ - inline void lclAppendHex( ByteString& rStr, double fData, bool bPrefix = true ) - { - const sal_uInt32* pnData = reinterpret_cast< const sal_uInt32* >( &fData ); -@@ -298,6 +319,34 @@ static void __AddHex( ByteString& r, INT - } - - -+static void __AddHex( ByteString& r, UINT64 nVal ) -+{ -+ r += __pHexPrefix; -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 60 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 56 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 52 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 48 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 44 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 40 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 36 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 32 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 28 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 24 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 20 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 16 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 12 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 8 ) ); -+ __AddHexNibble( r, ( UINT8 ) ( nVal >> 4 ) ); -+ __AddHexNibble( r, ( UINT8 ) nVal ); -+} -+ -+ -+static void __AddHex( ByteString& r, INT64 nVal ) -+{ -+ __AddHex( r, (UINT64) nVal ); -+} -+ -+ - static void __AddPureBinNibble( ByteString& r, UINT8 nVal ) - { - nVal <<= 4; -@@ -339,6 +388,14 @@ static void __AddPureBin( ByteString& r, - } - - -+inline static void __AddDec( ByteString& r, UINT64 n ) -+{ -+ // FIXME: need "%llu" for ILP32 platforms, "%lu" for LP64 platforms, -+ // and I have no idea for Win32. -+ __AddDec( r, static_cast(n) ); -+} -+ -+ - inline static void __AddDec( ByteString& r, UINT32 n ) - { - sal_Char p[ 32 ]; -@@ -367,6 +424,14 @@ inline static void __AddDec( ByteString& - } - - -+inline static void __AddDec( ByteString& r, INT64 n ) -+{ -+ // FIXME: need "%lld" for ILP32 platforms, "%ld" for LP64 platforms, -+ // and I have no idea for Win32. -+ __AddDec( r, static_cast(n) ); -+} -+ -+ - inline static void __AddDec( ByteString& r, INT16 n ) - { - __AddDec( r, ( INT32 ) n ); -@@ -1063,8 +1128,8 @@ UINT16 Biff8RecDumper::DumpXF( XclImpStr - ADDTEXT( "diag-line=" ); __AddDec( t, nTmp ); - ::extract_value( nTmp, nBorder2, 14, 7 ); - ADDTEXT( " color=" ); __AddDec( t, nTmp ); -- ADDTEXT( " diag-tl-to-br=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, 0x40000000UL ) ); -- ADDTEXT( " diag-bl-to-tr=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, 0x80000000UL ) ); -+ ADDTEXT( " diag-tl-to-br=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, static_cast< sal_Size >( 0x40000000U ) ) ); -+ ADDTEXT( " diag-bl-to-tr=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, static_cast< sal_Size >( 0x80000000U ) ) ); - PRINT(); - LINESTART(); - ::extract_value( nTmp, nBorder2, 26, 6 ); -@@ -9820,7 +9885,7 @@ BOOL Biff8RecDumper::Dump( XclImpStream& - SvFileStream aBook( String::CreateFromAscii( aBookOutName.GetBuffer() ), STREAM_WRITE|STREAM_SHARE_DENYWRITE|STREAM_TRUNC ); - if( aBook.IsOpen() ) - { -- const sal_uInt32 nBufLen = 0xFFFF; -+ const sal_Size nBufLen = 0xFFFF; - sal_uInt8 pBuffer[ nBufLen ]; - r.StoreGlobalPosition(); - while( r.StartNextRecord() ) diff --git a/applied_patches/0142-sc-dbrange-dynamic-resize.diff b/applied_patches/0142-sc-dbrange-dynamic-resize.diff new file mode 100644 index 000000000..3236a7464 --- /dev/null +++ b/applied_patches/0142-sc-dbrange-dynamic-resize.diff @@ -0,0 +1,371 @@ +diff --git sc/inc/dbcolect.hxx sc/inc/dbcolect.hxx +index eea9076..00ea53b 100644 +--- sc/inc/dbcolect.hxx ++++ sc/inc/dbcolect.hxx +@@ -94,6 +94,7 @@ private: + ScQueryConnect eQueryConnect[MAXQUERY]; + BOOL bIsAdvanced; // TRUE if created by advanced filter + ScRange aAdvSource; // source range ++ SCROW nDynamicEndRow; + // SubTotalParam + BOOL bSubRemoveOnly; + BOOL bSubReplace; +@@ -141,9 +142,10 @@ public: + const String& GetName() const { return aName; } + void GetName(String& rName) const { rName = aName; } + void SetName(const String& rName) { aName = rName; } +- void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const; +- SC_DLLPUBLIC void GetArea(ScRange& rRange) const; ++ void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, bool bUseDynamicRange = false) const; ++ SC_DLLPUBLIC void GetArea(ScRange& rRange, bool bUseDynamicRange = false) const; + void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); ++ void SetDynamicEndRow(SCROW nRow); + void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); + BOOL IsByRow() const { return bByRow; } + void SetByRow(BOOL bByR) { bByRow = bByR; } +diff --git sc/inc/document.hxx sc/inc/document.hxx +index a92545f..daeb91e 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -873,7 +873,7 @@ public: + bool ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const; + + void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, +- SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ); ++ SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) const; + SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; + SC_DLLPUBLIC BOOL GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; + SC_DLLPUBLIC BOOL GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, +@@ -1392,6 +1392,9 @@ public: + SCTAB nTab, ScQueryParam& rQueryParam ); + void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr); + ++ /** Update the dynamic end row position of a current data area. */ ++ void UpdateDynamicEndRow(ScDBData& rDBData) const; ++ + BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, + bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates); + SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, +diff --git sc/inc/queryparam.hxx sc/inc/queryparam.hxx +index bc50237..01ddffb 100644 +--- sc/inc/queryparam.hxx ++++ sc/inc/queryparam.hxx +@@ -86,6 +86,8 @@ struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamT + SCTAB nDestTab; + SCCOL nDestCol; + SCROW nDestRow; ++ SCROW nDynamicEndRow; ++ bool bUseDynamicRange; + + ScQueryParam(); + ScQueryParam( const ScQueryParam& r ); +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 3659381..89f505e 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -379,7 +379,7 @@ public: + SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow ); + + void GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, +- BOOL bIncludeOld ); ++ BOOL bIncludeOld ) const; + + SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ); +diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx +index caeb5b1..396d54c 100644 +--- sc/source/core/data/documen3.cxx ++++ sc/source/core/data/documen3.cxx +@@ -1255,6 +1255,18 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, + //return FALSE; + } + ++void ScDocument::UpdateDynamicEndRow(ScDBData& rDBData) const ++{ ++ SCCOL nCol1, nCol2; ++ SCROW nRow1, nRow2; ++ SCTAB nTab; ++ rDBData.GetArea(nTab, nCol1, nRow1, nCol2, nRow2); ++ SCCOL nCol1a = nCol1, nCol2a = nCol2; ++ SCROW nRow1a = nRow1, nRow2a = nRow2; ++ GetDataArea(nTab, nCol1a, nRow1a, nCol2a, nRow2a, false); ++ rDBData.SetDynamicEndRow(nRow2a); ++} ++ + // + // GetFilterEntries - Eintraege fuer AutoFilter-Listbox + // +@@ -1267,6 +1279,7 @@ BOOL ScDocument::GetFilterEntries( + ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!?? + if (pDBData) + { ++ UpdateDynamicEndRow(*pDBData); + SCTAB nAreaTab; + SCCOL nStartCol; + SCROW nStartRow; +@@ -1278,6 +1291,7 @@ BOOL ScDocument::GetFilterEntries( + + ScQueryParam aParam; + pDBData->GetQueryParam( aParam ); ++ nEndRow = aParam.nDynamicEndRow; + rStrings.SetCaseSensitive( aParam.bCaseSens ); + + // return all filter entries, if a filter condition is connected with a boolean OR +diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx +index 3d61f28..187199f 100644 +--- sc/source/core/data/document.cxx ++++ sc/source/core/data/document.cxx +@@ -663,7 +663,7 @@ bool ScDocument::ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow + // zusammenhaengender Bereich + + void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, +- SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) ++ SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) const + { + if (VALIDTAB(nTab)) + if (pTab[nTab]) +diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx +index 15db733..10b8cda 100644 +--- sc/source/core/data/table1.cxx ++++ sc/source/core/data/table1.cxx +@@ -680,7 +680,7 @@ BOOL ScTable::GetDataStart( SCCOL& rStartCol, SCROW& rStartRow ) const + } + + void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, +- BOOL bIncludeOld ) ++ BOOL bIncludeOld ) const + { + BOOL bLeft = FALSE; + BOOL bRight = FALSE; +diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx +index 986755a..2ecc8c1 100644 +--- sc/source/core/data/table3.cxx ++++ sc/source/core/data/table3.cxx +@@ -1617,6 +1617,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) + BOOL* pSpecial = new BOOL[nEntryCount]; + lcl_PrepareQuery( pDocument, this, aParam, pSpecial ); + ++ SCROW nEndRow = aParam.bUseDynamicRange ? aParam.nDynamicEndRow : aParam.nRow2; + if (!aParam.bInplace) + { + nOutRow = aParam.nDestRow + nHeader; +@@ -1625,7 +1626,7 @@ SCSIZE ScTable::Query(ScQueryParam& rParamOrg, BOOL bKeepSub) + aParam.nDestCol, aParam.nDestRow, aParam.nDestTab ); + } + +- for (SCROW j=aParam.nRow1 + nHeader; j<=aParam.nRow2; j++) ++ for (SCROW j=aParam.nRow1 + nHeader; j<=nEndRow; j++) + { + BOOL bResult; // Filterergebnis + BOOL bValid = ValidQuery(j, aParam, pSpecial); +diff --git sc/source/core/tool/dbcolect.cxx sc/source/core/tool/dbcolect.cxx +index 4f0e755..5fae4bd 100644 +--- sc/source/core/tool/dbcolect.cxx ++++ sc/source/core/tool/dbcolect.cxx +@@ -381,18 +381,20 @@ String ScDBData::GetOperations() const + return aVal; + } + +-void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const ++void ScDBData::GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, ++ bool bUseDynamicRange) const + { + rTab = nTable; + rCol1 = nStartCol; + rRow1 = nStartRow; + rCol2 = nEndCol; +- rRow2 = nEndRow; ++ rRow2 = bUseDynamicRange ? nDynamicEndRow : nEndRow; + } + +-void ScDBData::GetArea(ScRange& rRange) const ++void ScDBData::GetArea(ScRange& rRange, bool bUseDynamicRange) const + { +- rRange = ScRange( nStartCol,nStartRow,nTable, nEndCol,nEndRow,nTable ); ++ SCROW nNewEndRow = bUseDynamicRange ? nDynamicEndRow : nEndRow; ++ rRange = ScRange( nStartCol, nStartRow, nTable, nEndCol, nNewEndRow, nTable ); + } + + void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) +@@ -404,6 +406,11 @@ void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW + nEndRow = nRow2; + } + ++void ScDBData::SetDynamicEndRow(SCROW nRow) ++{ ++ nDynamicEndRow = nRow; ++} ++ + void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) + { + USHORT i; +@@ -511,6 +518,7 @@ void ScDBData::GetQueryParam( ScQueryParam& rQueryParam ) const + rQueryParam.nDestTab = nQueryDestTab; + rQueryParam.nDestCol = nQueryDestCol; + rQueryParam.nDestRow = nQueryDestRow; ++ rQueryParam.nDynamicEndRow = nDynamicEndRow; + + rQueryParam.Resize( MAXQUERY ); + for (SCSIZE i=0; i( nCol2 + nDifX ); + nRow2 = sal::static_int_cast( nRow2 + nDifY ); + nTab = sal::static_int_cast( nTab + nDifZ ); ++ nDynamicEndRow = sal::static_int_cast( nDynamicEndRow + nDifY ); + size_t n = maEntries.size(); + for (size_t i=0; iGetDocShell(); + ScDBData* pData = NULL; +@@ -136,11 +136,20 @@ ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode, bool bShrinkToData + ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(), + GetViewData()->GetTabNo() ), + eMode, FALSE ); ++ if (!pData) ++ return NULL; + +- if ( pData && bMark ) ++ if (bExpandRows) ++ { ++ // Dynamically expand rows to include any new data rows that are ++ // immediately below the original range. ++ GetViewData()->GetDocument()->UpdateDynamicEndRow(*pData); ++ } ++ ++ if (bMark) + { + ScRange aFound; +- pData->GetArea(aFound); ++ pData->GetArea(aFound, bExpandRows); + MarkRange( aFound, FALSE ); + } + return pData; +diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx +index 6e0280a..57f1996 100644 +--- sc/source/ui/view/gridwin.cxx ++++ sc/source/ui/view/gridwin.cxx +@@ -1276,6 +1276,7 @@ void ScGridWindow::ExecFilter( ULONG nSel, + pViewData->GetViewShell()->UpdateInputHandler(); + } + ++ aParam.bUseDynamicRange = true; + pViewData->GetView()->Query( aParam, NULL, TRUE ); + pDBData->SetQueryParam( aParam ); // speichern + } +diff --git sc/source/ui/view/tabvwshc.cxx sc/source/ui/view/tabvwshc.cxx +index 968984d..499c2a0 100644 +--- sc/source/ui/view/tabvwshc.cxx ++++ sc/source/ui/view/tabvwshc.cxx +@@ -178,8 +178,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( + SCITEM_QUERYDATA, + SCITEM_QUERYDATA ); + +- ScDBData* pDBData = GetDBData(); ++ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, true); + pDBData->GetQueryParam( aQueryParam ); ++ aQueryParam.bUseDynamicRange = true; + + ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam ); + ScRange aAdvSource; +@@ -203,8 +204,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( + SCITEM_QUERYDATA, + SCITEM_QUERYDATA ); + +- ScDBData* pDBData = GetDBData(); ++ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, true); + pDBData->GetQueryParam( aQueryParam ); ++ aQueryParam.bUseDynamicRange = true; + + aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, + GetViewData(), diff --git a/applied_patches/0145-sc-cellbackground-over-gridlines.diff b/applied_patches/0143-sc-cellbackground-over-gridlines.diff similarity index 100% rename from applied_patches/0145-sc-cellbackground-over-gridlines.diff rename to applied_patches/0143-sc-cellbackground-over-gridlines.diff diff --git a/applied_patches/0146-sc-cellformat-icon-toggle.diff b/applied_patches/0144-sc-cellformat-icon-toggle.diff similarity index 100% rename from applied_patches/0146-sc-cellformat-icon-toggle.diff rename to applied_patches/0144-sc-cellformat-icon-toggle.diff diff --git a/applied_patches/0144-sc-dbrange-dynamic-resize.diff b/applied_patches/0144-sc-dbrange-dynamic-resize.diff deleted file mode 100644 index bf74d4e9b..000000000 --- a/applied_patches/0144-sc-dbrange-dynamic-resize.diff +++ /dev/null @@ -1,372 +0,0 @@ -diff --git sc/inc/dbcolect.hxx sc/inc/dbcolect.hxx -index 73b4c3e..021a1e0 100644 ---- sc/inc/dbcolect.hxx -+++ sc/inc/dbcolect.hxx -@@ -96,6 +96,7 @@ private: - ScQueryConnect eQueryConnect[MAXQUERY]; - BOOL bIsAdvanced; // TRUE if created by advanced filter - ScRange aAdvSource; // source range -+ SCROW nDynamicEndRow; - // SubTotalParam - BOOL bSubRemoveOnly; - BOOL bSubReplace; -@@ -143,9 +144,10 @@ public: - const String& GetName() const { return aName; } - void GetName(String& rName) const { rName = aName; } - void SetName(const String& rName) { aName = rName; } -- void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2) const; -- SC_DLLPUBLIC void GetArea(ScRange& rRange) const; -+ void GetArea(SCTAB& rTab, SCCOL& rCol1, SCROW& rRow1, SCCOL& rCol2, SCROW& rRow2, bool bUseDynamicRange = false) const; -+ SC_DLLPUBLIC void GetArea(ScRange& rRange, bool bUseDynamicRange = false) const; - void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); -+ void SetDynamicEndRow(SCROW nRow); - void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2); - BOOL IsByRow() const { return bByRow; } - void SetByRow(BOOL bByR) { bByRow = bByR; } -diff --git sc/inc/document.hxx sc/inc/document.hxx -index 3675b1b..14c1ddc 100644 ---- sc/inc/document.hxx -+++ sc/inc/document.hxx -@@ -858,7 +858,7 @@ public: - USHORT GetErrCode( const ScAddress& ) const; - - void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, -- SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ); -+ SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) const; - SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; - SC_DLLPUBLIC BOOL GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; - SC_DLLPUBLIC BOOL GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, -@@ -1377,6 +1377,9 @@ public: - SCTAB nTab, ScQueryParam& rQueryParam ); - void GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab, String& rStr); - -+ /** Update the dynamic end row position of a current data area. */ -+ void UpdateDynamicEndRow(ScDBData& rDBData) const; -+ - BOOL GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, - bool bFilter, TypedScStrCollection& rStrings, bool& rHasDates); - SC_DLLPUBLIC BOOL GetFilterEntriesArea( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, -diff --git sc/inc/global.hxx sc/inc/global.hxx -index 4892a3e..05fbc13 100644 ---- sc/inc/global.hxx -+++ sc/inc/global.hxx -@@ -837,6 +837,8 @@ struct SC_DLLPUBLIC ScQueryParam - SCTAB nDestTab; - SCCOL nDestCol; - SCROW nDestRow; -+ SCROW nDynamicEndRow; -+ bool bUseDynamicRange; - - private: - SCSIZE nEntryCount; -diff --git sc/inc/table.hxx sc/inc/table.hxx -index 2b4017b..d754363 100644 ---- sc/inc/table.hxx -+++ sc/inc/table.hxx -@@ -347,11 +347,10 @@ public: - SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW nEndRow ); - - void GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, -- BOOL bIncludeOld ); -+ BOOL bIncludeOld ) const; - - SCSIZE GetEmptyLinesInBlock( SCCOL nStartCol, SCROW nStartRow, - SCCOL nEndCol, SCROW nEndRow, ScDirection eDir ); -- - void FindAreaPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY ); - void GetNextPos( SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, - BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark ); ---- sc/source/core/data/documen3.cxx -+++ sc/source/core/data/documen3.cxx -@@ -1290,14 +1290,24 @@ BOOL ScDocument::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, - //if (VALIDTAB(nTab)) - // if (pTab[nTab]) - // return pTab[nTab]->HasRowHeader( nStartCol, nStartRow, nEndCol, nEndRow ); -- - //return FALSE; - } - -+void ScDocument::UpdateDynamicEndRow(ScDBData& rDBData) const -+{ -+ SCCOL nCol1, nCol2; -+ SCROW nRow1, nRow2; -+ SCTAB nTab; -+ rDBData.GetArea(nTab, nCol1, nRow1, nCol2, nRow2); -+ SCCOL nCol1a = nCol1, nCol2a = nCol2; -+ SCROW nRow1a = nRow1, nRow2a = nRow2; -+ GetDataArea(nTab, nCol1a, nRow1a, nCol2a, nRow2a, false); -+ rDBData.SetDynamicEndRow(nRow2a); -+} -+ - // - // GetFilterEntries - Eintraege fuer AutoFilter-Listbox - // -- - BOOL ScDocument::GetFilterEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, TypedScStrCollection& rStrings, bool bFilter ) - { - if ( ValidTab(nTab) && pTab[nTab] && pDBCollection ) -@@ -1306,6 +1316,7 @@ BOOL ScDocument::GetFilterEntries( - ScDBData* pDBData = pDBCollection->GetDBAtCursor(nCol, nRow, nTab, FALSE); //!?? - if (pDBData) - { -+ UpdateDynamicEndRow(*pDBData); - SCTAB nAreaTab; - SCCOL nStartCol; - SCROW nStartRow; -@@ -1317,6 +1328,7 @@ BOOL ScDocument::GetFilterEntries( - - ScQueryParam aParam; - pDBData->GetQueryParam( aParam ); -+ nEndRow = aParam.nDynamicEndRow; - rStrings.SetCaseSensitive( aParam.bCaseSens ); - - // return all filter entries, if a filter condition is connected with a boolean OR -diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx -index d08a3c0..f43ec20 100644 ---- sc/source/core/data/document.cxx -+++ sc/source/core/data/document.cxx -@@ -601,7 +601,7 @@ BOOL ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) cons - // zusammenhaengender Bereich - - void ScDocument::GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, -- SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) -+ SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ) const - { - if (VALIDTAB(nTab)) - if (pTab[nTab]) -diff --git sc/source/core/data/global2.cxx sc/source/core/data/global2.cxx -index 3b0d0f6..43740e8 100644 ---- sc/source/core/data/global2.cxx -+++ sc/source/core/data/global2.cxx -@@ -261,7 +261,8 @@ ScQueryParam::ScQueryParam( const ScQueryParam& r ) : - bHasHeader(r.bHasHeader), bByRow(r.bByRow), bInplace(r.bInplace), bCaseSens(r.bCaseSens), - bRegExp(r.bRegExp), bMixedComparison(r.bMixedComparison), - bDuplicate(r.bDuplicate), bDestPers(r.bDestPers), -- nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow) -+ nDestTab(r.nDestTab), nDestCol(r.nDestCol), nDestRow(r.nDestRow), -+ nDynamicEndRow(r.nDynamicEndRow), bUseDynamicRange(r.bUseDynamicRange) - { - nEntryCount = 0; - -@@ -287,6 +288,8 @@ void ScQueryParam::Clear() - nTab = SCTAB_MAX; - bHasHeader = bCaseSens = bRegExp = bMixedComparison = FALSE; - bInplace = bByRow = bDuplicate = bDestPers = TRUE; -+ nDynamicEndRow = 0; -+ bUseDynamicRange = false; - - Resize( MAXQUERY ); - for (USHORT i=0; i( nCol2 + nDifX ); - nRow2 = sal::static_int_cast( nRow2 + nDifY ); - nTab = sal::static_int_cast( nTab + nDifZ ); -+ nDynamicEndRow = sal::static_int_cast( nDynamicEndRow + nDifY ); - for (USHORT i=0; iGetDocShell(); - ScDBData* pData = NULL; -@@ -119,11 +120,20 @@ ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode ) - ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(), - GetViewData()->GetTabNo() ), - eMode, FALSE ); -+ if (!pData) -+ return NULL; -+ -+ if (bExpandRows) -+ { -+ // Dynamically expand rows to include any new data rows that are -+ // immediately below the original range. -+ GetViewData()->GetDocument()->UpdateDynamicEndRow(*pData); -+ } - -- if ( pData && bMark ) -+ if (bMark) - { - ScRange aFound; -- pData->GetArea(aFound); -+ pData->GetArea(aFound, bExpandRows); - MarkRange( aFound, FALSE ); - } - return pData; -diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx -index 439f98d..b56189d 100644 ---- sc/source/ui/view/gridwin.cxx -+++ sc/source/ui/view/gridwin.cxx -@@ -1198,6 +1198,7 @@ void ScGridWindow::ExecFilter( ULONG nSel, - pViewData->GetViewShell()->UpdateInputHandler(); - } - -+ aParam.bUseDynamicRange = true; - pViewData->GetView()->Query( aParam, NULL, TRUE ); - pDBData->SetQueryParam( aParam ); // speichern - } -diff --git sc/source/ui/view/tabvwshc.cxx sc/source/ui/view/tabvwshc.cxx -index 5e61e4e..0312ded 100644 ---- sc/source/ui/view/tabvwshc.cxx -+++ sc/source/ui/view/tabvwshc.cxx -@@ -178,8 +178,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( - SCITEM_QUERYDATA, - SCITEM_QUERYDATA ); - -- ScDBData* pDBData = GetDBData(); -+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, true); - pDBData->GetQueryParam( aQueryParam ); -+ aQueryParam.bUseDynamicRange = true; - - ScQueryItem aItem( SCITEM_QUERYDATA, GetViewData(), &aQueryParam ); - ScRange aAdvSource; -@@ -203,8 +204,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( - SCITEM_QUERYDATA, - SCITEM_QUERYDATA ); - -- ScDBData* pDBData = GetDBData(); -+ ScDBData* pDBData = GetDBData(true, SC_DB_MAKE, true); - pDBData->GetQueryParam( aQueryParam ); -+ aQueryParam.bUseDynamicRange = true; - - aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, - GetViewData(), diff --git a/applied_patches/0147-sc-fit-to-width-height-skip-breaks.diff b/applied_patches/0145-sc-fit-to-width-height-skip-breaks.diff similarity index 100% rename from applied_patches/0147-sc-fit-to-width-height-skip-breaks.diff rename to applied_patches/0145-sc-fit-to-width-height-skip-breaks.diff diff --git a/applied_patches/0148-chart-skip-hidden-cells-sc-fix.diff b/applied_patches/0146-chart-skip-hidden-cells-sc-fix.diff similarity index 100% rename from applied_patches/0148-chart-skip-hidden-cells-sc-fix.diff rename to applied_patches/0146-chart-skip-hidden-cells-sc-fix.diff diff --git a/applied_patches/0151-calc-filter-xml-free-context.diff b/applied_patches/0147-calc-filter-xml-free-context.diff similarity index 100% rename from applied_patches/0151-calc-filter-xml-free-context.diff rename to applied_patches/0147-calc-filter-xml-free-context.diff diff --git a/applied_patches/0152-calc-status-bar-func.diff b/applied_patches/0148-calc-status-bar-func.diff similarity index 100% rename from applied_patches/0152-calc-status-bar-func.diff rename to applied_patches/0148-calc-status-bar-func.diff diff --git a/applied_patches/0149-calc-dp-default-new-sheet.diff b/applied_patches/0149-calc-dp-default-new-sheet.diff new file mode 100644 index 000000000..205432522 --- /dev/null +++ b/applied_patches/0149-calc-dp-default-new-sheet.diff @@ -0,0 +1,121 @@ +diff --git sc/source/ui/dbgui/pvlaydlg.cxx sc/source/ui/dbgui/pvlaydlg.cxx +index 99897a0..4dee615 100644 +--- sc/source/ui/dbgui/pvlaydlg.cxx ++++ sc/source/ui/dbgui/pvlaydlg.cxx +@@ -107,7 +107,7 @@ PointerStyle lclGetPointerForField( ScDPFieldType eType ) + //---------------------------------------------------------------------------- + + ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, +- const ScDPObject& rDPObject ) ++ const ScDPObject& rDPObject, bool bNewOutput ) + : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ), + aFlLayout ( this, ScResId( FL_LAYOUT ) ), + aFtPage ( this, ScResId( FT_PAGE ) ), +@@ -167,7 +167,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar + xDlgDPObject->FillOldParam( thePivotData, FALSE ); + xDlgDPObject->FillLabelData( thePivotData ); + +- Init(); ++ Init(bNewOutput); + FreeResource(); + } + +@@ -202,7 +202,7 @@ ScDPFieldWindow& ScDPLayoutDlg::GetFieldWindow( ScDPFieldType eType ) + return aWndSelect; + } + +-void __EXPORT ScDPLayoutDlg::Init() ++void __EXPORT ScDPLayoutDlg::Init(bool bNewOutput) + { + DBG_ASSERT( pViewData && pDoc, + "Ctor-Initialisierung fehlgeschlagen!" ); +@@ -302,21 +302,33 @@ void __EXPORT ScDPLayoutDlg::Init() + } + } + } ++ ++ if (bNewOutput) ++ { ++ // Output to a new sheet by default for a brand-new output. ++ aLbOutPos.SelectEntryPos(1); ++ aEdOutPos.Disable(); ++ aRbOutPos.Disable(); ++ } ++ else ++ { ++ // Modifying an existing dp output. + +- if ( thePivotData.nTab != MAXTAB+1 ) +- { +- String aStr; +- ScAddress( thePivotData.nCol, +- thePivotData.nRow, +- thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); +- aEdOutPos.SetText( aStr ); +- EdModifyHdl(0); +- } +- else +- { +- aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 ); +- SelAreaHdl(NULL); +- } ++ if ( thePivotData.nTab != MAXTAB+1 ) ++ { ++ String aStr; ++ ScAddress( thePivotData.nCol, ++ thePivotData.nRow, ++ thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); ++ aEdOutPos.SetText( aStr ); ++ EdModifyHdl(0); ++ } ++ else ++ { ++ aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 ); ++ SelAreaHdl(NULL); ++ } ++ } + + aBtnIgnEmptyRows.Check( thePivotData.bIgnoreEmptyRows ); + aBtnDetectCat .Check( thePivotData.bDetectCategories ); +diff --git sc/source/ui/inc/pvlaydlg.hxx sc/source/ui/inc/pvlaydlg.hxx +index ceebdb7..a3e08cb 100644 +--- sc/source/ui/inc/pvlaydlg.hxx ++++ sc/source/ui/inc/pvlaydlg.hxx +@@ -89,7 +89,8 @@ public: + SfxBindings* pB, + SfxChildWindow* pCW, + Window* pParent, +- const ScDPObject& rDPObject ); ++ const ScDPObject& rDPObject, ++ bool bNewOutput ); + virtual ~ScDPLayoutDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); +@@ -190,7 +191,7 @@ private: + + private: + ScDPFieldWindow& GetFieldWindow ( ScDPFieldType eType ); +- void Init (); ++ void Init (bool bNewOutput); + void InitWndSelect ( const ::std::vector& rLabels ); + void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType ); + void InitFocus (); +diff --git sc/source/ui/view/tabvwshc.cxx sc/source/ui/view/tabvwshc.cxx +index aa38b7a..b20876f 100644 +--- sc/source/ui/view/tabvwshc.cxx ++++ sc/source/ui/view/tabvwshc.cxx +@@ -255,8 +255,13 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( + + if( pDialogDPObject ) + { ++ // Check for an existing datapilot output. ++ ScViewData* pViewData = GetViewData(); ++ ScDPObject* pObj = GetViewData()->GetDocument()->GetDPAtCursor( ++ pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo()); ++ + GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() ); +- pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject ); ++ pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject, pObj == NULL); + } + } + break; diff --git a/applied_patches/0149-chart-axis-multi-chart-types-chart2.diff b/applied_patches/0149-chart-axis-multi-chart-types-chart2.diff deleted file mode 100644 index 8ccd9cf78..000000000 --- a/applied_patches/0149-chart-axis-multi-chart-types-chart2.diff +++ /dev/null @@ -1,617 +0,0 @@ -diff --git chart2/source/model/template/AreaChartType.cxx chart2/source/model/template/AreaChartType.cxx -index db529a7..3a562f0 100644 ---- chart2/source/model/template/AreaChartType.cxx -+++ chart2/source/model/template/AreaChartType.cxx -@@ -33,8 +33,72 @@ - #include "AreaChartType.hxx" - #include "macros.hxx" - #include "servicenames_charttypes.hxx" -+#include "PropertyHelper.hxx" -+#include "ContainerHelper.hxx" -+ -+#include - - using namespace ::com::sun::star; -+using ::com::sun::star::beans::Property; -+using ::com::sun::star::uno::Sequence; -+ -+namespace -+{ -+ -+enum -+{ -+ PROP_AREACHARTTYPE_STACKED, -+ PROP_AREACHARTTYPE_PERCENT -+}; -+ -+void lcl_AddPropertiesToVector( -+ ::std::vector< Property > & rOutProperties ) -+{ -+ rOutProperties.push_back( -+ Property( C2U( "Stacked" ), -+ PROP_AREACHARTTYPE_STACKED, -+ ::getBooleanCppuType(), -+ beans::PropertyAttribute::BOUND -+ | beans::PropertyAttribute::MAYBEDEFAULT )); -+ rOutProperties.push_back( -+ Property( C2U( "Percent" ), -+ PROP_AREACHARTTYPE_PERCENT, -+ ::getBooleanCppuType(), -+ beans::PropertyAttribute::BOUND -+ | beans::PropertyAttribute::MAYBEDEFAULT )); -+} -+ -+void lcl_AddDefaultsToMap( -+ ::chart::tPropertyValueMap & rOutMap ) -+{ -+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AREACHARTTYPE_STACKED, false ); -+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AREACHARTTYPE_PERCENT, false ); -+} -+ -+const Sequence< Property > & lcl_GetPropertySequence() -+{ -+ static Sequence< Property > aPropSeq; -+ -+ // /-- -+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); -+ if( 0 == aPropSeq.getLength() ) -+ { -+ // get properties -+ ::std::vector< ::com::sun::star::beans::Property > aProperties; -+ lcl_AddPropertiesToVector( aProperties ); -+ -+ // and sort them for access via bsearch -+ ::std::sort( aProperties.begin(), aProperties.end(), -+ ::chart::PropertyNameLess() ); -+ -+ // transfer result to static Sequence -+ aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties ); -+ } -+ -+ return aPropSeq; -+} -+ -+} // anonymous namespace - - namespace chart - { -@@ -65,6 +129,56 @@ uno::Reference< util::XCloneable > SAL_CALL AreaChartType::createClone() - return CHART2_SERVICE_NAME_CHARTTYPE_AREA; - } - -+// ____ OPropertySet ____ -+uno::Any AreaChartType::GetDefaultValue( sal_Int32 nHandle ) const -+ throw(beans::UnknownPropertyException) -+{ -+ static tPropertyValueMap aStaticDefaults; -+ -+ // /-- -+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); -+ if( 0 == aStaticDefaults.size() ) -+ { -+ // initialize defaults -+ lcl_AddDefaultsToMap( aStaticDefaults ); -+ } -+ -+ tPropertyValueMap::const_iterator aFound( -+ aStaticDefaults.find( nHandle )); -+ -+ if( aFound == aStaticDefaults.end()) -+ return uno::Any(); -+ -+ return (*aFound).second; -+ // \-- -+} -+ -+::cppu::IPropertyArrayHelper & SAL_CALL AreaChartType::getInfoHelper() -+{ -+ static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(), -+ /* bSorted = */ sal_True ); -+ -+ return aArrayHelper; -+} -+ -+// ____ XPropertySet ____ -+uno::Reference< beans::XPropertySetInfo > SAL_CALL AreaChartType::getPropertySetInfo() -+ throw (uno::RuntimeException) -+{ -+ static uno::Reference< beans::XPropertySetInfo > xInfo; -+ -+ // /-- -+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); -+ if( !xInfo.is()) -+ { -+ xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( -+ getInfoHelper()); -+ } -+ -+ return xInfo; -+ // \-- -+} -+ - uno::Sequence< ::rtl::OUString > AreaChartType::getSupportedServiceNames_Static() - { - uno::Sequence< ::rtl::OUString > aServices( 2 ); -diff --git chart2/source/model/template/AreaChartType.hxx chart2/source/model/template/AreaChartType.hxx -index 6b619b2..778f936 100644 ---- chart2/source/model/template/AreaChartType.hxx -+++ chart2/source/model/template/AreaChartType.hxx -@@ -56,6 +56,16 @@ protected: - virtual ::rtl::OUString SAL_CALL getChartType() - throw (::com::sun::star::uno::RuntimeException); - -+ // ____ OPropertySet ____ -+ virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const -+ throw(::com::sun::star::beans::UnknownPropertyException); -+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); -+ -+ // ____ XPropertySet ____ -+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL -+ getPropertySetInfo() -+ throw (::com::sun::star::uno::RuntimeException); -+ - // ____ XCloneable ____ - virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() - throw (::com::sun::star::uno::RuntimeException); -diff --git chart2/source/model/template/AreaChartTypeTemplate.cxx chart2/source/model/template/AreaChartTypeTemplate.cxx -index 98874ef..f7d24a5 100644 ---- chart2/source/model/template/AreaChartTypeTemplate.cxx -+++ chart2/source/model/template/AreaChartTypeTemplate.cxx -@@ -48,6 +48,8 @@ using ::com::sun::star::beans::Property; - using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::Any; -+using ::com::sun::star::uno::UNO_QUERY; -+using ::com::sun::star::uno::UNO_QUERY_THROW; - using ::osl::MutexGuard; - - namespace -@@ -275,6 +277,7 @@ Reference< chart2::XChartType > SAL_CALL AreaChartTypeTemplate::getChartTypeForN - { - Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) ); - ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult ); -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/model/template/BarChartTypeTemplate.cxx chart2/source/model/template/BarChartTypeTemplate.cxx -index e6382d5..0e5904d 100644 ---- chart2/source/model/template/BarChartTypeTemplate.cxx -+++ chart2/source/model/template/BarChartTypeTemplate.cxx -@@ -221,6 +221,7 @@ Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForNe - { - Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) ); - ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult ); -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/model/template/ChartTypeTemplate.cxx chart2/source/model/template/ChartTypeTemplate.cxx -index 3e9be6e..2b7aa35 100644 ---- chart2/source/model/template/ChartTypeTemplate.cxx -+++ chart2/source/model/template/ChartTypeTemplate.cxx -@@ -63,6 +63,7 @@ using ::rtl::OUString; - using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::Any; -+using ::com::sun::star::uno::UNO_QUERY; - - // ====================================================================== - -@@ -968,6 +969,48 @@ void ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( - comphelper::copyProperties( xSource, xDestination ); - } - -+void ChartTypeTemplate::setStackModePropertiesToChartType(const Reference& xChartType) -+{ -+ Reference xPropSet(xChartType, UNO_QUERY); -+ if (!xPropSet.is()) -+ return; -+ -+ bool bStacked = false; -+ bool bPercent = false; -+ switch (getStackMode(0)) -+ { -+ case StackMode_Y_STACKED: -+ bStacked = true; -+ break; -+ case StackMode_Y_STACKED_PERCENT: -+ bStacked = true; -+ bPercent = true; -+ break; -+ case StackMode_Z_STACKED: -+ break; -+ default: -+ ; -+ } -+ -+ try -+ { -+ xPropSet->setPropertyValue( -+ C2U("Stacked"), uno::makeAny(static_cast(bStacked))); -+ } -+ catch (const beans::UnknownPropertyException&) -+ { -+ } -+ -+ try -+ { -+ xPropSet->setPropertyValue( -+ C2U("Percent"), uno::makeAny(static_cast(bPercent))); -+ } -+ catch (const beans::UnknownPropertyException&) -+ { -+ } -+} -+ - // ________ - - Sequence< OUString > ChartTypeTemplate::getSupportedServiceNames_Static() -diff --git chart2/source/model/template/ChartTypeTemplate.hxx chart2/source/model/template/ChartTypeTemplate.hxx -index 47633ad..57d78d4 100644 ---- chart2/source/model/template/ChartTypeTemplate.hxx -+++ chart2/source/model/template/ChartTypeTemplate.hxx -@@ -272,6 +272,11 @@ protected: - const ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XChartType > & xNewChartType ); - -+ void setStackModePropertiesToChartType( -+ const ::com::sun::star::uno::Reference< -+ ::com::sun::star::chart2::XChartType>& xChartType ); -+ -+ - protected: - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > - m_xContext; -diff --git chart2/source/model/template/ColumnChartType.cxx chart2/source/model/template/ColumnChartType.cxx -index ed5aea8..a326aa4 100644 ---- chart2/source/model/template/ColumnChartType.cxx -+++ chart2/source/model/template/ColumnChartType.cxx -@@ -49,7 +49,9 @@ namespace - enum - { - PROP_BARCHARTTYPE_OVERLAP_SEQUENCE, -- PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE -+ PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, -+ PROP_BARCHARTTYPE_STACKED, -+ PROP_BARCHARTTYPE_PERCENT - }; - - void lcl_AddPropertiesToVector( -@@ -68,6 +70,19 @@ void lcl_AddPropertiesToVector( - ::getCppuType( reinterpret_cast< const Sequence< sal_Int32 > * >(0)), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT )); -+ -+ rOutProperties.push_back( -+ Property( C2U( "Stacked" ), -+ PROP_BARCHARTTYPE_STACKED, -+ ::getBooleanCppuType(), -+ beans::PropertyAttribute::BOUND -+ | beans::PropertyAttribute::MAYBEDEFAULT )); -+ rOutProperties.push_back( -+ Property( C2U( "Percent" ), -+ PROP_BARCHARTTYPE_PERCENT, -+ ::getBooleanCppuType(), -+ beans::PropertyAttribute::BOUND -+ | beans::PropertyAttribute::MAYBEDEFAULT )); - } - - void lcl_AddDefaultsToMap( -@@ -80,6 +95,9 @@ void lcl_AddDefaultsToMap( - - aSeq[0] = aSeq[1] = 100; - ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_GAPWIDTH_SEQUENCE, aSeq ); -+ -+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_STACKED, false ); -+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_BARCHARTTYPE_PERCENT, false ); - } - - const Sequence< Property > & lcl_GetPropertySequence() -diff --git chart2/source/model/template/ColumnLineChartTypeTemplate.cxx chart2/source/model/template/ColumnLineChartTypeTemplate.cxx -index 54e7ea8..4d92176 100644 ---- chart2/source/model/template/ColumnLineChartTypeTemplate.cxx -+++ chart2/source/model/template/ColumnLineChartTypeTemplate.cxx -@@ -410,6 +410,7 @@ Reference< XChartType > SAL_CALL ColumnLineChartTypeTemplate::getChartTypeForNew - ASSERT_EXCEPTION( ex ); - } - -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/model/template/LineChartType.cxx chart2/source/model/template/LineChartType.cxx -index 05f6b43..274abb0 100644 ---- chart2/source/model/template/LineChartType.cxx -+++ chart2/source/model/template/LineChartType.cxx -@@ -54,7 +54,9 @@ enum - { - PROP_LINECHARTTYPE_CURVE_STYLE, - PROP_LINECHARTTYPE_CURVE_RESOLUTION, -- PROP_LINECHARTTYPE_SPLINE_ORDER -+ PROP_LINECHARTTYPE_SPLINE_ORDER, -+ PROP_LINECHARTTYPE_STACKED, -+ PROP_LINECHARTTYPE_PERCENT - }; - - void lcl_AddPropertiesToVector( -@@ -79,6 +81,19 @@ void lcl_AddPropertiesToVector( - ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT )); -+ -+ rOutProperties.push_back( -+ Property( C2U( "Stacked" ), -+ PROP_LINECHARTTYPE_STACKED, -+ ::getBooleanCppuType(), -+ beans::PropertyAttribute::BOUND -+ | beans::PropertyAttribute::MAYBEDEFAULT )); -+ rOutProperties.push_back( -+ Property( C2U( "Percent" ), -+ PROP_LINECHARTTYPE_PERCENT, -+ ::getBooleanCppuType(), -+ beans::PropertyAttribute::BOUND -+ | beans::PropertyAttribute::MAYBEDEFAULT )); - } - - void lcl_AddDefaultsToMap( -@@ -90,6 +105,9 @@ void lcl_AddDefaultsToMap( - // todo: check whether order 3 means polygons of order 3 or 2. (see - // http://www.people.nnov.ru/fractal/Splines/Basis.htm ) - ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 ); -+ -+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_STACKED, false ); -+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_PERCENT, false ); - } - - const Sequence< Property > & lcl_GetPropertySequence() -diff --git chart2/source/model/template/LineChartTypeTemplate.cxx chart2/source/model/template/LineChartTypeTemplate.cxx -index 746920a..eb08a53 100644 ---- chart2/source/model/template/LineChartTypeTemplate.cxx -+++ chart2/source/model/template/LineChartTypeTemplate.cxx -@@ -348,6 +348,7 @@ Reference< chart2::XChartType > SAL_CALL LineChartTypeTemplate::getChartTypeForN - ASSERT_EXCEPTION( ex ); - } - -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/model/template/NetChartTypeTemplate.cxx chart2/source/model/template/NetChartTypeTemplate.cxx -index ea85c9c..f13db16 100644 ---- chart2/source/model/template/NetChartTypeTemplate.cxx -+++ chart2/source/model/template/NetChartTypeTemplate.cxx -@@ -183,6 +183,7 @@ Reference< chart2::XChartType > SAL_CALL NetChartTypeTemplate::getChartTypeForNe - { - Reference< chart2::XChartType > xResult( getChartTypeForIndex( 0 ) ); - ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult ); -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/model/template/PieChartTypeTemplate.cxx chart2/source/model/template/PieChartTypeTemplate.cxx -index 8df8ce9..dbce73d 100644 ---- chart2/source/model/template/PieChartTypeTemplate.cxx -+++ chart2/source/model/template/PieChartTypeTemplate.cxx -@@ -475,6 +475,7 @@ Reference< chart2::XChartType > SAL_CALL PieChartTypeTemplate::getChartTypeForNe - ASSERT_EXCEPTION( ex ); - } - -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/model/template/ScatterChartTypeTemplate.cxx chart2/source/model/template/ScatterChartTypeTemplate.cxx -index 2b67f37..62d0a77 100644 ---- chart2/source/model/template/ScatterChartTypeTemplate.cxx -+++ chart2/source/model/template/ScatterChartTypeTemplate.cxx -@@ -387,6 +387,7 @@ Reference< chart2::XChartType > SAL_CALL ScatterChartTypeTemplate::getChartTypeF - ASSERT_EXCEPTION( ex ); - } - -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/model/template/StockChartTypeTemplate.cxx chart2/source/model/template/StockChartTypeTemplate.cxx -index 43cc054..0d090a5 100644 ---- chart2/source/model/template/StockChartTypeTemplate.cxx -+++ chart2/source/model/template/StockChartTypeTemplate.cxx -@@ -528,6 +528,7 @@ Reference< XChartType > SAL_CALL StockChartTypeTemplate::getChartTypeForNewSerie - ASSERT_EXCEPTION( ex ); - } - -+ setStackModePropertiesToChartType(xResult); - return xResult; - } - -diff --git chart2/source/view/axes/ScaleAutomatism.cxx chart2/source/view/axes/ScaleAutomatism.cxx -index 3e412c4..c151ce0 100644 ---- chart2/source/view/axes/ScaleAutomatism.cxx -+++ chart2/source/view/axes/ScaleAutomatism.cxx -@@ -132,7 +132,15 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement( - if( bAutoMinimum ) - { - if( m_aSourceScale.AxisType==AxisType::PERCENT ) -+ { - rExplicitScale.Minimum = 0.0; -+ if (!::rtl::math::isNan(m_fValueMinimum)) -+ { -+ double fMin = m_fValueMinimum / 100.0; -+ if (rExplicitScale.Minimum > fMin) -+ rExplicitScale.Minimum = fMin; -+ } -+ } - else if( ::rtl::math::isNan( m_fValueMinimum ) ) - rExplicitScale.Minimum = 0.0; //@todo get Minimum from scaling or from plotter???? - else -@@ -143,7 +151,15 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement( - if( bAutoMaximum ) - { - if( m_aSourceScale.AxisType==AxisType::PERCENT ) -+ { - rExplicitScale.Maximum = 1.0; -+ if (!::rtl::math::isNan(m_fValueMaximum)) -+ { -+ double fMax = m_fValueMaximum / 100.0; -+ if (rExplicitScale.Maximum < fMax) -+ rExplicitScale.Maximum = fMax; -+ } -+ } - else if( ::rtl::math::isNan( m_fValueMaximum ) ) - rExplicitScale.Maximum = 10.0; //@todo get Maximum from scaling or from plotter???? - else -diff --git chart2/source/view/charttypes/AreaChart.cxx chart2/source/view/charttypes/AreaChart.cxx -index 1ed2c6d..0ab9969 100644 ---- chart2/source/view/charttypes/AreaChart.cxx -+++ chart2/source/view/charttypes/AreaChart.cxx -@@ -600,6 +600,19 @@ struct FormerPoint - - void AreaChart::createShapes() - { -+ sal_Bool bPercent = sal_False; -+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY); -+ if (xPropSet.is()) -+ { -+ try -+ { -+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent; -+ } -+ catch (const beans::UnknownPropertyException&) -+ { -+ } -+ } -+ - if( m_aZSlots.begin() == m_aZSlots.end() ) //no series - return; - -@@ -753,9 +766,30 @@ void AreaChart::createShapes() - if( m_nDimension==3 && m_bArea && pSeriesList->size()!=1 ) - fLogicY = fabs( fLogicY ); - -- if( pPosHelper->isPercentY() && !::rtl::math::approxEqual( aLogicYSumMap[nAttachedAxisIndex], 0.0 ) ) -+ if (bPercent) -+ { -+ // This data series is percent-stacked. -+ -+ if (::rtl::math::approxEqual(aLogicYSumMap[nAttachedAxisIndex], 0.0)) -+ fLogicY = 0.0; -+ else -+ fLogicY = fabs( fLogicY )/aLogicYSumMap[nAttachedAxisIndex]; -+ -+ if (!pPosHelper->isPercentY()) -+ { -+ // When the axis itself is not percent-stacked, -+ // their internal range value is 0 - 100. So we -+ // need to adjust the data point values -+ // accordingly. -+ fLogicY *= 100.0; -+ } -+ } -+ else if (pPosHelper->isPercentY()) - { -- fLogicY = fabs( fLogicY )/aLogicYSumMap[nAttachedAxisIndex]; -+ // The data series is not percent-stacked, but the -+ // axis itself is. In this case, the axis' internal -+ // range is 0 to 1. Adjust the data point values. -+ fLogicY /= 100.0; - } - - if( ::rtl::math::isNan(fLogicX) || ::rtl::math::isInf(fLogicX) -diff --git chart2/source/view/charttypes/BarChart.cxx chart2/source/view/charttypes/BarChart.cxx -index 88d2461..feadf90 100644 ---- chart2/source/view/charttypes/BarChart.cxx -+++ chart2/source/view/charttypes/BarChart.cxx -@@ -456,6 +456,19 @@ void BarChart::adaptOverlapAndGapwidthForGroupBarsPerAxis() - - void BarChart::createShapes() - { -+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY); -+ sal_Bool bPercent = sal_False; -+ if (xPropSet.is()) -+ { -+ try -+ { -+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent; -+ } -+ catch (const beans::UnknownPropertyException&) -+ { -+ } -+ } -+ - if( m_aZSlots.begin() == m_aZSlots.end() ) //no series - return; - -diff --git chart2/source/view/charttypes/VSeriesPlotter.cxx chart2/source/view/charttypes/VSeriesPlotter.cxx -index 159866c..fe790b9 100644 ---- chart2/source/view/charttypes/VSeriesPlotter.cxx -+++ chart2/source/view/charttypes/VSeriesPlotter.cxx -@@ -1154,6 +1154,23 @@ double VSeriesPlotter::getMaximumX() - - double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) - { -+ sal_Bool bPercent = sal_False; -+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY); -+ if (xPropSet.is()) -+ { -+ try -+ { -+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent; -+ } -+ catch (const beans::UnknownPropertyException&) -+ { -+ } -+ } -+ -+ if (bPercent) -+ // This plotter is percent-stacked. -+ return 0.0; -+ - if( !m_bCategoryXAxis ) - { - double fMinY, fMaxY; -@@ -1188,6 +1205,23 @@ double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX, s - - double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ) - { -+ sal_Bool bPercent = sal_False; -+ uno::Reference< beans::XPropertySet > xPropSet(m_xChartTypeModel, uno::UNO_QUERY); -+ if (xPropSet.is()) -+ { -+ try -+ { -+ xPropSet->getPropertyValue(C2U("Percent")) >>= bPercent; -+ } -+ catch (const beans::UnknownPropertyException&) -+ { -+ } -+ } -+ -+ if (bPercent) -+ // This plotter is percent-stacked. -+ return 100.0; -+ - if( !m_bCategoryXAxis ) - { - double fMinY, fMaxY; -diff --git chart2/source/view/main/ChartView.cxx chart2/source/view/main/ChartView.cxx -index 0357b26..639b4ec 100644 ---- chart2/source/view/main/ChartView.cxx -+++ chart2/source/view/main/ChartView.cxx -@@ -1735,7 +1735,15 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForAxis( - if( nDimensionIndex == 0 ) - aRoleToMatch = C2U("values-x"); - Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes()); -- for( sal_Int32 nCTIdx=0; nCTIdx 0) -+ // When multiple chart types share the same axis, always -+ // use the first chart type for automatic detection of -+ // desired number format. This is in line with the -+ // fact that the axis type is also determined from the -+ // first chart type alone. -+ nCTCount = 1; -+ for( sal_Int32 nCTIdx=0; nCTIdxgetRoleOfSequenceForSeriesLabel(); diff --git a/applied_patches/0158-calc-menu-manual-page-break.diff b/applied_patches/0150-calc-menu-manual-page-break.diff similarity index 100% rename from applied_patches/0158-calc-menu-manual-page-break.diff rename to applied_patches/0150-calc-menu-manual-page-break.diff diff --git a/applied_patches/0150-chart-axis-multi-chart-types-xmloff.diff b/applied_patches/0150-chart-axis-multi-chart-types-xmloff.diff deleted file mode 100644 index 524a8bfd9..000000000 --- a/applied_patches/0150-chart-axis-multi-chart-types-xmloff.diff +++ /dev/null @@ -1,83 +0,0 @@ -diff --git xmloff/source/chart/SchXMLChartContext.cxx xmloff/source/chart/SchXMLChartContext.cxx -index 510d366..3824e67 100644 ---- xmloff/source/chart/SchXMLChartContext.cxx -+++ xmloff/source/chart/SchXMLChartContext.cxx -@@ -71,13 +71,17 @@ - #include - #include - #include -+#include - #include -+#include - #include - - using namespace com::sun::star; - using namespace ::xmloff::token; - using ::rtl::OUString; - using com::sun::star::uno::Reference; -+using ::com::sun::star::uno::Sequence; -+using ::com::sun::star::uno::UNO_QUERY; - using namespace ::SchXMLTools; - - namespace -@@ -706,6 +710,48 @@ void SchXMLChartContext::ChangeDiagramAccordingToTemplate( - xTemplate->changeDiagramData( xNewDia, xDataSource, aArgs ); - } - -+static void lcl_setStackTypeToAllChartTypes( -+ const Reference& rDiagram, const uno::Any& rStacked, const uno::Any& rPercent) -+{ -+ Reference xCoordContainer(rDiagram, uno::UNO_QUERY); -+ if (!xCoordContainer.is()) -+ return; -+ -+ Sequence< Reference > xCoords = xCoordContainer->getCoordinateSystems(); -+ -+ sal_Int32 n = xCoords.getLength(); -+ if (!n) -+ return; -+ -+ for (sal_Int32 i = 0; i < n; ++i) -+ { -+ Reference xChartTypeContainer(xCoords[i], UNO_QUERY); -+ if (!xChartTypeContainer.is()) -+ continue; -+ -+ Sequence< Reference > xChartTypes = xChartTypeContainer->getChartTypes(); -+ sal_Int32 nChartTypeCount = xChartTypes.getLength(); -+ for (sal_Int32 j = 0; j < nChartTypeCount; ++j) -+ { -+ Reference xProp(xChartTypes[j], UNO_QUERY); -+ if (!xProp.is()) -+ continue; -+ -+ try -+ { -+ if (rStacked.hasValue()) -+ xProp->setPropertyValue(OUString::createFromAscii("Stacked"), rStacked); -+ if (rPercent.hasValue()) -+ xProp->setPropertyValue(OUString::createFromAscii("Percent"), rPercent); -+ } -+ catch (const beans::UnknownPropertyException&) -+ { -+ // fail silently. -+ } -+ } -+ } -+} -+ - void SchXMLChartContext::EndElement() - { - uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument(); -@@ -869,6 +915,11 @@ void SchXMLChartContext::EndElement() - , SchXMLSeriesHelper::getDataSeriesIndexMapFromDiagram(xNewDiagram) ); - } - -+ // For now, set the diagram's stack-related properties to all included -+ // chart types until we support chart types of mixed stack states. -+ lcl_setStackTypeToAllChartTypes( -+ xNewDoc->getFirstDiagram(), maSeriesDefaultsAndStyles.maStackedDefault, maSeriesDefaultsAndStyles.maPercentDefault); -+ - SchXMLSeries2Context::initSeriesPropertySets( maSeriesDefaultsAndStyles, uno::Reference< frame::XModel >(xDoc, uno::UNO_QUERY ) ); - - //set defaults from diagram to the new series: diff --git a/applied_patches/0151-sc-sheet-gridline-toggle.diff b/applied_patches/0151-sc-sheet-gridline-toggle.diff new file mode 100644 index 000000000..c690a8d89 --- /dev/null +++ b/applied_patches/0151-sc-sheet-gridline-toggle.diff @@ -0,0 +1,324 @@ +diff --git officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +index d77187c..ab59975 100644 +--- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu ++++ officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +@@ -1483,6 +1483,14 @@ + S~hare Document... + + ++ ++ ++ Toggle Grid Lines for Current Sheet ++ ++ ++ 1 ++ ++ + + + +diff --git sc/inc/ViewSettingsSequenceDefines.hxx sc/inc/ViewSettingsSequenceDefines.hxx +index c720413..1143d9f 100644 +--- sc/inc/ViewSettingsSequenceDefines.hxx ++++ sc/inc/ViewSettingsSequenceDefines.hxx +@@ -64,7 +64,7 @@ + // this are the defines for the position of the settings in the + // TableViewSettingsSequence + +-#define SC_TABLE_VIEWSETTINGS_COUNT 15 ++#define SC_TABLE_VIEWSETTINGS_COUNT 16 + + #define SC_CURSOR_X 0 + #define SC_CURSOR_Y 1 +@@ -81,6 +81,7 @@ + #define SC_TABLE_ZOOM_VALUE 12 + #define SC_TABLE_PAGE_VIEW_ZOOM_VALUE 13 + #define SC_TABLE_TAB_BG_COLOR 14 ++#define SC_TABLE_SHOWGRID 15 + + #define SC_CURSORPOSITIONX "CursorPositionX" + #define SC_CURSORPOSITIONY "CursorPositionY" +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index d7e1983..f7d4695 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -1672,6 +1672,9 @@ + // Autoformat for DataPilot + #define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 4) + ++// Toggle sheet grid ++#define FID_TAB_TOGGLE_GRID (SC_OOO_BUILD_START + 5) ++ + #endif + + +diff --git sc/inc/scextopt.hxx sc/inc/scextopt.hxx +index 0e3866e..206ff20 100644 +--- sc/inc/scextopt.hxx ++++ sc/inc/scextopt.hxx +@@ -80,6 +80,7 @@ struct ScExtTabSettings + bool mbSelected; /// true = Sheet is selected. + bool mbFrozenPanes; /// true = Frozen panes; false = Normal splits. + bool mbPageMode; /// true = Pagebreak mode; false = Normal view mode. ++ bool mbShowGrid; /// Whether or not to display gridlines. + Color maTabBgColor; /// Tab Bg Color + bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? TRUE : FALSE; }; + +diff --git sc/sdi/docsh.sdi sc/sdi/docsh.sdi +index 4a773ab..e780e11 100644 +--- sc/sdi/docsh.sdi ++++ sc/sdi/docsh.sdi +@@ -64,6 +64,7 @@ interface TableSelection + FID_TAB_RENAME [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + FID_TAB_RTL [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + FID_TAB_SET_TAB_BG_COLOR [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] ++ FID_TAB_TOGGLE_GRID [ ExecMethod = ExecuteTable; StateMethod = GetStateTable; ] + + SID_TABLE_ACTIVATE [ ExecMethod = Execute; ] + } +diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi +index 11874e5..471ab26 100644 +--- sc/sdi/scalc.sdi ++++ sc/sdi/scalc.sdi +@@ -7875,6 +7875,33 @@ SfxVoidItem ShareDocument SID_SHARE_DOC + ] + + //-------------------------------------------------------------------------- ++SfxBoolItem ToggleSheetGrid FID_TAB_TOGGLE_GRID ++ ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = FALSE, ++ ReadOnlyDoc = TRUE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = TRUE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = TRUE, ++ GroupId = GID_FORMAT; ++] ++ ++ ++ ++//-------------------------------------------------------------------------- + SvxColorItem TabBgColor FID_TAB_SET_TAB_BG_COLOR + + [ +diff --git sc/source/filter/excel/xeview.cxx sc/source/filter/excel/xeview.cxx +index 81c5b9a..d15634b 100644 +--- sc/source/filter/excel/xeview.cxx ++++ sc/source/filter/excel/xeview.cxx +@@ -316,7 +316,6 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc + + const ScViewOptions& rViewOpt = GetDoc().GetViewOptions(); + maData.mbShowFormulas = rViewOpt.GetOption( VOPT_FORMULAS ); +- maData.mbShowGrid = rViewOpt.GetOption( VOPT_GRID ); + maData.mbShowHeadings = rViewOpt.GetOption( VOPT_HEADER ); + maData.mbShowZeros = rViewOpt.GetOption( VOPT_NULLVALS ); + maData.mbShowOutline = rViewOpt.GetOption( VOPT_OUTLINER ); +@@ -391,6 +390,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB nSc + else + maData.maGridColor = rGridColor; + } ++ maData.mbShowGrid = rTabSett.mbShowGrid; + + // view mode and zoom + maData.mbPageMode = (GetBiff() == EXC_BIFF8) && rTabSett.mbPageMode; +diff --git sc/source/filter/excel/xiview.cxx sc/source/filter/excel/xiview.cxx +index fbd72d0..ce76483 100644 +--- sc/source/filter/excel/xiview.cxx ++++ sc/source/filter/excel/xiview.cxx +@@ -277,6 +277,9 @@ void XclImpTabViewSettings::Finalize() + else + rTabSett.maGridColor = maData.maGridColor; + ++ // show grid option ++ rTabSett.mbShowGrid = maData.mbShowGrid; ++ + // view mode and zoom + if( maData.mnCurrentZoom != 0 ) + (maData.mbPageMode ? maData.mnPageZoom : maData.mnNormalZoom) = maData.mnCurrentZoom; +@@ -291,7 +294,6 @@ void XclImpTabViewSettings::Finalize() + // set Excel sheet settings globally at Calc document, take settings from displayed sheet + ScViewOptions aViewOpt( rDoc.GetViewOptions() ); + aViewOpt.SetOption( VOPT_FORMULAS, maData.mbShowFormulas ); +- aViewOpt.SetOption( VOPT_GRID, maData.mbShowGrid ); + aViewOpt.SetOption( VOPT_HEADER, maData.mbShowHeadings ); + aViewOpt.SetOption( VOPT_NULLVALS, maData.mbShowZeros ); + aViewOpt.SetOption( VOPT_OUTLINER, maData.mbShowOutline ); +diff --git sc/source/ui/inc/viewdata.hxx sc/source/ui/inc/viewdata.hxx +index c66083f..c77088e 100644 +--- sc/source/ui/inc/viewdata.hxx ++++ sc/source/ui/inc/viewdata.hxx +@@ -149,6 +149,8 @@ private: + SCCOL nPosX[2]; + SCROW nPosY[2]; + ++ bool bShowGrid; // per-sheet show grid-lines option. ++ + BOOL bOldCurValid; // "virtuelle" Cursorpos. bei zusammengefassten + + Color aTabBgColor; +@@ -339,6 +341,9 @@ public: + const Fraction& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; } + const Fraction& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; } + ++ void SetShowGrid( bool bShow ); ++ bool GetShowGrid() const { return pThisTab->bShowGrid; } ++ + const MapMode& GetLogicMode( ScSplitPos eWhich ); + const MapMode& GetLogicMode(); // Offset 0 + +diff --git sc/source/ui/view/gridwin4.cxx sc/source/ui/view/gridwin4.cxx +index 10db2f6..8a9d867 100644 +--- sc/source/ui/view/gridwin4.cxx ++++ sc/source/ui/view/gridwin4.cxx +@@ -573,7 +573,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod + aOutputData.SetEditObject( GetEditObject() ); + aOutputData.SetViewShell( pViewData->GetViewShell() ); + +- BOOL bGrid = rOpts.GetOption( VOPT_GRID ); ++ BOOL bGrid = rOpts.GetOption( VOPT_GRID ) && pViewData->GetShowGrid(); ++ + BOOL bPage = rOpts.GetOption( VOPT_PAGEBREAKS ); + + if ( eMode == SC_UPDATE_CHANGED ) +diff --git sc/source/ui/view/scextopt.cxx sc/source/ui/view/scextopt.cxx +index fd28d95..8ca5fc2 100644 +--- sc/source/ui/view/scextopt.cxx ++++ sc/source/ui/view/scextopt.cxx +@@ -62,6 +62,7 @@ ScExtTabSettings::ScExtTabSettings() : + mbSelected( false ), + mbFrozenPanes( false ), + mbPageMode( false ), ++ mbShowGrid( true ), + maTabBgColor( COL_AUTO) + { + } +diff --git sc/source/ui/view/tabvwshf.cxx sc/source/ui/view/tabvwshf.cxx +index c65b62a..971e646 100644 +--- sc/source/ui/view/tabvwshf.cxx ++++ sc/source/ui/view/tabvwshf.cxx +@@ -37,6 +37,8 @@ + + #include "scitems.hxx" + #include ++#include ++#include + #include + #include + #include +@@ -690,6 +692,17 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) + } + break; + ++ case FID_TAB_TOGGLE_GRID: ++ { ++ bool bShowGrid = pViewData->GetShowGrid(); ++ pViewData->SetShowGrid(!bShowGrid); ++ SfxBindings& rBindings = GetViewFrame()->GetBindings(); ++ rBindings.Invalidate( FID_TAB_TOGGLE_GRID ); ++ PaintGrid(); ++ rReq.Done(); ++ } ++ break; ++ + case FID_TAB_SET_TAB_BG_COLOR: + case FID_TAB_MENU_SET_TAB_BG_COLOR: + { +@@ -939,6 +952,10 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet ) + rSet.Put( SvxColorItem( aColor, nWhich ) ); + } + break; ++ ++ case FID_TAB_TOGGLE_GRID: ++ rSet.Put( SfxBoolItem(nWhich, pViewData->GetShowGrid()) ); ++ break; + } + nWhich = aIter.NextWhich(); + } +diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx +index 23e0e59..8f458db 100644 +--- sc/source/ui/view/viewdata.cxx ++++ sc/source/ui/view/viewdata.cxx +@@ -104,6 +104,7 @@ ScViewDataTable::ScViewDataTable() : + nFixPosY( 0 ), + nCurX( 0 ), + nCurY( 0 ), ++ bShowGrid( true ), + bOldCurValid( FALSE ), + aTabBgColor( Color(COL_AUTO) ) + { +@@ -165,6 +166,10 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence + pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_PAGEVIEWZOOMVALUE)); + pSettings[SC_TABLE_PAGE_VIEW_ZOOM_VALUE].Value <<= nPageZoomValue; + ++ pSettings[SC_TABLE_SHOWGRID].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_SHOWGRID)); ++ pSettings[SC_TABLE_SHOWGRID].Value <<= static_cast(bShowGrid); ++ ++ + if ( !IsDefaultTabBgColor() ) + { + pSettings[SC_TABLE_TAB_BG_COLOR].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_TABCOLOR)); +@@ -276,6 +281,10 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence >= bShowGrid; ++ } + else if (sName.compareToAscii(SC_TABLESELECTED) == 0) + { + bool bSelected = false; +@@ -704,6 +713,12 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAl + RefreshZoom(); + } + ++void ScViewData::SetShowGrid( bool bShow ) ++{ ++ CreateSelectedTabData(); ++ pTabData[nTabNo]->bShowGrid = bShow; ++} ++ + void ScViewData::RefreshZoom() + { + // recalculate zoom-dependent values (only for current sheet) +@@ -2500,6 +2515,7 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const + if( rGridColor.GetColor() != SC_STD_GRIDCOLOR ) + rTabSett.maGridColor = rGridColor; + } ++ rTabSett.mbShowGrid = pViewTab->bShowGrid; + + // view mode and zoom + rTabSett.mbPageMode = bPagebreak; +@@ -2635,6 +2651,8 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt ) + if( rTabSett.mnPageZoom ) + rViewTab.aPageZoomX = rViewTab.aPageZoomY = Fraction( rTabSett.mnPageZoom, 100L ); + ++ rViewTab.bShowGrid = rTabSett.mbShowGrid; ++ + // get some settings from displayed Excel sheet, set at Calc document + if( nTab == GetTabNo() ) + { +diff --git sc/uiconfig/scalc/toolbar/formatobjectbar.xml sc/uiconfig/scalc/toolbar/formatobjectbar.xml +index 49c31d7..773befc 100644 +--- sc/uiconfig/scalc/toolbar/formatobjectbar.xml ++++ sc/uiconfig/scalc/toolbar/formatobjectbar.xml +@@ -50,4 +50,6 @@ + + + ++ ++ + diff --git a/applied_patches/0152-calc-formula-variable-separators-sc.diff b/applied_patches/0152-calc-formula-variable-separators-sc.diff new file mode 100644 index 000000000..3a0e051e5 --- /dev/null +++ b/applied_patches/0152-calc-formula-variable-separators-sc.diff @@ -0,0 +1,1050 @@ +diff --git formula/inc/formula/FormulaCompiler.hxx formula/inc/formula/FormulaCompiler.hxx +index 7da03fd..6df4898 100644 +--- formula/inc/formula/FormulaCompiler.hxx ++++ formula/inc/formula/FormulaCompiler.hxx +@@ -237,6 +237,8 @@ public: + including an address reference convention. */ + inline FormulaGrammar::Grammar GetGrammar() const { return meGrammar; } + ++ static void UpdateSeparatorsNative( const rtl::OUString& rSep, const rtl::OUString& rArrayColSep, const rtl::OUString& rArrayRowSep ); ++ + protected: + virtual String FindAddInFunction( const String& rUpperName, BOOL bLocalFirst ) const; + virtual void fillFromAddInCollectionUpperName( NonConstOpCodeMapPtr xMap ) const; +diff --git formula/source/core/api/FormulaCompiler.cxx formula/source/core/api/FormulaCompiler.cxx +index d031c9a..5834e9e 100644 +--- formula/source/core/api/FormulaCompiler.cxx ++++ formula/source/core/api/FormulaCompiler.cxx +@@ -1681,6 +1681,17 @@ void FormulaCompiler::AppendString( rtl::OUStringBuffer& rBuffer, const String & + rBuffer.append(sal_Unicode('"')); + } + } ++ ++void FormulaCompiler::UpdateSeparatorsNative( ++ const rtl::OUString& rSep, const rtl::OUString& rArrayColSep, const rtl::OUString& rArrayRowSep ) ++{ ++ NonConstOpCodeMapPtr xSymbolsNative; ++ lcl_fillNativeSymbols(xSymbolsNative); ++ xSymbolsNative->putOpCode(rSep, ocSep); ++ xSymbolsNative->putOpCode(rArrayColSep, ocArrayColSep); ++ xSymbolsNative->putOpCode(rArrayRowSep, ocArrayRowSep); ++} ++ + // ----------------------------------------------------------------------------- + OpCode FormulaCompiler::NextToken() + { +diff --git sc/inc/docoptio.hxx sc/inc/docoptio.hxx +index 51a6405..bbd92e8 100644 +--- sc/inc/docoptio.hxx ++++ sc/inc/docoptio.hxx +@@ -36,6 +36,8 @@ + #include "scdllapi.h" + #include "optutil.hxx" + ++#include "formula/grammar.hxx" ++ + class SC_DLLPUBLIC ScDocOptions + { + double fIterEps; // Epsilon-Wert dazu +@@ -53,6 +55,11 @@ class SC_DLLPUBLIC ScDocOptions + BOOL bDoAutoSpell; // Auto-Spelling + BOOL bLookUpColRowNames; // Spalten-/Zeilenbeschriftungen automagisch suchen + BOOL bFormulaRegexEnabled; // regular expressions in formulas enabled ++ ::formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax ++ ++ ::rtl::OUString aFormulaSepArg; ++ ::rtl::OUString aFormulaSepArrayRow; ++ ::rtl::OUString aFormulaSepArrayCol; + + public: + ScDocOptions(); +@@ -99,6 +106,20 @@ public: + + void SetFormulaRegexEnabled( BOOL bVal ) { bFormulaRegexEnabled = bVal; } + BOOL IsFormulaRegexEnabled() const { return bFormulaRegexEnabled; } ++ ++ void SetFormulaSyntax( ::formula::FormulaGrammar::Grammar eGram ) { eFormulaGrammar = eGram; } ++ ::formula::FormulaGrammar::Grammar GetFormulaSyntax() const { return eFormulaGrammar; } ++ ++ void SetFormulaSepArg(const ::rtl::OUString& rSep) { aFormulaSepArg = rSep; } ++ ::rtl::OUString GetFormulaSepArg() const { return aFormulaSepArg; } ++ ++ void SetFormulaSepArrayRow(const ::rtl::OUString& rSep) { aFormulaSepArrayRow = rSep; } ++ ::rtl::OUString GetFormulaSepArrayRow() const { return aFormulaSepArrayRow; } ++ ++ void SetFormulaSepArrayCol(const ::rtl::OUString& rSep) { aFormulaSepArrayCol = rSep; } ++ ::rtl::OUString GetFormulaSepArrayCol() const { return aFormulaSepArrayCol; } ++ ++ const LocaleDataWrapper& GetLocaleDataWrapper() const; + }; + + +@@ -119,6 +140,10 @@ inline void ScDocOptions::CopyTo(ScDocOptions& rOpt) + rOpt.bDoAutoSpell = bDoAutoSpell; + rOpt.bLookUpColRowNames = bLookUpColRowNames; + rOpt.bFormulaRegexEnabled = bFormulaRegexEnabled; ++ rOpt.eFormulaGrammar = eFormulaGrammar; ++ rOpt.aFormulaSepArg = aFormulaSepArg; ++ rOpt.aFormulaSepArrayRow = aFormulaSepArrayRow; ++ rOpt.aFormulaSepArrayCol = aFormulaSepArrayCol; + } + + inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy ) +@@ -138,6 +163,10 @@ inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy ) + bDoAutoSpell = rCpy.bDoAutoSpell; + bLookUpColRowNames = rCpy.bLookUpColRowNames; + bFormulaRegexEnabled= rCpy.bFormulaRegexEnabled; ++ eFormulaGrammar = rCpy.eFormulaGrammar; ++ aFormulaSepArg = rCpy.aFormulaSepArg; ++ aFormulaSepArrayRow = rCpy.aFormulaSepArrayRow; ++ aFormulaSepArrayCol = rCpy.aFormulaSepArrayCol; + + return *this; + } +@@ -160,6 +189,10 @@ inline int ScDocOptions::operator==( const ScDocOptions& rOpt ) const + && rOpt.bDoAutoSpell == bDoAutoSpell + && rOpt.bLookUpColRowNames == bLookUpColRowNames + && rOpt.bFormulaRegexEnabled == bFormulaRegexEnabled ++ && rOpt.eFormulaGrammar == eFormulaGrammar ++ && rOpt.aFormulaSepArg == aFormulaSepArg ++ && rOpt.aFormulaSepArrayRow == aFormulaSepArrayRow ++ && rOpt.aFormulaSepArrayCol == aFormulaSepArrayCol + ); + } + +@@ -199,12 +232,15 @@ private: + class ScDocCfg : public ScDocOptions + { + ScLinkConfigItem aCalcItem; ++ ScLinkConfigItem aFormulaItem; + ScLinkConfigItem aLayoutItem; + + DECL_LINK( CalcCommitHdl, void* ); ++ DECL_LINK( FormulaCommitHdl, void* ); + DECL_LINK( LayoutCommitHdl, void* ); + + com::sun::star::uno::Sequence GetCalcPropertyNames(); ++ com::sun::star::uno::Sequence GetFormulaPropertyNames(); + com::sun::star::uno::Sequence GetLayoutPropertyNames(); + + public: +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index 7301766..2eba0d8 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -1660,5 +1660,9 @@ + // Autoformat for DataPilot + #define SID_PIVOT_AFMT (SC_OOO_BUILD_START + 4) + ++// Formula options page ++#define RID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 5) ++#define HID_SCPAGE_FORMULA (SC_OOO_BUILD_START + 6) ++ + #endif + +diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx +index ec6c46c..27f9d36 100644 +--- sc/source/core/data/documen3.cxx ++++ sc/source/core/data/documen3.cxx +@@ -54,6 +54,7 @@ + #include "rangelst.hxx" + #include "chartarr.hxx" + #include "chartlock.hxx" ++#include "compiler.hxx" + #include "refupdat.hxx" + #include "docoptio.hxx" + #include "viewopti.hxx" +@@ -1771,7 +1772,13 @@ void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) + *pDocOptions = rOpt; + rOpt.GetDate( d,m,y ); + + xPoolHelper->SetFormTableOpt(rOpt); ++ ++ SetGrammar( rOpt.GetFormulaSyntax() ); ++ ++ // Update the separators. ++ ScCompiler::UpdateSeparatorsNative( ++ rOpt.GetFormulaSepArg(), rOpt.GetFormulaSepArrayCol(), rOpt.GetFormulaSepArrayRow()); + } + + const ScViewOptions& ScDocument::GetViewOptions() const +diff --git sc/source/core/tool/docoptio.cxx sc/source/core/tool/docoptio.cxx +index ffbb2d9..4338af6 100644 +--- sc/source/core/tool/docoptio.cxx ++++ sc/source/core/tool/docoptio.cxx +@@ -38,6 +38,8 @@ + + #include + #include ++#include ++#include + + #include "cfgids.hxx" + #include "docoptio.hxx" +@@ -45,10 +47,13 @@ + #include "scresid.hxx" + #include "sc.hrc" + #include "miscuno.hxx" ++#include "global.hxx" + + using namespace utl; + using namespace rtl; + using namespace com::sun::star::uno; ++using ::com::sun::star::lang::Locale; ++using ::com::sun::star::i18n::LocaleDataItem; + + //------------------------------------------------------------------------ + +@@ -100,7 +105,11 @@ ScDocOptions::ScDocOptions( const ScDocOptions& rCpy ) + bMatchWholeCell( rCpy.bMatchWholeCell ), + bDoAutoSpell( rCpy.bDoAutoSpell ), + bLookUpColRowNames( rCpy.bLookUpColRowNames ), +- bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ) ++ bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ), ++ eFormulaGrammar( rCpy.eFormulaGrammar ), ++ aFormulaSepArg( rCpy.aFormulaSepArg ), ++ aFormulaSepArrayRow( rCpy.aFormulaSepArrayRow ), ++ aFormulaSepArrayCol( rCpy.aFormulaSepArrayCol ) + { + } + +@@ -129,6 +138,67 @@ void ScDocOptions::ResetDocOptions() + bDoAutoSpell = FALSE; + bLookUpColRowNames = TRUE; + bFormulaRegexEnabled= TRUE; ++ eFormulaGrammar = ::formula::FormulaGrammar::GRAM_NATIVE; ++ ++ do ++ { ++ const Locale& rLocale = *ScGlobal::GetLocale(); ++ const OUString& rLang = rLocale.Language; ++ if (rLang.equalsAscii("ru")) ++ // Don't do automatic guess for these languages, and fall back to ++ // the old separator set. ++ break; ++ ++ const LocaleDataWrapper& rLocaleData = GetLocaleDataWrapper(); ++ const OUString& rDecSep = rLocaleData.getNumDecimalSep(); ++ const OUString& rListSep = rLocaleData.getListSep(); ++ ++ if (!rDecSep.getLength() || !rListSep.getLength()) ++ // Something is wrong. Stick with the default separators. ++ break; ++ ++ sal_Unicode cDecSep = rDecSep.getStr()[0]; ++ sal_Unicode cListSep = rListSep.getStr()[0]; ++ ++ // Excel by default uses system's list separator as the parameter ++ // separator, which in English locales is a comma. However, OOo's list ++ // separator value is set to ';' for all English locales. Because of this ++ // discrepancy, we will hardcode the separator value here, for now. ++ if (cDecSep == sal_Unicode('.')) ++ cListSep = sal_Unicode(','); ++ ++ // Special case for de_CH locale. ++ if (rLocale.Language.equalsAsciiL("de", 2) && rLocale.Country.equalsAsciiL("CH", 2)) ++ cListSep = sal_Unicode(';'); ++ ++ // by default, the parameter separator equals the locale-specific ++ // list separator. ++ aFormulaSepArg = OUString(cListSep); ++ ++ if (cDecSep == cListSep && cDecSep != sal_Unicode(';')) ++ // if the decimal and list separators are equal, set the ++ // parameter separator to be ';', unless they are both ++ // semicolon in which case don't change the decimal separator. ++ aFormulaSepArg = OUString::createFromAscii(";"); ++ ++ aFormulaSepArrayCol = OUString::createFromAscii(","); ++ if (cDecSep == sal_Unicode(',')) ++ aFormulaSepArrayCol = OUString::createFromAscii("."); ++ aFormulaSepArrayRow = OUString::createFromAscii(";"); ++ ++ return; ++ } ++ while (false); ++ ++ // Defaults to the old separator values. ++ aFormulaSepArg = OUString::createFromAscii(";"); ++ aFormulaSepArrayCol = OUString::createFromAscii(";"); ++ aFormulaSepArrayRow = OUString::createFromAscii("|"); ++} ++ ++const LocaleDataWrapper& ScDocOptions::GetLocaleDataWrapper() const ++{ ++ return *ScGlobal::pLocaleData; + } + + //======================================================================== +@@ -206,6 +276,13 @@ SfxPoolItem* __EXPORT ScTpCalcItem::Clone( SfxItemPool * ) const + #define SCCALCOPT_REGEX 11 + #define SCCALCOPT_COUNT 12 + ++#define CFGPATH_FORMULA "Office.Calc/Formula" ++#define SCFORMULAOPT_GRAMMAR 0 ++#define SCFORMULAOPT_SEP_ARG 1 ++#define SCFORMULAOPT_SEP_ARRAY_ROW 2 ++#define SCFORMULAOPT_SEP_ARRAY_COL 3 ++#define SCFORMULAOPT_COUNT 4 ++ + #define CFGPATH_DOCLAYOUT "Office.Calc/Layout/Other" + + #define SCDOCLAYOUTOPT_TABSTOP 0 +@@ -227,7 +304,7 @@ Sequence ScDocCfg::GetCalcPropertyNames() + "Other/Precision", // SCCALCOPT_PRECISION + "Other/SearchCriteria", // SCCALCOPT_SEARCHCRIT + "Other/FindLabel", // SCCALCOPT_FINDLABEL +- "Other/RegularExpressions" // SCCALCOPT_REGEX ++ "Other/RegularExpressions", // SCCALCOPT_REGEX + }; + Sequence aNames(SCCALCOPT_COUNT); + OUString* pNames = aNames.getArray(); +@@ -237,6 +314,23 @@ Sequence ScDocCfg::GetCalcPropertyNames() + return aNames; + } + ++Sequence ScDocCfg::GetFormulaPropertyNames() ++{ ++ static const char* aPropNames[] = ++ { ++ "Syntax/Grammar", // SCFORMULAOPT_GRAMMAR ++ "Syntax/SeparatorArg", // SCFORMULAOPT_SEP_ARG ++ "Syntax/SeparatorArrayRow", // SCFORMULAOPT_SEP_ARRAY_ROW ++ "Syntax/SeparatorArrayCol", // SCFORMULAOPT_SEP_ARRAY_COL ++ }; ++ Sequence aNames(SCFORMULAOPT_COUNT); ++ OUString* pNames = aNames.getArray(); ++ for (int i = 0; i < SCFORMULAOPT_COUNT; ++i) ++ pNames[i] = OUString::createFromAscii(aPropNames[i]); ++ ++ return aNames; ++} ++ + Sequence ScDocCfg::GetLayoutPropertyNames() + { + static const char* aPropNames[] = +@@ -257,6 +351,7 @@ Sequence ScDocCfg::GetLayoutPropertyNames() + + ScDocCfg::ScDocCfg() : + aCalcItem( OUString::createFromAscii( CFGPATH_CALC ) ), ++ aFormulaItem(OUString::createFromAscii(CFGPATH_FORMULA)), + aLayoutItem( OUString::createFromAscii( CFGPATH_DOCLAYOUT ) ) + { + sal_Int32 nIntVal = 0; +@@ -328,6 +423,69 @@ ScDocCfg::ScDocCfg() : + + SetDate( nDateDay, nDateMonth, nDateYear ); + ++ aNames = GetFormulaPropertyNames(); ++ aValues = aFormulaItem.GetProperties(aNames); ++ aFormulaItem.EnableNotification(aNames); ++ pValues = aValues.getConstArray(); ++ if (aValues.getLength() == aNames.getLength()) ++ { ++ for (int nProp = 0; nProp < aNames.getLength(); ++nProp) ++ { ++ switch (nProp) ++ { ++ case SCFORMULAOPT_GRAMMAR: ++ { ++ ::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT; ++ ++ do ++ { ++ if (!(pValues[nProp] >>= nIntVal)) ++ // extractino failed. ++ break; ++ ++ switch (nIntVal) ++ { ++ case 0: // Calc A1 ++ eGram = ::formula::FormulaGrammar::GRAM_NATIVE; ++ break; ++ case 1: // Excel A1 ++ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1; ++ break; ++ case 2: // Excel R1C1 ++ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1; ++ break; ++ } ++ } ++ while (false); ++ SetFormulaSyntax(eGram); ++ } ++ break; ++ case SCFORMULAOPT_SEP_ARG: ++ { ++ OUString aSep; ++ if ((pValues[nProp] >>= aSep) && aSep.getLength()) ++ SetFormulaSepArg(aSep); ++ } ++ break; ++ case SCFORMULAOPT_SEP_ARRAY_ROW: ++ { ++ OUString aSep; ++ if ((pValues[nProp] >>= aSep) && aSep.getLength()) ++ SetFormulaSepArrayRow(aSep); ++ } ++ break; ++ case SCFORMULAOPT_SEP_ARRAY_COL: ++ { ++ OUString aSep; ++ if ((pValues[nProp] >>= aSep) && aSep.getLength()) ++ SetFormulaSepArrayCol(aSep); ++ } ++ break; ++ } ++ } ++ } ++ aFormulaItem.SetCommitLink( LINK(this, ScDocCfg, FormulaCommitHdl) ); ++ + aNames = GetLayoutPropertyNames(); + aValues = aLayoutItem.GetProperties(aNames); + aLayoutItem.EnableNotification(aNames); +@@ -410,6 +568,43 @@ IMPL_LINK( ScDocCfg, CalcCommitHdl, void *, EMPTYARG ) + return 0; + } + ++IMPL_LINK( ScDocCfg, FormulaCommitHdl, void *, EMPTYARG ) ++{ ++ Sequence aNames = GetFormulaPropertyNames(); ++ Sequence aValues(aNames.getLength()); ++ Any* pValues = aValues.getArray(); ++ ++ for (int nProp = 0; nProp < aNames.getLength(); ++nProp) ++ { ++ switch (nProp) ++ { ++ case SCFORMULAOPT_GRAMMAR : ++ { ++ sal_Int32 nVal = 0; ++ switch (GetFormulaSyntax()) ++ { ++ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1: nVal = 1; break; ++ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1: nVal = 2; break; ++ } ++ pValues[nProp] <<= nVal; ++ } ++ break; ++ case SCFORMULAOPT_SEP_ARG: ++ pValues[nProp] <<= GetFormulaSepArg(); ++ break; ++ case SCFORMULAOPT_SEP_ARRAY_ROW: ++ pValues[nProp] <<= GetFormulaSepArrayRow(); ++ break; ++ case SCFORMULAOPT_SEP_ARRAY_COL: ++ pValues[nProp] <<= GetFormulaSepArrayCol(); ++ break; ++ } ++ } ++ aFormulaItem.PutProperties(aNames, aValues); ++ ++ return 0; ++} ++ + IMPL_LINK( ScDocCfg, LayoutCommitHdl, void *, EMPTYARG ) + { + Sequence aNames = GetLayoutPropertyNames(); +@@ -439,6 +634,7 @@ void ScDocCfg::SetOptions( const ScDocOptions& rNew ) + *(ScDocOptions*)this = rNew; + + aCalcItem.SetModified(); ++ aFormulaItem.SetModified(); + aLayoutItem.SetModified(); + } + +diff --git sc/source/ui/app/scmod.cxx sc/source/ui/app/scmod.cxx +index bc0a91f..2362c23 100644 +--- sc/source/ui/app/scmod.cxx ++++ sc/source/ui/app/scmod.cxx +@@ -2134,6 +2134,13 @@ SfxTabPage* ScModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItem + pRet = (*ScTpCalcOptionsCreate)(pParent, rSet); + } + break; ++ case SID_SC_TP_FORMULA: ++ { ++ ::CreateTabPage ScTpFormulaOptionsCreate = pFact->GetTabPageCreatorFunc (RID_SCPAGE_FORMULA); ++ if (ScTpFormulaOptionsCreate) ++ pRet = (*ScTpFormulaOptionsCreate)(pParent, rSet); ++ } ++ break; + case SID_SC_TP_CHANGES: + { //CHINA001 pRet = ScRedlineOptionsTabPage::Create(pParent, rSet); + ::CreateTabPage ScRedlineOptionsTabPageCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_OPREDLINE ); +diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx +index de9b284..7e6e248 100644 +--- sc/source/ui/attrdlg/scdlgfact.cxx ++++ sc/source/ui/attrdlg/scdlgfact.cxx +@@ -76,6 +76,7 @@ + #include "tpstat.hxx" //add for ScDocStatPage + #include "tpusrlst.hxx" //add for ScTpUserLists + #include "tpview.hxx" //add for ScTpContentOptions ++#include "tpformula.hxx" + + // ause + +@@ -1432,6 +1433,8 @@ CreateTabPage ScAbstractDialogFactory_Impl::GetTabPageCreatorFunc( USHORT nId ) + case RID_SCPAGE_CALC : + return ScTpCalcOptions::Create; + //break; ++ case RID_SCPAGE_FORMULA: ++ return ScTpFormulaOptions::Create; + case RID_SCPAGE_PRINT : + return ScTpPrintOptions::Create; + //break; +diff --git sc/source/ui/inc/optdlg.hrc sc/source/ui/inc/optdlg.hrc +index e834a11..aaeb33d 100644 +--- sc/source/ui/inc/optdlg.hrc ++++ sc/source/ui/inc/optdlg.hrc +@@ -52,6 +52,7 @@ + #define TP_LAYOUT 12 + #define TP_INPUT 13 + #define TP_CHANGES 14 ++#define TP_FORMULA 15 + + // TP_CALC: + #define BTN_ITERATE 1 +@@ -192,3 +193,16 @@ + #define CB_TEXTFMT 78 + #define CB_REPLWARN 79 + ++ ++// TP_FORMULA ++#define FL_FORMULA_OPTIONS 80 ++#define FT_FORMULA_SYNTAX 81 ++#define LB_FORMULA_SYNTAX 82 ++#define FL_FORMULA_SEPS 83 ++#define FT_FORMULA_SEP_ARG 84 ++#define ED_FORMULA_SEP_ARG 85 ++#define FT_FORMULA_SEP_ARRAY_R 86 ++#define ED_FORMULA_SEP_ARRAY_R 87 ++#define FT_FORMULA_SEP_ARRAY_C 88 ++#define ED_FORMULA_SEP_ARRAY_C 89 ++#define BTN_FORMULA_SEP_RESET 90 +diff --git sc/source/ui/inc/tpformula.hxx sc/source/ui/inc/tpformula.hxx +new file mode 100644 +index 0000000..054655e +--- /dev/null ++++ sc/source/ui/inc/tpformula.hxx +@@ -0,0 +1,96 @@ ++/************************************************************************* ++ * ++ * 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: tpcalc.hxx,v $ ++ * $Revision: 1.9 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_TPFORMULA_HXX ++#define SC_TPFORMULA_HXX ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++class ScDocOptions; ++class SfxItemSet; ++class Window; ++ ++class ScTpFormulaOptions : public SfxTabPage ++{ ++public: ++ static SfxTabPage* Create (Window* pParent, const SfxItemSet& rCoreSet); ++ ++// static USHORT* GetRanges(); ++ virtual BOOL FillItemSet(SfxItemSet& rCoreSet); ++ virtual void Reset( const SfxItemSet& rCoreSet ); ++ virtual int DeactivatePage(SfxItemSet* pSet = NULL); ++ ++private: ++ explicit ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreSet); ++ virtual ~ScTpFormulaOptions(); ++ ++ void Init(); ++ void ResetSeparators(); ++ void OnFocusSeparatorInput(Edit* pEdit); ++ ++ bool IsValidSeparator(const ::rtl::OUString& rSep) const; ++ bool IsValidSeparatorSet() const; ++ ++ DECL_LINK( ButtonHdl, PushButton* ); ++ DECL_LINK( SepModifyHdl, Edit* ); ++ DECL_LINK( SepEditOnFocusHdl, Edit* ); ++ ++private: ++ FixedLine maFlFormulaOpt; ++ FixedText maFtFormulaSyntax; ++ ListBox maLbFormulaSyntax; ++ ++ FixedLine maFlFormulaSeps; ++ FixedText maFtSepFuncArg; ++ Edit maEdSepFuncArg; ++ FixedText maFtSepArrayCol; ++ Edit maEdSepArrayCol; ++ FixedText maFtSepArrayRow; ++ Edit maEdSepArrayRow; ++ PushButton maBtnSepReset; ++ ++ ::std::auto_ptr mpOldOptions; ++ ::std::auto_ptr mpNewOptions; ++ ++ /** Stores old separator value of currently focused separator edit box. ++ This value is used to revert undesired value change. */ ++ ::rtl::OUString maOldSepValue; ++ ++ sal_Unicode mnDecSep; ++}; ++ ++ ++#endif +diff --git sc/source/ui/optdlg/makefile.mk sc/source/ui/optdlg/makefile.mk +index e8a6d20..cb43db7 100644 +--- sc/source/ui/optdlg/makefile.mk ++++ sc/source/ui/optdlg/makefile.mk +@@ -47,6 +47,7 @@ CXXFILES = \ + tpusrlst.cxx \ + tpview.cxx \ + tpcalc.cxx \ ++ tpformula.cxx \ + tpprint.cxx \ + opredlin.cxx + +@@ -54,6 +55,7 @@ SLOFILES = \ + $(SLO)$/tpusrlst.obj \ + $(SLO)$/tpview.obj \ + $(SLO)$/tpcalc.obj \ ++ $(SLO)$/tpformula.obj \ + $(SLO)$/tpprint.obj \ + $(SLO)$/opredlin.obj + +diff --git sc/source/ui/optdlg/tpformula.cxx sc/source/ui/optdlg/tpformula.cxx +new file mode 100644 +index 0000000..a27d5a7 +--- /dev/null ++++ sc/source/ui/optdlg/tpformula.cxx +@@ -0,0 +1,289 @@ ++/************************************************************************* ++ * ++ * 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: tpcalc.hxx,v $ ++ * $Revision: 1.9 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++// MARKER(update_precomp.py): autogen include statement, do not remove ++#include "precompiled_sc.hxx" ++ ++#undef SC_DLLIMPLEMENTATION ++ ++ ++ ++//------------------------------------------------------------------ ++ ++#include "tpformula.hxx" ++#include "optdlg.hrc" ++#include "scresid.hxx" ++#include "formula/grammar.hxx" ++#include "docoptio.hxx" ++#include "global.hxx" ++ ++#include ++ ++#include ++#include ++ ++using ::rtl::OUString; ++using ::com::sun::star::lang::Locale; ++using ::com::sun::star::i18n::LocaleDataItem; ++ ++ScTpFormulaOptions::ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreAttrs) : ++ SfxTabPage(pParent, ScResId(RID_SCPAGE_FORMULA), rCoreAttrs), ++ ++ maFlFormulaOpt(this, ScResId(FL_FORMULA_OPTIONS)), ++ maFtFormulaSyntax(this, ScResId(FT_FORMULA_SYNTAX)), ++ maLbFormulaSyntax(this, ScResId(LB_FORMULA_SYNTAX)), ++ maFlFormulaSeps(this, ScResId(FL_FORMULA_SEPS)), ++ maFtSepFuncArg(this, ScResId(FT_FORMULA_SEP_ARG)), ++ maEdSepFuncArg(this, ScResId(ED_FORMULA_SEP_ARG)), ++ maFtSepArrayCol(this, ScResId(FT_FORMULA_SEP_ARRAY_C)), ++ maEdSepArrayCol(this, ScResId(ED_FORMULA_SEP_ARRAY_C)), ++ maFtSepArrayRow(this, ScResId(FT_FORMULA_SEP_ARRAY_R)), ++ maEdSepArrayRow(this, ScResId(ED_FORMULA_SEP_ARRAY_R)), ++ maBtnSepReset(this, ScResId(BTN_FORMULA_SEP_RESET)), ++ ++ mpOldOptions(NULL), ++ mpNewOptions(NULL), ++ mnDecSep(0) ++{ ++ FreeResource(); ++ ++ const ScTpCalcItem& rItem = static_cast( ++ rCoreAttrs.Get(GetWhich(SID_SCDOCOPTIONS))); ++ mpOldOptions.reset(new ScDocOptions(rItem.GetDocOptions())); ++ mpNewOptions.reset(new ScDocOptions(rItem.GetDocOptions())); ++ ++ Init(); ++} ++ ++ScTpFormulaOptions::~ScTpFormulaOptions() ++{ ++} ++ ++void ScTpFormulaOptions::Init() ++{ ++ Link aLink = LINK( this, ScTpFormulaOptions, ButtonHdl ); ++ maBtnSepReset.SetClickHdl(aLink); ++ ++ aLink = LINK( this, ScTpFormulaOptions, SepModifyHdl ); ++ maEdSepFuncArg.SetModifyHdl(aLink); ++ maEdSepArrayCol.SetModifyHdl(aLink); ++ maEdSepArrayRow.SetModifyHdl(aLink); ++ ++ aLink = LINK( this, ScTpFormulaOptions, SepEditOnFocusHdl ); ++ maEdSepFuncArg.SetGetFocusHdl(aLink); ++ maEdSepArrayCol.SetGetFocusHdl(aLink); ++ maEdSepArrayRow.SetGetFocusHdl(aLink); ++ ++ // Get the decimal separator for current locale. ++ String aSep = mpOldOptions->GetLocaleDataWrapper().getNumDecimalSep(); ++ mnDecSep = aSep.Len() ? aSep.GetChar(0) : sal_Unicode('.'); ++} ++ ++void ScTpFormulaOptions::ResetSeparators() ++{ ++ ScDocOptions aOpt; ++ maEdSepFuncArg.SetText(aOpt.GetFormulaSepArg()); ++ maEdSepArrayCol.SetText(aOpt.GetFormulaSepArrayCol()); ++ maEdSepArrayRow.SetText(aOpt.GetFormulaSepArrayRow()); ++} ++ ++void ScTpFormulaOptions::OnFocusSeparatorInput(Edit* pEdit) ++{ ++ if (!pEdit) ++ return; ++ ++ // Make sure the entire text is selected. ++ xub_StrLen nLen = pEdit->GetText().Len(); ++ Selection aSel(0, nLen); ++ pEdit->SetSelection(aSel); ++ maOldSepValue = pEdit->GetText(); ++} ++ ++bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const ++{ ++ if (rSep.getLength() != 1) ++ // Must be one-character long. ++ return false; ++ ++ if (rSep.compareToAscii("a") >= 0 && rSep.compareToAscii("z") <= 0) ++ return false; ++ ++ if (rSep.compareToAscii("A") >= 0 && rSep.compareToAscii("Z") <= 0) ++ return false; ++ ++ sal_Unicode c = rSep.getStr()[0]; ++ switch (c) ++ { ++ case '+': ++ case '-': ++ case '/': ++ case '*': ++ case '<': ++ case '>': ++ case '[': ++ case ']': ++ case '(': ++ case ')': ++ case '"': ++ case '\'': ++ // Disallowed characters. Anything else we want to disallow ? ++ return false; ++ } ++ ++ if (c == mnDecSep) ++ // decimal separator is not allowed. ++ return false; ++ ++ return true; ++} ++ ++bool ScTpFormulaOptions::IsValidSeparatorSet() const ++{ ++ // Make sure the column and row separators are different. ++ String aColStr = maEdSepArrayCol.GetText(); ++ String aRowStr = maEdSepArrayRow.GetText(); ++ if (aColStr == aRowStr) ++ return false; ++ ++ return true; ++} ++ ++IMPL_LINK( ScTpFormulaOptions, ButtonHdl, PushButton*, pBtn ) ++{ ++ if (pBtn == &maBtnSepReset) ++ ResetSeparators(); ++ ++ return 0; ++} ++ ++IMPL_LINK( ScTpFormulaOptions, SepModifyHdl, Edit*, pEdit ) ++{ ++ if (!pEdit) ++ return 0; ++ ++ String aStr = pEdit->GetText(); ++ if (aStr.Len() > 1) ++ { ++ // In case the string is more than one character long, only grab the ++ // first character. ++ aStr = aStr.Copy(0, 1); ++ pEdit->SetText(aStr); ++ } ++ ++ if ((!IsValidSeparator(aStr) || !IsValidSeparatorSet()) && maOldSepValue.getLength()) ++ // Invalid separator. Restore the old value. ++ pEdit->SetText(maOldSepValue); ++ ++ OnFocusSeparatorInput(pEdit); ++ return 0; ++} ++ ++IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Edit*, pEdit ) ++{ ++ OnFocusSeparatorInput(pEdit); ++ return 0; ++} ++ ++// static ++SfxTabPage* ScTpFormulaOptions::Create(Window* pParent, const SfxItemSet& rCoreSet) ++{ ++ return new ScTpFormulaOptions(pParent, rCoreSet); ++} ++ ++BOOL ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet) ++{ ++ ::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT; ++ switch (maLbFormulaSyntax.GetSelectEntryPos()) ++ { ++ case 0: ++ eGram = ::formula::FormulaGrammar::GRAM_NATIVE; ++ break; ++ case 1: ++ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1; ++ break; ++ case 2: ++ eGram = ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1; ++ break; ++ } ++ ++ mpNewOptions->SetFormulaSyntax(eGram); ++ ++ mpNewOptions->SetFormulaSepArg(maEdSepFuncArg.GetText()); ++ mpNewOptions->SetFormulaSepArrayCol(maEdSepArrayCol.GetText()); ++ mpNewOptions->SetFormulaSepArrayRow(maEdSepArrayRow.GetText()); ++ ++ if (*mpNewOptions != *mpOldOptions) ++ { ++ rCoreSet.Put(ScTpCalcItem(GetWhich(SID_SCDOCOPTIONS), *mpNewOptions)); ++ return true; ++ } ++ else ++ return false; ++} ++ ++void ScTpFormulaOptions::Reset(const SfxItemSet& /*rCoreSet*/) ++{ ++ ::formula::FormulaGrammar::Grammar eGram = mpNewOptions->GetFormulaSyntax(); ++ switch (eGram) ++ { ++ case ::formula::FormulaGrammar::GRAM_NATIVE: ++ maLbFormulaSyntax.SelectEntryPos(0); ++ break; ++ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1: ++ maLbFormulaSyntax.SelectEntryPos(1); ++ break; ++ case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1: ++ maLbFormulaSyntax.SelectEntryPos(2); ++ break; ++ default: ++ maLbFormulaSyntax.SelectEntryPos(0); ++ } ++ ++ OUString aSep = mpNewOptions->GetFormulaSepArg(); ++ OUString aSepArrayRow = mpNewOptions->GetFormulaSepArrayRow(); ++ OUString aSepArrayCol = mpNewOptions->GetFormulaSepArrayCol(); ++ ++ if (aSep.getLength() == 1 && aSepArrayRow.getLength() == 1 && aSepArrayCol.getLength() == 1) ++ { ++ // Each separator must be one character long. ++ maEdSepFuncArg.SetText(aSep); ++ maEdSepArrayCol.SetText(aSepArrayCol); ++ maEdSepArrayRow.SetText(aSepArrayRow); ++ } ++ else ++ ResetSeparators(); ++} ++ ++int ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/) ++{ ++ // What's this method for ? ++ return KEEP_PAGE; ++} ++ +diff --git sc/source/ui/src/optdlg.src sc/source/ui/src/optdlg.src +index 82a1161..2ea00b8 100644 +--- sc/source/ui/src/optdlg.src ++++ sc/source/ui/src/optdlg.src +@@ -176,6 +176,105 @@ TabPage RID_SCPAGE_CALC + /* */ + /**************************************************************************/ + ++TabPage RID_SCPAGE_FORMULA ++{ ++ HelpId = HID_SCPAGE_FORMULA ; ++ SVLook = TRUE ; ++ Hide = TRUE ; ++ Pos = MAP_APPFONT ( 0 , 0 ) ; ++ Size = MAP_APPFONT ( 260 , 185 ) ; ++ ++ FixedLine FL_FORMULA_OPTIONS ++ { ++ Pos = MAP_APPFONT ( 6 , 3 ) ; ++ Size = MAP_APPFONT ( 248 , 8 ) ; ++ Text [ en-US ] = "Formula options"; ++ }; ++ ++ FixedText FT_FORMULA_SYNTAX ++ { ++ Pos = MAP_APPFONT ( 21, 16 ) ; ++ Size = MAP_APPFONT ( 80, 8 ) ; ++ Text [ en-US ] = "Formula ~syntax" ; ++ }; ++ ++ ListBox LB_FORMULA_SYNTAX ++ { ++ Border = TRUE ; ++ Pos = MAP_APPFONT ( 85, 14 ) ; ++ Size = MAP_APPFONT ( 60, 46 ) ; ++ DropDown = TRUE ; ++ StringList [ en-US ] = ++ { ++ < "Calc A1" ; Default ; > ; ++ < "Excel A1" ; Default ; > ; ++ < "Excel R1C1" ; Default ; > ; ++ }; ++ }; ++ ++ FixedLine FL_FORMULA_SEPS ++ { ++ Pos = MAP_APPFONT ( 6 , 32 ) ; ++ Size = MAP_APPFONT ( 248 , 8 ) ; ++ Text [ en-US ] = "Separators"; ++ }; ++ ++ FixedText FT_FORMULA_SEP_ARG ++ { ++ Pos = MAP_APPFONT ( 21, 45 ); ++ Size = MAP_APPFONT ( 40, 8 ); ++ Text [ en-US ] = "~Function"; ++ }; ++ ++ Edit ED_FORMULA_SEP_ARG ++ { ++ Border = TRUE; ++ Pos = MAP_APPFONT ( 65, 43 ); ++ Size = MAP_APPFONT ( 10, 12 ); ++ }; ++ ++ FixedText FT_FORMULA_SEP_ARRAY_C ++ { ++ Pos = MAP_APPFONT ( 21, 63 ); ++ Size = MAP_APPFONT ( 40, 8 ); ++ Text [ en-US ] = "Array co~lumn"; ++ }; ++ ++ Edit ED_FORMULA_SEP_ARRAY_C ++ { ++ Border = TRUE; ++ Pos = MAP_APPFONT ( 65, 61 ); ++ Size = MAP_APPFONT ( 10, 12 ); ++ }; ++ ++ FixedText FT_FORMULA_SEP_ARRAY_R ++ { ++ Pos = MAP_APPFONT ( 21, 81 ); ++ Size = MAP_APPFONT ( 40, 8 ); ++ Text [ en-US ] = "Array ~row"; ++ }; ++ ++ Edit ED_FORMULA_SEP_ARRAY_R ++ { ++ Border = TRUE; ++ Pos = MAP_APPFONT ( 65, 79 ); ++ Size = MAP_APPFONT ( 10, 12 ); ++ }; ++ ++ PushButton BTN_FORMULA_SEP_RESET ++ { ++ Pos = MAP_APPFONT ( 21, 99 ); ++ Size = MAP_APPFONT ( 40, 14 ); ++ Text [ en-US ] = "Rese~t"; ++ }; ++}; ++ ++/**************************************************************************/ ++/* */ ++/* */ ++/* */ ++/**************************************************************************/ ++ + TabPage RID_SCPAGE_USERLISTS + { + HelpId = HID_SCPAGE_USERLISTS ; diff --git a/applied_patches/0153-calc-dp-custom-names-offapi.diff b/applied_patches/0153-calc-dp-custom-names-offapi.diff deleted file mode 100644 index 8525f8b3e..000000000 --- a/applied_patches/0153-calc-dp-custom-names-offapi.diff +++ /dev/null @@ -1,22 +0,0 @@ -diff --git offapi/com/sun/star/sheet/MemberResultFlags.idl offapi/com/sun/star/sheet/MemberResultFlags.idl -index 788673c..943e9ac 100644 ---- offapi/com/sun/star/sheet/MemberResultFlags.idl -+++ offapi/com/sun/star/sheet/MemberResultFlags.idl -@@ -59,6 +59,17 @@ published constants MemberResultFlags - */ - const long CONTINUE = 4; - -+ //------------------------------------------------------------------------- -+ -+ /** The element contains a grand total. -+ */ -+ const long GRANDTOTAL = 8; -+ -+ //------------------------------------------------------------------------- -+ -+ /** The element is a numeric value. -+ */ -+ const long NUMERIC = 16; - }; - - //============================================================================= diff --git a/applied_patches/0431-calc-formula-variable-separators-svx.diff b/applied_patches/0153-calc-formula-variable-separators-svx.diff similarity index 100% rename from applied_patches/0431-calc-formula-variable-separators-svx.diff rename to applied_patches/0153-calc-formula-variable-separators-svx.diff diff --git a/applied_patches/0154-calc-dp-custom-names-sc.diff b/applied_patches/0154-calc-dp-custom-names-sc.diff deleted file mode 100644 index 2036b1230..000000000 --- a/applied_patches/0154-calc-dp-custom-names-sc.diff +++ /dev/null @@ -1,2848 +0,0 @@ -diff --git sc/inc/dpobject.hxx sc/inc/dpobject.hxx -index 2eff673..854e1da 100644 ---- sc/inc/dpobject.hxx -+++ sc/inc/dpobject.hxx -@@ -38,6 +38,8 @@ - #include "dpoutput.hxx" - #include - -+#include -+ - //------------------------------------------------------------------ - - namespace com { namespace sun { namespace star { namespace sheet { -@@ -66,6 +68,7 @@ class ScStrCollection; - class TypedScStrCollection; - struct PivotField; - class ScDPCacheTable; -+class ScDPTableData; - - struct ScDPServiceDesc - { -@@ -101,6 +104,7 @@ private: - ScSheetSourceDesc* pSheetDesc; // for sheet data - ScImportSourceDesc* pImpDesc; // for database data - ScDPServiceDesc* pServDesc; // for external service -+ ::std::auto_ptr mpTableData; - // cached data - com::sun::star::uno::Reference xSource; - ScDPOutput* pOutput; -@@ -113,6 +117,7 @@ private: - bool bHeaderLayout; // TRUE : grid, FALSE : standard - - -+ SC_DLLPRIVATE ScDPTableData* GetTableData(); - SC_DLLPRIVATE void CreateObjects(); - SC_DLLPRIVATE void CreateOutput(); - -@@ -167,7 +172,14 @@ public: - void SetTag(const String& rNew); - const String& GetTag() const { return aTableTag; } - -- BOOL IsDimNameInUse( const String& rName ) const; -+ /** -+ * Data description cell displays the description of a data dimension if -+ * and only if there is only one data dimension. It's usually located at -+ * the upper-left corner of the table output. -+ */ -+ bool IsDataDescriptionCell(const ScAddress& rPos); -+ -+ bool IsDimNameInUse(const ::rtl::OUString& rName) const; - String GetDimName( long nDim, BOOL& rIsDataLayout ); - BOOL IsDuplicated( long nDim ); - long GetDimCount(); -@@ -231,6 +245,8 @@ public: - // (button attribute must be present) - void RefreshAfterLoad(); - -+ void BuildAllDimensionMembers(); -+ - static BOOL HasRegisteredSources(); - static com::sun::star::uno::Sequence GetRegisteredSources(); - static com::sun::star::uno::Reference ---- sc/inc/dpsave.hxx -+++ sc/inc/dpsave.hxx -@@ -34,9 +34,11 @@ - #include - #include - #include -+#include - #include "scdllapi.h" - #include - #include -+#include - - namespace com { namespace sun { namespace star { namespace sheet { - struct DataPilotFieldReference; -@@ -46,6 +48,7 @@ namespace com { namespace sun { namespace star { namespace sheet { - } } } } - - class ScDPDimensionSaveData; -+class ScDPTableData; - - // -------------------------------------------------------------------- - // -@@ -57,6 +60,7 @@ class ScDPSaveMember - { - private: - String aName; -+ ::std::auto_ptr mpLayoutName; // custom name to be displayed in the table. - USHORT nVisibleMode; - USHORT nShowDetailsMode; - -@@ -77,18 +81,23 @@ public: - - void SetName( const String& rNew ); // used if the source member was renamed (groups) - -+ SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName ); -+ SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; -+ void RemoveLayoutName(); -+ - void WriteToSource( const com::sun::star::uno::Reference< - com::sun::star::uno::XInterface>& xMember, - sal_Int32 nPosition ); - }; - - --class ScDPSaveDimension -+class SC_DLLPUBLIC ScDPSaveDimension - { - private: - String aName; -- String* pLayoutName; // alternative name for layout, not used (yet) - String* pSelectedPage; -+ ::std::auto_ptr mpLayoutName; -+ ::std::auto_ptr mpSubtotalName; - BOOL bIsDataLayout; - BOOL bDupFlag; - USHORT nOrientation; -@@ -127,38 +136,43 @@ public: - - void SetName( const String& rNew ); // used if the source dim was renamed (groups) - -- SC_DLLPUBLIC void SetOrientation(USHORT nNew); -+ void SetOrientation(USHORT nNew); -- SC_DLLPUBLIC void SetSubTotals(long nCount, const USHORT* pFuncs); -+ void SetSubTotals(long nCount, const USHORT* pFuncs); - long GetSubTotalsCount() const { return nSubTotalCount; } - USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; } -- SC_DLLPUBLIC void SetShowEmpty(BOOL bSet); -+ void SetShowEmpty(BOOL bSet); - BOOL GetShowEmpty() const { return BOOL(nShowEmptyMode); } -- SC_DLLPUBLIC void SetFunction(USHORT nNew); // enum GeneralFunction -+ void SetFunction(USHORT nNew); // enum GeneralFunction - USHORT GetFunction() const { return nFunction; } - void SetUsedHierarchy(long nNew); - long GetUsedHierarchy() const { return nUsedHierarchy; } -- SC_DLLPUBLIC void SetLayoutName(const String* pName); -- SC_DLLPUBLIC const String& GetLayoutName() const; -- SC_DLLPUBLIC BOOL HasLayoutName() const; -+ -+ void SetLayoutName(const ::rtl::OUString& rName); -+ const ::rtl::OUString* GetLayoutName() const; -+ void RemoveLayoutName(); -+ void SetSubtotalName(const ::rtl::OUString& rName); -+ const ::rtl::OUString* GetSubtotalName() const; -+ -+ bool IsMemberNameInUse(const ::rtl::OUString& rName) const; - - const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const { return pReferenceValue; } -- SC_DLLPUBLIC void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); -+ void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); - - const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const { return pSortInfo; } -- SC_DLLPUBLIC void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); -+ void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); - const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const { return pAutoShowInfo; } -- SC_DLLPUBLIC void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); -+ void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); - const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const { return pLayoutInfo; } -- SC_DLLPUBLIC void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); -+ void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); - -- SC_DLLPUBLIC void SetCurrentPage( const String* pPage ); // NULL = no selection (all) -- SC_DLLPUBLIC BOOL HasCurrentPage() const; -- SC_DLLPUBLIC const String& GetCurrentPage() const; -+ void SetCurrentPage( const String* pPage ); // NULL = no selection (all) -+ BOOL HasCurrentPage() const; -+ const String& GetCurrentPage() const; - - USHORT GetOrientation() const { return nOrientation; } - - ScDPSaveMember* GetExistingMemberByName(const String& rName); -- SC_DLLPUBLIC ScDPSaveMember* GetMemberByName(const String& rName); -+ ScDPSaveMember* GetMemberByName(const String& rName); - - void SetMemberPosition( const String& rName, sal_Int32 nNewPos ); - -@@ -180,6 +194,12 @@ private: - BOOL bFilterButton; // not passed to DataPilotSource - BOOL bDrillDown; // not passed to DataPilotSource - -+ /** if true, all dimensions already have all of their member instances -+ * created. */ -+ bool mbDimensionMembersBuilt; -+ -+ ::std::auto_ptr mpGrandTotalName; -+ - public: - SC_DLLPUBLIC ScDPSaveData(); - ScDPSaveData(const ScDPSaveData& r); -@@ -189,11 +209,15 @@ public: - - BOOL operator== ( const ScDPSaveData& r ) const; - -+ SC_DLLPUBLIC void SetGrandTotalName(const ::rtl::OUString& rName); -+ SC_DLLPUBLIC const ::rtl::OUString* GetGrandTotalName() const; -+ - const List& GetDimensions() const { return aDimList; } - void AddDimension(ScDPSaveDimension* pDim) { aDimList.Insert(pDim, LIST_APPEND); } - - ScDPSaveDimension* GetDimensionByName(const String& rName); - SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension(); -+ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const; - - ScDPSaveDimension* DuplicateDimension(const String& rName); - SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim); -@@ -204,6 +228,7 @@ public: - void RemoveDimensionByName(const String& rName); - - ScDPSaveDimension* GetInnermostDimension(USHORT nOrientation); -+ ScDPSaveDimension* GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation); - long GetDataDimensionCount() const; - - -@@ -230,6 +255,7 @@ public: - const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; } - SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there - void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied -+ void BuildAllDimensionMembers(ScDPTableData* pData); - }; - - -diff --git sc/inc/dptabres.hxx sc/inc/dptabres.hxx -index 3fb5ef8..60ad93e 100644 ---- sc/inc/dptabres.hxx -+++ sc/inc/dptabres.hxx -@@ -41,6 +41,7 @@ - #include - #include - #include -+#include - - namespace com { namespace sun { namespace star { namespace sheet { - struct DataPilotFieldReference; -@@ -262,7 +263,7 @@ public: - - long GetMeasureCount() const { return nMeasCount; } - ScSubTotalFunc GetMeasureFunction(long nMeasure) const; -- String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc) const; -+ String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const; - String GetMeasureDimensionName(long nMeasure) const; - const ::com::sun::star::sheet::DataPilotFieldReference& GetMeasureRefVal(long nMeasure) const; - USHORT GetMeasureRefOrient(long nMeasure) const; -@@ -284,6 +285,8 @@ public: - const ScDPItemData& rBaseData, long nBaseIndex ) const; - BOOL HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, - const ScDPItemData& rSecondData, long nSecondIndex ) const; -+ -+ const ScDPSource* GetSource() const; - }; - - -diff --git sc/inc/dptabsrc.hxx sc/inc/dptabsrc.hxx -index f7ae03b..9d6e8e4 100644 ---- sc/inc/dptabsrc.hxx -+++ sc/inc/dptabsrc.hxx -@@ -33,6 +33,7 @@ - - #include - #include -+#include - #include - #include - #include "global.hxx" // enum ScSubTotalFunc -@@ -108,7 +109,7 @@ class ScDPSource : public cppu::WeakImplHelper6< - com::sun::star::lang::XServiceInfo > - { - private: -- ScDPTableData* pData; // data source -+ ScDPTableData* pData; // data source (ScDPObject manages its life time) - ScDPDimensions* pDimensions; // api objects - // settings: - long nColDims[SC_DAPI_MAXFIELDS]; -@@ -136,6 +137,8 @@ private: - List aRowLevelList; - BOOL bResultOverflow; - -+ ::std::auto_ptr mpGrandTotalName; -+ - void CreateRes_Impl(); - void FillMemberResults(); - void FillLevelList( USHORT nOrientation, List& rList ); -@@ -162,11 +165,15 @@ public: - ScDPTableData* GetData() { return pData; } - const ScDPTableData* GetData() const { return pData; } - -+ void SetGrandTotalName(const ::rtl::OUString& rName); -+ const ::rtl::OUString* GetGrandTotalName() const; -+ - USHORT GetOrientation(long nColumn); - void SetOrientation(long nColumn, USHORT nNew); - long GetPosition(long nColumn); - - long GetDataDimensionCount(); -+ ScDPDimension* GetDataDimension(long nIndex); - String GetDataDimName(long nIndex); - BOOL IsDataLayoutDimension(long nDim); - USHORT GetDataLayoutOrientation(); -@@ -333,6 +340,8 @@ private: - long nUsedHier; - USHORT nFunction; // enum GeneralFunction - String aName; // if empty, take from source -+ ::std::auto_ptr mpLayoutName; -+ ::std::auto_ptr mpSubtotalName; - long nSourceDim; // >=0 if dup'ed - ::com::sun::star::sheet::DataPilotFieldReference - aReferenceValue; // settings for "show data as" / "displayed value" -@@ -350,6 +359,9 @@ public: - ScDPDimension* CreateCloneObject(); - ScDPHierarchies* GetHierarchiesObject(); - -+ SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; -+ const ::rtl::OUString* GetSubtotalName() const; -+ - // XNamed - virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setName( const ::rtl::OUString& aName ) -@@ -736,7 +748,7 @@ private: - long nLev; - - ScDPItemData maData; --// String aCaption; // visible name (changeable by user) -+ ::std::auto_ptr mpLayoutName; - - sal_Int32 nPosition; // manual sorting - BOOL bVisible; -@@ -750,6 +762,7 @@ public: - BOOL IsNamedItem( const ScDPItemData& r ) const; - String GetNameStr() const; - void FillItemData( ScDPItemData& rData ) const; -+ SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; - - sal_Int32 Compare( const ScDPMember& rOther ) const; // visible order - -diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx -index abfcf3a..6afb1a3 100644 ---- sc/inc/unonames.hxx -+++ sc/inc/unonames.hxx -@@ -563,6 +563,9 @@ - #define SC_UNO_ROWFIELDCOUNT "RowFieldCount" - #define SC_UNO_COLUMNFIELDCOUNT "ColumnFieldCount" - #define SC_UNO_DATAFIELDCOUNT "DataFieldCount" -+#define SC_UNO_LAYOUTNAME "LayoutName" -+#define SC_UNO_FIELD_SUBTOTALNAME "FieldSubtotalName" -+#define SC_UNO_GRANDTOTAL_NAME "GrandTotalName" - - // (preliminary:) - #define SC_UNO_REFVALUE "ReferenceValue" -diff --git sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx -index d7c9a6c..afa90e9 100644 ---- sc/source/core/data/dpobject.cxx -+++ sc/source/core/data/dpobject.cxx -@@ -78,6 +78,7 @@ - - using namespace com::sun::star; - using ::std::vector; -+using ::std::auto_ptr; - using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::UNO_QUERY; -@@ -162,6 +163,7 @@ ScDPObject::ScDPObject( ScDocument* pD ) : - pSheetDesc( NULL ), - pImpDesc( NULL ), - pServDesc( NULL ), -+ mpTableData(NULL), - pOutput( NULL ), - nAutoFormatIndex( 65535 ), - bSettingsChanged( FALSE ), -@@ -184,6 +186,7 @@ ScDPObject::ScDPObject(const ScDPObject& r) : - pSheetDesc( NULL ), - pImpDesc( NULL ), - pServDesc( NULL ), -+ mpTableData(NULL), - pOutput( NULL ), - bSettingsChanged( FALSE ), - bAlive( FALSE ), -@@ -342,6 +345,22 @@ void ScDPObject::SetTag(const String& rNew) - aTableTag = rNew; - } - -+bool ScDPObject::IsDataDescriptionCell(const ScAddress& rPos) -+{ -+ if (!pSaveData) -+ return false; -+ -+ long nDataDimCount = pSaveData->GetDataDimensionCount(); -+ if (nDataDimCount != 1) -+ // There has to be exactly one data dimension for the description to -+ // appear at top-left corner. -+ return false; -+ -+ CreateOutput(); -+ ScRange aTabRange = pOutput->GetOutputRange(sheet::DataPilotOutputRangeType::TABLE); -+ return (rPos == aTabRange.aStart); -+} -+ - uno::Reference ScDPObject::GetSource() - { - CreateObjects(); -@@ -384,6 +412,38 @@ void ScDPObject::CreateOutput() - } - } - -+ScDPTableData* ScDPObject::GetTableData() -+{ -+ if (!mpTableData.get()) -+ { -+ if ( pImpDesc ) -+ { -+ // database data -+ mpTableData.reset(new ScDatabaseDPData(pDoc, *pImpDesc)); -+ } -+ else -+ { -+ // cell data -+ if (!pSheetDesc) -+ { -+ DBG_ERROR("no source descriptor"); -+ pSheetDesc = new ScSheetSourceDesc; // dummy defaults -+ } -+ mpTableData.reset(new ScSheetDPData(pDoc, *pSheetDesc)); -+ } -+ -+ // grouping (for cell or database data) -+ if ( pSaveData && pSaveData->GetExistingDimensionData() ) -+ { -+ auto_ptr pGroupData(new ScDPGroupTableData(mpTableData.release(), pDoc)); -+ pSaveData->GetExistingDimensionData()->WriteToData(*pGroupData); -+ mpTableData = pGroupData; -+ } -+ } -+ -+ return mpTableData.get(); -+} -+ - void ScDPObject::CreateObjects() - { - // if groups are involved, create a new source with the ScDPGroupTableData -@@ -406,33 +466,9 @@ void ScDPObject::CreateObjects() - if ( !xSource.is() ) // database or sheet data, or error in CreateSource - { - DBG_ASSERT( !pServDesc, "DPSource could not be created" ); -- -- ScDPTableData* pData = NULL; -- if ( pImpDesc ) -- { -- // database data -- pData = new ScDatabaseDPData( pDoc, *pImpDesc ); -- } -- else -- { -- // cell data -- if (!pSheetDesc) -- { -- DBG_ERROR("no source descriptor"); -- pSheetDesc = new ScSheetSourceDesc; // dummy defaults -- } -- pData = new ScSheetDPData( pDoc, *pSheetDesc ); -- } -- -- // grouping (for cell or database data) -- if ( pSaveData && pSaveData->GetExistingDimensionData() ) -- { -- ScDPGroupTableData* pGroupData = new ScDPGroupTableData( pData, pDoc ); -- pSaveData->GetExistingDimensionData()->WriteToData( *pGroupData ); -- pData = pGroupData; -- } -- -- xSource = new ScDPSource( pData ); -+ ScDPTableData* pData = GetTableData(); -+ ScDPSource* pSource = new ScDPSource( pData ); -+ xSource = pSource; - } - - if (pSaveData) -@@ -554,6 +590,14 @@ void ScDPObject::RefreshAfterLoad() - bInfoValid = TRUE; - } - -+void ScDPObject::BuildAllDimensionMembers() -+{ -+ if (!pSaveData) -+ return; -+ -+ pSaveData->BuildAllDimensionMembers(GetTableData()); -+} -+ - void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode, - const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) - { -@@ -676,23 +720,33 @@ void ScDPObject::GetDrillDownData(const ScAddress& rPos, Sequence< Sequence - rTableData = xDrillDownData->getDrillDownData(filters); - } - --BOOL ScDPObject::IsDimNameInUse( const String& rName ) const -+bool ScDPObject::IsDimNameInUse(const OUString& rName) const - { -- if ( xSource.is() ) -- { -- uno::Reference xDimsName = xSource->getDimensions(); -- if ( xDimsName.is() ) -- { -- rtl::OUString aCompare( rName ); -- uno::Sequence aNames = xDimsName->getElementNames(); -- long nCount = aNames.getLength(); -- const rtl::OUString* pArr = aNames.getConstArray(); -- for (long nPos=0; nPos xDims = xSource->getDimensions(); -+ Sequence aDimNames = xDims->getElementNames(); -+ sal_Int32 n = aDimNames.getLength(); -+ for (sal_Int32 i = 0; i < n; ++i) -+ { -+ const OUString& rDimName = aDimNames[i]; -+ if (rDimName.equalsIgnoreAsciiCase(rName)) -+ return true; -+ -+ Reference xPropSet(xDims->getByName(rDimName), UNO_QUERY); -+ if (!xPropSet.is()) -+ continue; -+ -+ Any any = xPropSet->getPropertyValue(OUString::createFromAscii(SC_UNO_LAYOUTNAME)); -+ OUString aLayoutName; -+ if (any >>= aLayoutName) -+ { -+ if (aLayoutName.equalsIgnoreAsciiCase(rName)) -+ return true; -+ } -+ } -+ return false; - } - - String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout ) -diff --git sc/source/core/data/dpoutput.cxx sc/source/core/data/dpoutput.cxx -index a411c80..de9c898 100644 ---- sc/source/core/data/dpoutput.cxx -+++ sc/source/core/data/dpoutput.cxx -@@ -81,6 +81,7 @@ - - using namespace com::sun::star; - using ::std::vector; -+using ::com::sun::star::beans::XPropertySet; - using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::uno::Reference; -@@ -98,7 +99,6 @@ using ::rtl::OUString; - #define DP_PROP_ORIENTATION "Orientation" - #define DP_PROP_POSITION "Position" - #define DP_PROP_USEDHIERARCHY "UsedHierarchy" --#define DP_PROP_DATADESCR "DataDescription" - #define DP_PROP_ISDATALAYOUT "IsDataLayoutDimension" - #define DP_PROP_NUMBERFORMAT "NumberFormat" - #define DP_PROP_FILTER "Filter" -@@ -119,7 +119,8 @@ struct ScDPOutLevelData - long nLevel; - long nDimPos; - uno::Sequence aResult; -- String aCaption; -+ String maName; /// Name is the internal field name. -+ String aCaption; /// Caption is the name visible in the output table. - - ScDPOutLevelData() { nDim = nHier = nLevel = nDimPos = -1; } - -@@ -444,7 +445,15 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetName()); //! Caption... -+ String aName = xLevNam->getName(); -+ OUString aCaption = aName; // Caption equals the field name by default. -+ Reference xPropSet(xLevel, UNO_QUERY); -+ if (xPropSet.is()) -+ { -+ Any any = xPropSet->getPropertyValue( -+ OUString::createFromAscii(SC_UNO_LAYOUTNAME)); -+ any >>= aCaption; -+ } - switch ( eDimOrient ) - { - case sheet::DataPilotFieldOrientation_COLUMN: -@@ -453,6 +462,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); -+ pColFields[nColFieldCount].maName = aName; - pColFields[nColFieldCount].aCaption= aCaption; - if (!lcl_MemberEmpty(pColFields[nColFieldCount].aResult)) - ++nColFieldCount; -@@ -463,6 +473,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); -+ pRowFields[nRowFieldCount].maName = aName; - pRowFields[nRowFieldCount].aCaption= aCaption; - if (!lcl_MemberEmpty(pRowFields[nRowFieldCount].aResult)) - ++nRowFieldCount; -@@ -473,6 +484,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetPropertyValue( -- rtl::OUString::createFromAscii(DP_PROP_DATADESCR) ); -+ rtl::OUString::createFromAscii(SC_UNO_DATADESC) ); - rtl::OUString aUStr; - aAny >>= aUStr; - aDataDescription = String( aUStr ); -@@ -606,9 +618,16 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, - const sheet::MemberResult& rData, BOOL bColHeader, long nLevel ) - { - long nFlags = rData.Flags; -+ -+ rtl::OUStringBuffer aCaptionBuf; -+ if (!(nFlags & sheet::MemberResultFlags::NUMERIC)) -+ // This caption is not a number. Make sure it won't get parsed as one. -+ aCaptionBuf.append(sal_Unicode('\'')); -+ aCaptionBuf.append(rData.Caption); -+ - if ( nFlags & sheet::MemberResultFlags::HASMEMBER ) - { -- pDoc->SetString( nCol, nRow, nTab, rData.Caption ); -+ pDoc->SetString( nCol, nRow, nTab, aCaptionBuf.makeStringAndClear() ); - } - else - { -@@ -1151,7 +1170,7 @@ bool ScDPOutput::GetDataResultPositionData(vector& - for (SCCOL nColField = 0; nColField < nColFieldCount && bFilterByCol; ++nColField) - { - sheet::DataPilotFieldFilter filter; -- filter.FieldName = pColFields[nColField].aCaption; -+ filter.FieldName = pColFields[nColField].maName; - - const uno::Sequence rSequence = pColFields[nColField].aResult; - const sheet::MemberResult* pArray = rSequence.getConstArray(); -@@ -1168,10 +1187,15 @@ bool ScDPOutput::GetDataResultPositionData(vector& - } - - // row fields -+ bool bDataLayoutExists = (nDataFieldCount > 1); - for (SCROW nRowField = 0; nRowField < nRowFieldCount && bFilterByRow; ++nRowField) - { -+ if (bDataLayoutExists && nRowField == nRowFieldCount - 1) -+ // There is no sense including the data layout field for filtering. -+ continue; -+ - sheet::DataPilotFieldFilter filter; -- filter.FieldName = pRowFields[nRowField].aCaption; -+ filter.FieldName = pRowFields[nRowField].maName; - - const uno::Sequence rSequence = pRowFields[nRowField].aResult; - const sheet::MemberResult* pArray = rSequence.getConstArray(); -@@ -1209,8 +1233,7 @@ bool lcl_IsNamedDataField( const ScDPGetPivotDataField& rTarget, const String& r - - bool lcl_IsNamedCategoryField( const ScDPGetPivotDataField& rFilter, const ScDPOutLevelData& rField ) - { -- //! name from source instead of caption? -- return ScGlobal::pTransliteration->isEqual( rFilter.maFieldName, rField.aCaption ); -+ return ScGlobal::pTransliteration->isEqual( rFilter.maFieldName, rField.maName ); - } - - bool lcl_IsCondition( const sheet::MemberResult& rResultEntry, const ScDPGetPivotDataField& rFilter ) ---- sc/source/core/data/dpsave.cxx -+++ sc/source/core/data/dpsave.cxx -@@ -58,7 +58,12 @@ - #include - #include - -+#include -+ - using namespace com::sun::star; -+using ::rtl::OUString; -+using ::std::hash_map; -+using ::std::auto_ptr; - - // ----------------------------------------------------------------------- - -@@ -113,6 +118,7 @@ void lcl_SkipExtra( SvStream& rStream ) - - ScDPSaveMember::ScDPSaveMember(const String& rName) : - aName( rName ), -+ mpLayoutName(NULL), - nVisibleMode( SC_DPSAVEMODE_DONTKNOW ), - nShowDetailsMode( SC_DPSAVEMODE_DONTKNOW ) - { -@@ -120,9 +126,12 @@ ScDPSaveMember::ScDPSaveMember(const String& rName) : - - ScDPSaveMember::ScDPSaveMember(const ScDPSaveMember& r) : - aName( r.aName ), -+ mpLayoutName(NULL), - nVisibleMode( r.nVisibleMode ), - nShowDetailsMode( r.nShowDetailsMode ) - { -+ if (r.mpLayoutName.get()) -+ mpLayoutName.reset(new OUString(*r.mpLayoutName)); - } - - ScDPSaveMember::~ScDPSaveMember() -@@ -167,6 +176,21 @@ void ScDPSaveMember::SetName( const String& rNew ) - aName = rNew; - } - -+void ScDPSaveMember::SetLayoutName( const OUString& rName ) -+{ -+ mpLayoutName.reset(new OUString(rName)); -+} -+ -+const OUString* ScDPSaveMember::GetLayoutName() const -+{ -+ return mpLayoutName.get(); -+} -+ -+void ScDPSaveMember::RemoveLayoutName() -+{ -+ mpLayoutName.reset(NULL); -+} -+ - void ScDPSaveMember::WriteToSource( const uno::Reference& xMember, sal_Int32 nPosition ) - { - // nothing to do? -@@ -187,6 +211,18 @@ void ScDPSaveMember::WriteToSource( const uno::Reference& xMemb - lcl_SetBoolProperty( xMembProp, - rtl::OUString::createFromAscii(DP_PROP_SHOWDETAILS), (BOOL)nShowDetailsMode ); - -+ if (mpLayoutName.get()) -+ { -+ try -+ { -+ uno::Any any; -+ any <<= rtl::OUString(*mpLayoutName); -+ xMembProp->setPropertyValue(rtl::OUString::createFromAscii(SC_UNO_LAYOUTNAME), any); -+ } -+ catch (uno::Exception&) -+ { -+ } -+ } - if ( nPosition >= 0 ) - { - try -@@ -205,8 +241,9 @@ void ScDPSaveMember::WriteToSource( const uno::Reference& xMemb - - ScDPSaveDimension::ScDPSaveDimension(const String& rName, BOOL bDataLayout) : - aName( rName ), -- pLayoutName( NULL ), - pSelectedPage( NULL ), -+ mpLayoutName(NULL), -+ mpSubtotalName(NULL), - bIsDataLayout( bDataLayout ), - bDupFlag( FALSE ), - nOrientation( sheet::DataPilotFieldOrientation_HIDDEN ), -@@ -225,6 +262,8 @@ ScDPSaveDimension::ScDPSaveDimension(const String& rName, BOOL bDataLayout) : - - ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) : - aName( r.aName ), -+ mpLayoutName(NULL), -+ mpSubtotalName(NULL), - bIsDataLayout( r.bIsDataLayout ), - bDupFlag( r.bDupFlag ), - nOrientation( r.nOrientation ), -@@ -265,14 +304,14 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) : - pLayoutInfo = new sheet::DataPilotFieldLayoutInfo( *(r.pLayoutInfo) ); - else - pLayoutInfo = NULL; -- if (r.pLayoutName) -- pLayoutName = new String( *(r.pLayoutName) ); -- else -- pLayoutName = NULL; - if (r.pSelectedPage) - pSelectedPage = new String( *(r.pSelectedPage) ); - else - pSelectedPage = NULL; -+ if (r.mpLayoutName.get()) -+ mpLayoutName.reset(new OUString(*r.mpLayoutName)); -+ if (r.mpSubtotalName.get()) -+ mpSubtotalName.reset(new OUString(*r.mpSubtotalName)); - } - - ScDPSaveDimension::~ScDPSaveDimension() -@@ -283,7 +322,6 @@ ScDPSaveDimension::~ScDPSaveDimension() - delete pSortInfo; - delete pAutoShowInfo; - delete pLayoutInfo; -- delete pLayoutName; - delete pSelectedPage; - delete [] pSubTotalFuncs; - } -@@ -395,25 +433,45 @@ void ScDPSaveDimension::SetUsedHierarchy(long nNew) - nUsedHierarchy = nNew; - } - --BOOL ScDPSaveDimension::HasLayoutName() const -+void ScDPSaveDimension::SetSubtotalName(const OUString& rName) - { -- return ( pLayoutName != NULL ); -+ mpSubtotalName.reset(new OUString(rName)); - } - --void ScDPSaveDimension::SetLayoutName(const String* pName) -+const OUString* ScDPSaveDimension::GetSubtotalName() const - { -- delete pLayoutName; -- if (pName) -- pLayoutName = new String( *pName ); -- else -- pLayoutName = NULL; -+ return mpSubtotalName.get(); - } - --const String& ScDPSaveDimension::GetLayoutName() const -+bool ScDPSaveDimension::IsMemberNameInUse(const OUString& rName) const - { -- if (pLayoutName) -- return *pLayoutName; -- return aName; -+ MemberList::const_iterator itr = maMemberList.begin(), itrEnd = maMemberList.end(); -+ for (; itr != itrEnd; ++itr) -+ { -+ const ScDPSaveMember* pMem = *itr; -+ if (rName.equalsIgnoreAsciiCase(pMem->GetName())) -+ return true; -+ -+ const OUString* pLayoutName = pMem->GetLayoutName(); -+ if (pLayoutName && rName.equalsIgnoreAsciiCase(*pLayoutName)) -+ return true; -+ } -+ return false; -+} -+ -+void ScDPSaveDimension::SetLayoutName(const OUString& rName) -+{ -+ mpLayoutName.reset(new OUString(rName)); -+} -+ -+const OUString* ScDPSaveDimension::GetLayoutName() const -+{ -+ return mpLayoutName.get(); -+} -+ -+void ScDPSaveDimension::RemoveLayoutName() -+{ -+ mpLayoutName.reset(NULL); - } - - void ScDPSaveDimension::SetReferenceValue(const sheet::DataPilotFieldReference* pNew) -@@ -549,6 +607,19 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD - { - aAny <<= aFilter; - xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_FILTER), aAny ); -+ if (mpLayoutName.get()) -+ { -+ aAny <<= *mpLayoutName; -+ xDimProp->setPropertyValue(rtl::OUString::createFromAscii(SC_UNO_LAYOUTNAME), aAny); -+ } -+ -+ const OUString* pSubTotalName = GetSubtotalName(); -+ if (pSubTotalName) -+ { -+ // Custom subtotal name, with '?' being replaced by the visible field name later. -+ aAny <<= *pSubTotalName; -+ xDimProp->setPropertyValue(OUString::createFromAscii(SC_UNO_FIELD_SUBTOTALNAME), aAny); -+ } - } - catch ( beans::UnknownPropertyException& ) - { -@@ -691,7 +762,9 @@ ScDPSaveData::ScDPSaveData() : - nIgnoreEmptyMode( SC_DPSAVEMODE_DONTKNOW ), - nRepeatEmptyMode( SC_DPSAVEMODE_DONTKNOW ), - bFilterButton( TRUE ), -- bDrillDown( TRUE ) -+ bDrillDown( TRUE ), -+ mbDimensionMembersBuilt(false), -+ mpGrandTotalName(NULL) - { - } - -@@ -701,7 +774,9 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) : - nIgnoreEmptyMode( r.nIgnoreEmptyMode ), - nRepeatEmptyMode( r.nRepeatEmptyMode ), - bFilterButton( r.bFilterButton ), -- bDrillDown( r.bDrillDown ) -+ bDrillDown( r.bDrillDown ), -+ mbDimensionMembersBuilt(r.mbDimensionMembersBuilt), -+ mpGrandTotalName(NULL) - { - if ( r.pDimensionData ) - pDimensionData = new ScDPDimensionSaveData( *r.pDimensionData ); -@@ -714,6 +789,9 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) : - ScDPSaveDimension* pNew = new ScDPSaveDimension( *(ScDPSaveDimension*)r.aDimList.GetObject(i) ); - aDimList.Insert( pNew, LIST_APPEND ); - } -+ -+ if (r.mpGrandTotalName.get()) -+ mpGrandTotalName.reset(new OUString(*r.mpGrandTotalName)); - } - - ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) -@@ -732,6 +810,7 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) - nRepeatEmptyMode = r.nRepeatEmptyMode; - bFilterButton = r.bFilterButton; - bDrillDown = r.bDrillDown; -+ mbDimensionMembersBuilt = r.mbDimensionMembersBuilt; - - // remove old dimensions - -@@ -750,6 +829,9 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) - new ScDPSaveDimension( *(ScDPSaveDimension*)r.aDimList.GetObject(i) ); - aDimList.Insert( pNew, LIST_APPEND ); - } -+ -+ if (r.mpGrandTotalName.get()) -+ mpGrandTotalName.reset(new OUString(*r.mpGrandTotalName)); - } - return *this; - } -@@ -761,7 +843,8 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const - nIgnoreEmptyMode != r.nIgnoreEmptyMode || - nRepeatEmptyMode != r.nRepeatEmptyMode || - bFilterButton != r.bFilterButton || -- bDrillDown != r.bDrillDown ) -+ bDrillDown != r.bDrillDown || -+ mbDimensionMembersBuilt != r.mbDimensionMembersBuilt) - return FALSE; - - if ( pDimensionData || r.pDimensionData ) -@@ -777,6 +860,16 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const - *(ScDPSaveDimension*)r.aDimList.GetObject(i) ) ) - return FALSE; - -+ if (mpGrandTotalName.get()) -+ { -+ if (!r.mpGrandTotalName.get()) -+ return false; -+ if (!mpGrandTotalName->equals(*r.mpGrandTotalName)) -+ return false; -+ } -+ else if (r.mpGrandTotalName.get()) -+ return false; -+ - return TRUE; - } - -@@ -790,6 +883,16 @@ ScDPSaveData::~ScDPSaveData() - delete pDimensionData; - } - -+void ScDPSaveData::SetGrandTotalName(const OUString& rName) -+{ -+ mpGrandTotalName.reset(new OUString(rName)); -+} -+ -+const OUString* ScDPSaveData::GetGrandTotalName() const -+{ -+ return mpGrandTotalName.get(); -+} -+ - ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName) - { - long nCount = aDimList.Count(); -@@ -832,6 +935,17 @@ ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const String& rName) - - ScDPSaveDimension* ScDPSaveData::GetDataLayoutDimension() - { -+ ScDPSaveDimension* pDim = GetExistingDataLayoutDimension(); -+ if (pDim) -+ return pDim; -+ -+ ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), TRUE ); -+ aDimList.Insert( pNew, LIST_APPEND ); -+ return pNew; -+} -+ -+ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const -+{ - ULONG nCount = aDimList.Count(); - for (ULONG i=0; iIsDataLayout() ) - return pDim; - } -- ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), TRUE ); -- aDimList.Insert( pNew, LIST_APPEND ); -- return pNew; -+ return NULL; - } - - ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName) -@@ -895,6 +1007,18 @@ ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(USHORT nOrientation) - return pInner; // the last matching one - } - -+ScDPSaveDimension* ScDPSaveData::GetFirstDimension(sheet::DataPilotFieldOrientation eOrientation) -+{ -+ long nCount = aDimList.Count(); -+ for (long i = 0; i < nCount; ++i) -+ { -+ ScDPSaveDimension* pDim = static_cast(aDimList.GetObject(i)); -+ if (pDim->GetOrientation() == eOrientation && !pDim->IsDataLayout()) -+ return pDim; -+ } -+ return NULL; -+} -+ - long ScDPSaveData::GetDataDimensionCount() const - { - long nDataCount = 0; -@@ -1002,6 +1126,14 @@ void ScDPSaveData::WriteToSource( const uno::ReferencesetPropertyValue(OUString::createFromAscii(SC_UNO_GRANDTOTAL_NAME), any); -+ } - } - catch(uno::Exception&) - { -@@ -1125,3 +1257,50 @@ void ScDPSaveData::SetDimensionData( const ScDPDimensionSaveData* pNew ) - pDimensionData = NULL; - } - -+void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData) -+{ -+ if (mbDimensionMembersBuilt) -+ return; -+ -+ // First, build a dimension name-to-index map. -+ typedef hash_map NameIndexMap; -+ NameIndexMap aMap; -+ long nColCount = pData->GetColumnCount(); -+ for (long i = 0; i < nColCount; ++i) -+ aMap.insert( NameIndexMap::value_type(pData->getDimensionName(i), i)); -+ -+ NameIndexMap::const_iterator itrEnd = aMap.end(); -+ -+ sal_uInt32 n = aDimList.Count(); -+ for (sal_uInt32 i = 0; i < n; ++i) -+ { -+ ScDPSaveDimension* pDim = static_cast(aDimList.GetObject(i)); -+ const String& rDimName = pDim->GetName(); -+ if (!rDimName.Len()) -+ // empty dimension name. It must be data layout. -+ continue; -+ -+ NameIndexMap::const_iterator itr = aMap.find(rDimName); -+ if (itr == itrEnd) -+ // dimension name not in the data. This should never happen! -+ continue; -+ -+ long nDimIndex = itr->second; -+ const TypedScStrCollection& rMembers = pData->GetColumnEntries(nDimIndex); -+ sal_uInt16 nMemberCount = rMembers.GetCount(); -+ for (sal_uInt16 j = 0; j < nMemberCount; ++j) -+ { -+ const String& rMemName = rMembers[j]->GetString(); -+ if (pDim->GetExistingMemberByName(rMemName)) -+ // this member instance already exists. nothing to do. -+ continue; -+ -+ auto_ptr pNewMember(new ScDPSaveMember(rMemName)); -+ pNewMember->SetIsVisible(true); -+ pDim->AddMember(pNewMember.release()); -+ } -+ } -+ -+ mbDimensionMembersBuilt = true; -+} -+ -diff --git sc/source/core/data/dptabres.cxx sc/source/core/data/dptabres.cxx -index d8f6454..e53ecb9 100644 ---- sc/source/core/data/dptabres.cxx -+++ sc/source/core/data/dptabres.cxx -@@ -67,6 +67,7 @@ using ::std::vector; - using ::std::pair; - using ::std::hash_map; - using ::com::sun::star::uno::Sequence; -+using ::rtl::OUString; - - // ----------------------------------------------------------------------- - -@@ -825,11 +826,11 @@ USHORT ScDPResultData::GetMeasureRefOrient(long nMeasure) const - return pMeasRefOrient[nMeasure]; - } - --String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc) const -+String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const - { - // with bForce==TRUE, return function instead of "result" for single measure - // with eForceFunc != SUBTOTAL_FUNC_NONE, always use eForceFunc -- -+ rbTotalResult = false; - if ( nMeasure < 0 || ( nMeasCount == 1 && !bForce && eForceFunc == SUBTOTAL_FUNC_NONE ) ) - { - // for user-specified subtotal function with all measures, -@@ -837,12 +838,19 @@ String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFu - if ( eForceFunc != SUBTOTAL_FUNC_NONE ) - return ScGlobal::GetRscString(nFuncStrIds[eForceFunc]); - -+ rbTotalResult = true; - return ScGlobal::GetRscString(STR_TABLE_ERGEBNIS); - } - else - { - DBG_ASSERT( pMeasNames && nMeasure < nMeasCount, "bumm" ); -- -+ ScDPDimension* pDataDim = pSource->GetDataDimension(nMeasure); -+ if (pDataDim) -+ { -+ const OUString* pLayoutName = pDataDim->GetLayoutName(); -+ if (pLayoutName) -+ return *pLayoutName; -+ } - String aRet; - ScSubTotalFunc eFunc = ( eForceFunc == SUBTOTAL_FUNC_NONE ) ? - GetMeasureFunction(nMeasure) : eForceFunc; -@@ -896,6 +904,11 @@ BOOL ScDPResultData::HasCommonElement( const ScDPItemData& rFirstData, long nFir - return pSource->GetData()->HasCommonElement( rFirstData, nFirstIndex, rSecondData, nSecondIndex ); - } - -+const ScDPSource* ScDPResultData::GetSource() const -+{ -+ return pSource; -+} -+ - // ----------------------------------------------------------------------- - - -@@ -1172,6 +1185,25 @@ void ScDPResultMember::ProcessData( const vector& aChildMembers, c - } - } - -+/** -+ * Parse subtotal string and replace all occurrences of '?' with the -+ * caption string. -+ */ -+static String lcl_parseSubtotalName(const String& rSubStr, const String& rCaption) -+{ -+ String aNewStr; -+ xub_StrLen n = rSubStr.Len(); -+ for (xub_StrLen i = 0; i < n; ++i) -+ { -+ sal_Unicode c = rSubStr.GetChar(i); -+ if (c == sal_Unicode('?')) -+ aNewStr.Append(rCaption); -+ else -+ aNewStr.Append(c); -+ } -+ return aNewStr; -+} -+ - void ScDPResultMember::FillMemberResults( uno::Sequence* pSequences, - long& rPos, long nMeasure, BOOL bRoot, - const String* pMemberName, -@@ -1204,17 +1236,25 @@ void ScDPResultMember::FillMemberResults( uno::Sequence* pS - } - - String aCaption = aName; -+ if (pMemberDesc) -+ { -+ const OUString* pLayoutName = pMemberDesc->GetLayoutName(); -+ if (pLayoutName) -+ { -+ aCaption = *pLayoutName; -+ bIsNumeric = false; // layout name is always non-numeric. -+ } -+ } -+ - if ( pMemberCaption ) // use pMemberCaption if != NULL - aCaption = *pMemberCaption; - if (!aCaption.Len()) - aCaption = ScGlobal::GetRscString(STR_EMPTYDATA); - -- if ( !bIsNumeric ) -- { -- // add a "'" character so a string isn't parsed as value in the output cell -- //! have a separate bit in Flags (MemberResultFlags) instead? -- aCaption.Insert( (sal_Unicode) '\'', 0 ); -- } -+ if (bIsNumeric) -+ pArray[rPos].Flags |= sheet::MemberResultFlags::NUMERIC; -+ else -+ pArray[rPos].Flags &= ~sheet::MemberResultFlags::NUMERIC; - - if ( nSize && !bRoot ) // root is overwritten by first dimension - { -@@ -1277,9 +1317,30 @@ void ScDPResultMember::FillMemberResults( uno::Sequence* pS - if (bHasChild) - eForce = lcl_GetForceFunc( pParentLevel, nUserPos ); - -- String aSubStr = aName; //! caption? -+ bool bTotalResult = false; -+ String aSubStr = aCaption; - aSubStr += ' '; -- aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce); -+ aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce, bTotalResult); -+ -+ if (bTotalResult) -+ { -+ if (pMemberDesc) -+ { -+ // single data field layout. -+ const OUString* pSubtotalName = pParentDim->GetSubtotalName(); -+ if (pSubtotalName) -+ aSubStr = lcl_parseSubtotalName(*pSubtotalName, aCaption); -+ pArray[rPos].Flags &= ~sheet::MemberResultFlags::GRANDTOTAL; -+ } -+ else -+ { -+ // root member - subtotal (grand total?) for multi-data field layout. -+ const rtl::OUString* pGrandTotalName = pResultData->GetSource()->GetGrandTotalName(); -+ if (pGrandTotalName) -+ aSubStr = *pGrandTotalName; -+ pArray[rPos].Flags |= sheet::MemberResultFlags::GRANDTOTAL; -+ } -+ } - - pArray[rPos].Name = rtl::OUString(aName); - pArray[rPos].Caption = rtl::OUString(aSubStr); -@@ -2796,8 +2857,9 @@ void ScDPResultDimension::FillMemberResults( uno::Sequence* - // in data layout dimension, use first member with different measures/names - if ( bIsDataLayout ) - { -+ bool bTotalResult = false; - String aMbrName = pResultData->GetMeasureDimensionName( nSorted ); -- String aMbrCapt = pResultData->GetMeasureString( nSorted, FALSE, SUBTOTAL_FUNC_NONE ); -+ String aMbrCapt = pResultData->GetMeasureString( nSorted, FALSE, SUBTOTAL_FUNC_NONE, bTotalResult ); - maMemberArray[0]->FillMemberResults( pSequences, nPos, nSorted, FALSE, &aMbrName, &aMbrCapt ); - } - else if ( pMember->IsVisible() ) ---- sc/source/core/data/dptabsrc.cxx -+++ sc/source/core/data/dptabsrc.cxx -@@ -85,6 +85,7 @@ using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::Any; - using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; -+using ::rtl::OUString; - - // ----------------------------------------------------------------------- - -@@ -141,15 +142,14 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : - pRowResRoot( NULL ), - pColResults( NULL ), - pRowResults( NULL ), -- bResultOverflow( FALSE ) -+ bResultOverflow( FALSE ), -+ mpGrandTotalName(NULL) - { - pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); - } - - ScDPSource::~ScDPSource() - { -- delete pData; // ScDPTableData is not ref-counted -- - if (pDimensions) - pDimensions->release(); // ref-counted - -@@ -163,6 +163,16 @@ ScDPSource::~ScDPSource() - delete pResData; - } - -+void ScDPSource::SetGrandTotalName(const ::rtl::OUString& rName) -+{ -+ mpGrandTotalName.reset(new ::rtl::OUString(rName)); -+} -+ -+const ::rtl::OUString* ScDPSource::GetGrandTotalName() const -+{ -+ return mpGrandTotalName.get(); -+} -+ - USHORT ScDPSource::GetOrientation(long nColumn) - { - long i; -@@ -186,16 +196,21 @@ long ScDPSource::GetDataDimensionCount() - return nDataDimCount; - } - -+ScDPDimension* ScDPSource::GetDataDimension(long nIndex) -+{ -+ if (nIndex < 0 || nIndex >= nDataDimCount) -+ return NULL; -+ -+ long nDimIndex = nDataDims[nIndex]; -+ return GetDimensionsObject()->getByIndex(nDimIndex); -+} -+ - String ScDPSource::GetDataDimName( long nIndex ) - { - String aRet; -- if ( nIndex >= 0 && nIndex < nDataDimCount ) -- { -- long nDimIndex = nDataDims[nIndex]; -- ScDPDimension* pDim = GetDimensionsObject()->getByIndex(nDimIndex); -- if (pDim) -- aRet = String( pDim->getName() ); -- } -+ ScDPDimension* pDim = GetDataDimension(nIndex); -+ if (pDim) -+ aRet = String(pDim->getName()); - return aRet; - } - -@@ -484,7 +499,10 @@ String ScDPSource::getDataDescription() - - String aRet; - if ( pResData->GetMeasureCount() == 1 ) -- aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE ); -+ { -+ bool bTotalResult = false; -+ aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE, bTotalResult ); -+ } - - // empty for more than one measure - -@@ -1128,6 +1146,7 @@ uno::Reference SAL_CALL ScDPSource::getPropertySetInfo( - throw(uno::RuntimeException) - { - ScUnoGuard aGuard; -+ using beans::PropertyAttribute::READONLY; - - static SfxItemPropertyMapEntry aDPSourceMap_Impl[] = - { -@@ -1136,6 +1155,10 @@ uno::Reference SAL_CALL ScDPSource::getPropertySetInfo( - {MAP_CHAR_LEN(SC_UNO_IGNOREEM), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only - {MAP_CHAR_LEN(SC_UNO_REPEATIF), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only - {MAP_CHAR_LEN(SC_UNO_ROWGRAND), 0, &getBooleanCppuType(), 0, 0 }, -+ {MAP_CHAR_LEN(SC_UNO_ROWFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, -+ {MAP_CHAR_LEN(SC_UNO_COLUMNFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, -+ {MAP_CHAR_LEN(SC_UNO_DATAFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, -+ {MAP_CHAR_LEN(SC_UNO_GRANDTOTAL_NAME), 0, &getCppuType(static_cast(0)), 0, 0 }, - {0,0,0,0,0,0} - }; - static uno::Reference aRef = -@@ -1157,6 +1180,12 @@ void SAL_CALL ScDPSource::setPropertyValue( const rtl::OUString& aPropertyName, - setIgnoreEmptyRows( lcl_GetBoolFromAny( aValue ) ); - else if ( aNameStr.EqualsAscii( SC_UNO_REPEATIF ) ) - setRepeatIfEmpty( lcl_GetBoolFromAny( aValue ) ); -+ else if (aNameStr.EqualsAscii(SC_UNO_GRANDTOTAL_NAME)) -+ { -+ OUString aName; -+ if (aValue >>= aName) -+ mpGrandTotalName.reset(new OUString(aName)); -+ } - else - { - DBG_ERROR("unknown property"); -@@ -1186,6 +1215,11 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const rtl::OUString& aPropertyNa - aRet <<= static_cast(nColDimCount); - else if ( aNameStr.EqualsAscii( SC_UNO_DATAFIELDCOUNT ) ) // read-only - aRet <<= static_cast(nDataDimCount); -+ else if (aNameStr.EqualsAscii(SC_UNO_GRANDTOTAL_NAME)) -+ { -+ if (mpGrandTotalName.get()) -+ aRet <<= *mpGrandTotalName; -+ } - else - { - DBG_ERROR("unknown property"); -@@ -1333,6 +1367,8 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) : - pHierarchies( NULL ), - nUsedHier( 0 ), - nFunction( SUBTOTAL_FUNC_SUM ), // sum is default -+ mpLayoutName(NULL), -+ mpSubtotalName(NULL), - nSourceDim( -1 ), - bHasSelectedPage( FALSE ), - pSelectedData( NULL ) -@@ -1360,6 +1396,16 @@ ScDPHierarchies* ScDPDimension::GetHierarchiesObject() - return pHierarchies; - } - -+const rtl::OUString* ScDPDimension::GetLayoutName() const -+{ -+ return mpLayoutName.get(); -+} -+ -+const rtl::OUString* ScDPDimension::GetSubtotalName() const -+{ -+ return mpSubtotalName.get(); -+} -+ - uno::Reference SAL_CALL ScDPDimension::getHierarchies() - throw(uno::RuntimeException) - { -@@ -1519,6 +1565,8 @@ uno::Reference SAL_CALL ScDPDimension::getPropertySetIn - {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_REFVALUE), 0, &getCppuType((sheet::DataPilotFieldReference*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_USEDHIER), 0, &getCppuType((sal_Int32*)0), 0, 0 }, -+ {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, -+ {MAP_CHAR_LEN(SC_UNO_FIELD_SUBTOTALNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, - {0,0,0,0,0,0} - }; - static uno::Reference aRef = -@@ -1589,6 +1637,18 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam - } - DELETEZ( pSelectedData ); // invalid after changing aSelectedPage - } -+ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) -+ { -+ OUString aTmpName; -+ if (aValue >>= aTmpName) -+ mpLayoutName.reset(new OUString(aTmpName)); -+ } -+ else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME)) -+ { -+ OUString aTmpName; -+ if (aValue >>= aTmpName) -+ mpSubtotalName.reset(new OUString(aTmpName)); -+ } - else - { - DBG_ERROR("unknown property"); -@@ -1648,6 +1708,10 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert - else - aRet <<= uno::Sequence(0); - } -+ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) -+ aRet <<= mpLayoutName.get() ? *mpLayoutName : OUString::createFromAscii(""); -+ else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME)) -+ aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii(""); - else - { - DBG_ERROR("unknown property"); -@@ -2148,7 +2212,11 @@ uno::Sequence SAL_CALL ScDPLevel::getResults() throw(uno::R - return aRet; - } - -- return pSource->GetData()->getDimensionName( nSrcDim ); // (original) dimension name -+ ScDPDimension* pDim = pSource->GetDimensionsObject()->getByIndex(nSrcDim); -+ if (!pDim) -+ return rtl::OUString(); -+ -+ return pDim->getName(); - } - - void SAL_CALL ScDPLevel::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException) -@@ -2251,6 +2319,20 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const rtl::OUString& aPropertyNam - aRet <<= aAutoShowInfo; - else if ( aNameStr.EqualsAscii( SC_UNO_LAYOUT ) ) - aRet <<= aLayoutInfo; -+ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) -+ { -+ // read only property -+ long nSrcDim = pSource->GetSourceDim(nDim); -+ ScDPDimension* pDim = pSource->GetDimensionsObject()->getByIndex(nSrcDim); -+ if (!pDim) -+ return aRet; -+ -+ const OUString* pLayoutName = pDim->GetLayoutName(); -+ if (!pLayoutName) -+ return aRet; -+ -+ aRet <<= *pLayoutName; -+ } - else - { - DBG_ERROR("unknown property"); -@@ -2543,6 +2625,7 @@ ScDPMember::ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, - nHier( nH ), - nLev( nL ), - maData( rN, fV, bHV ), -+ mpLayoutName(NULL), - nPosition( -1 ), - bVisible( TRUE ), - bShowDet( TRUE ) -@@ -2603,6 +2686,11 @@ void ScDPMember::FillItemData( ScDPItemData& rData ) const - rData = maData; - } - -+const OUString* ScDPMember::GetLayoutName() const -+{ -+ return mpLayoutName.get(); -+} -+ - String ScDPMember::GetNameStr() const - { - return maData.aString; -@@ -2662,6 +2750,7 @@ uno::Reference SAL_CALL ScDPMember::getPropertySetInfo( - {MAP_CHAR_LEN(SC_UNO_ISVISIBL), 0, &getBooleanCppuType(), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNO_SHOWDETA), 0, &getBooleanCppuType(), 0, 0 }, -+ {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, - {0,0,0,0,0,0} - }; - static uno::Reference aRef = -@@ -2685,6 +2774,12 @@ void SAL_CALL ScDPMember::setPropertyValue( const rtl::OUString& aPropertyName, - if (aValue >>= nInt) - setPosition( nInt ); - } -+ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) -+ { -+ rtl::OUString aName; -+ if (aValue >>= aName) -+ mpLayoutName.reset(new rtl::OUString(aName)); -+ } - else - { - DBG_ERROR("unknown property"); -@@ -2704,6 +2799,8 @@ uno::Any SAL_CALL ScDPMember::getPropertyValue( const rtl::OUString& aPropertyNa - lcl_SetBoolInAny( aRet, getShowDetails() ); - else if ( aNameStr.EqualsAscii( SC_UNO_POSITION ) ) - aRet <<= (sal_Int32) getPosition(); -+ else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) -+ aRet <<= mpLayoutName.get() ? *mpLayoutName : rtl::OUString(); - else - { - DBG_ERROR("unknown property"); -diff --git sc/source/filter/excel/read.cxx sc/source/filter/excel/read.cxx -index 6b486ca..aa2b377 100644 ---- sc/source/filter/excel/read.cxx -+++ sc/source/filter/excel/read.cxx -@@ -1199,6 +1199,9 @@ FltError ImportExcel8::Read( void ) - eLastErr = SCWARN_IMPORT_ROW_OVERFLOW; - else if( rAddrConv.IsColTruncated() ) - eLastErr = SCWARN_IMPORT_COLUMN_OVERFLOW; -+ -+ if( GetBiff() == EXC_BIFF8 ) -+ GetPivotTableManager().MaybeRefreshPivotTables(); - } - - return eLastErr; -diff --git sc/source/filter/excel/xepivot.cxx sc/source/filter/excel/xepivot.cxx -index 2e7d2aa..0d43d06 100644 ---- sc/source/filter/excel/xepivot.cxx -+++ sc/source/filter/excel/xepivot.cxx -@@ -67,6 +67,7 @@ using ::com::sun::star::sheet::DataPilotFieldSortInfo; - using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; - using ::com::sun::star::sheet::DataPilotFieldLayoutInfo; - using ::com::sun::star::sheet::DataPilotFieldReference; -+using ::rtl::OUString; - - using ::rtl::OString; - using ::rtl::OUString; -@@ -972,6 +973,11 @@ void XclExpPTItem::SetPropertiesFromMember( const ScDPSaveMember& rSaveMem ) - { - ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, !rSaveMem.GetIsVisible() ); - ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, !rSaveMem.GetShowDetails() ); -+ -+ // visible name -+ const OUString* pVisName = rSaveMem.GetLayoutName(); -+ if (pVisName && !pVisName->equals(GetItemName())) -+ maItemInfo.SetVisName(*pVisName); - } - - void XclExpPTItem::WriteBody( XclExpStream& rStrm ) -@@ -1040,8 +1046,13 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) - ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.GetShowEmpty() ); - - // visible name -- if( rSaveDim.HasLayoutName() && (rSaveDim.GetLayoutName() != GetFieldName()) ) -- maFieldInfo.SetVisName( rSaveDim.GetLayoutName() ); -+ const OUString* pLayoutName = rSaveDim.GetLayoutName(); -+ if (pLayoutName && !pLayoutName->equals(GetFieldName())) -+ maFieldInfo.SetVisName(*pLayoutName); -+ -+ const rtl::OUString* pSubtotalName = rSaveDim.GetSubtotalName(); -+ if (pSubtotalName) -+ maFieldExtInfo.mpFieldTotalName.reset(new rtl::OUString(*pSubtotalName)); - - // subtotals - XclPTSubtotalVec aSubtotals; -@@ -1108,7 +1119,11 @@ void XclExpPTField::SetDataPropertiesFromDim( const ScDPSaveDimension& rSaveDim - rDataInfo.SetApiAggFunc( eFunc ); - - // visible name -- rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); -+ const rtl::OUString* pVisName = rSaveDim.GetLayoutName(); -+ if (pVisName) -+ rDataInfo.SetVisName(*pVisName); -+ else -+ rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); - - // result field reference - if( const DataPilotFieldReference* pFieldRef = rSaveDim.GetReferenceValue() ) -@@ -1217,10 +1232,9 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r - // pivot table properties from DP object - mnOutScTab = rOutScRange.aStart.Tab(); - maPTInfo.maTableName = rDPObj.GetName(); -- maPTInfo.maDataName = ScGlobal::GetRscString( STR_PIVOT_DATA ); - maPTInfo.mnCacheIdx = mrPCache.GetCacheIndex(); - -- maPTAutoFormat.Init( rDPObj ); -+ maPTViewEx9Info.Init( rDPObj ); - - if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) - { -@@ -1301,8 +1315,10 @@ void XclExpPivotTable::Save( XclExpStream& rStrm ) - WriteSxli( rStrm, maPTInfo.mnDataCols, maPTInfo.mnColFields ); - // SXEX - WriteSxex( rStrm ); -- // SX_AUTOFORMAT -- WriteSxAutoformat( rStrm ); -+ // QSISXTAG -+ WriteQsiSxTag( rStrm ); -+ // SXVIEWEX9 -+ WriteSxViewEx9( rStrm ); - } - } - -@@ -1336,6 +1352,15 @@ void XclExpPivotTable::SetPropertiesFromDP( const ScDPSaveData& rSaveData ) - ::set_flag( maPTInfo.mnFlags, EXC_SXVIEW_COLGRAND, rSaveData.GetColumnGrand() ); - ::set_flag( maPTExtInfo.mnFlags, EXC_SXEX_DRILLDOWN, rSaveData.GetDrillDown() ); - mbFilterBtn = rSaveData.GetFilterButton(); -+ const ScDPSaveDimension* pDim = rSaveData.GetExistingDataLayoutDimension(); -+ if (!pDim) -+ return; -+ -+ const rtl::OUString* pLayoutName = pDim->GetLayoutName(); -+ if (pLayoutName) -+ maPTInfo.maDataName = *pLayoutName; -+ else -+ maPTInfo.maDataName = ScGlobal::GetRscString(STR_PIVOT_DATA); - } - - void XclExpPivotTable::SetFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) -@@ -1443,17 +1468,21 @@ void XclExpPivotTable::Finalize() - rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1; - if( maDataFields.empty() ) - ++rnDataXclRow; -- if( 0 == maPTAutoFormat.mnGridLayout ) -+ -+ bool bExtraHeaderRow = (0 == maPTViewEx9Info.mnGridLayout && maPTInfo.mnColFields == 0); -+ if (bExtraHeaderRow) -+ // Insert an extra row only when there is no column field. - ++rnDataXclRow; -+ - rnXclCol2 = ::std::max( rnXclCol2, rnDataXclCol ); - rnXclRow2 = ::std::max( rnXclRow2, rnDataXclRow ); - maPTInfo.mnDataCols = rnXclCol2 - rnDataXclCol + 1; - maPTInfo.mnDataRows = rnXclRow2 - rnDataXclRow + 1; - - // first heading -- maPTInfo.mnFirstHeadRow = rnXclRow1 + 1; -- if( 0 == maPTAutoFormat.mnGridLayout ) -- maPTInfo.mnFirstHeadRow++; -+ maPTInfo.mnFirstHeadRow = rnXclRow1; -+ if (bExtraHeaderRow) -+ maPTInfo.mnFirstHeadRow += 2; - } - - // records ---------------------------------------------------------------- -@@ -1529,14 +1558,68 @@ void XclExpPivotTable::WriteSxex( XclExpStream& rStrm ) const - rStrm.EndRecord(); - } - --void XclExpPivotTable::WriteSxAutoformat( XclExpStream& rStrm ) const -+void XclExpPivotTable::WriteQsiSxTag( XclExpStream& rStrm ) const -+{ -+ rStrm.StartRecord( 0x0802, 32 ); -+ -+ sal_uInt16 nRecordType = 0x0802; -+ sal_uInt16 nDummyFlags = 0x0000; -+ sal_uInt16 nTableType = 1; // 0 = query table : 1 = pivot table -+ -+ rStrm << nRecordType << nDummyFlags << nTableType; -+ -+ // General flags -+ bool bEnableRefresh = true; -+ bool bPCacheInvalid = false; -+ bool bOlapPTReport = false; -+ -+ sal_uInt16 nFlags = 0x0000; -+ if (bEnableRefresh) nFlags |= 0x0001; -+ if (bPCacheInvalid) nFlags |= 0x0002; -+ if (bOlapPTReport) nFlags |= 0x0004; -+ rStrm << nFlags; -+ -+ // Feature-specific options. The value differs depending on the table -+ // type, but we assume the table type is always pivot table. -+ sal_uInt32 nOptions = 0x00000000; -+ bool bNoStencil = false; -+ bool bHideTotal = false; -+ bool bEmptyRows = false; -+ bool bEmptyCols = false; -+ if (bNoStencil) nOptions |= 0x00000001; -+ if (bHideTotal) nOptions |= 0x00000002; -+ if (bEmptyRows) nOptions |= 0x00000008; -+ if (bEmptyCols) nOptions |= 0x00000010; -+ rStrm << nOptions; -+ -+ enum ExcelVersion -+ { -+ Excel2000 = 0, -+ ExcelXP = 1, -+ Excel2003 = 2, -+ Excel2007 = 3 -+ }; -+ ExcelVersion eXclVer = Excel2000; -+ sal_uInt8 nOffsetBytes = 16; -+ rStrm << static_cast(eXclVer) // version table last refreshed -+ << static_cast(eXclVer) // minimum version to refresh -+ << nOffsetBytes -+ << static_cast(eXclVer); // first version created -+ -+ rStrm << XclExpString(maPTInfo.maTableName); -+ rStrm << static_cast(0x0001); // no idea what this is for. -+ -+ rStrm.EndRecord(); -+} -+ -+void XclExpPivotTable::WriteSxViewEx9( XclExpStream& rStrm ) const - { - // Until we sync the autoformat ids only export if using grid header layout - // That could only have been set via xls import so far. -- if ( 0 == maPTAutoFormat.mnGridLayout ) -+ if ( 0 == maPTViewEx9Info.mnGridLayout ) - { - rStrm.StartRecord( EXC_ID_SXVIEWEX9, 17 ); -- rStrm << maPTAutoFormat; -+ rStrm << maPTViewEx9Info; - rStrm.EndRecord(); - } - } -diff --git sc/source/filter/excel/xestring.cxx sc/source/filter/excel/xestring.cxx -index e65c6bc..afcd334 100644 ---- sc/source/filter/excel/xestring.cxx -+++ sc/source/filter/excel/xestring.cxx -@@ -489,7 +489,8 @@ void XclExpString::WritePhoneticSettings( XclExpStream& rStrm ) const - - void XclExpString::Write( XclExpStream& rStrm ) const - { -- WriteHeader( rStrm ); -+ if (!mbSkipHeader) -+ WriteHeader( rStrm ); - WriteBuffer( rStrm ); - if( IsWriteFormats() ) // only in BIFF8 included in string - WriteFormats( rStrm ); -@@ -662,6 +663,7 @@ void XclExpString::Init( sal_Int32 nCurrLen, XclStrFlags nFlags, sal_uInt16 nMax - mbSmartFlags = bBiff8 && ::get_flag( nFlags, EXC_STR_SMARTFLAGS ); - mbSkipFormats = ::get_flag( nFlags, EXC_STR_SEPARATEFORMATS ); - mbWrapped = false; -+ mbSkipHeader = ::get_flag( nFlags, EXC_STR_NOHEADER ); - mnMaxLen = nMaxLen; - SetStrLen( nCurrLen ); - -diff --git sc/source/filter/excel/xipivot.cxx sc/source/filter/excel/xipivot.cxx -index f0d8c4c..cc449b9 100644 ---- sc/source/filter/excel/xipivot.cxx -+++ sc/source/filter/excel/xipivot.cxx -@@ -847,6 +847,11 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) - } - } - -+bool XclImpPivotCache::IsRefreshOnLoad() const -+{ -+ return static_cast(maPCInfo.mnFlags & 0x0004); -+} -+ - // ============================================================================ - // Pivot table - // ============================================================================ -@@ -882,6 +887,8 @@ void XclImpPTItem::ConvertItem( ScDPSaveDimension& rSaveDim ) const - ScDPSaveMember& rMember = *rSaveDim.GetMemberByName( *pItemName ); - rMember.SetIsVisible( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN ) ); - rMember.SetShowDetails( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL ) ); -+ if (maItemInfo.HasVisName()) -+ rMember.SetLayoutName(*maItemInfo.GetVisName()); - } - } - -@@ -1043,7 +1050,7 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con - // visible name - if( const String* pVisName = maFieldInfo.GetVisName() ) - if( pVisName->Len() > 0 ) -- rSaveDim.SetLayoutName( pVisName ); -+ rSaveDim.SetLayoutName( *pVisName ); - - // subtotal function(s) - XclPTSubtotalVec aSubtotalVec; -@@ -1075,6 +1082,10 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con - // grouping info - pCacheField->ConvertGroupField( rSaveData, mrPTable.GetVisFieldNames() ); - -+ // custom subtotal name -+ if (maFieldExtInfo.mpFieldTotalName.get()) -+ rSaveDim.SetSubtotalName(*maFieldExtInfo.mpFieldTotalName); -+ - return &rSaveDim; - } - -@@ -1099,7 +1110,7 @@ void XclImpPTField::ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const Xcl - // visible name - if( const String* pVisName = rDataInfo.GetVisName() ) - if( pVisName->Len() > 0 ) -- rSaveDim.SetLayoutName( pVisName ); -+ rSaveDim.SetLayoutName( *pVisName ); - - // aggregation function - rSaveDim.SetFunction( static_cast< USHORT >( rDataInfo.GetApiAggFunc() ) ); -@@ -1134,7 +1145,8 @@ void XclImpPTField::ConvertItems( ScDPSaveDimension& rSaveDim ) const - - XclImpPivotTable::XclImpPivotTable( const XclImpRoot& rRoot ) : - XclImpRoot( rRoot ), -- maDataOrientField( *this, EXC_SXIVD_DATA ) -+ maDataOrientField( *this, EXC_SXIVD_DATA ), -+ mpDPObj(NULL) - { - } - -@@ -1298,7 +1310,7 @@ void XclImpPivotTable::ReadSxex( XclImpStream& rStrm ) - - void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm ) - { -- rStrm >> maPTAutoFormat; -+ rStrm >> maPTViewEx9Info; - } - - // ---------------------------------------------------------------------------- -@@ -1336,11 +1348,14 @@ void XclImpPivotTable::Convert() - if( const XclImpPTField* pField = GetField( *aIt ) ) - pField->ConvertPageField( aSaveData ); - -+#if 0 // Why do we do this ??? -+ - // hidden fields - for( sal_uInt16 nField = 0, nCount = GetFieldCount(); nField < nCount; ++nField ) - if( const XclImpPTField* pField = GetField( nField ) ) - if( (pField->GetAxes() & EXC_SXVD_AXIS_ROWCOLPAGE) == 0 ) - pField->ConvertHiddenField( aSaveData ); -+#endif - - // data fields - for( aIt = maFiltDataFields.begin(), aEnd = maFiltDataFields.end(); aIt != aEnd; ++aIt ) -@@ -1364,12 +1379,30 @@ void XclImpPivotTable::Convert() - // create the DataPilot - ScDPObject* pDPObj = new ScDPObject( GetDocPtr() ); - pDPObj->SetName( maPTInfo.maTableName ); -+ if (maPTInfo.maDataName.Len() > 0) -+ aSaveData.GetDataLayoutDimension()->SetLayoutName(maPTInfo.maDataName); -+ -+ if (maPTViewEx9Info.maGrandTotalName.Len() > 0) -+ aSaveData.SetGrandTotalName(maPTViewEx9Info.maGrandTotalName); -+ - pDPObj->SetSaveData( aSaveData ); - pDPObj->SetSheetDesc( aDesc ); - pDPObj->SetOutRange( aOutRange ); - pDPObj->SetAlive( TRUE ); -- pDPObj->SetHeaderLayout( maPTAutoFormat.mnGridLayout == 0 ); -+ pDPObj->SetHeaderLayout( maPTViewEx9Info.mnGridLayout == 0 ); -+ - GetDoc().GetDPCollection()->Insert( pDPObj ); -+ mpDPObj = pDPObj; -+} -+ -+void XclImpPivotTable::MaybeRefresh() -+{ -+ if (mpDPObj && mxPCache->IsRefreshOnLoad()) -+ { -+ // 'refresh table on load' flag is set. Refresh the table now. Some -+ // Excel files contain partial table output when this flag is set. -+ mpDPObj->Output(); -+ } - } - - // ============================================================================ -@@ -1484,85 +1517,10 @@ void XclImpPivotTableManager::ConvertPivotTables() - (*aIt)->Convert(); - } - --// ============================================================================ -- --// Pivot table autoformat settings ============================================ -- --/** --classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 --default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 --report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 --report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 --report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 --report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 --report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 --report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 --report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 --report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 --report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 --report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 --table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 --table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 --table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 --table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 --table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 --table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 --table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 --table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 --table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 --table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 --none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 --**/ -- --XclPTAutoFormat::XclPTAutoFormat() : -- mbReport( 0 ), -- mnAutoFormat( 0 ), -- mnGridLayout( 0x10 ) --{ --} -- --void XclPTAutoFormat::Init( const ScDPObject& rDPObj ) --{ -- if( rDPObj.GetHeaderLayout() ) -- { -- mbReport = 0; -- mnAutoFormat = 1; -- mnGridLayout = 0; -- } -- else -- { -- // Report1 for now -- // TODO : sync with autoformat indicies -- mbReport = 2; -- mnAutoFormat = 1; -- mnGridLayout = 0x10; -- } --} -- --XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ) --{ -- rStrm.Ignore( 2 ); -- rStrm >> rInfo.mbReport; /// 2 for report* fmts ? -- rStrm.Ignore( 6 ); -- sal_uInt8 nDummy; -- return rStrm -- >> rInfo.mnAutoFormat -- >> rInfo.mnGridLayout -- >> nDummy >> nDummy >> nDummy; --} -- --XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ) -+void XclImpPivotTableManager::MaybeRefreshPivotTables() - { -- return rStrm -- << EXC_PT_AUTOFMT_HEADER -- << rInfo.mbReport -- << EXC_PT_AUTOFMT_ZERO -- << EXC_PT_AUTOFMT_FLAGS -- << rInfo.mnAutoFormat -- << rInfo.mnGridLayout -- << static_cast(0x00) -- << static_cast(0x00) -- << static_cast(0x00); -+ for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt ) -+ (*aIt)->MaybeRefresh(); - } - - // ============================================================================ -diff --git sc/source/filter/excel/xlpivot.cxx sc/source/filter/excel/xlpivot.cxx -index e3544b5..c915903 100644 ---- sc/source/filter/excel/xlpivot.cxx -+++ sc/source/filter/excel/xlpivot.cxx -@@ -31,6 +31,7 @@ - // MARKER(update_precomp.py): autogen include statement, do not remove - #include "precompiled_sc.hxx" - #include "dpgroup.hxx" -+#include "dpsave.hxx" - #include "xestream.hxx" - #include "xistream.hxx" - #include "xestring.hxx" -@@ -581,7 +582,9 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldInfo& rInfo ) - XclPTFieldExtInfo::XclPTFieldExtInfo() : - mnFlags( EXC_SXVDEX_DEFAULTFLAGS ), - mnSortField( EXC_SXVDEX_SORT_OWN ), -- mnShowField( EXC_SXVDEX_SHOW_NONE ) -+ mnShowField( EXC_SXVDEX_SHOW_NONE ), -+ mnNumFmt(0), -+ mpFieldTotalName(NULL) - { - } - -@@ -639,10 +642,19 @@ void XclPTFieldExtInfo::SetApiLayoutMode( sal_Int32 nLayoutMode ) - - XclImpStream& operator>>( XclImpStream& rStrm, XclPTFieldExtInfo& rInfo ) - { -- return rStrm -- >> rInfo.mnFlags -- >> rInfo.mnSortField -- >> rInfo.mnShowField; -+ sal_uInt8 nNameLen = 0; -+ rStrm >> rInfo.mnFlags -+ >> rInfo.mnSortField -+ >> rInfo.mnShowField -+ >> rInfo.mnNumFmt -+ >> nNameLen; -+ -+ rStrm.Ignore(10); -+ if (nNameLen != 0xFF) -+ // Custom field total name is used. Pick it up. -+ rInfo.mpFieldTotalName.reset(new rtl::OUString(rStrm.ReadUniString(nNameLen, 0))); -+ -+ return rStrm; - } - - XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) -@@ -650,9 +662,23 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) - rStrm << rInfo.mnFlags - << rInfo.mnSortField - << rInfo.mnShowField -- << EXC_SXVDEX_FORMAT_NONE -- << sal_uInt16( 0xFFFF ); // unknown -- rStrm.WriteZeroBytes( 8 ); // unknown -+ << EXC_SXVDEX_FORMAT_NONE; -+ -+ if (rInfo.mpFieldTotalName.get() && rInfo.mpFieldTotalName->getLength() > 0) -+ { -+ rtl::OUString aFinalName = *rInfo.mpFieldTotalName; -+ if (aFinalName.getLength() >= 254) -+ aFinalName = aFinalName.copy(0, 254); -+ sal_uInt8 nNameLen = static_cast(aFinalName.getLength()); -+ rStrm << nNameLen; -+ rStrm.WriteZeroBytes(10); -+ rStrm << XclExpString(aFinalName, EXC_STR_NOHEADER); -+ } -+ else -+ { -+ rStrm << sal_uInt16(0xFFFF); -+ rStrm.WriteZeroBytes(8); -+ } - return rStrm; - } - -@@ -923,3 +949,86 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ) - - // ============================================================================ - -+// Pivot table autoformat settings ============================================ -+ -+/** -+classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 -+default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 -+report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 -+report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 -+report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 -+report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 -+report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 -+report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 -+report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 -+report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 -+report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 -+report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 -+table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 -+table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 -+table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 -+table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 -+table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 -+table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 -+table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 -+table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 -+table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 -+table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 -+none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 -+**/ -+ -+XclPTViewEx9Info::XclPTViewEx9Info() : -+ mbReport( 0 ), -+ mnAutoFormat( 0 ), -+ mnGridLayout( 0x10 ) -+{ -+} -+ -+void XclPTViewEx9Info::Init( const ScDPObject& rDPObj ) -+{ -+ if( rDPObj.GetHeaderLayout() ) -+ { -+ mbReport = 0; -+ mnAutoFormat = 1; -+ mnGridLayout = 0; -+ } -+ else -+ { -+ // Report1 for now -+ // TODO : sync with autoformat indicies -+ mbReport = 2; -+ mnAutoFormat = 1; -+ mnGridLayout = 0x10; -+ } -+ -+ const ScDPSaveData* pData = rDPObj.GetSaveData(); -+ if (pData) -+ { -+ const rtl::OUString* pGrandTotal = pData->GetGrandTotalName(); -+ if (pGrandTotal) -+ maGrandTotalName = *pGrandTotal; -+ } -+} -+ -+XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ) -+{ -+ rStrm.Ignore( 2 ); -+ rStrm >> rInfo.mbReport; /// 2 for report* fmts ? -+ rStrm.Ignore( 6 ); -+ rStrm >> rInfo.mnAutoFormat >> rInfo.mnGridLayout; -+ rInfo.maGrandTotalName = rStrm.ReadUniString(); -+ return rStrm; -+} -+ -+XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ) -+{ -+ return rStrm -+ << EXC_PT_AUTOFMT_HEADER -+ << rInfo.mbReport -+ << EXC_PT_AUTOFMT_ZERO -+ << EXC_PT_AUTOFMT_FLAGS -+ << rInfo.mnAutoFormat -+ << rInfo.mnGridLayout -+ << XclExpString(rInfo.maGrandTotalName, EXC_STR_DEFAULT, EXC_PT_MAXSTRLEN); -+} -+ -diff --git sc/source/filter/inc/xepivot.hxx sc/source/filter/inc/xepivot.hxx -index 2de57fa..2078003 100644 ---- sc/source/filter/inc/xepivot.hxx -+++ sc/source/filter/inc/xepivot.hxx -@@ -412,8 +412,10 @@ private: - void WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount ) const; - /** Writes the SXEX records containing additional pivot table info. */ - void WriteSxex( XclExpStream& rStrm ) const; -+ -+ void WriteQsiSxTag( XclExpStream& rStrm ) const; - /** Writes the SX_AUTOFORMAT records with the autoformat id and header layout */ -- void WriteSxAutoformat( XclExpStream& rStrm ) const; -+ void WriteSxViewEx9( XclExpStream& rStrm ) const; - - // ------------------------------------------------------------------------ - private: -@@ -424,7 +426,7 @@ private: - const XclExpPivotCache& mrPCache; /// The pivot cache this pivot table bases on. - XclPTInfo maPTInfo; /// Info about the pivot table (SXVIEW record). - XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). -- XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SXVIEWEX9) -+ XclPTViewEx9Info maPTViewEx9Info; /// The selected autoformat (SXVIEWEX9) - XclExpPTFieldList maFieldList; /// All fields in pivot cache order. - ScfUInt16Vec maRowFields; /// Row field indexes. - ScfUInt16Vec maColFields; /// Column field indexes. -diff --git sc/source/filter/inc/xestring.hxx sc/source/filter/inc/xestring.hxx -index a7443cb..8851736 100644 ---- sc/source/filter/inc/xestring.hxx -+++ sc/source/filter/inc/xestring.hxx -@@ -341,6 +341,7 @@ private: - bool mbSmartFlags; /// true = omit flags on empty string; false = always write flags. - bool mbSkipFormats; /// true = skip formats on export; false = write complete formatted string. - bool mbWrapped; /// true = text contains several paragraphs. -+ bool mbSkipHeader; /// ture = skip length and flags when writing string bytes. - }; - - inline bool operator==( const XclExpString& rLeft, const XclExpString& rRight ) -diff --git sc/source/filter/inc/xipivot.hxx sc/source/filter/inc/xipivot.hxx -index 365ea53..813963c 100644 ---- sc/source/filter/inc/xipivot.hxx -+++ sc/source/filter/inc/xipivot.hxx -@@ -186,6 +186,8 @@ public: - /** Reads the entire pivot cache stream. Uses decrypter from passed stream. */ - void ReadPivotCacheStream( XclImpStream& rStrm ); - -+ bool IsRefreshOnLoad() const; -+ - private: - typedef ::std::vector< XclImpPCFieldRef > XclImpPCFieldVec; - -@@ -359,6 +361,8 @@ public: - /** Inserts the pivot table into the Calc document. */ - void Convert(); - -+ void MaybeRefresh(); -+ - // ------------------------------------------------------------------------ - private: - typedef ::std::vector< XclImpPTFieldRef > XclImpPTFieldVec; -@@ -367,7 +371,7 @@ private: - - XclPTInfo maPTInfo; /// General info about the pivot table (SXVIEW record). - XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). -- XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SX_AUTOFORMAT) -+ XclPTViewEx9Info maPTViewEx9Info; /// (SXVIEWEX9 record) - XclImpPTFieldVec maFields; /// Vector containing all fields. - XclImpPTFieldRef mxCurrField; /// Current field for importing additional info. - ScfStringVec maVisFieldNames; /// Vector containing all visible field names. -@@ -378,6 +382,7 @@ private: - ScfUInt16Vec maFiltDataFields; /// Filtered data field indexes. - XclImpPTField maDataOrientField; /// Special data field orientation field. - ScRange maOutScRange; /// Output range in the Calc document. -+ ScDPObject* mpDPObj; - }; - - typedef ScfRef< XclImpPivotTable > XclImpPivotTableRef; -@@ -437,6 +442,8 @@ public: - /** Inserts all pivot tables into the Calc document. */ - void ConvertPivotTables(); - -+ void MaybeRefreshPivotTables(); -+ - private: - typedef ::std::vector< XclImpPivotCacheRef > XclImpPivotCacheVec; - typedef ::std::vector< XclImpPivotTableRef > XclImpPivotTableVec; -diff --git sc/source/filter/inc/xlpivot.hxx sc/source/filter/inc/xlpivot.hxx -index 5b88882..8b5bd4e 100644 ---- sc/source/filter/inc/xlpivot.hxx -+++ sc/source/filter/inc/xlpivot.hxx -@@ -43,6 +43,8 @@ - #include "xladdress.hxx" - #include "dpobject.hxx" - -+#include -+ - class XclImpStream; - class XclExpStream; - -@@ -671,6 +673,8 @@ struct XclPTFieldExtInfo - sal_uInt32 mnFlags; /// Several flags and number of items for AutoShow. - sal_uInt16 mnSortField; /// Index to data field sorting bases on. - sal_uInt16 mnShowField; /// Index to data field AutoShow bases on. -+ sal_uInt16 mnNumFmt; -+ ::std::auto_ptr mpFieldTotalName; - - explicit XclPTFieldExtInfo(); - -@@ -796,19 +800,20 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ); - - // Pivot table autoformat settings ============================================== - --/** Pivot table autoformat settings (SX_AUTOFORMAT record). */ --struct XclPTAutoFormat -+/** Pivot table autoformat settings (SXVIEWEX9 record). */ -+struct XclPTViewEx9Info - { - sal_uInt32 mbReport; /// 2 for report* fmts ? - sal_uInt8 mnAutoFormat; /// AutoFormat ID - sal_uInt8 mnGridLayout; /// 0 == gridlayout, 0x10 == modern -+ String maGrandTotalName; - -- explicit XclPTAutoFormat(); -+ explicit XclPTViewEx9Info(); - void Init( const ScDPObject& rDPObj ); - }; - --XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ); --XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ); -+XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ); -+XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ); - - // ============================================================================ - #endif -diff --git sc/source/filter/inc/xlstring.hxx sc/source/filter/inc/xlstring.hxx -index 0b30049..89f8275 100644 ---- sc/source/filter/inc/xlstring.hxx -+++ sc/source/filter/inc/xlstring.hxx -@@ -43,6 +43,7 @@ const XclStrFlags EXC_STR_FORCEUNICODE = 0x0001; /// Always use UCS-2 cha - const XclStrFlags EXC_STR_8BITLENGTH = 0x0002; /// 8-bit string length field (default: 16-bit). - const XclStrFlags EXC_STR_SMARTFLAGS = 0x0004; /// Omit flags on empty string (default: read/write always). BIFF8 only. - const XclStrFlags EXC_STR_SEPARATEFORMATS = 0x0008; /// Import: Keep old formats when reading unformatted string (default: clear formats); Export: Write unformatted string. -+const XclStrFlags EXC_STR_NOHEADER = 0x0010; /// Export: Don't write the length and flag fields. - - // ---------------------------------------------------------------------------- - -diff --git sc/source/ui/dbgui/pvfundlg.cxx sc/source/ui/dbgui/pvfundlg.cxx -index 6dc4551..880a14b 100644 ---- sc/source/ui/dbgui/pvfundlg.cxx -+++ sc/source/ui/dbgui/pvfundlg.cxx -@@ -705,7 +705,9 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR - maLbDims ( this, ScResId( LB_DIMS ) ), - maBtnOk ( this, ScResId( BTN_OK ) ), - maBtnCancel ( this, ScResId( BTN_CANCEL ) ), -- maBtnHelp ( this, ScResId( BTN_HELP ) ) -+ maBtnHelp ( this, ScResId( BTN_HELP ) ), -+ -+ mrDPObj(rDPObj) - { - FreeResource(); - -@@ -719,7 +721,13 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR - { - const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : 0; - if ( !pDimension || (pDimension->GetOrientation() != nOrient) ) -+ { -+ const OUString* pLayoutName = pDimension->GetLayoutName(); -+ if (pLayoutName) -+ aName = *pLayoutName; - maLbDims.InsertEntry( aName ); -+ maNameIndexMap.insert(DimNameIndexMap::value_type(aName, nDim)); -+ } - } - } - if( maLbDims.GetEntryCount() ) -@@ -735,7 +743,17 @@ short ScDPShowDetailDlg::Execute() - - String ScDPShowDetailDlg::GetDimensionName() const - { -- return maLbDims.GetSelectEntry(); -+ // Look up the internal dimension name which may be different from the -+ // displayed field name. -+ String aSelectedName = maLbDims.GetSelectEntry(); -+ DimNameIndexMap::const_iterator itr = maNameIndexMap.find(aSelectedName); -+ if (itr == maNameIndexMap.end()) -+ // This should never happen! -+ return aSelectedName; -+ -+ long nDim = itr->second; -+ BOOL bIsDataLayout = false; -+ return mrDPObj.GetDimName(nDim, bIsDataLayout); - } - - IMPL_LINK( ScDPShowDetailDlg, DblClickHdl, ListBox*, pLBox ) -diff --git sc/source/ui/dbgui/pvlaydlg.cxx sc/source/ui/dbgui/pvlaydlg.cxx -index bedf6c3..4dee615 100644 ---- sc/source/ui/dbgui/pvlaydlg.cxx -+++ sc/source/ui/dbgui/pvlaydlg.cxx -@@ -63,6 +63,7 @@ - #include "sc.hrc" //CHINA001 - #include "scabstdlg.hxx" //CHINA001 - using namespace com::sun::star; -+using ::rtl::OUString; - - //---------------------------------------------------------------------------- - -@@ -1506,6 +1507,8 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) - nPageCount, nColCount, nRowCount, nDataCount ); - if ( bFit ) - { -+ ScDPSaveData* pOldSaveData = xDlgDPObject->GetSaveData(); -+ - ScRange aOutRange( aAdrDest ); // bToNewTable is passed separately - - ScDPSaveData aSaveData; -@@ -1537,6 +1540,22 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) - pDim->SetSortInfo( &aIt->maSortInfo ); - pDim->SetLayoutInfo( &aIt->maLayoutInfo ); - pDim->SetAutoShowInfo( &aIt->maShowInfo ); -+ ScDPSaveDimension* pOldDim = NULL; -+ if (pOldSaveData) -+ { -+ // Transfer the existing layout names to new dimension instance. -+ pOldDim = pOldSaveData->GetExistingDimensionByName(aIt->maName); -+ if (pOldDim) -+ { -+ const OUString* pLayoutName = pOldDim->GetLayoutName(); -+ if (pLayoutName) -+ pDim->SetLayoutName(*pLayoutName); -+ -+ const OUString* pSubtotalName = pOldDim->GetSubtotalName(); -+ if (pSubtotalName) -+ pDim->SetSubtotalName(*pSubtotalName); -+ } -+ } - - bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL ); - -@@ -1557,11 +1576,33 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) - ScDPSaveMember* pMember = pDim->GetMemberByName( *pItem ); - pMember->SetIsVisible( bIsVisible ); - pMember->SetShowDetails( bShowDetails ); -+ if (pOldDim) -+ { -+ // Transfer the existing layout name. -+ ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(*pItem); -+ if (pOldMember) -+ { -+ const OUString* pLayoutName = pOldMember->GetLayoutName(); -+ if (pLayoutName) -+ pMember->SetLayoutName(*pLayoutName); -+ } -+ } - } - } - } - } - } -+ ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension(); -+ if (pDim && pOldSaveData) -+ { -+ ScDPSaveDimension* pOldDim = pOldSaveData->GetDataLayoutDimension(); -+ if (pOldDim) -+ { -+ const OUString* pLayoutName = pOldDim->GetLayoutName(); -+ if (pLayoutName) -+ pDim->SetLayoutName(*pLayoutName); -+ } -+ } - - USHORT nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE ); - ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable ); -diff --git sc/source/ui/inc/pvfundlg.hxx sc/source/ui/inc/pvfundlg.hxx -index 804f162..1707cd6 100644 ---- sc/source/ui/inc/pvfundlg.hxx -+++ sc/source/ui/inc/pvfundlg.hxx -@@ -55,6 +55,8 @@ - #include - #include "pivot.hxx" - -+#include -+ - // ============================================================================ - - typedef sfx::ListBoxWrapper< sal_Int32 > ScDPListBoxWrapper; -@@ -217,6 +219,11 @@ public: - - virtual short Execute(); - -+ /** -+ * @return String internal name of the selected field. Note that this may -+ * be different from the name displayed in the dialog if the field -+ * has a layout name. -+ */ - String GetDimensionName() const; - - private: -@@ -228,6 +235,10 @@ private: - OKButton maBtnOk; - CancelButton maBtnCancel; - HelpButton maBtnHelp; -+ -+ typedef ::std::hash_map DimNameIndexMap; -+ DimNameIndexMap maNameIndexMap; -+ ScDPObject& mrDPObj; - }; - - // ============================================================================ ---- sc/source/ui/unoobj/dapiuno.cxx -+++ sc/source/ui/unoobj/dapiuno.cxx -@@ -1605,6 +1605,10 @@ rtl::OUString SAL_CALL ScDataPilotFieldObj::getName() throw(uno::RuntimeExceptio - if( pDim->IsDataLayout() ) - aName = OUString( RTL_CONSTASCII_USTRINGPARAM( SC_DATALAYOUT_NAME ) ); - else -- aName = pDim->GetLayoutName(); -+ { -+ aName = pDim->GetLayoutName(); -+ if (!aName) -+ aName = pDim->GetName(); -+ } - } - return aName; -@@ -1625,7 +1631,7 @@ void SAL_CALL ScDataPilotFieldObj::setName( const rtl::OUString& aNewName ) - if( pDim && !pDim->IsDataLayout() ) - { - String aName( rName ); -- pDim->SetLayoutName( &aName ); -+ pDim->SetLayoutName( aName ); - SetDPObject( pDPObj ); - } - } -diff --git sc/source/ui/view/dbfunc3.cxx sc/source/ui/view/dbfunc3.cxx -index 3e5a627..df92a5e 100644 ---- sc/source/ui/view/dbfunc3.cxx -+++ sc/source/ui/view/dbfunc3.cxx -@@ -91,6 +91,10 @@ using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::beans::XPropertySet; -+using ::com::sun::star::container::XNameAccess; -+using ::com::sun::star::sheet::XDimensionsSupplier; -+using ::rtl::OUString; -+using ::rtl::OUStringBuffer; - using ::std::auto_ptr; - - // STATIC DATA ----------------------------------------------------------- -@@ -1377,123 +1381,304 @@ void ScDBFunc::UngroupDataPilot() - } - } - -+OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUString& rMemberName) -+{ -+ sal_Int32 n = rSubtotal.getLength(); -+ const sal_Unicode* p = rSubtotal.getStr(); -+ OUStringBuffer aBuf, aWordBuf; -+ for (sal_Int32 i = 0; i < n; ++i) -+ { -+ sal_Unicode c = p[i]; -+ if (c == sal_Unicode(' ')) -+ { -+ OUString aWord = aWordBuf.makeStringAndClear(); -+ if (aWord.equals(rMemberName)) -+ aBuf.append(sal_Unicode('?')); -+ else -+ aBuf.append(aWord); -+ aBuf.append(c); -+ } -+ else -+ aWordBuf.append(c); -+ } -+ -+ if (aWordBuf.getLength() > 0) -+ { -+ OUString aWord = aWordBuf.makeStringAndClear(); -+ if (aWord.equals(rMemberName)) -+ aBuf.append(sal_Unicode('?')); -+ else -+ aBuf.append(aWord); -+ } -+ -+ return aBuf.makeStringAndClear(); -+} -+ - void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString ) - { -+ using namespace ::com::sun::star::sheet; -+ - String aNewName( rString ); - - ScDocument* pDoc = GetViewData()->GetDocument(); - ScDPObject* pDPObj = pDoc->GetDPAtCursor( rPos.Col(), rPos.Row(), rPos.Tab() ); -- if ( pDPObj ) -+ if (!pDPObj) -+ return; -+ -+ String aOldText; -+ pDoc->GetString( rPos.Col(), rPos.Row(), rPos.Tab(), aOldText ); -+ -+ if ( aOldText == rString ) - { -- String aOldText; -- pDoc->GetString( rPos.Col(), rPos.Row(), rPos.Tab(), aOldText ); -+ // nothing to do: silently exit -+ return; -+ } - -- if ( aOldText == rString ) -+ USHORT nErrorId = 0; -+ -+ pDPObj->BuildAllDimensionMembers(); -+ ScDPSaveData aData( *pDPObj->GetSaveData() ); -+ BOOL bChange = FALSE; -+ -+ USHORT nOrient = DataPilotFieldOrientation_HIDDEN; -+ long nField = pDPObj->GetHeaderDim( rPos, nOrient ); -+ if ( nField >= 0 ) -+ { -+ // changing a field title -+ if ( aData.GetExistingDimensionData() ) - { -- // nothing to do: silently exit -- return; -- } -+ // only group dimensions can be renamed - -- USHORT nErrorId = 0; -+ ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); -+ ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aOldText ); -+ if ( pGroupDim ) -+ { -+ // valid name: not empty, no existing dimension (group or other) -+ if ( rString.Len() && !pDPObj->IsDimNameInUse(rString) ) -+ { -+ pGroupDim->Rename( aNewName ); - -- ScDPSaveData aData( *pDPObj->GetSaveData() ); -- BOOL bChange = FALSE; -+ // also rename in SaveData to preserve the field settings -+ ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aOldText ); -+ pSaveDim->SetName( aNewName ); - -- USHORT nOrient = sheet::DataPilotFieldOrientation_HIDDEN; -- long nField = pDPObj->GetHeaderDim( rPos, nOrient ); -- if ( nField >= 0 ) -+ bChange = TRUE; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } -+ } -+ else if (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW) - { -- // changing a field title -+ BOOL bDataLayout = false; -+ String aDimName = pDPObj->GetDimName(nField, bDataLayout); -+ ScDPSaveDimension* pDim = bDataLayout ? aData.GetDataLayoutDimension() : aData.GetDimensionByName(aDimName); -+ if (pDim) -+ { -+ if (rString.Len()) -+ { -+ if (rString.EqualsIgnoreCaseAscii(aDimName)) -+ { -+ pDim->RemoveLayoutName(); -+ bChange = true; -+ } -+ else if (!pDPObj->IsDimNameInUse(rString)) -+ { -+ pDim->SetLayoutName(rString); -+ bChange = true; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } -+ } -+ } -+ else if (pDPObj->IsDataDescriptionCell(rPos)) -+ { -+ // There is only one data dimension. -+ ScDPSaveDimension* pDim = aData.GetFirstDimension(sheet::DataPilotFieldOrientation_DATA); -+ if (pDim) -+ { -+ if (rString.Len()) -+ { -+ if (rString.EqualsIgnoreCaseAscii(pDim->GetName())) -+ { -+ pDim->RemoveLayoutName(); -+ bChange = true; -+ } -+ else if (!pDPObj->IsDimNameInUse(rString)) -+ { -+ pDim->SetLayoutName(rString); -+ bChange = true; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } -+ } -+ else -+ { -+ // This is not a field header. -+ sheet::DataPilotTableHeaderData aPosData; -+ pDPObj->GetHeaderPositionData(rPos, aPosData); - -- if ( aData.GetExistingDimensionData() ) -+ if ( (aPosData.Flags & MemberResultFlags::HASMEMBER) && aOldText.Len() ) -+ { -+ if ( aData.GetExistingDimensionData() && !(aPosData.Flags & MemberResultFlags::SUBTOTAL)) - { -- // only group dimensions can be renamed -+ BOOL bIsDataLayout; -+ String aDimName = pDPObj->GetDimName( aPosData.Dimension, bIsDataLayout ); - - ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); -- ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aOldText ); -+ ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName ); - if ( pGroupDim ) - { -- // valid name: not empty, no existing dimension (group or other) -- if ( aNewName.Len() && !pDPObj->IsDimNameInUse( aNewName ) ) -+ // valid name: not empty, no existing group in this dimension -+ //! ignore case? -+ if ( aNewName.Len() && !pGroupDim->GetNamedGroup( aNewName ) ) - { -- pGroupDim->Rename( aNewName ); -+ ScDPSaveGroupItem* pGroup = pGroupDim->GetNamedGroupAcc( aOldText ); -+ if ( pGroup ) -+ pGroup->Rename( aNewName ); // rename the existing group -+ else -+ { -+ // create a new group to replace the automatic group -+ ScDPSaveGroupItem aGroup( aNewName ); -+ aGroup.AddElement( aOldText ); -+ pGroupDim->AddGroupItem( aGroup ); -+ } - -- // also rename in SaveData to preserve the field settings -- ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aOldText ); -- pSaveDim->SetName( aNewName ); -+ // in both cases also adjust savedata, to preserve member settings (show details) -+ ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aDimName ); -+ ScDPSaveMember* pSaveMember = pSaveDim->GetExistingMemberByName( aOldText ); -+ if ( pSaveMember ) -+ pSaveMember->SetName( aNewName ); - - bChange = TRUE; - } - else - nErrorId = STR_INVALIDNAME; -- } -+ } - } -- } -- else -- { -- // renaming a group (item)? -- // allow only on the item name itself - not on empty cells, not on subtotals -- -- sheet::DataPilotTableHeaderData aPosData; -- pDPObj->GetHeaderPositionData(rPos, aPosData); -- if ( ( aPosData.Flags & sheet::MemberResultFlags::HASMEMBER ) && -- ! ( aPosData.Flags & sheet::MemberResultFlags::SUBTOTAL ) && -- aOldText.Len() ) -+ else if ((aPosData.Flags & MemberResultFlags::GRANDTOTAL)) - { -- if ( aData.GetExistingDimensionData() ) -+ aData.SetGrandTotalName(rString); -+ bChange = true; -+ } -+ else if (aPosData.Dimension >= 0 && aPosData.MemberName.getLength() > 0) -+ { -+ BOOL bDataLayout = false; -+ String aDimName = pDPObj->GetDimName(static_cast(aPosData.Dimension), bDataLayout); -+ if (bDataLayout) - { -- BOOL bIsDataLayout; -- String aDimName = pDPObj->GetDimName( aPosData.Dimension, bIsDataLayout ); -+ // data dimension -+ do -+ { -+ if ((aPosData.Flags & MemberResultFlags::SUBTOTAL)) -+ break; -+ -+ ScDPSaveDimension* pDim = aData.GetDimensionByName(aPosData.MemberName); -+ if (!pDim) -+ break; - -- ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); -- ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName ); -- if ( pGroupDim ) -+ if (!rString.Len()) -+ { -+ nErrorId = STR_INVALIDNAME; -+ break; -+ } -+ -+ if (aPosData.MemberName.equalsIgnoreAsciiCase(rString)) -+ { -+ pDim->RemoveLayoutName(); -+ bChange = true; -+ } -+ else if (!pDPObj->IsDimNameInUse(rString)) -+ { -+ pDim->SetLayoutName(rString); -+ bChange = true; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } -+ while (false); -+ } -+ else -+ { -+ // field member -+ do - { -- // valid name: not empty, no existing group in this dimension -- //! ignore case? -- if ( aNewName.Len() && !pGroupDim->GetNamedGroup( aNewName ) ) -+ ScDPSaveDimension* pDim = aData.GetDimensionByName(aDimName); -+ if (!pDim) -+ break; -+ -+ ScDPSaveMember* pMem = pDim->GetExistingMemberByName(aPosData.MemberName); -+ if (!pMem) -+ break; -+ -+ if ((aPosData.Flags & MemberResultFlags::SUBTOTAL)) - { -- ScDPSaveGroupItem* pGroup = pGroupDim->GetNamedGroupAcc( aOldText ); -- if ( pGroup ) -- pGroup->Rename( aNewName ); // rename the existing group -+ // Change subtotal only when the table has one data dimension. -+ if (aData.GetDataDimensionCount() > 1) -+ break; -+ -+ const OUString* pLayoutName = pMem->GetLayoutName(); -+ String aMemberName; -+ if (pLayoutName) -+ aMemberName = *pLayoutName; - else -- { -- // create a new group to replace the automatic group -- ScDPSaveGroupItem aGroup( aNewName ); -- aGroup.AddElement( aOldText ); -- pGroupDim->AddGroupItem( aGroup ); -- } -+ aMemberName = aPosData.MemberName; - -- // in both cases also adjust savedata, to preserve member settings (show details) -- ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aDimName ); -- ScDPSaveMember* pSaveMember = pSaveDim->GetExistingMemberByName( aOldText ); -- if ( pSaveMember ) -- pSaveMember->SetName( aNewName ); -- -- bChange = TRUE; -+ String aNew = lcl_replaceMemberNameInSubtotal(rString, aMemberName); -+ pDim->SetSubtotalName(aNew); -+ bChange = true; - } - else -- nErrorId = STR_INVALIDNAME; -+ { -+ // Check to make sure the member name isn't -+ // already used. -+ if (rString.Len()) -+ { -+ if (rString.EqualsIgnoreCaseAscii(pMem->GetName())) -+ { -+ pMem->RemoveLayoutName(); -+ bChange = true; -+ } -+ else if (!pDim->IsMemberNameInUse(rString)) -+ { -+ pMem->SetLayoutName(rString); -+ bChange = true; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } -+ else -+ nErrorId = STR_INVALIDNAME; -+ } - } -+ while (false); - } - } - } -+ } - -- if ( bChange ) -- { -- // apply changes -- ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); -- ScDPObject* pNewObj = new ScDPObject( *pDPObj ); -- pNewObj->SetSaveData( aData ); -- aFunc.DataPilotUpdate( pDPObj, pNewObj, TRUE, FALSE ); -- delete pNewObj; -- } -- else -- { -- if ( !nErrorId ) -- nErrorId = STR_ERR_DATAPILOT_INPUT; -- ErrorMessage( nErrorId ); -- } -+ if ( bChange ) -+ { -+ // apply changes -+ ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); -+ ScDPObject* pNewObj = new ScDPObject( *pDPObj ); -+ pNewObj->SetSaveData( aData ); -+ aFunc.DataPilotUpdate( pDPObj, pNewObj, TRUE, FALSE ); -+ delete pNewObj; -+ } -+ else -+ { -+ if ( !nErrorId ) -+ nErrorId = STR_ERR_DATAPILOT_INPUT; -+ ErrorMessage( nErrorId ); - } - } - diff --git a/applied_patches/0432-calc-formula-variable-separators-officecfg.diff b/applied_patches/0154-calc-formula-variable-separators-officecfg.diff similarity index 100% rename from applied_patches/0432-calc-formula-variable-separators-officecfg.diff rename to applied_patches/0154-calc-formula-variable-separators-officecfg.diff diff --git a/applied_patches/0155-calc-dp-custom-names-sc-win32-fix.diff b/applied_patches/0155-calc-dp-custom-names-sc-win32-fix.diff deleted file mode 100644 index 5953bf6c4..000000000 --- a/applied_patches/0155-calc-dp-custom-names-sc-win32-fix.diff +++ /dev/null @@ -1,130 +0,0 @@ -diff --git sc/inc/dpgroup.hxx sc/inc/dpgroup.hxx -index 0aab7c8..e98a248 100644 ---- sc/inc/dpgroup.hxx -+++ sc/inc/dpgroup.hxx -@@ -33,6 +33,7 @@ - - #include - #include -+#include - - #include "dptabdat.hxx" - #include "scdllapi.h" -@@ -183,7 +183,7 @@ class ScDPGroupTableData : public ScDPTableData - { - typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > StringHashSet; - -- ScDPTableData* pSourceData; -+ ::boost::shared_ptr pSourceData; - long nSourceCount; - ScDPGroupDimensionVec aGroups; - ScDPNumGroupDimension* pNumGroups; // array[nSourceCount] -@@ -201,7 +201,7 @@ class ScDPGroupTableData : public ScDPTableData - - public: - // takes ownership of pSource -- ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ); -+ ScDPGroupTableData( const ::boost::shared_ptr& pSource, ScDocument* pDocument ); - virtual ~ScDPGroupTableData(); - - void AddGroupDimension( const ScDPGroupDimension& rGroup ); -diff --git sc/inc/dpobject.hxx sc/inc/dpobject.hxx -index 854e1da..503c531 100644 ---- sc/inc/dpobject.hxx -+++ sc/inc/dpobject.hxx -@@ -38,7 +38,7 @@ - #include "dpoutput.hxx" - #include - --#include -+#include - - //------------------------------------------------------------------ - -@@ -104,7 +104,7 @@ private: - ScSheetSourceDesc* pSheetDesc; // for sheet data - ScImportSourceDesc* pImpDesc; // for database data - ScDPServiceDesc* pServDesc; // for external service -- ::std::auto_ptr mpTableData; -+ ::boost::shared_ptr mpTableData; - // cached data - com::sun::star::uno::Reference xSource; - ScDPOutput* pOutput; -diff --git sc/source/core/data/dpgroup.cxx sc/source/core/data/dpgroup.cxx -index 8b4bb57..cbb03ba 100644 ---- sc/source/core/data/dpgroup.cxx -+++ sc/source/core/data/dpgroup.cxx -@@ -70,6 +70,7 @@ using ::rtl::OUStringHash; - using ::std::vector; - using ::std::hash_set; - using ::std::hash_map; -+using ::boost::shared_ptr; - - #define D_TIMEFACTOR 86400.0 - -@@ -978,7 +978,7 @@ String lcl_GetNumGroupForValue( double fValue, const ScDPNumGroupInfo& rInfo, bo - return lcl_GetNumGroupName( fGroupStart, rInfo, bHasNonInteger, cDecSeparator, pFormatter ); - } - --ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ) : -+ScDPGroupTableData::ScDPGroupTableData( const shared_ptr& pSource, ScDocument* pDocument ) : - ScDPTableData(pDocument), - pSourceData( pSource ), - pDoc( pDocument ) -@@ -993,7 +993,6 @@ ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDoc - ScDPGroupTableData::~ScDPGroupTableData() - { - delete[] pNumGroups; -- delete pSourceData; - } - - void ScDPGroupTableData::AddGroupDimension( const ScDPGroupDimension& rGroup ) -diff --git sc/source/core/data/dpobject.cxx sc/source/core/data/dpobject.cxx -index 7e977f0..cd4dcd1 100644 ---- sc/source/core/data/dpobject.cxx -+++ sc/source/core/data/dpobject.cxx -@@ -78,7 +78,7 @@ - - using namespace com::sun::star; - using ::std::vector; --using ::std::auto_ptr; -+using ::boost::shared_ptr; - using ::com::sun::star::uno::Sequence; - using ::com::sun::star::uno::Reference; - using ::com::sun::star::uno::UNO_QUERY; -@@ -163,7 +163,7 @@ ScDPObject::ScDPObject( ScDocument* pD ) : - pSheetDesc( NULL ), - pImpDesc( NULL ), - pServDesc( NULL ), -- mpTableData(NULL), -+ mpTableData(static_cast(NULL)), - pOutput( NULL ), - nAutoFormatIndex( 65535 ), - bSettingsChanged( FALSE ), -@@ -186,7 +186,7 @@ ScDPObject::ScDPObject(const ScDPObject& r) : - pSheetDesc( NULL ), - pImpDesc( NULL ), - pServDesc( NULL ), -- mpTableData(NULL), -+ mpTableData(static_cast(NULL)), - pOutput( NULL ), - bSettingsChanged( FALSE ), - bAlive( FALSE ), -@@ -414,7 +414,7 @@ void ScDPObject::CreateOutput() - - ScDPTableData* ScDPObject::GetTableData() - { -- if (!mpTableData.get()) -+ if (!mpTableData) - { - if ( pImpDesc ) - { -@@ -435,7 +435,7 @@ ScDPTableData* ScDPObject::GetTableData() - // grouping (for cell or database data) - if ( pSaveData && pSaveData->GetExistingDimensionData() ) - { -- auto_ptr pGroupData(new ScDPGroupTableData(mpTableData.release(), pDoc)); -+ shared_ptr pGroupData(new ScDPGroupTableData(mpTableData, pDoc)); - pSaveData->GetExistingDimensionData()->WriteToData(*pGroupData); - mpTableData = pGroupData; - } diff --git a/applied_patches/0433-chart-subtitle-xls-export.diff b/applied_patches/0155-chart-subtitle-xls-export.diff similarity index 100% rename from applied_patches/0433-chart-subtitle-xls-export.diff rename to applied_patches/0155-chart-subtitle-xls-export.diff diff --git a/applied_patches/0156-calc-dp-custom-names-sc-group-fix.diff b/applied_patches/0156-calc-dp-custom-names-sc-group-fix.diff deleted file mode 100644 index 892f66cd8..000000000 --- a/applied_patches/0156-calc-dp-custom-names-sc-group-fix.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- sc/source/core/data/dpobject.cxx -+++ sc/source/core/data/dpobject.cxx -@@ -448,7 +448,7 @@ void ScDPObject::CreateObjects() - { - // if groups are involved, create a new source with the ScDPGroupTableData - if ( bSettingsChanged && pSaveData && pSaveData->GetExistingDimensionData() ) -- xSource = NULL; -+ InvalidateSource(); - - if (!xSource.is()) - { -@@ -501,6 +501,7 @@ void ScDPObject::InvalidateSource() - void ScDPObject::InvalidateSource() - { - xSource = NULL; -+ mpTableData.reset(); - } - - ScRange ScDPObject::GetNewOutputRange( BOOL& rOverflow ) diff --git a/applied_patches/0434-calc-external-defined-names-enable.diff b/applied_patches/0156-calc-external-defined-names-enable.diff similarity index 100% rename from applied_patches/0434-calc-external-defined-names-enable.diff rename to applied_patches/0156-calc-external-defined-names-enable.diff diff --git a/applied_patches/0157-calc-dp-default-new-sheet.diff b/applied_patches/0157-calc-dp-default-new-sheet.diff deleted file mode 100644 index d099e530e..000000000 --- a/applied_patches/0157-calc-dp-default-new-sheet.diff +++ /dev/null @@ -1,121 +0,0 @@ -diff --git sc/source/ui/dbgui/pvlaydlg.cxx sc/source/ui/dbgui/pvlaydlg.cxx -index 99897a0..4dee615 100644 ---- sc/source/ui/dbgui/pvlaydlg.cxx -+++ sc/source/ui/dbgui/pvlaydlg.cxx -@@ -107,7 +107,7 @@ PointerStyle lclGetPointerForField( ScDPFieldType eType ) - //---------------------------------------------------------------------------- - - ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, -- const ScDPObject& rDPObject ) -+ const ScDPObject& rDPObject, bool bNewOutput ) - : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ), - aFlLayout ( this, ScResId( FL_LAYOUT ) ), - aFtPage ( this, ScResId( FT_PAGE ) ), -@@ -167,7 +167,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar - xDlgDPObject->FillOldParam( thePivotData, FALSE ); - xDlgDPObject->FillLabelData( thePivotData ); - -- Init(); -+ Init(bNewOutput); - FreeResource(); - } - -@@ -202,7 +202,7 @@ ScDPFieldWindow& ScDPLayoutDlg::GetFieldWindow( ScDPFieldType eType ) - return aWndSelect; - } - --void __EXPORT ScDPLayoutDlg::Init() -+void __EXPORT ScDPLayoutDlg::Init(bool bNewOutput) - { - DBG_ASSERT( pViewData && pDoc, - "Ctor-Initialisierung fehlgeschlagen!" ); -@@ -302,21 +302,33 @@ void __EXPORT ScDPLayoutDlg::Init() - } - } - } -+ -+ if (bNewOutput) -+ { -+ // Output to a new sheet by default for a brand-new output. -+ aLbOutPos.SelectEntryPos(1); -+ aEdOutPos.Disable(); -+ aRbOutPos.Disable(); -+ } -+ else -+ { -+ // Modifying an existing dp output. - -- if ( thePivotData.nTab != MAXTAB+1 ) -- { -- String aStr; -- ScAddress( thePivotData.nCol, -- thePivotData.nRow, -- thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); -- aEdOutPos.SetText( aStr ); -- EdModifyHdl(0); -- } -- else -- { -- aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 ); -- SelAreaHdl(NULL); -- } -+ if ( thePivotData.nTab != MAXTAB+1 ) -+ { -+ String aStr; -+ ScAddress( thePivotData.nCol, -+ thePivotData.nRow, -+ thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); -+ aEdOutPos.SetText( aStr ); -+ EdModifyHdl(0); -+ } -+ else -+ { -+ aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 ); -+ SelAreaHdl(NULL); -+ } -+ } - - aBtnIgnEmptyRows.Check( thePivotData.bIgnoreEmptyRows ); - aBtnDetectCat .Check( thePivotData.bDetectCategories ); -diff --git sc/source/ui/inc/pvlaydlg.hxx sc/source/ui/inc/pvlaydlg.hxx -index ceebdb7..a3e08cb 100644 ---- sc/source/ui/inc/pvlaydlg.hxx -+++ sc/source/ui/inc/pvlaydlg.hxx -@@ -89,7 +89,8 @@ public: - SfxBindings* pB, - SfxChildWindow* pCW, - Window* pParent, -- const ScDPObject& rDPObject ); -+ const ScDPObject& rDPObject, -+ bool bNewOutput ); - virtual ~ScDPLayoutDlg(); - - virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); -@@ -190,7 +191,7 @@ private: - - private: - ScDPFieldWindow& GetFieldWindow ( ScDPFieldType eType ); -- void Init (); -+ void Init (bool bNewOutput); - void InitWndSelect ( LabelData** ppLabelArr, long nLabels ); - void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType ); - void InitFocus (); -diff --git sc/source/ui/view/tabvwshc.cxx sc/source/ui/view/tabvwshc.cxx -index aa38b7a..b20876f 100644 ---- sc/source/ui/view/tabvwshc.cxx -+++ sc/source/ui/view/tabvwshc.cxx -@@ -255,8 +255,13 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( - - if( pDialogDPObject ) - { -+ // Check for an existing datapilot output. -+ ScViewData* pViewData = GetViewData(); -+ ScDPObject* pObj = GetViewData()->GetDocument()->GetDPAtCursor( -+ pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo()); -+ - GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() ); -- pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject ); -+ pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject, pObj == NULL); - } - } - break; diff --git a/applied_patches/0435-calc-xls-disable-adjust-row-height.diff b/applied_patches/0157-calc-xls-disable-adjust-row-height.diff similarity index 100% rename from applied_patches/0435-calc-xls-disable-adjust-row-height.diff rename to applied_patches/0157-calc-xls-disable-adjust-row-height.diff diff --git a/applied_patches/0436-calc-grammar-xls-english-offapi.diff b/applied_patches/0158-calc-grammar-xls-english-offapi.diff similarity index 100% rename from applied_patches/0436-calc-grammar-xls-english-offapi.diff rename to applied_patches/0158-calc-grammar-xls-english-offapi.diff diff --git a/applied_patches/0437-calc-grammar-xls-english-sc.diff b/applied_patches/0159-calc-grammar-xls-english-sc.diff similarity index 100% rename from applied_patches/0437-calc-grammar-xls-english-sc.diff rename to applied_patches/0159-calc-grammar-xls-english-sc.diff diff --git a/applied_patches/0159-fix-biffdumper.diff b/applied_patches/0159-fix-biffdumper.diff deleted file mode 100644 index 25bc8efed..000000000 --- a/applied_patches/0159-fix-biffdumper.diff +++ /dev/null @@ -1,161 +0,0 @@ -Index: sc/source/filter/inc/xistream.hxx -=================================================================== ---- sc/source/filter/inc/xistream.hxx (revision 264332) -+++ sc/source/filter/inc/xistream.hxx (working copy) -@@ -310,8 +310,7 @@ - /** Seeks to last position from user position stack. - @descr This position will be removed from the stack. */ - void PopPosition(); --//UNUSED2008-05 /** Removes last position from user position stack, but does not seek to it. */ --//UNUSED2008-05 void RejectPosition(); -+ void RejectPosition(); - - /** Stores current position. This position keeps valid in all records. */ - void StoreGlobalPosition(); -Index: sc/source/filter/excel/xistream.cxx -=================================================================== ---- sc/source/filter/excel/xistream.cxx (revision 264332) -+++ sc/source/filter/excel/xistream.cxx (working copy) -@@ -468,12 +468,12 @@ - } - } - --//UNUSED2008-05 void XclImpStream::RejectPosition() --//UNUSED2008-05 { --//UNUSED2008-05 DBG_ASSERT( !maPosStack.empty(), "XclImpStream::RejectPosition - stack empty" ); --//UNUSED2008-05 if( !maPosStack.empty() ) --//UNUSED2008-05 maPosStack.pop_back(); --//UNUSED2008-05 } -+void XclImpStream::RejectPosition() -+{ -+ DBG_ASSERT( !maPosStack.empty(), "XclImpStream::RejectPosition - stack empty" ); -+ if( !maPosStack.empty() ) -+ maPosStack.pop_back(); -+} - - void XclImpStream::StoreGlobalPosition() - { -Index: sc/source/filter/excel/biffdump.cxx -=================================================================== ---- sc/source/filter/excel/biffdump.cxx (revision 264332) -+++ sc/source/filter/excel/biffdump.cxx (working copy) -@@ -918,7 +918,7 @@ - - // XF type/parent - LINESTART(); -- ::extract_value( nTmp, nTypeProt, 4, 12 ); -+ nTmp = ::extract_value( nTypeProt, 4, 12 ); - ADDTEXT( "index=#" ); __AddDec( t, nXFCount++ ); - ADDTEXT( " type=" ); lcl_AddFlag( t, bCell, "cell", "style" ); - ADDTEXT( " parent-xf=#" ); __AddDec( t, nTmp ); -@@ -926,7 +926,7 @@ - - // attribute used flags - LINESTART(); -- ::extract_value( __nFlags, nMiscAttrib, 10, 6 ); -+ __nFlags = ::extract_value( nMiscAttrib, 10, 6 ); - if( !bCell ) __nFlags ^= 0x3F; // in style XFs a 0 means used - ADDTEXT( "used " ); STARTFLAG(); - ADDFLAG( EXC_XF_DIFF_VALFMT, "numfmt" ); -@@ -947,7 +947,7 @@ - - // alignment - LINESTART(); -- ::extract_value( nTmp, nAlign, 0, 3 ); -+ nTmp = ::extract_value( nAlign, 0, 3 ); - ADDTEXT( "hor-align=" ); __AddDec( t, nTmp ); - ADDTEXT( " (" ); - switch( nTmp ) -@@ -962,7 +962,7 @@ - case EXC_XF_HOR_DISTRIB: ADDTEXT( "distrib" ); break; - default: ADDTEXT( "!unknown!" ); - }; -- ::extract_value( nTmp, nAlign, 4, 3 ); -+ nTmp = ::extract_value( nAlign, 4, 3 ); - ADDTEXT( ") ver-align=" ); __AddDec( t, nTmp ); - ADDTEXT( " (" ); - switch( nTmp ) -@@ -978,7 +978,7 @@ - PRINT(); - - LINESTART(); -- ::extract_value( nTmp, nAlign, 8, 8 ); -+ nTmp = ::extract_value( nAlign, 8, 8 ); - ADDTEXT( "rotation=" ); __AddDec( t, nTmp ); - ADDTEXT( " (" ); - if( nTmp < 91 ) -@@ -989,10 +989,10 @@ - { ADDTEXT( "stacked" ); } - else - { ADDTEXT( "!unknown!" ); } -- ::extract_value( nTmp, nMiscAttrib, 0, 4 ); -+ nTmp = ::extract_value( nMiscAttrib, 0, 4 ); - ADDTEXT( ") indent=" ); __AddDec( t, nTmp ); - ADDTEXT( " shrink=" ); lcl_AddOnOff( t, ::get_flag( nMiscAttrib, EXC_XF8_SHRINK ) ); -- ::extract_value( nTmp, nMiscAttrib, 6, 2 ); -+ nTmp = ::extract_value( nMiscAttrib, 6, 2 ); - ADDTEXT( " text-dir=" ); __AddDec( t, nTmp ); - ADDTEXT( " (" ); - switch( nTmp ) -@@ -1007,39 +1007,39 @@ - - // border/area - LINESTART(); -- ::extract_value( nTmp, nBorder1, 0, 4 ); -+ nTmp = ::extract_value( nBorder1, 0, 4 ); - ADDTEXT( "left-line=" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nBorder1, 16, 7 ); -+ nTmp = ::extract_value( nBorder1, 16, 7 ); - ADDTEXT( " color=" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nBorder1, 4, 4 ); -+ nTmp = ::extract_value( nBorder1, 4, 4 ); - ADDTEXT( " right-line =" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nBorder1, 23, 7 ); -+ nTmp = ::extract_value( nBorder1, 23, 7 ); - ADDTEXT( " color=" ); __AddDec( t, nTmp ); - PRINT(); - LINESTART(); -- ::extract_value( nTmp, nBorder1, 8, 4 ); -+ nTmp = ::extract_value( nBorder1, 8, 4 ); - ADDTEXT( "top-line =" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nBorder2, 0, 7 ); -+ nTmp = ::extract_value( nBorder2, 0, 7 ); - ADDTEXT( " color=" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nBorder1, 12, 4 ); -+ nTmp = ::extract_value( nBorder1, 12, 4 ); - ADDTEXT( " bottom-line=" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nBorder2, 7, 7 ); -+ nTmp = ::extract_value( nBorder2, 7, 7 ); - ADDTEXT( " color=" ); __AddDec( t, nTmp ); - PRINT(); - LINESTART(); -- ::extract_value( nTmp, nBorder2, 21, 4 ); -+ nTmp = ::extract_value( nBorder2, 21, 4 ); - ADDTEXT( "diag-line=" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nBorder2, 14, 7 ); -+ nTmp = ::extract_value( nBorder2, 14, 7 ); - ADDTEXT( " color=" ); __AddDec( t, nTmp ); - ADDTEXT( " diag-tl-to-br=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, static_cast< sal_Size >( 0x40000000U ) ) ); - ADDTEXT( " diag-bl-to-tr=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, static_cast< sal_Size >( 0x80000000U ) ) ); - PRINT(); - LINESTART(); -- ::extract_value( nTmp, nBorder2, 26, 6 ); -+ nTmp = ::extract_value( nBorder2, 26, 6 ); - ADDTEXT( "area-pattern=" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nArea, 0, 7 ); -+ nTmp = ::extract_value( nArea, 0, 7 ); - ADDTEXT( " fore-color=" ); __AddDec( t, nTmp ); -- ::extract_value( nTmp, nArea, 7, 7 ); -+ nTmp = ::extract_value( nArea, 7, 7 ); - ADDTEXT( " back-color=" ); __AddDec( t, nTmp ); - PRINT(); - -@@ -7478,7 +7478,7 @@ - #define EXC_CTRLDUMP_PLAIN_STARTFLAG( text ) EXC_CTRLDUMP_PLAIN_STARTOPTFLAG( text, true, 0 ) - #define EXC_CTRLDUMP_STARTFLAG( text ) EXC_CTRLDUMP_STARTOPTFLAG( text, true, 0 ) - #define EXC_CTRLDUMP_ADDFLAG( flag, text ) { if( nFlags & (flag) ) t.Append( " " text ); } --#define EXC_CTRLDUMP_ADDFLAGVALUE( start, width, text ) { sal_uInt32 nValue; ::extract_value( nValue, nFlags, start, width ); t.Append( " " text "=" ); lclAppendDec( t, nValue ); } -+#define EXC_CTRLDUMP_ADDFLAGVALUE( start, width, text ) { sal_uInt32 nValue = ::extract_value( nFlags, start, width ); t.Append( " " text "=" ); lclAppendDec( t, nValue ); } - #define EXC_CTRLDUMP_ENDFLAG( reserved ) { if( nFlags & (reserved) ) { t.Append( " ?" ); lclAppendHex( t, static_cast< sal_uInt32 >( nFlags & (reserved) ) ); } EXC_CTRLDUMP_PRINT(); } - // read coordinates - #define EXC_CTRLDUMP_COORD2( text ) { EXC_CTRLDUMP_ALIGN_INSTRM( 4 ); EXC_CTRLDUMP_DEC2( text "-x" ); EXC_CTRLDUMP_DEC2( text "-y" ); } diff --git a/applied_patches/0160-calc-find-replace-empty-cells-sc.diff b/applied_patches/0160-calc-find-replace-empty-cells-sc.diff new file mode 100644 index 000000000..f78ad8b0b --- /dev/null +++ b/applied_patches/0160-calc-find-replace-empty-cells-sc.diff @@ -0,0 +1,371 @@ +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 3c62a56..0c45c64 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -702,6 +702,16 @@ private: + BOOL SearchAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark); + BOOL ReplaceAllStyle(const SvxSearchItem& rSearchItem, ScMarkData& rMark, + ScDocument* pUndoDoc); ++ bool SearchAndReplaceEmptyCells( ++ const SvxSearchItem& rSearchItem, ++ SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, ++ String& rUndoStr, ScDocument* pUndoDoc); ++ bool SearchRangeForEmptyCell(const ScRange& rRange, ++ const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, ++ String& rUndoStr, ScDocument* pUndoDoc); ++ bool SearchRangeForAllEmptyCells(const ScRange& rRange, ++ const SvxSearchItem& rSearchItem, ScMarkData& rMark, ++ String& rUndoStr, ScDocument* pUndoDoc); + + // benutzen globalen SortParam: + BOOL IsSorted(SCCOLROW nStart, SCCOLROW nEnd); +diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx +index cb9dd4a..5b94923 100644 +--- sc/source/core/data/column.cxx ++++ sc/source/core/data/column.cxx +@@ -1373,7 +1373,24 @@ void ScColumn::CopyToColumn(SCROW nRow1, SCROW nRow2, USHORT nFlags, BOOL bMarke + CloneCell( i, nFlags, *rColumn.pDocument, aDestPos ); + + if (pNew) +- rColumn.Insert(pItems[i].nRow, pNew); ++ { ++ // Special case to allow removing of cell instances. A ++ // string cell with empty content is used to indicate an ++ // empty cell. ++ if (pNew->GetCellType() == CELLTYPE_STRING) ++ { ++ String aStr; ++ static_cast(pNew)->GetString(aStr); ++ if (aStr.Len() == 0) ++ // A string cell with empty string. Delete the cell itself. ++ rColumn.Delete(pItems[i].nRow); ++ else ++ // non-empty string cell ++ rColumn.Insert(pItems[i].nRow, pNew); ++ } ++ else ++ rColumn.Insert(pItems[i].nRow, pNew); ++ } + } + } + } +diff --git sc/source/core/data/table6.cxx sc/source/core/data/table6.cxx +index 994596d..8d5ec0f 100644 +--- sc/source/core/data/table6.cxx ++++ sc/source/core/data/table6.cxx +@@ -52,6 +52,8 @@ + //-------------------------------------------------------------------------- + + ++using ::com::sun::star::util::SearchOptions; ++ + BOOL lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, String& rVal ) + { + // TRUE = more than 1 paragraph +@@ -660,6 +662,12 @@ BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, + com::sun::star::util::SearchOptions aSearchOptions = rSearchItem.GetSearchOptions(); + aSearchOptions.Locale = *ScGlobal::pLocale; + ++ if (!aSearchOptions.searchString.getLength()) ++ { ++ // Search for empty cells. ++ return SearchAndReplaceEmptyCells(rSearchItem, rCol, rRow, rMark, rUndoStr, pUndoDoc); ++ } ++ + // #107259# reflect UseAsianOptions flag in SearchOptions + // (use only ignore case and width if asian options are disabled). + // This is also done in SvxSearchDialog CommandHdl, but not in API object. +@@ -686,6 +694,274 @@ BOOL ScTable::SearchAndReplace(const SvxSearchItem& rSearchItem, + return bFound; + } + ++bool ScTable::SearchAndReplaceEmptyCells( ++ const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, ++ String& rUndoStr, ScDocument* pUndoDoc) ++{ ++ SCCOL nColStart, nColEnd; ++ SCROW nRowStart, nRowEnd; ++ GetFirstDataPos(nColStart, nRowStart); ++ GetLastDataPos(nColEnd, nRowEnd); ++ ++ ScRangeList aRanges; ++ aRanges.Append(ScRange(nColStart, nRowStart, nTab, nColEnd, nRowEnd, nTab)); ++ ++ if (rSearchItem.GetSelection()) ++ { ++ // current selection only. ++ if (!rMark.IsMarked() && !rMark.IsMultiMarked()) ++ // There is no selection. Bail out. ++ return false; ++ ++ ScRangeList aMarkedRanges, aNewRanges; ++ rMark.FillRangeListWithMarks(&aMarkedRanges, true); ++ for (ScRangePtr p = aMarkedRanges.First(); p; p = aMarkedRanges.Next()) ++ { ++ if (p->aStart.Col() > nColEnd || p->aStart.Row() > nRowEnd) ++ // This range is outside the data area. Skip it. ++ continue; ++ ++ // Shrink the range into data area only. ++ if (p->aStart.Col() < nColStart) ++ p->aStart.SetCol(rCol); ++ if (p->aStart.Row() < nRowStart) ++ p->aStart.SetRow(rRow); ++ ++ if (p->aEnd.Col() > nColEnd) ++ p->aEnd.SetCol(nColEnd); ++ if (p->aEnd.Row() > nRowEnd) ++ p->aEnd.SetRow(nRowEnd); ++ ++ aNewRanges.Append(*p); ++ } ++ aRanges = aNewRanges; ++ } ++ ++ sal_uInt16 nCommand = rSearchItem.GetCommand(); ++ if (nCommand == SVX_SEARCHCMD_FIND || nCommand == SVX_SEARCHCMD_REPLACE) ++ { ++ if (rSearchItem.GetBackward()) ++ { ++ for (ScRangePtr p = aRanges.Last(); p; p = aRanges.Prev()) ++ { ++ if (SearchRangeForEmptyCell(*p, rSearchItem, rCol, rRow, rUndoStr, pUndoDoc)) ++ return true; ++ } ++ } ++ else ++ { ++ for (ScRangePtr p = aRanges.First(); p; p = aRanges.Next()) ++ { ++ if (SearchRangeForEmptyCell(*p, rSearchItem, rCol, rRow, rUndoStr, pUndoDoc)) ++ return true; ++ } ++ } ++ } ++ else if (nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == SVX_SEARCHCMD_REPLACE_ALL) ++ { ++ bool bFound = false; ++ ScMarkData aNewMark(rMark); ++ aNewMark.ResetMark(); ++ for (ScRangePtr p = aRanges.First(); p; p = aRanges.Next()) ++ bFound |= SearchRangeForAllEmptyCells(*p, rSearchItem, aNewMark, rUndoStr, pUndoDoc); ++ rMark = aNewMark; ++ return bFound; ++ } ++ return false; ++} ++ ++bool ScTable::SearchRangeForEmptyCell( ++ const ScRange& rRange, const SvxSearchItem& rSearchItem, ++ SCCOL& rCol, SCROW& rRow, String& rUndoStr, ScDocument* /*pUndoDoc*/) ++{ ++ sal_uInt16 nCmd = rSearchItem.GetCommand(); ++ if (rSearchItem.GetBackward()) ++ { ++ // backward search ++ if (rSearchItem.GetRowDirection()) ++ { ++ // row direction. ++ SCROW nBeginRow = rRange.aEnd.Row() > rRow ? rRow : rRange.aEnd.Row(); ++ for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) ++ { ++ SCCOL nBeginCol = rRange.aEnd.Col(); ++ if (nRow == rRow && nBeginCol >= rCol) ++ // always start from one cell before the cursor. ++ nBeginCol = rCol - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); ++ ++ for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol) ++ { ++ ScBaseCell* pCell = aCol[nCol].GetCell(nRow); ++ if (!pCell) ++ { ++ // empty cell found. ++ rCol = nCol; ++ rRow = nRow; ++ if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && ++ rSearchItem.GetReplaceString().Len()) ++ { ++ aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); ++ rUndoStr = String(); ++ } ++ return true; ++ } ++ } ++ } ++ } ++ else ++ { ++ // column direction. ++ SCCOL nBeginCol = rRange.aEnd.Col() > rCol ? rCol : rRange.aEnd.Col(); ++ for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol) ++ { ++ SCROW nBeginRow = rRange.aEnd.Row(); ++ if (nCol == rCol && nBeginRow >= rRow) ++ // always start from one cell before the cursor. ++ nBeginRow = rRow - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); ++ for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) ++ { ++ ScBaseCell* pCell = aCol[nCol].GetCell(nRow); ++ if (!pCell) ++ { ++ // empty cell found. ++ rCol = nCol; ++ rRow = nRow; ++ if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && ++ rSearchItem.GetReplaceString().Len()) ++ { ++ aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); ++ rUndoStr = String(); ++ } ++ return true; ++ } ++ } ++ } ++ } ++ } ++ else ++ { ++ // forward search ++ if (rSearchItem.GetRowDirection()) ++ { ++ // row direction. ++ SCROW nBeginRow = rRange.aStart.Row() < rRow ? rRow : rRange.aStart.Row(); ++ for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) ++ { ++ SCCOL nBeginCol = rRange.aStart.Col(); ++ if (nRow == rRow && nBeginCol <= rCol) ++ // always start from one cell past the cursor. ++ nBeginCol = rCol + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); ++ for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol) ++ { ++ ScBaseCell* pCell = aCol[nCol].GetCell(nRow); ++ if (!pCell) ++ { ++ // empty cell found. ++ rCol = nCol; ++ rRow = nRow; ++ if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && ++ rSearchItem.GetReplaceString().Len()) ++ { ++ aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); ++ rUndoStr = String(); ++ } ++ return true; ++ } ++ } ++ } ++ } ++ else ++ { ++ // column direction. ++ SCCOL nBeginCol = rRange.aStart.Col() < rCol ? rCol : rRange.aStart.Col(); ++ for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol) ++ { ++ SCROW nBeginRow = rRange.aStart.Row(); ++ if (nCol == rCol && nBeginRow <= rRow) ++ // always start from one cell past the cursor. ++ nBeginRow = rRow + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); ++ for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) ++ { ++ ScBaseCell* pCell = aCol[nCol].GetCell(nRow); ++ if (!pCell) ++ { ++ // empty cell found. ++ rCol = nCol; ++ rRow = nRow; ++ if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && ++ rSearchItem.GetReplaceString().Len()) ++ { ++ aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); ++ rUndoStr = String(); ++ } ++ return true; ++ } ++ } ++ } ++ } ++ } ++ return false; ++} ++ ++bool ScTable::SearchRangeForAllEmptyCells( ++ const ScRange& rRange, const SvxSearchItem& rSearchItem, ScMarkData& rMark, ++ String& rUndoStr, ScDocument* pUndoDoc) ++{ ++ bool bFound = false; ++ bool bReplace = (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL) && ++ (rSearchItem.GetReplaceString().Len() > 0); ++ ++ for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol) ++ { ++ if (aCol[nCol].IsEmptyData()) ++ { ++ // The entire column is empty. Add the whole column and move on. ++ rMark.SetMultiMarkArea( ++ ScRange(nCol, rRange.aStart.Row(), nTab, nCol, rRange.aEnd.Row(), nTab)); ++ bFound = true; ++ ++ if (bReplace) ++ { ++ const String& rNewStr = rSearchItem.GetReplaceString(); ++ for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) ++ { ++ aCol[nCol].Insert(nRow, new ScStringCell(rNewStr)); ++ if (pUndoDoc) ++ // TODO: I'm using a string cell with empty content to ++ // trigger deletion of cell instance on undo. Maybe I ++ // should create a new cell type for this? ++ pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String())); ++ } ++ rUndoStr = String(); ++ } ++ continue; ++ } ++ ++ for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) ++ { ++ ScBaseCell* pCell = aCol[nCol].GetCell(nRow); ++ if (!pCell) ++ { ++ // empty cell found ++ rMark.SetMultiMarkArea(ScRange(nCol, nRow, nTab)); ++ bFound = true; ++ ++ if (bReplace) ++ { ++ aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); ++ if (pUndoDoc) ++ // TODO: I'm using a string cell with empty content to ++ // trigger deletion of cell instance on undo. Maybe I ++ // should create a new cell type for this? ++ pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String())); ++ } ++ } ++ } ++ } ++ return bFound; ++} ++ ++ + + + +diff --git sc/source/ui/view/tabvwsha.cxx sc/source/ui/view/tabvwsha.cxx +index c64698b..a7fd06d 100644 +--- sc/source/ui/view/tabvwsha.cxx ++++ sc/source/ui/view/tabvwsha.cxx +@@ -224,8 +224,13 @@ void __EXPORT ScTabViewShell::GetState( SfxItemSet& rSet ) + break; + + case SID_SEARCH_ITEM: +- rSet.Put( ScGlobal::GetSearchItem() ); ++ { ++ SvxSearchItem aItem(ScGlobal::GetSearchItem()); // make a copy. ++ // Search on current selection if a range is marked. ++ aItem.SetSelection(rMark.IsMarked()); ++ rSet.Put(aItem); + break; ++ } + + case SID_SEARCH_OPTIONS: + { diff --git a/applied_patches/0161-calc-find-replace-empty-cells-svx.diff b/applied_patches/0161-calc-find-replace-empty-cells-svx.diff new file mode 100644 index 000000000..0c7f92ddb --- /dev/null +++ b/applied_patches/0161-calc-find-replace-empty-cells-svx.diff @@ -0,0 +1,105 @@ +diff --git svx/inc/srchdlg.hxx svx/inc/srchdlg.hxx +index 1df6e3d..97a343e 100644 +--- svx/inc/srchdlg.hxx ++++ svx/inc/srchdlg.hxx +@@ -177,6 +177,8 @@ public: + + INT32 GetTransliterationFlags() const; + ++ void SetSaveToModule(bool b); ++ + private: + FixedText aSearchText; + ComboBox aSearchLB; +diff --git svx/source/dialog/srchdlg.cxx svx/source/dialog/srchdlg.cxx +index 670264a..5981347 100644 +--- svx/source/dialog/srchdlg.cxx ++++ svx/source/dialog/srchdlg.cxx +@@ -701,6 +701,11 @@ INT32 SvxSearchDialog::GetTransliterationFlags() const + return nTransliterationFlags; + } + ++void SvxSearchDialog::SetSaveToModule(bool b) ++{ ++ pImpl->bSaveToModule = b; ++} ++ + // ----------------------------------------------------------------------- + + void SvxSearchDialog::ApplyTransliterationFlags_Impl( INT32 nSettings ) +@@ -956,9 +961,36 @@ void SvxSearchDialog::CalculateDelta_Impl() + + // ----------------------------------------------------------------------- + ++namespace { ++ ++class ToggleSaveToModule ++{ ++public: ++ ToggleSaveToModule(SvxSearchDialog& rDialog, bool bValue) : ++ mrDialog(rDialog), mbValue(bValue) ++ { ++ mrDialog.SetSaveToModule(mbValue); ++ } ++ ++ ~ToggleSaveToModule() ++ { ++ mrDialog.SetSaveToModule(!mbValue); ++ } ++private: ++ SvxSearchDialog& mrDialog; ++ bool mbValue; ++}; ++ ++} ++ + void SvxSearchDialog::Init_Impl( int bSearchPattern ) + { + DBG_ASSERT( pSearchItem, "SearchItem == 0" ); ++ ++ // We don't want to save any intermediate state to the module while the ++ // dialog is being initialized. ++ ToggleSaveToModule aNoModuleSave(*this, false); ++ + bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER ); + + pImpl->bMultiLineEdit = FALSE; +@@ -1106,10 +1138,8 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) + aSimilarityBox.Check( pSearchItem->IsLevenshtein() ); + bSet = TRUE; + +- pImpl->bSaveToModule = FALSE; + FlagHdl_Impl( &aSimilarityBox ); + FlagHdl_Impl( &aJapOptionsCB ); +- pImpl->bSaveToModule = TRUE; + + FASTBOOL bDisableSearch = FALSE; + SfxViewShell* pViewShell = SfxViewShell::Current(); +@@ -1638,16 +1668,23 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd ) + else + bSet = FALSE; + ++ // Calc allows searching for empty cells. ++ bool bAllowEmptySearch = (pSearchItem->GetAppFlag() == SVX_SEARCHAPP_CALC); ++ + if ( pEd == &aSearchLB || pEd == &aReplaceLB ) + { +- xub_StrLen nLBTxtLen = aSearchLB.GetText().Len(), nTxtLen; ++ xub_StrLen nSrchTxtLen = aSearchLB.GetText().Len(); ++ xub_StrLen nReplTxtLen = 0; ++ if (bAllowEmptySearch) ++ nReplTxtLen = aReplaceLB.GetText().Len(); ++ xub_StrLen nAttrTxtLen = 0; + + if ( !pImpl->bMultiLineEdit ) +- nTxtLen = aSearchAttrText.GetText().Len(); ++ nAttrTxtLen = aSearchAttrText.GetText().Len(); + else +- nTxtLen = pImpl->aSearchFormats.GetText().Len(); ++ nAttrTxtLen = pImpl->aSearchFormats.GetText().Len(); + +- if ( nLBTxtLen || nTxtLen ) ++ if (nSrchTxtLen || nReplTxtLen || nAttrTxtLen) + { + EnableControl_Impl( &aSearchBtn ); + EnableControl_Impl( &aReplaceBtn ); diff --git a/applied_patches/0162-calc-enhanced-merge-cells-sc.diff b/applied_patches/0162-calc-enhanced-merge-cells-sc.diff new file mode 100644 index 000000000..3320a3be3 --- /dev/null +++ b/applied_patches/0162-calc-enhanced-merge-cells-sc.diff @@ -0,0 +1,1115 @@ +diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx +index 123a716..fde95e5 100644 +--- sc/source/ui/docshell/docfunc.cxx ++++ sc/source/ui/docshell/docfunc.cxx +@@ -67,6 +67,7 @@ + #include "attrib.hxx" + #include "autoform.hxx" + #include "cell.hxx" ++#include "cellmergeoption.hxx" + #include "detdata.hxx" + #include "detfunc.hxx" + #include "docpool.hxx" +@@ -101,6 +102,7 @@ + #include "tabprotection.hxx" + + #include ++#include + + using namespace com::sun::star; + using ::com::sun::star::uno::Sequence; +@@ -1693,7 +1693,11 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, + default: + break; + } +- MergeCells(aRange, FALSE, TRUE, TRUE); ++ ScCellMergeOption aMergeOption( ++ aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aEnd.Col(), aRange.aEnd.Row() ); ++ aMergeOption.maTabs.insert(aRange.aStart.Tab()); ++ MergeCells(aMergeOption, FALSE, TRUE, TRUE); + } + qIncreaseRange.pop_back(); + } +@@ -1742,7 +1746,10 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, + while( !qIncreaseRange.empty() ) + { + ScRange aRange = qIncreaseRange.back(); +- MergeCells(aRange, FALSE, TRUE, TRUE); ++ ScCellMergeOption aMergeOption( ++ aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aEnd.Col(), aRange.aEnd.Row() ); ++ MergeCells(aMergeOption, FALSE, TRUE, TRUE); + qIncreaseRange.pop_back(); + } + +@@ -2180,7 +2187,10 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, + + if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) ) + { +- MergeCells( aRange, FALSE, TRUE, TRUE ); ++ ScCellMergeOption aMergeOption( ++ aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aEnd.Col(), aRange.aEnd.Row() ); ++ MergeCells( aMergeOption, FALSE, TRUE, TRUE ); + } + qDecreaseRange.pop_back(); + } +@@ -3974,86 +3976,110 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e + + //------------------------------------------------------------------------ + +-BOOL ScDocFunc::MergeCells( const ScRange& rRange, BOOL bContents, BOOL bRecord, BOOL bApi ) ++BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BOOL bRecord, BOOL bApi ) + { ++ using ::std::set; ++ + ScDocShellModificator aModificator( rDocShell ); + +- ScDocument* pDoc = rDocShell.GetDocument(); +- SCCOL nStartCol = rRange.aStart.Col(); +- SCROW nStartRow = rRange.aStart.Row(); +- SCCOL nEndCol = rRange.aEnd.Col(); +- SCROW nEndRow = rRange.aEnd.Row(); +- SCTAB nTab = rRange.aStart.Tab(); ++ SCCOL nStartCol = rOption.mnStartCol; ++ SCROW nStartRow = rOption.mnStartRow; ++ SCCOL nEndCol = rOption.mnEndCol; ++ SCROW nEndRow = rOption.mnEndRow; ++ if ((nStartCol == nEndCol && nStartRow == nEndRow) || rOption.maTabs.empty()) ++ { ++ // Nothing to do. Bail out quick. ++ return TRUE; ++ } ++ ++ ScDocument* pDoc = rDocShell.GetDocument(); ++ set::const_iterator itrBeg = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end(); ++ SCTAB nTab1 = *itrBeg, nTab2 = *rOption.maTabs.rbegin(); + + if (bRecord && !pDoc->IsUndoEnabled()) + bRecord = FALSE; + +- ScEditableTester aTester( pDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow ); +- if (!aTester.IsEditable()) +- { +- if (!bApi) +- rDocShell.ErrorMessage(aTester.GetMessageId()); +- return FALSE; +- } ++ for (set::const_iterator itr = itrBeg; itr != itrEnd; ++itr) ++ { ++ ScEditableTester aTester( pDoc, *itr, nStartCol, nStartRow, nEndCol, nEndRow ); ++ if (!aTester.IsEditable()) ++ { ++ if (!bApi) ++ rDocShell.ErrorMessage(aTester.GetMessageId()); ++ return FALSE; ++ } + +- if ( nStartCol == nEndCol && nStartRow == nEndRow ) +- { +- // nichts zu tun +- return TRUE; +- } ++ if ( pDoc->HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr, ++ HASATTR_MERGED | HASATTR_OVERLAPPED ) ) ++ { ++ // "Zusammenfassen nicht verschachteln !" ++ if (!bApi) ++ rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0); ++ return FALSE; ++ } ++ } + +- if ( pDoc->HasAttrib( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, +- HASATTR_MERGED | HASATTR_OVERLAPPED ) ) +- { +- // "Zusammenfassen nicht verschachteln !" +- if (!bApi) +- rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0); +- return FALSE; +- } ++ ScDocument* pUndoDoc = NULL; ++ bool bNeedContentsUndo = false; ++ for (set::const_iterator itr = itrBeg; itr != itrEnd; ++itr) ++ { ++ SCTAB nTab = *itr; ++ bool bNeedContents = bContents && ++ ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) || ++ !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) ); ++ ++ if (bRecord) ++ { ++ // test if the range contains other notes which also implies that we need an undo document ++ bool bHasNotes = false; ++ for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() ) ++ for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() ) ++ bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0); + +- BOOL bNeedContents = bContents && +- ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) || +- !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) ); ++ if (bNeedContents || bHasNotes || rOption.mbCenter) ++ { ++ if (!pUndoDoc) ++ { ++ pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); ++ pUndoDoc->InitUndo(pDoc, nTab1, nTab2); ++ } ++ // note captions are collected by drawing undo ++ pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, ++ IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc ); ++ } ++ if( bHasNotes ) ++ pDoc->BeginDrawUndo(); ++ } + +- ScDocument* pUndoDoc = 0; +- if (bRecord) +- { +- // test if the range contains other notes which also implies that we need an undo document +- bool bHasNotes = false; +- for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() ) +- for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() ) +- bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0); ++ if (bNeedContents) ++ pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); ++ pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); ++ ++ if (rOption.mbCenter) ++ { ++ pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) ); ++ pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) ); ++ } + +- if (bNeedContents || bHasNotes) +- { +- pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); +- pUndoDoc->InitUndo( pDoc, nTab, nTab ); +- // note captions are collected by drawing undo +- pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, +- IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc ); +- } +- if( bHasNotes ) +- pDoc->BeginDrawUndo(); +- } ++ if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) ) ++ rDocShell.PostPaint( nStartCol, nStartRow, nTab, ++ nEndCol, nEndRow, nTab, PAINT_GRID ); ++ if (bNeedContents || rOption.mbCenter) ++ { ++ ScRange aRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab); ++ pDoc->SetDirty(aRange); ++ } + +- if (bNeedContents) +- pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); +- pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow ); ++ bNeedContentsUndo |= bNeedContents; ++ } + +- if( bRecord ) ++ if (pUndoDoc) + { +- SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : 0; ++ SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : NULL; + rDocShell.GetUndoManager()->AddUndoAction( +- new ScUndoMerge( &rDocShell, +- nStartCol, nStartRow, nTab, +- nEndCol, nEndRow, nTab, bNeedContents, pUndoDoc, pDrawUndo ) ); ++ new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, pUndoDoc, pDrawUndo) ); + } + +- if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) ) +- rDocShell.PostPaint( nStartCol, nStartRow, nTab, +- nEndCol, nEndRow, nTab, PAINT_GRID ); +- if (bNeedContents) +- pDoc->SetDirty( rRange ); + aModificator.SetDocumentModified(); + + SfxBindings* pBindings = rDocShell.GetViewBindings(); +@@ -4069,49 +4095,81 @@ BOOL ScDocFunc::MergeCells( const ScRange& rRange, BOOL bContents, BOOL bRecord, + + BOOL ScDocFunc::UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi ) + { +- ScDocShellModificator aModificator( rDocShell ); ++ ScCellMergeOption aOption(rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row()); ++ SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab(); ++ for (SCTAB i = nTab1; i <= nTab2; ++i) ++ aOption.maTabs.insert(i); + ++ return UnmergeCells(aOption, bRecord, bApi); ++} ++ ++bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BOOL bApi ) ++{ ++ using ::std::set; ++ ++ if (rOption.maTabs.empty()) ++ // Nothing to unmerge. ++ return true; ++ ++ ScDocShellModificator aModificator( rDocShell ); + ScDocument* pDoc = rDocShell.GetDocument(); +- SCTAB nTab = rRange.aStart.Tab(); + + if (bRecord && !pDoc->IsUndoEnabled()) + bRecord = FALSE; + +- if ( pDoc->HasAttrib( rRange, HASATTR_MERGED ) ) +- { +- ScRange aExtended = rRange; +- pDoc->ExtendMerge( aExtended ); +- ScRange aRefresh = aExtended; +- pDoc->ExtendOverlapped( aRefresh ); ++ ScDocument* pUndoDoc = NULL; ++ bool bBeep = false; ++ for (set::const_iterator itr = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end(); ++ itr != itrEnd; ++itr) ++ { ++ SCTAB nTab = *itr; ++ ScRange aRange = rOption.getSingleRange(nTab); ++ if ( !pDoc->HasAttrib(aRange, HASATTR_MERGED) ) ++ { ++ bBeep = true; ++ continue; ++ } + +- if (bRecord) +- { +- ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); +- pUndoDoc->InitUndo( pDoc, nTab, nTab ); +- pDoc->CopyToDocument( aExtended, IDF_ATTRIB, FALSE, pUndoDoc ); +- rDocShell.GetUndoManager()->AddUndoAction( +- new ScUndoRemoveMerge( &rDocShell, rRange, pUndoDoc ) ); +- } ++ ScRange aExtended = aRange; ++ pDoc->ExtendMerge(aExtended); ++ ScRange aRefresh = aExtended; ++ pDoc->ExtendOverlapped(aRefresh); + +- const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE ); +- ScPatternAttr aPattern( pDoc->GetPool() ); +- aPattern.GetItemSet().Put( rDefAttr ); +- pDoc->ApplyPatternAreaTab( rRange.aStart.Col(), rRange.aStart.Row(), +- rRange.aEnd.Col(), rRange.aEnd.Row(), nTab, +- aPattern ); ++ if (bRecord) ++ { ++ if (!pUndoDoc) ++ { ++ pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); ++ pUndoDoc->InitUndo(pDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin()); ++ } ++ pDoc->CopyToDocument(aExtended, IDF_ATTRIB, FALSE, pUndoDoc); ++ } + +- pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(), +- aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab, +- SC_MF_HOR | SC_MF_VER ); ++ const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE ); ++ ScPatternAttr aPattern( pDoc->GetPool() ); ++ aPattern.GetItemSet().Put( rDefAttr ); ++ pDoc->ApplyPatternAreaTab( aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aEnd.Col(), aRange.aEnd.Row(), nTab, ++ aPattern ); + +- pDoc->ExtendMerge( aRefresh, TRUE, FALSE ); ++ pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(), ++ aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab, ++ SC_MF_HOR | SC_MF_VER ); + +- if ( !AdjustRowHeight( aExtended ) ) +- rDocShell.PostPaint( aExtended, PAINT_GRID ); +- aModificator.SetDocumentModified(); +- } +- else if (!bApi) +- Sound::Beep(); //! FALSE zurueck??? ++ pDoc->ExtendMerge( aRefresh, TRUE, FALSE ); ++ ++ if ( !AdjustRowHeight( aExtended ) ) ++ rDocShell.PostPaint( aExtended, PAINT_GRID ); ++ } ++ if (bBeep && !bApi) ++ Sound::Beep(); ++ ++ if (bRecord) ++ { ++ rDocShell.GetUndoManager()->AddUndoAction( ++ new ScUndoRemoveMerge( &rDocShell, rOption, pUndoDoc ) ); ++ } ++ aModificator.SetDocumentModified(); + + return TRUE; + } +diff --git sc/source/ui/inc/cellmergeoption.hxx sc/source/ui/inc/cellmergeoption.hxx +new file mode 100644 +index 0000000..2e2dff2 +--- /dev/null ++++ sc/source/ui/inc/cellmergeoption.hxx +@@ -0,0 +1,60 @@ ++/************************************************************************* ++ * ++ * 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: docfunc.hxx,v $ ++ * $Revision: 1.18.30.2 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#ifndef SC_CELLMERGEOPTION_HXX ++#define SC_CELLMERGEOPTION_HXX ++ ++#include "address.hxx" ++ ++#include ++ ++class ScRange; ++ ++struct ScCellMergeOption ++{ ++ ::std::set maTabs; ++ SCCOL mnStartCol; ++ SCROW mnStartRow; ++ SCCOL mnEndCol; ++ SCROW mnEndRow; ++ bool mbCenter; ++ ++ explicit ScCellMergeOption(); ++ explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, ++ SCCOL nEndCol, SCROW nEndRow, ++ bool bCenter = false); ++ explicit ScCellMergeOption(const ScCellMergeOption& r); ++ ++ ScRange getSingleRange(SCTAB nTab) const; ++ ScRange getFirstSingleRange() const; ++}; ++ ++ ++#endif +diff --git sc/source/ui/inc/docfunc.hxx sc/source/ui/inc/docfunc.hxx +index 8490bab..9976230 100644 +--- sc/source/ui/inc/docfunc.hxx ++++ sc/source/ui/inc/docfunc.hxx +@@ -49,6 +49,7 @@ class ScBaseCell; + class ScTokenArray; + struct ScTabOpParam; + class ScTableProtection; ++struct ScCellMergeOption; + + // --------------------------------------------------------------------------- + +@@ -172,9 +173,10 @@ public: + + BOOL ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, BOOL bApi ); + +- BOOL MergeCells( const ScRange& rRange, BOOL bContents, ++ BOOL MergeCells( const ScCellMergeOption& rOption, BOOL bContents, + BOOL bRecord, BOOL bApi ); +- BOOL UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi ); ++ BOOL UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi ); ++ bool UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BOOL bApi ); + + BOOL SetNewRangeNames( ScRangeName* pNewRanges, BOOL bApi ); // takes ownership of pNewRanges + BOOL ModifyRangeNames( const ScRangeName& rNewRanges, BOOL bApi ); +diff --git sc/source/ui/inc/undoblk.hxx sc/source/ui/inc/undoblk.hxx +index 31932fd..2320502 100644 +--- sc/source/ui/inc/undoblk.hxx ++++ sc/source/ui/inc/undoblk.hxx +@@ -34,6 +34,7 @@ + #include "markdata.hxx" + #include "viewutil.hxx" + #include "spellparam.hxx" ++#include "cellmergeoption.hxx" + + #include "cell.hxx" + +@@ -454,10 +455,8 @@ class ScUndoMerge: public ScSimpleUndo + { + public: + TYPEINFO(); +- ScUndoMerge( ScDocShell* pNewDocShell, +- SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, +- SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, +- bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo ); ++ ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption, ++ bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo); + virtual ~ScUndoMerge(); + + virtual void Undo(); +@@ -468,7 +467,7 @@ public: + virtual String GetComment() const; + + private: +- ScRange maRange; ++ ScCellMergeOption maOption; + bool mbMergeContents; // Merge contents in Redo(). + ScDocument* mpUndoDoc; // wenn Daten zusammengefasst + SdrUndoAction* mpDrawUndo; +@@ -920,7 +919,7 @@ class ScUndoRemoveMerge: public ScBlockUndo + public: + TYPEINFO(); + ScUndoRemoveMerge( ScDocShell* pNewDocShell, +- const ScRange& rArea, ++ const ScCellMergeOption& rOption, + ScDocument* pNewUndoDoc ); + virtual ~ScUndoRemoveMerge(); + +@@ -932,6 +931,9 @@ public: + virtual String GetComment() const; + + private: ++ void SetCurTab(); ++ ++ ScCellMergeOption maOption; + ScDocument* pUndoDoc; + }; + +diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx +index 1f5102e..051a705 100644 +--- sc/source/ui/inc/viewfunc.hxx ++++ sc/source/ui/inc/viewfunc.hxx +@@ -242,7 +242,7 @@ public: + BOOL TestMergeCells(); + BOOL TestRemoveMerge(); + +- BOOL MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord = TRUE ); ++ BOOL MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord = TRUE, BOOL bCenter = FALSE ); + BOOL RemoveMerge( BOOL bRecord = TRUE ); + + void FillSimple( FillDir eDir, BOOL bRecord = TRUE ); +diff --git sc/source/ui/undo/undoblk.cxx sc/source/ui/undo/undoblk.cxx +index 5b3e219..fe2c7bc 100644 +--- sc/source/ui/undo/undoblk.cxx ++++ sc/source/ui/undo/undoblk.cxx +@@ -66,6 +66,7 @@ + #include "undoolk.hxx" + #include "sc.hrc" + ++#include + + // STATIC DATA ----------------------------------------------------------- + +@@ -2066,8 +2067,9 @@ BOOL __EXPORT ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const + // + + ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell, +- const ScRange& rArea, ScDocument* pNewUndoDoc ) : +- ScBlockUndo( pNewDocShell, rArea, SC_UNDO_SIMPLE ), ++ const ScCellMergeOption& rOption, ScDocument* pNewUndoDoc ) : ++ ScBlockUndo( pNewDocShell, rOption.getFirstSingleRange(), SC_UNDO_SIMPLE ), ++ maOption(rOption), + pUndoDoc( pNewUndoDoc ) + { + } +@@ -2084,66 +2086,78 @@ String __EXPORT ScUndoRemoveMerge::GetComment() const + + void __EXPORT ScUndoRemoveMerge::Undo() + { +- BeginUndo(); +- +- ScDocument* pDoc = pDocShell->GetDocument(); ++ using ::std::set; + +- ScRange aExtended = aBlockRange; +- pUndoDoc->ExtendMerge( aExtended ); ++ SetCurTab(); ++ BeginUndo(); + +- pDoc->DeleteAreaTab( aExtended, IDF_ATTRIB ); +- pUndoDoc->CopyToDocument( aExtended, IDF_ATTRIB, FALSE, pDoc ); ++ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + +- BOOL bDidPaint = FALSE; +- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); +- if ( pViewShell ) +- { +- pViewShell->SetTabNo( aExtended.aStart.Tab() ); +- bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() ); +- } +- if (!bDidPaint) +- ScUndoUtil::PaintMore( pDocShell, aExtended ); ++ ScDocument* pDoc = pDocShell->GetDocument(); ++ for (set::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end(); ++ itr != itrEnd; ++itr) ++ { ++ // There is no need to extend merge area because it's already been extended. ++ ScRange aRange = maOption.getSingleRange(*itr); ++ pDoc->DeleteAreaTab(aRange, IDF_ATTRIB); ++ pUndoDoc->CopyToDocument(aRange, IDF_ATTRIB, FALSE, pDoc); ++ ++ bool bDidPaint = false; ++ if ( pViewShell ) ++ { ++ pViewShell->SetTabNo(*itr); ++ bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow); ++ } ++ if (!bDidPaint) ++ ScUndoUtil::PaintMore(pDocShell, aRange); ++ } + + EndUndo(); + } + + void __EXPORT ScUndoRemoveMerge::Redo() + { ++ using ::std::set; ++ ++ SetCurTab(); + BeginRedo(); + +- SCTAB nTab = aBlockRange.aStart.Tab(); + ScDocument* pDoc = pDocShell->GetDocument(); +- ScRange aExtended = aBlockRange; +- pDoc->ExtendMerge( aExtended ); +- ScRange aRefresh = aExtended; +- pDoc->ExtendOverlapped( aRefresh ); +- +- // ausfuehren +- +- const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE ); +- ScPatternAttr aPattern( pDoc->GetPool() ); +- aPattern.GetItemSet().Put( rDefAttr ); +- pDoc->ApplyPatternAreaTab( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(), +- aBlockRange.aEnd.Col(), aBlockRange.aEnd.Row(), nTab, +- aPattern ); +- +- pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(), +- aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab, +- SC_MF_HOR | SC_MF_VER ); +- +- pDoc->ExtendMerge( aRefresh, TRUE, FALSE ); +- +- // Paint ++ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + +- BOOL bDidPaint = FALSE; +- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); +- if ( pViewShell ) +- { +- pViewShell->SetTabNo( aExtended.aStart.Tab() ); +- bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() ); +- } +- if (!bDidPaint) +- ScUndoUtil::PaintMore( pDocShell, aExtended ); ++ for (set::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end(); ++ itr != itrEnd; ++itr) ++ { ++ SCTAB nTab = *itr; ++ // There is no need to extend merge area because it's already been extended. ++ ScRange aRange = maOption.getSingleRange(nTab); ++ ++ // ausfuehren ++ ++ const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE ); ++ ScPatternAttr aPattern( pDoc->GetPool() ); ++ aPattern.GetItemSet().Put( rDefAttr ); ++ pDoc->ApplyPatternAreaTab( maOption.mnStartCol, maOption.mnStartRow, ++ maOption.mnEndCol, maOption.mnEndRow, nTab, ++ aPattern ); ++ ++ pDoc->RemoveFlagsTab( maOption.mnStartCol, maOption.mnStartRow, ++ maOption.mnEndCol, maOption.mnEndRow, nTab, ++ SC_MF_HOR | SC_MF_VER ); ++ ++ pDoc->ExtendMerge(aRange, TRUE, FALSE); ++ ++ // Paint ++ ++ BOOL bDidPaint = FALSE; ++ if ( pViewShell ) ++ { ++ pViewShell->SetTabNo(nTab); ++ bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow); ++ } ++ if (!bDidPaint) ++ ScUndoUtil::PaintMore(pDocShell, aRange); ++ } + + EndRedo(); + } +@@ -2159,6 +2173,13 @@ BOOL __EXPORT ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const + return (rTarget.ISA(ScTabViewTarget)); + } + ++void ScUndoRemoveMerge::SetCurTab() ++{ ++ SCTAB nCurTab = pDocShell->GetCurTab(); ++ aBlockRange.aStart.SetTab(nCurTab); ++ aBlockRange.aEnd.SetTab(nCurTab); ++} ++ + // ----------------------------------------------------------------------- + // + // nur Umrandung setzen, per ScRangeList (StarOne) +diff --git sc/source/ui/undo/undoblk3.cxx sc/source/ui/undo/undoblk3.cxx +index 5521813..f3f006c 100644 +--- sc/source/ui/undo/undoblk3.cxx ++++ sc/source/ui/undo/undoblk3.cxx +@@ -34,6 +34,7 @@ + // INCLUDE ------------------------------------------------------------------- + + #include "scitems.hxx" ++#include + #include + #include + #include +@@ -814,14 +815,12 @@ BOOL __EXPORT ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const + + //---------------------------------------------------------------------------- + +-ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, +- SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, +- SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, +- bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo ) ++ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption, ++ bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo ) + // + : ScSimpleUndo( pNewDocShell ), + // +- maRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), ++ maOption(rOption), + mbMergeContents( bMergeContents ), + mpUndoDoc( pUndoDoc ), + mpDrawUndo( pDrawUndo ) +@@ -850,51 +849,77 @@ String ScUndoMerge::GetComment() const + + void ScUndoMerge::DoChange( bool bUndo ) const + { +- ScDocument* pDoc = pDocShell->GetDocument(); ++ using ::std::set; + +- ScUndoUtil::MarkSimpleBlock( pDocShell, maRange ); ++ if (maOption.maTabs.empty()) ++ // Nothing to do. ++ return; + +- if (bUndo) +- // remove merge (contents are copied back below from undo document) +- pDoc->RemoveMerge( maRange.aStart.Col(), maRange.aStart.Row(), maRange.aStart.Tab() ); +- else +- // repeat merge, but do not remove note captions (will be done by drawing redo below) +-/*!*/ pDoc->DoMerge( maRange.aStart.Tab(), +- maRange.aStart.Col(), maRange.aStart.Row(), +- maRange.aEnd.Col(), maRange.aEnd.Row(), false ); ++ ScDocument* pDoc = pDocShell->GetDocument(); ++ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + +- // undo -> copy back deleted contents +- if (bUndo && mpUndoDoc) +- { +- pDoc->DeleteAreaTab( maRange, IDF_CONTENTS|IDF_NOCAPTIONS ); +- mpUndoDoc->CopyToDocument( maRange, IDF_ALL|IDF_NOCAPTIONS, FALSE, pDoc ); +- } ++ ScRange aCurRange = maOption.getSingleRange(pDocShell->GetCurTab()); ++ ScUndoUtil::MarkSimpleBlock(pDocShell, aCurRange); ++ ++ for (set::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end(); ++ itr != itrEnd; ++itr) ++ { ++ SCTAB nTab = *itr; ++ ScRange aRange = maOption.getSingleRange(nTab); + +- // redo -> merge contents again +- else if (!bUndo && mbMergeContents) +- { +-/*!*/ pDoc->DoMergeContents( maRange.aStart.Tab(), +- maRange.aStart.Col(), maRange.aStart.Row(), +- maRange.aEnd.Col(), maRange.aEnd.Row() ); ++ if (bUndo) ++ // remove merge (contents are copied back below from undo document) ++ pDoc->RemoveMerge( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() ); ++ else ++ { ++ // repeat merge, but do not remove note captions (will be done by drawing redo below) ++ pDoc->DoMerge( aRange.aStart.Tab(), ++ aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aEnd.Col(), aRange.aEnd.Row(), false ); ++ ++ if (maOption.mbCenter) ++ { ++ pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aStart.Tab(), ++ SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) ); ++ pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aStart.Tab(), ++ SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) ); ++ } ++ } ++ ++ // undo -> copy back deleted contents ++ if (bUndo && mpUndoDoc) ++ { ++ pDoc->DeleteAreaTab( aRange, IDF_CONTENTS|IDF_NOCAPTIONS ); ++ mpUndoDoc->CopyToDocument( aRange, IDF_ALL|IDF_NOCAPTIONS, FALSE, pDoc ); ++ } ++ ++ // redo -> merge contents again ++ else if (!bUndo && mbMergeContents) ++ { ++ pDoc->DoMergeContents( aRange.aStart.Tab(), ++ aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aEnd.Col(), aRange.aEnd.Row() ); ++ } ++ ++ if (bUndo) ++ DoSdrUndoAction( mpDrawUndo, pDoc ); ++ else ++ RedoSdrUndoAction( mpDrawUndo ); ++ ++ bool bDidPaint = false; ++ if ( pViewShell ) ++ { ++ pViewShell->SetTabNo(nTab); ++ bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow); ++ } ++ ++ if (!bDidPaint) ++ ScUndoUtil::PaintMore(pDocShell, aRange); + } + +- if (bUndo) +- DoSdrUndoAction( mpDrawUndo, pDoc ); +- else +- RedoSdrUndoAction( mpDrawUndo ); +- +- BOOL bDidPaint = FALSE; +- ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); +- if ( pViewShell ) +- { +- pViewShell->SetTabNo( maRange.aStart.Tab() ); +- bDidPaint = pViewShell->AdjustRowHeight( maRange.aStart.Row(), maRange.aEnd.Row() ); +- } +- +- if (!bDidPaint) +- ScUndoUtil::PaintMore( pDocShell, maRange ); +- +- ShowTable( maRange ); ++ ShowTable(aCurRange); + } + + +diff --git sc/source/ui/unoobj/cellsuno.cxx sc/source/ui/unoobj/cellsuno.cxx +index c2eb810..d4cfb42 100644 +--- sc/source/ui/unoobj/cellsuno.cxx ++++ sc/source/ui/unoobj/cellsuno.cxx +@@ -71,6 +71,7 @@ + #include + + #include "autoform.hxx" ++#include "cellmergeoption.hxx" + #include "cellsuno.hxx" + #include "cursuno.hxx" + #include "textuno.hxx" +@@ -5404,10 +5405,14 @@ void SAL_CALL ScCellRangeObj::merge( sal_Bool bMerge ) throw(uno::RuntimeExcepti + if ( pDocSh ) + { + ScDocFunc aFunc(*pDocSh); ++ ScCellMergeOption aMergeOption( ++ aRange.aStart.Col(), aRange.aStart.Row(), ++ aRange.aEnd.Col(), aRange.aEnd.Row(), false); ++ aMergeOption.maTabs.insert(aRange.aStart.Tab()); + if ( bMerge ) +- aFunc.MergeCells( aRange, FALSE, TRUE, TRUE ); ++ aFunc.MergeCells( aMergeOption, FALSE, TRUE, TRUE ); + else +- aFunc.UnmergeCells( aRange, TRUE, TRUE ); ++ aFunc.UnmergeCells( aMergeOption, TRUE, TRUE ); + + //! Fehler abfangen? + } +diff --git sc/source/ui/view/cellmergeoption.cxx sc/source/ui/view/cellmergeoption.cxx +new file mode 100644 +index 0000000..ed6b8cb +--- /dev/null ++++ sc/source/ui/view/cellmergeoption.cxx +@@ -0,0 +1,74 @@ ++/************************************************************************* ++ * ++ * 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: docfunc.hxx,v $ ++ * $Revision: 1.18.30.2 $ ++ * ++ * This file is part of OpenOffice.org. ++ * ++ * OpenOffice.org is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License version 3 ++ * only, as published by the Free Software Foundation. ++ * ++ * OpenOffice.org is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Lesser General Public License version 3 for more details ++ * (a copy is included in the LICENSE file that accompanied this code). ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * version 3 along with OpenOffice.org. If not, see ++ * ++ * for a copy of the LGPLv3 License. ++ * ++ ************************************************************************/ ++ ++#include "cellmergeoption.hxx" ++#include "address.hxx" ++ ++ScCellMergeOption::ScCellMergeOption() : ++ mnStartCol(0), ++ mnStartRow(0), ++ mnEndCol(0), ++ mnEndRow(0), ++ mbCenter(false) ++{ ++} ++ ++ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) : ++ mnStartCol(nStartCol), ++ mnStartRow(nStartRow), ++ mnEndCol(nEndCol), ++ mnEndRow(nEndRow), ++ mbCenter(bCenter) ++{ ++} ++ ++ScCellMergeOption::ScCellMergeOption(const ScCellMergeOption& r) : ++ maTabs(r.maTabs), ++ mnStartCol(r.mnStartCol), ++ mnStartRow(r.mnStartRow), ++ mnEndCol(r.mnEndCol), ++ mnEndRow(r.mnEndRow), ++ mbCenter(r.mbCenter) ++{ ++} ++ ++ScRange ScCellMergeOption::getSingleRange(SCTAB nTab) const ++{ ++ return ScRange(mnStartCol, mnStartRow, nTab, mnEndCol, mnEndRow, nTab); ++} ++ ++ScRange ScCellMergeOption::getFirstSingleRange() const ++{ ++ SCTAB nTab = 0; ++ if (!maTabs.empty()) ++ nTab = *maTabs.begin(); ++ ++ return getSingleRange(nTab); ++} +diff --git sc/source/ui/view/cellsh3.cxx sc/source/ui/view/cellsh3.cxx +index 57309e3..c689fa1 100644 +--- sc/source/ui/view/cellsh3.cxx ++++ sc/source/ui/view/cellsh3.cxx +@@ -772,6 +772,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) + { + // test whether to merge or to split + bool bMerge = false; ++ BOOL bCenter = FALSE; + switch( nSlot ) + { + case FID_MERGE_ON: +@@ -782,6 +783,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) + break; + case FID_MERGE_TOGGLE: + { ++ bCenter = TRUE; + SfxPoolItem* pItem = 0; + if( rBindings.QueryState( nSlot, pItem ) >= SFX_ITEM_DEFAULT ) + bMerge = !static_cast< SfxBoolItem* >( pItem )->GetValue(); +@@ -802,7 +804,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) + bMoveContents = ((const SfxBoolItem*)pItem)->GetValue(); + } + +- if (pTabViewShell->MergeCells( bApi, bMoveContents )) ++ if (pTabViewShell->MergeCells( bApi, bMoveContents, TRUE, bCenter )) + { + if (!bApi && bMoveContents) // "ja" im Dialog geklickt + rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) ); +diff --git sc/source/ui/view/makefile.mk sc/source/ui/view/makefile.mk +index 48395f3..46b8122 100644 +--- sc/source/ui/view/makefile.mk ++++ sc/source/ui/view/makefile.mk +@@ -100,6 +100,7 @@ SLOFILES = \ + $(SLO)$/output3.obj \ + $(SLO)$/gridmerg.obj \ + $(SLO)$/invmerge.obj \ ++ $(SLO)$/cellmergeoption.obj \ + $(SLO)$/select.obj \ + $(SLO)$/olinewin.obj \ + $(SLO)$/hintwin.obj \ +diff --git sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx +index c563b9a..d6fd25d 100644 +--- sc/source/ui/view/viewfun2.cxx ++++ sc/source/ui/view/viewfun2.cxx +@@ -70,6 +70,7 @@ using namespace com::sun::star; + #include "attrib.hxx" + #include "autoform.hxx" + #include "cell.hxx" // EnterAutoSum ++#include "cellmergeoption.hxx" + #include "compiler.hxx" + #include "docfunc.hxx" + #include "docpool.hxx" +@@ -1087,7 +1088,7 @@ BOOL ScViewFunc::TestMergeCells() // Vorab-Test (fuer Menue) + + //---------------------------------------------------------------------------- + +-BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord ) ++BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord, BOOL bCenter ) + { + // Editable- und Verschachtelungs-Abfrage muss vorneweg sein (auch in DocFunc), + // damit dann nicht die Inhalte-QueryBox kommt +@@ -1130,10 +1131,26 @@ BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord ) + return FALSE; + } + ++ // Check for the contents of all selected tables. ++ bool bAskDialog = false; ++ SCTAB nTabCount = pDoc->GetTableCount(); ++ ScCellMergeOption aMergeOption(nStartCol, nStartRow, nEndCol, nEndRow, bCenter); ++ for (SCTAB i = 0; i < nTabCount; ++i) ++ { ++ if (!rMark.GetTableSelect(i)) ++ // this table is not selected. ++ continue; ++ ++ aMergeOption.maTabs.insert(i); ++ ++ if (!pDoc->IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, nEndRow) || ++ !pDoc->IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, nEndRow)) ++ bAskDialog = true; ++ } ++ + BOOL bOk = TRUE; + +- if ( !pDoc->IsBlockEmpty( nStartTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) || +- !pDoc->IsBlockEmpty( nStartTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) ) ++ if (bAskDialog) + { + if (!bApi) + { +@@ -1153,7 +1170,7 @@ BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord ) + if (bOk) + { + HideCursor(); +- bOk = pDocSh->GetDocFunc().MergeCells( aMarkRange, rDoContents, bRecord, bApi ); ++ bOk = pDocSh->GetDocFunc().MergeCells( aMergeOption, rDoContents, bRecord, bApi ); + ShowCursor(); + + if (bOk) +@@ -1189,6 +1206,32 @@ BOOL ScViewFunc::TestRemoveMerge() + + //---------------------------------------------------------------------------- + ++static bool lcl_extendMergeRange(ScCellMergeOption& rOption, const ScRange& rRange) ++{ ++ bool bExtended = false; ++ if (rOption.mnStartCol > rRange.aStart.Col()) ++ { ++ rOption.mnStartCol = rRange.aStart.Col(); ++ bExtended = true; ++ } ++ if (rOption.mnStartRow > rRange.aStart.Row()) ++ { ++ rOption.mnStartRow = rRange.aStart.Row(); ++ bExtended = true; ++ } ++ if (rOption.mnEndCol < rRange.aEnd.Col()) ++ { ++ rOption.mnEndCol = rRange.aEnd.Col(); ++ bExtended = true; ++ } ++ if (rOption.mnEndRow < rRange.aEnd.Row()) ++ { ++ rOption.mnEndRow = rRange.aEnd.Row(); ++ bExtended = true; ++ } ++ return bExtended; ++} ++ + BOOL ScViewFunc::RemoveMerge( BOOL bRecord ) + { + ScRange aRange; +@@ -1200,12 +1243,39 @@ BOOL ScViewFunc::RemoveMerge( BOOL bRecord ) + } + else if (GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE) + { ++ ScDocument* pDoc = GetViewData()->GetDocument(); + ScRange aExtended( aRange ); +- GetViewData()->GetDocument()->ExtendMerge( aExtended ); ++ pDoc->ExtendMerge( aExtended ); + ScDocShell* pDocSh = GetViewData()->GetDocShell(); ++ const ScMarkData& rMark = GetViewData()->GetMarkData(); ++ SCTAB nTabCount = pDoc->GetTableCount(); ++ ScCellMergeOption aOption(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row()); ++ bool bExtended = false; ++ do ++ { ++ bExtended = false; ++ for (SCTAB i = 0; i < nTabCount; ++i) ++ { ++ if (!rMark.GetTableSelect(i)) ++ // This table is not selected. ++ continue; ++ ++ aOption.maTabs.insert(i); ++ aExtended.aStart.SetTab(i); ++ aExtended.aEnd.SetTab(i); ++ pDoc->ExtendMerge(aExtended); ++ pDoc->ExtendOverlapped(aExtended); ++ ++ // Expand the current range to be inclusive of all merged ++ // areas on all sheets. ++ bExtended = lcl_extendMergeRange(aOption, aExtended); ++ } ++ } ++ while (bExtended); + + HideCursor(); +- BOOL bOk = pDocSh->GetDocFunc().UnmergeCells( aRange, bRecord, FALSE ); ++ BOOL bOk = pDocSh->GetDocFunc().UnmergeCells(aOption, bRecord, FALSE ); ++ aExtended = aOption.getFirstSingleRange(); + MarkRange( aExtended ); + ShowCursor(); + +diff --git sc/uiconfig/scalc/menubar/menubar.xml sc/uiconfig/scalc/menubar/menubar.xml +index 118fac7..322d448 100644 +--- sc/uiconfig/scalc/menubar/menubar.xml ++++ sc/uiconfig/scalc/menubar/menubar.xml +@@ -218,7 +218,13 @@ + + + +- ++ ++ ++ ++ ++ ++ ++ + + + diff --git a/applied_patches/0442-calc-enhanced-merge-cells-officecfg.diff b/applied_patches/0163-calc-enhanced-merge-cells-officecfg.diff similarity index 100% rename from applied_patches/0442-calc-enhanced-merge-cells-officecfg.diff rename to applied_patches/0163-calc-enhanced-merge-cells-officecfg.diff diff --git a/applied_patches/0443-calc-filter-dbf-precision.diff b/applied_patches/0164-calc-filter-dbf-precision.diff similarity index 100% rename from applied_patches/0443-calc-filter-dbf-precision.diff rename to applied_patches/0164-calc-filter-dbf-precision.diff diff --git a/applied_patches/0444-calc-autoinput-case-insensitive-matching.diff b/applied_patches/0165-calc-autoinput-case-insensitive-matching.diff similarity index 100% rename from applied_patches/0444-calc-autoinput-case-insensitive-matching.diff rename to applied_patches/0165-calc-autoinput-case-insensitive-matching.diff diff --git a/applied_patches/0450-calc-jump-on-formula-ref-offapi.diff b/applied_patches/0166-calc-jump-on-formula-ref-offapi.diff similarity index 100% rename from applied_patches/0450-calc-jump-on-formula-ref-offapi.diff rename to applied_patches/0166-calc-jump-on-formula-ref-offapi.diff diff --git a/applied_patches/0451-calc-jump-on-formula-ref-officecfg.diff b/applied_patches/0167-calc-jump-on-formula-ref-officecfg.diff similarity index 100% rename from applied_patches/0451-calc-jump-on-formula-ref-officecfg.diff rename to applied_patches/0167-calc-jump-on-formula-ref-officecfg.diff diff --git a/applied_patches/0168-calc-jump-on-formula-ref-sc.diff b/applied_patches/0168-calc-jump-on-formula-ref-sc.diff new file mode 100644 index 000000000..ce24a0a92 --- /dev/null +++ b/applied_patches/0168-calc-jump-on-formula-ref-sc.diff @@ -0,0 +1,616 @@ +diff --git sc/inc/cell.hxx sc/inc/cell.hxx +index 5ec1281..4c1afdb 100644 +--- sc/inc/cell.hxx ++++ sc/inc/cell.hxx +@@ -662,6 +662,7 @@ private: + public: + ScDetectiveRefIter( ScFormulaCell* pCell ); + BOOL GetNextRef( ScRange& rRange ); ++ ScToken* GetNextRefToken(); + }; + + // ============================================================================ +diff --git sc/inc/detfunc.hxx sc/inc/detfunc.hxx +index 49a7938..c38150d 100644 +--- sc/inc/detfunc.hxx ++++ sc/inc/detfunc.hxx +@@ -35,6 +35,9 @@ + #include + #include + #include "scdllapi.h" ++#include "token.hxx" ++ ++#include + + class SdrObject; + class SdrPage; +@@ -46,6 +49,7 @@ class ScDetectiveData; + class ScDocument; + class ScAddress; + class ScRange; ++class ScRangeList; + + #define SC_DET_MAXCIRCLE 1000 + +@@ -146,6 +150,9 @@ public: + + BOOL MarkInvalid(BOOL& rOverflow); + ++ void GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector& rRefTokens); ++ void GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector& rRefTokens); ++ + static void UpdateAllComments( ScDocument& rDoc ); // on all tables + void UpdateAllArrowColors(); // on all tables + +diff --git sc/inc/reftokenhelper.hxx sc/inc/reftokenhelper.hxx +index d7b335f..44619ab 100644 +--- sc/inc/reftokenhelper.hxx ++++ sc/inc/reftokenhelper.hxx +@@ -78,6 +78,9 @@ public: + static void join(::std::vector& rTokens, const ScSharedTokenRef& pToken); + + static bool getDoubleRefDataFromToken(ScComplexRefData& rData, const ScSharedTokenRef& pToken); ++ ++ static ScSharedTokenRef createRefToken(const ScAddress& rAddr); ++ static ScSharedTokenRef createRefToken(const ScRange& rRange); + }; + + #endif +diff --git sc/inc/sc.hrc sc/inc/sc.hrc +index bd688c8..340416b 100644 +--- sc/inc/sc.hrc ++++ sc/inc/sc.hrc +@@ -900,6 +900,9 @@ + #define SID_DETECTIVE_REFRESH (DETECTIVE_START+14) + #define SID_DETECTIVE_AUTO (DETECTIVE_START+15) + ++#define SID_DETECTIVE_MARK_PRED (DETECTIVE_START+16) ++#define SID_DETECTIVE_MARK_SUCC (DETECTIVE_START+17) ++ + #define DETECTIVE_END (DETECTIVE_START+20) + + #define SID_API_SLOTS (DETECTIVE_END) +diff --git sc/sdi/cellsh.sdi sc/sdi/cellsh.sdi +index 05ab23c..b22589b 100644 +--- sc/sdi/cellsh.sdi ++++ sc/sdi/cellsh.sdi +@@ -113,6 +113,8 @@ interface CellSelection + SID_DETECTIVE_ADD_ERR [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] + SID_DETECTIVE_INVALID [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] + SID_DETECTIVE_REFRESH [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] ++ SID_DETECTIVE_MARK_PRED [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] ++ SID_DETECTIVE_MARK_SUCC [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] + FID_INS_ROW [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] + FID_INS_COLUMN [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] + FID_INS_CELLSDOWN [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] +diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi +index 66c0a09..f8eddc2 100644 +--- sc/sdi/scalc.sdi ++++ sc/sdi/scalc.sdi +@@ -7899,4 +7899,53 @@ SfxBoolItem ToggleSheetGrid FID_TAB_TOGGLE_GRID + GroupId = GID_FORMAT; + ] + ++//-------------------------------------------------------------------------- ++SfxVoidItem MarkPrecedents SID_DETECTIVE_MARK_PRED ++() ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = FALSE, ++ ReadOnlyDoc = TRUE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = TRUE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = FALSE, ++ GroupId = GID_OPTIONS; ++] ++ ++//-------------------------------------------------------------------------- ++SfxVoidItem MarkDependents SID_DETECTIVE_MARK_SUCC ++() ++[ ++ /* flags: */ ++ AutoUpdate = FALSE, ++ Cachable = Cachable, ++ FastCall = FALSE, ++ HasCoreId = FALSE, ++ HasDialog = FALSE, ++ ReadOnlyDoc = TRUE, ++ Toggle = FALSE, ++ Container = FALSE, ++ RecordAbsolute = FALSE, ++ RecordPerSet; ++ Synchron; ++ ++ /* config: */ ++ AccelConfig = TRUE, ++ MenuConfig = TRUE, ++ StatusBarConfig = FALSE, ++ ToolBoxConfig = FALSE, ++ GroupId = GID_OPTIONS; ++] + +diff --git sc/source/core/data/cell.cxx sc/source/core/data/cell.cxx +index 1c3035c..4d5773d 100644 +--- sc/source/core/data/cell.cxx ++++ sc/source/core/data/cell.cxx +@@ -1954,7 +1954,7 @@ BOOL lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) + if ( rRef1.IsColDeleted() || rRef1.IsRowDeleted() || rRef1.IsTabDeleted() + || !rRef1.Valid() ) + return TRUE; +- if ( p->GetType() == svDoubleRef ) ++ if ( p->GetType() == svDoubleRef || p->GetType() == svExternalDoubleRef ) + { + ScSingleRefData& rRef2 = p->GetDoubleRef().Ref2; + if ( rRef2.IsColDeleted() || rRef2.IsRowDeleted() || rRef2.IsTabDeleted() +@@ -1967,7 +1967,20 @@ BOOL lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) + BOOL ScDetectiveRefIter::GetNextRef( ScRange& rRange ) + { + BOOL bRet = FALSE; ++ ScToken* p = GetNextRefToken(); ++ if( p ) ++ { ++ SingleDoubleRefProvider aProv( *p ); ++ rRange.aStart.Set( aProv.Ref1.nCol, aProv.Ref1.nRow, aProv.Ref1.nTab ); ++ rRange.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab ); ++ bRet = TRUE; ++ } + ++ return bRet; ++} ++ ++ScToken* ScDetectiveRefIter::GetNextRefToken() ++{ + ScToken* p = static_cast(pCode->GetNextReferenceRPN()); + if (p) + p->CalcAbsIfRel( aPos ); +@@ -1978,16 +1991,7 @@ BOOL ScDetectiveRefIter::GetNextRef( ScRange& rRange ) + if (p) + p->CalcAbsIfRel( aPos ); + } +- +- if( p ) +- { +- SingleDoubleRefProvider aProv( *p ); +- rRange.aStart.Set( aProv.Ref1.nCol, aProv.Ref1.nRow, aProv.Ref1.nTab ); +- rRange.aEnd.Set( aProv.Ref2.nCol, aProv.Ref2.nRow, aProv.Ref2.nTab ); +- bRet = TRUE; +- } +- +- return bRet; ++ return p; + } + + // ============================================================================ +diff --git sc/source/core/tool/detfunc.cxx sc/source/core/tool/detfunc.cxx +index 7680bda..99e0e71 100644 +--- sc/source/core/tool/detfunc.cxx ++++ sc/source/core/tool/detfunc.cxx +@@ -80,6 +80,12 @@ + #include "attrib.hxx" + #include "scmod.hxx" + #include "postit.hxx" ++#include "rangelst.hxx" ++#include "reftokenhelper.hxx" ++ ++#include ++ ++using ::std::vector; + + //------------------------------------------------------------------------ + +@@ -1407,6 +1413,52 @@ BOOL ScDetectiveFunc::MarkInvalid(BOOL& rOverflow) + return ( bDeleted || nInsCount != 0 ); + } + ++void ScDetectiveFunc::GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ++ vector& rRefTokens) ++{ ++ ScCellIterator aCellIter(pDoc, nCol1, nRow1, nTab, nCol2, nRow2, nTab); ++ for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext()) ++ { ++ if (pCell->GetCellType() != CELLTYPE_FORMULA) ++ continue; ++ ++ ScFormulaCell* pFCell = static_cast(pCell); ++ ScDetectiveRefIter aRefIter(pFCell); ++ for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken()) ++ { ++ ScSharedTokenRef pRef(static_cast(p->Clone())); ++ ScRefTokenHelper::join(rRefTokens, pRef); ++ } ++ } ++} ++ ++void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ++ vector& rRefTokens) ++{ ++ vector aSrcRange; ++ aSrcRange.push_back( ++ ScRefTokenHelper::createRefToken(ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab))); ++ ++ ScCellIterator aCellIter(pDoc, 0, 0, nTab, MAXCOL, MAXROW, nTab); ++ for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext()) ++ { ++ if (pCell->GetCellType() != CELLTYPE_FORMULA) ++ continue; ++ ++ ScFormulaCell* pFCell = static_cast(pCell); ++ ScDetectiveRefIter aRefIter(pFCell); ++ for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken()) ++ { ++ ScSharedTokenRef pRef(static_cast(p->Clone())); ++ if (ScRefTokenHelper::intersects(aSrcRange, pRef)) ++ { ++ pRef = ScRefTokenHelper::createRefToken(aCellIter.GetPos()); ++ ScRefTokenHelper::join(rRefTokens, pRef); ++ } ++ } ++ } ++} ++ + void ScDetectiveFunc::UpdateAllComments( ScDocument& rDoc ) + { + // for all caption objects, update attributes and SpecialTextBoxShadow flag +diff --git sc/source/core/tool/reftokenhelper.cxx sc/source/core/tool/reftokenhelper.cxx +index ed196e0..635df6e 100644 +--- sc/source/core/tool/reftokenhelper.cxx ++++ sc/source/core/tool/reftokenhelper.cxx +@@ -475,3 +475,19 @@ bool ScRefTokenHelper::getDoubleRefDataFromToken(ScComplexRefData& rData, const + } + return true; + } ++ ++ScSharedTokenRef ScRefTokenHelper::createRefToken(const ScAddress& rAddr) ++{ ++ ScSingleRefData aRefData; ++ aRefData.InitAddress(rAddr); ++ ScSharedTokenRef pRef(new ScSingleRefToken(aRefData)); ++ return pRef; ++} ++ ++ScSharedTokenRef ScRefTokenHelper::createRefToken(const ScRange& rRange) ++{ ++ ScComplexRefData aRefData; ++ aRefData.InitRange(rRange); ++ ScSharedTokenRef pRef(new ScDoubleRefToken(aRefData)); ++ return pRef; ++} +diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx +index f55b697..a289649 100644 +--- sc/source/ui/docshell/docfunc.cxx ++++ sc/source/ui/docshell/docfunc.cxx +@@ -102,6 +102,7 @@ + + using namespace com::sun::star; + using ::com::sun::star::uno::Sequence; ++using ::std::vector; + + // STATIC DATA ----------------------------------------------------------- + +@@ -524,6 +525,44 @@ BOOL ScDocFunc::DetectiveRefresh( BOOL bAutomatic ) + return bDone; + } + ++static void lcl_collectAllPredOrSuccRanges( ++ const ScRangeList& rSrcRanges, vector& rRefTokens, ScDocShell& rDocShell, ++ bool bPred) ++{ ++ ScDocument* pDoc = rDocShell.GetDocument(); ++ vector aRefTokens; ++ ScRangeList aSrcRanges(rSrcRanges); ++ ScRange* p = aSrcRanges.First(); ++ if (!p) ++ return; ++ ScDetectiveFunc aDetFunc(pDoc, p->aStart.Tab()); ++ ScRangeList aDestRanges; ++ for (; p; p = aSrcRanges.Next()) ++ { ++ if (bPred) ++ { ++ aDetFunc.GetAllPreds( ++ p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), aRefTokens); ++ } ++ else ++ { ++ aDetFunc.GetAllSuccs( ++ p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), aRefTokens); ++ } ++ } ++ rRefTokens.swap(aRefTokens); ++} ++ ++void ScDocFunc::DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, vector& rRefTokens) ++{ ++ lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, true); ++} ++ ++void ScDocFunc::DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, vector& rRefTokens) ++{ ++ lcl_collectAllPredOrSuccRanges(rSrcRanges, rRefTokens, rDocShell, false); ++} ++ + //------------------------------------------------------------------------ + + BOOL ScDocFunc::DeleteContents( const ScMarkData& rMark, USHORT nFlags, +diff --git sc/source/ui/inc/docfunc.hxx sc/source/ui/inc/docfunc.hxx +index 6a1bf00..302b07d 100644 +--- sc/source/ui/inc/docfunc.hxx ++++ sc/source/ui/inc/docfunc.hxx +@@ -34,7 +34,10 @@ + #include + #include "global.hxx" + #include "formula/grammar.hxx" + #include "tabbgcolor.hxx" ++#include "token.hxx" ++ ++#include + + class ScEditEngineDefaulter; + class SdrUndoAction; +@@ -42,6 +45,7 @@ class ScDocShell; + class ScMarkData; + class ScPatternAttr; + class ScRange; ++class ScRangeList; + class ScRangeName; + class ScBaseCell; + class ScTokenArray; +@@ -77,6 +81,8 @@ public: + BOOL DetectiveMarkInvalid(SCTAB nTab); + BOOL DetectiveDelAll(SCTAB nTab); + BOOL DetectiveRefresh(BOOL bAutomatic = FALSE); ++ void DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, ::std::vector& rRefTokens); ++ void DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, ::std::vector& rRefTokens); + + BOOL DeleteContents( const ScMarkData& rMark, USHORT nFlags, + BOOL bRecord, BOOL bApi ); +diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx +index 7bf556d..7bd9a26 100644 +--- sc/source/ui/inc/viewfunc.hxx ++++ sc/source/ui/inc/viewfunc.hxx +@@ -326,6 +326,8 @@ public: + void DetectiveMarkInvalid(); + void DetectiveDelAll(); + void DetectiveRefresh(); ++ void DetectiveMarkPred(); ++ void DetectiveMarkSucc(); + + void ShowNote( bool bShow = true ); + inline void HideNote() { ShowNote( false ); } +@@ -366,6 +368,8 @@ private: + BOOL TestFormatArea( SCCOL nCol, SCROW nRow, SCTAB nTab, BOOL bAttrChanged ); + void DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab, + BOOL bAttrChanged, BOOL bAddUndo ); ++ ++ void MarkAndJumpToRanges(const ScRangeList& rRanges); + }; + + +diff --git sc/source/ui/view/cellsh1.cxx sc/source/ui/view/cellsh1.cxx +index 0cd4007..d6fdb75 100644 +--- sc/source/ui/view/cellsh1.cxx ++++ sc/source/ui/view/cellsh1.cxx +@@ -1584,6 +1584,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) + rReq.Done(); + break; + ++ case SID_DETECTIVE_MARK_PRED: ++ pTabViewShell->DetectiveMarkPred(); ++ break; ++ case SID_DETECTIVE_MARK_SUCC: ++ pTabViewShell->DetectiveMarkSucc(); ++ break; ++ + case SID_SPELL_DIALOG: + // pTabViewShell->DoSpellingChecker(); + { +diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx +index 57f1996..2b2ec31 100644 +--- sc/source/ui/view/gridwin.cxx ++++ sc/source/ui/view/gridwin.cxx +@@ -3078,6 +3078,17 @@ void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt) + ShowNoteMarker( pViewData->GetCurX(), pViewData->GetCurY(), TRUE ); + return; + } ++ if (aCode.GetCode() == KEY_BRACKETLEFT && aCode.GetModifier() == KEY_MOD1) ++ { ++ pViewSh->DetectiveMarkPred(); ++ return; ++ } ++ if (aCode.GetCode() == KEY_BRACKETRIGHT && aCode.GetModifier() == KEY_MOD1) ++ { ++ pViewSh->DetectiveMarkSucc(); ++ return; ++ } ++ + } + + Window::KeyInput(rKEvt); +diff --git sc/source/ui/view/tabvwsh3.cxx sc/source/ui/view/tabvwsh3.cxx +index e106539..eb4c908 100644 +--- sc/source/ui/view/tabvwsh3.cxx ++++ sc/source/ui/view/tabvwsh3.cxx +@@ -407,13 +407,15 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) + { + pViewData->ResetOldCursor(); + SetCursor( nCol, nRow ); +- AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); + rBindings.Invalidate( SID_CURRENTCELL ); + rBindings.Update( nSlot ); + + if (!rReq.IsAPI()) + rReq.Done(); + } ++ // align to cursor even if the cursor position hasn't changed, ++ // because the cursor may be set outside the visible area. ++ AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); + + rReq.SetReturnValue( SfxStringItem( SID_CURRENTCELL, aAddress ) ); + } +diff --git sc/source/ui/view/viewfun6.cxx sc/source/ui/view/viewfun6.cxx +index 43b3db1..e686cfc 100644 +--- sc/source/ui/view/viewfun6.cxx ++++ sc/source/ui/view/viewfun6.cxx +@@ -50,6 +50,13 @@ + #include "globstr.hrc" + #include "sc.hrc" + #include "fusel.hxx" ++#include "reftokenhelper.hxx" ++#include "externalrefmgr.hxx" ++ ++#include ++ ++using ::rtl::OUStringBuffer; ++using ::std::vector; + + //================================================================== + +@@ -140,6 +147,136 @@ void ScViewFunc::DetectiveRefresh() + RecalcPPT(); + } + ++static void lcl_jumpToRange(const ScRange& rRange, ScViewData* pView, ScDocument* pDoc) ++{ ++ String aAddrText; ++ rRange.Format(aAddrText, SCR_ABS_3D, pDoc); ++ SfxStringItem aPosItem(SID_CURRENTCELL, aAddrText); ++ SfxBoolItem aUnmarkItem(FN_PARAM_1, TRUE); // remove existing selection ++ pView->GetDispatcher().Execute( ++ SID_CURRENTCELL, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, ++ &aPosItem, &aUnmarkItem, 0L); ++} ++ ++void ScViewFunc::MarkAndJumpToRanges(const ScRangeList& rRanges) ++{ ++ ScViewData* pView = GetViewData(); ++ ScDocShell* pDocSh = pView->GetDocShell(); ++ ++ ScRangeList aRanges(rRanges); ++ ScRange* p = aRanges.First(); ++ ScRangeList aRangesToMark; ++ ScAddress aCurPos = pView->GetCurPos(); ++ for (; p; p = aRanges.Next()) ++ { ++ // Collect only those ranges that are on the same sheet as the current ++ // cursor. ++ ++ if (p->aStart.Tab() == aCurPos.Tab()) ++ aRangesToMark.Append(*p); ++ } ++ ++ if (!aRangesToMark.Count()) ++ return; ++ ++ // Jump to the first range of all precedent ranges. ++ p = aRangesToMark.First(); ++ lcl_jumpToRange(*p, pView, pDocSh->GetDocument()); ++ ++ for (; p; p = aRangesToMark.Next()) ++ MarkRange(*p, false, true); ++} ++ ++void ScViewFunc::DetectiveMarkPred() ++{ ++ ScViewData* pView = GetViewData(); ++ ScDocShell* pDocSh = pView->GetDocShell(); ++ ScDocument* pDoc = pDocSh->GetDocument(); ++ ScMarkData& rMarkData = pView->GetMarkData(); ++ ScAddress aCurPos = pView->GetCurPos(); ++ ScRangeList aRanges; ++ if (rMarkData.IsMarked() || rMarkData.IsMultiMarked()) ++ rMarkData.FillRangeListWithMarks(&aRanges, false); ++ else ++ aRanges.Append(aCurPos); ++ ++ vector aRefTokens; ++ pDocSh->GetDocFunc().DetectiveCollectAllPreds(aRanges, aRefTokens); ++ ++ if (aRefTokens.empty()) ++ // No precedents found. Nothing to do. ++ return; ++ ++ ScSharedTokenRef p = aRefTokens.front(); ++ if (ScRefTokenHelper::isExternalRef(p)) ++ { ++ // This is external. Open the external document if available, and ++ // jump to the destination. ++ ++ sal_uInt16 nFileId = p->GetIndex(); ++ ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager(); ++ const String* pPath = pRefMgr->getExternalFileName(nFileId); ++ ++ ScRange aRange; ++ if (pPath && ScRefTokenHelper::getRangeFromToken(aRange, p, true)) ++ { ++ const String& rTabName = p->GetString(); ++ OUStringBuffer aBuf; ++ aBuf.append(*pPath); ++ aBuf.append(sal_Unicode('#')); ++ aBuf.append(rTabName); ++ aBuf.append(sal_Unicode('.')); ++ ++ String aRangeStr; ++ aRange.Format(aRangeStr, SCA_VALID); ++ aBuf.append(aRangeStr); ++ ++ ScGlobal::OpenURL(aBuf.makeStringAndClear(), String()); ++ } ++ return; ++ } ++ else ++ { ++ ScRange aRange; ++ ScRefTokenHelper::getRangeFromToken(aRange, p, false); ++ if (aRange.aStart.Tab() != aCurPos.Tab()) ++ { ++ // The first precedent range is on a different sheet. Jump to it ++ // immediately and forget the rest. ++ lcl_jumpToRange(aRange, pView, pDoc); ++ return; ++ } ++ } ++ ++ ScRangeList aDestRanges; ++ ScRefTokenHelper::getRangeListFromTokens(aDestRanges, aRefTokens); ++ MarkAndJumpToRanges(aDestRanges); ++} ++ ++void ScViewFunc::DetectiveMarkSucc() ++{ ++ ScViewData* pView = GetViewData(); ++ ScDocShell* pDocSh = pView->GetDocShell(); ++ ScMarkData& rMarkData = pView->GetMarkData(); ++ ScAddress aCurPos = pView->GetCurPos(); ++ ScRangeList aRanges; ++ if (rMarkData.IsMarked() || rMarkData.IsMultiMarked()) ++ rMarkData.FillRangeListWithMarks(&aRanges, false); ++ else ++ aRanges.Append(aCurPos); ++ ++ vector aRefTokens; ++ pDocSh->GetDocFunc().DetectiveCollectAllSuccs(aRanges, aRefTokens); ++ ++ if (aRefTokens.empty()) ++ // No dependants found. Nothing to do. ++ return; ++ ++ ScRangeList aDestRanges; ++ ScRefTokenHelper::getRangeListFromTokens(aDestRanges, aRefTokens); ++ MarkAndJumpToRanges(aDestRanges); ++} ++ + //--------------------------------------------------------------------------- + + void ScViewFunc::ShowNote( bool bShow ) diff --git a/applied_patches/0453-calc-jump-on-formula-ref-sfx2.diff b/applied_patches/0169-calc-jump-on-formula-ref-sfx2.diff similarity index 100% rename from applied_patches/0453-calc-jump-on-formula-ref-sfx2.diff rename to applied_patches/0169-calc-jump-on-formula-ref-sfx2.diff diff --git a/applied_patches/0454-calc-jump-on-formula-ref-vcl.diff b/applied_patches/0170-calc-jump-on-formula-ref-vcl.diff similarity index 100% rename from applied_patches/0454-calc-jump-on-formula-ref-vcl.diff rename to applied_patches/0170-calc-jump-on-formula-ref-vcl.diff diff --git a/applied_patches/0171-calc-ods-sheet-protection-sc.diff b/applied_patches/0171-calc-ods-sheet-protection-sc.diff new file mode 100644 index 000000000..9c5b21b60 --- /dev/null +++ b/applied_patches/0171-calc-ods-sheet-protection-sc.diff @@ -0,0 +1,1032 @@ +diff --git sc/inc/tabprotection.hxx sc/inc/tabprotection.hxx +index 99fec7b..b986070 100644 +--- sc/inc/tabprotection.hxx ++++ sc/inc/tabprotection.hxx +@@ -35,7 +35,6 @@ + #include + + #include "global.hxx" +-#include + #include + + #define ENABLE_SHEET_PROTECTION 1 +@@ -45,8 +44,9 @@ class ScTableProtectionImpl; + + enum ScPasswordHash + { +- PASSHASH_OOO = 0, +- PASSHASH_XL ++ PASSHASH_SHA1 = 0, ++ PASSHASH_XL, ++ PASSHASH_UNSPECIFIED + }; + + class ScPassHashHelper +@@ -56,7 +56,11 @@ public: + least one hash that needs to be regenerated, it returns true. If all + hash values are compatible with the specified hash type, then it + returns false. */ +- static bool needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash); ++ static bool needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); ++ ++ static ::rtl::OUString getHashURI(ScPasswordHash eHash); ++ ++ static ScPasswordHash getHashTypeFromURI(const ::rtl::OUString& rURI); + + private: + ScPassHashHelper(); +@@ -75,11 +79,13 @@ public: + virtual void setProtected(bool bProtected) = 0; + + virtual bool isPasswordEmpty() const = 0; +- virtual bool hasPasswordHash(ScPasswordHash eHash) const = 0; ++ virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const = 0; + virtual void setPassword(const String& aPassText) = 0; +- virtual ::com::sun::star::uno::Sequence getPasswordHash(ScPasswordHash eHash) const = 0; +- virtual void setPasswordHash(const ::com::sun::star::uno::Sequence& aPassword, +- ScPasswordHash eHash = PASSHASH_OOO) = 0; ++ virtual ::com::sun::star::uno::Sequence getPasswordHash( ++ ScPasswordHash eHash, ScPasswordHash eHas2 = PASSHASH_UNSPECIFIED) const = 0; ++ virtual void setPasswordHash( ++ const ::com::sun::star::uno::Sequence& aPassword, ++ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) = 0; + virtual bool verifyPassword(const String& aPassText) const = 0; + }; + +@@ -105,11 +111,13 @@ public: + virtual void setProtected(bool bProtected); + + virtual bool isPasswordEmpty() const; +- virtual bool hasPasswordHash(ScPasswordHash eHash) const; ++ virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; + virtual void setPassword(const String& aPassText); +- virtual ::com::sun::star::uno::Sequence getPasswordHash(ScPasswordHash eHash) const; +- virtual void setPasswordHash(const ::com::sun::star::uno::Sequence& aPassword, +- ScPasswordHash eHash = PASSHASH_OOO); ++ virtual ::com::sun::star::uno::Sequence getPasswordHash( ++ ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; ++ virtual void setPasswordHash( ++ const ::com::sun::star::uno::Sequence& aPassword, ++ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); + virtual bool verifyPassword(const String& aPassText) const; + + bool isOptionEnabled(Option eOption) const; +@@ -162,11 +170,13 @@ public: + virtual void setProtected(bool bProtected); + + virtual bool isPasswordEmpty() const; +- virtual bool hasPasswordHash(ScPasswordHash eHash) const; ++ virtual bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; + virtual void setPassword(const String& aPassText); +- virtual ::com::sun::star::uno::Sequence getPasswordHash(ScPasswordHash eHash) const; +- virtual void setPasswordHash(const ::com::sun::star::uno::Sequence& aPassword, +- ScPasswordHash eHash = PASSHASH_OOO); ++ virtual ::com::sun::star::uno::Sequence getPasswordHash( ++ ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; ++ virtual void setPasswordHash( ++ const ::com::sun::star::uno::Sequence& aPassword, ++ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); + virtual bool verifyPassword(const String& aPassText) const; + + bool isOptionEnabled(Option eOption) const; +diff --git sc/source/core/data/tabprotection.cxx sc/source/core/data/tabprotection.cxx +index 2e51a33..463e6a8 100644 +--- sc/source/core/data/tabprotection.cxx ++++ sc/source/core/data/tabprotection.cxx +@@ -38,20 +38,27 @@ + #include "svtools/PasswordHelper.hxx" + #include "document.hxx" + ++#include ++ + #define DEBUG_TAB_PROTECTION 0 + ++#define URI_SHA1 "http://www.w3.org/2000/09/xmldsig#sha1" ++#define URI_XLS_LEGACY "http://docs.oasis-open.org/office/ns/table/legacy-hash-excel" ++ + using namespace ::com::sun::star; + using ::com::sun::star::uno::Sequence; + using ::rtl::OUString; ++using ::rtl::OUStringBuffer; ++using ::std::vector; + + // ============================================================================ + +-bool ScPassHashHelper::needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash) ++bool ScPassHashHelper::needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash eHash1, ScPasswordHash eHash2) + { + if (rDoc.IsDocProtected()) + { + const ScDocProtection* p = rDoc.GetDocProtection(); +- if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash)) ++ if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash1, eHash2)) + return true; + } + +@@ -63,13 +70,37 @@ bool ScPassHashHelper::needsPassHashRegen(const ScDocument& rDoc, ScPasswordHash + // Sheet not protected. Skip it. + continue; + +- if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash)) ++ if (!p->isPasswordEmpty() && !p->hasPasswordHash(eHash1, eHash2)) + return true; + } + + return false; + } + ++OUString ScPassHashHelper::getHashURI(ScPasswordHash eHash) ++{ ++ switch (eHash) ++ { ++ case PASSHASH_SHA1: ++ return OUString::createFromAscii(URI_SHA1); ++ case PASSHASH_XL: ++ return OUString::createFromAscii(URI_XLS_LEGACY); ++ case PASSHASH_UNSPECIFIED: ++ default: ++ ; ++ } ++ return OUString(); ++} ++ ++ScPasswordHash ScPassHashHelper::getHashTypeFromURI(const OUString& rURI) ++{ ++ if (rURI.equalsAscii(URI_SHA1)) ++ return PASSHASH_SHA1; ++ else if (rURI.equalsAscii(URI_XLS_LEGACY)) ++ return PASSHASH_XL; ++ return PASSHASH_UNSPECIFIED; ++} ++ + // ============================================================================ + + ScPassHashProtectable::~ScPassHashProtectable() +@@ -115,7 +146,8 @@ static Sequence lcl_getXLHash(const String& aPassText) + class ScTableProtectionImpl + { + public: +- static ::com::sun::star::uno::Sequence hashPassword(const String& aPassText, ScPasswordHash eHash = PASSHASH_OOO); ++ static Sequence hashPassword(const String& aPassText, ScPasswordHash eHash = PASSHASH_SHA1); ++ static Sequence hashPassword(const Sequence& rPassHash, ScPasswordHash eHash = PASSHASH_SHA1); + + explicit ScTableProtectionImpl(SCSIZE nOptSize); + explicit ScTableProtectionImpl(const ScTableProtectionImpl& r); +@@ -125,10 +157,13 @@ public: + void setProtected(bool bProtected); + + bool isPasswordEmpty() const; +- bool hasPasswordHash(ScPasswordHash eHash) const; ++ bool hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; + void setPassword(const String& aPassText); +- ::com::sun::star::uno::Sequence getPasswordHash(ScPasswordHash eHash) const; +- void setPasswordHash(const ::com::sun::star::uno::Sequence& aPassword, ScPasswordHash eHash = PASSHASH_OOO); ++ ::com::sun::star::uno::Sequence getPasswordHash( ++ ScPasswordHash eHash, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED) const; ++ void setPasswordHash( ++ const ::com::sun::star::uno::Sequence& aPassword, ++ ScPasswordHash eHash = PASSHASH_SHA1, ScPasswordHash eHash2 = PASSHASH_UNSPECIFIED); + bool verifyPassword(const String& aPassText) const; + + bool isOptionEnabled(SCSIZE nOptId) const; +@@ -140,7 +175,8 @@ private: + ::std::vector maOptions; + bool mbEmptyPass; + bool mbProtected; +- ScPasswordHash meHash; ++ ScPasswordHash meHash1; ++ ScPasswordHash meHash2; + }; + + Sequence ScTableProtectionImpl::hashPassword(const String& aPassText, ScPasswordHash eHash) +@@ -151,19 +187,44 @@ Sequence ScTableProtectionImpl::hashPassword(const String& aPassText, + case PASSHASH_XL: + aHash = lcl_getXLHash(aPassText); + break; +- case PASSHASH_OOO: +- default: ++ case PASSHASH_SHA1: + SvPasswordHelper::GetHashPassword(aHash, aPassText); + break; ++ default: ++ ; + } + return aHash; + } + ++Sequence ScTableProtectionImpl::hashPassword( ++ const Sequence& rPassHash, ScPasswordHash eHash) ++{ ++ if (!rPassHash.getLength() || eHash == PASSHASH_UNSPECIFIED) ++ return rPassHash; ++ ++ // TODO: Right now, we only support double-hash by SHA1. ++ if (eHash == PASSHASH_SHA1) ++ { ++ vector aChars; ++ sal_Int32 n = rPassHash.getLength(); ++ aChars.reserve(n); ++ for (sal_Int32 i = 0; i < n; ++i) ++ aChars.push_back(static_cast(rPassHash[i])); ++ ++ Sequence aNewHash; ++ SvPasswordHelper::GetHashPassword(aNewHash, &aChars[0], aChars.size()); ++ return aNewHash; ++ } ++ ++ return rPassHash; ++} ++ + ScTableProtectionImpl::ScTableProtectionImpl(SCSIZE nOptSize) : + maOptions(nOptSize), + mbEmptyPass(true), + mbProtected(false), +- meHash(PASSHASH_OOO) ++ meHash1(PASSHASH_SHA1), ++ meHash2(PASSHASH_UNSPECIFIED) + { + } + +@@ -173,7 +234,8 @@ ScTableProtectionImpl::ScTableProtectionImpl(const ScTableProtectionImpl& r) : + maOptions(r.maOptions), + mbEmptyPass(r.mbEmptyPass), + mbProtected(r.mbProtected), +- meHash(r.meHash) ++ meHash1(r.meHash1), ++ meHash2(r.meHash2) + { + } + +@@ -217,7 +279,7 @@ bool ScTableProtectionImpl::isPasswordEmpty() const + return mbEmptyPass; + } + +-bool ScTableProtectionImpl::hasPasswordHash(ScPasswordHash eHash) const ++bool ScTableProtectionImpl::hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const + { + if (mbEmptyPass) + return true; +@@ -225,35 +287,65 @@ bool ScTableProtectionImpl::hasPasswordHash(ScPasswordHash eHash) const + if (maPassText.Len()) + return true; + +- if (meHash == eHash) +- return true; ++ if (meHash1 == eHash) ++ { ++ if (meHash2 == PASSHASH_UNSPECIFIED) ++ // single hash. ++ return true; ++ ++ return meHash2 == eHash2; ++ } + + return false; + } + +-Sequence ScTableProtectionImpl::getPasswordHash(ScPasswordHash eHash) const ++Sequence ScTableProtectionImpl::getPasswordHash( ++ ScPasswordHash eHash, ScPasswordHash eHash2) const + { ++ Sequence aPassHash; ++ + if (mbEmptyPass) + // Flaged as empty. +- return Sequence(); ++ return aPassHash; + + if (maPassText.Len()) ++ { + // Cleartext password exists. Hash it. +- return hashPassword(maPassText, eHash); ++ aPassHash = hashPassword(maPassText, eHash); ++ if (eHash2 != PASSHASH_UNSPECIFIED) ++ // Double-hash it. ++ aPassHash = hashPassword(aPassHash, eHash2); + +- if (meHash == eHash) +- // Stored hash exists. +- return maPassHash; ++ return aPassHash; ++ } ++ else ++ { ++ // No clear text password. Check if we have a hash value of the right hash type. ++ if (meHash1 == eHash) ++ { ++ aPassHash = maPassHash; ++ ++ if (meHash2 == eHash2) ++ // Matching double-hash requested. ++ return aPassHash; ++ else if (meHash2 == PASSHASH_UNSPECIFIED) ++ // primary hashing type match. Double hash it by the requested ++ // double-hash type. ++ return hashPassword(aPassHash, eHash2); ++ } ++ } + +- // Failed to find a matching hash. ++ // failed. + return Sequence(); + } + +-void ScTableProtectionImpl::setPasswordHash(const uno::Sequence& aPassword, ScPasswordHash eHash) ++void ScTableProtectionImpl::setPasswordHash( ++ const uno::Sequence& aPassword, ScPasswordHash eHash, ScPasswordHash eHash2) + { + sal_Int32 nLen = aPassword.getLength(); + mbEmptyPass = nLen <= 0 ? true : false; +- meHash = eHash; ++ meHash1 = eHash; ++ meHash2 = eHash2; + maPassHash = aPassword; + + #if DEBUG_TAB_PROTECTION +@@ -277,7 +369,8 @@ bool ScTableProtectionImpl::verifyPassword(const String& aPassText) const + // Clear text password exists, and this one takes precedence. + return aPassText.Equals(maPassText); + +- Sequence aHash = hashPassword(aPassText, meHash); ++ Sequence aHash = hashPassword(aPassText, meHash1); ++ aHash = hashPassword(aHash, meHash2); + + #if DEBUG_TAB_PROTECTION + fprintf(stdout, "ScTableProtectionImpl::verifyPassword: hash = "); +@@ -353,9 +446,9 @@ bool ScDocProtection::isPasswordEmpty() const + return mpImpl->isPasswordEmpty(); + } + +-bool ScDocProtection::hasPasswordHash(ScPasswordHash eHash) const ++bool ScDocProtection::hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const + { +- return mpImpl->hasPasswordHash(eHash); ++ return mpImpl->hasPasswordHash(eHash, eHash2); + } + + void ScDocProtection::setPassword(const String& aPassText) +@@ -363,14 +456,15 @@ void ScDocProtection::setPassword(const String& aPassText) + mpImpl->setPassword(aPassText); + } + +-uno::Sequence ScDocProtection::getPasswordHash(ScPasswordHash eHash) const ++uno::Sequence ScDocProtection::getPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const + { +- return mpImpl->getPasswordHash(eHash); ++ return mpImpl->getPasswordHash(eHash, eHash2); + } + +-void ScDocProtection::setPasswordHash(const uno::Sequence& aPassword, ScPasswordHash eHash) ++void ScDocProtection::setPasswordHash( ++ const uno::Sequence& aPassword, ScPasswordHash eHash, ScPasswordHash eHash2) + { +- mpImpl->setPasswordHash(aPassword, eHash); ++ mpImpl->setPasswordHash(aPassword, eHash, eHash2); + } + + bool ScDocProtection::verifyPassword(const String& aPassText) const +@@ -428,9 +522,9 @@ bool ScTableProtection::isPasswordEmpty() const + return mpImpl->isPasswordEmpty(); + } + +-bool ScTableProtection::hasPasswordHash(ScPasswordHash eHash) const ++bool ScTableProtection::hasPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const + { +- return mpImpl->hasPasswordHash(eHash); ++ return mpImpl->hasPasswordHash(eHash, eHash2); + } + + void ScTableProtection::setPassword(const String& aPassText) +@@ -438,14 +532,15 @@ void ScTableProtection::setPassword(const String& aPassText) + mpImpl->setPassword(aPassText); + } + +-Sequence ScTableProtection::getPasswordHash(ScPasswordHash eHash) const ++Sequence ScTableProtection::getPasswordHash(ScPasswordHash eHash, ScPasswordHash eHash2) const + { +- return mpImpl->getPasswordHash(eHash); ++ return mpImpl->getPasswordHash(eHash, eHash2); + } + +-void ScTableProtection::setPasswordHash(const uno::Sequence& aPassword, ScPasswordHash eHash) ++void ScTableProtection::setPasswordHash( ++ const uno::Sequence& aPassword, ScPasswordHash eHash, ScPasswordHash eHash2) + { +- mpImpl->setPasswordHash(aPassword, eHash); ++ mpImpl->setPasswordHash(aPassword, eHash, eHash2); + } + + bool ScTableProtection::verifyPassword(const String& aPassText) const +diff --git sc/source/filter/xml/xmlbodyi.cxx sc/source/filter/xml/xmlbodyi.cxx +index fa993ef..c118998 100644 +--- sc/source/filter/xml/xmlbodyi.cxx ++++ sc/source/filter/xml/xmlbodyi.cxx +@@ -77,6 +77,8 @@ ScXMLBodyContext::ScXMLBodyContext( ScXMLImport& rImport, + const uno::Reference& xAttrList ) : + SvXMLImportContext( rImport, nPrfx, rLName ), + sPassword(), ++ meHash1(PASSHASH_SHA1), ++ meHash2(PASSHASH_UNSPECIFIED), + bProtected(sal_False), + bHadCalculationSettings(sal_False), + pChangeTrackingImportHelper(NULL) +@@ -122,6 +124,10 @@ ScXMLBodyContext::ScXMLBodyContext( ScXMLImport& rImport, + bProtected = IsXMLToken(sValue, XML_TRUE); + else if (IsXMLToken(aLocalName, XML_PROTECTION_KEY)) + sPassword = sValue; ++ else if (IsXMLToken(aLocalName, XML_PROTECTION_KEY_DIGEST_ALGORITHM)) ++ meHash1 = ScPassHashHelper::getHashTypeFromURI(sValue); ++ else if (IsXMLToken(aLocalName, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2)) ++ meHash2 = ScPassHashHelper::getHashTypeFromURI(sValue); + } + } + } +@@ -291,7 +297,7 @@ void ScXMLBodyContext::EndElement() + if (sPassword.getLength()) + { + SvXMLUnitConverter::decodeBase64(aPass, sPassword); +- pProtection->setPasswordHash(aPass, PASSHASH_OOO); ++ pProtection->setPasswordHash(aPass, meHash1, meHash2); + } + + pDoc->SetDocProtection(pProtection.get()); +diff --git sc/source/filter/xml/xmlbodyi.hxx sc/source/filter/xml/xmlbodyi.hxx +index 483741e..69d5407 100644 +--- sc/source/filter/xml/xmlbodyi.hxx ++++ sc/source/filter/xml/xmlbodyi.hxx +@@ -34,12 +34,16 @@ + #include + #include + ++#include "tabprotection.hxx" ++ + class ScXMLImport; + class ScXMLChangeTrackingImportHelper; + + class ScXMLBodyContext : public SvXMLImportContext + { + rtl::OUString sPassword; ++ ScPasswordHash meHash1; ++ ScPasswordHash meHash2; + sal_Bool bProtected; + sal_Bool bHadCalculationSettings; + +diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx +index 3658d78..089f12d 100644 +--- sc/source/filter/xml/xmlexprt.cxx ++++ sc/source/filter/xml/xmlexprt.cxx +@@ -1441,12 +1441,36 @@ void ScXMLExport::SetBodyAttributes() + AddAttribute(XML_NAMESPACE_TABLE, XML_STRUCTURE_PROTECTED, XML_TRUE); + rtl::OUStringBuffer aBuffer; + uno::Sequence aPassHash; ++ ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED; + const ScDocProtection* p = pDoc->GetDocProtection(); + if (p) +- aPassHash = p->getPasswordHash(PASSHASH_OOO); ++ { ++ if (p->hasPasswordHash(PASSHASH_SHA1)) ++ { ++ aPassHash = p->getPasswordHash(PASSHASH_SHA1); ++ eHashUsed = PASSHASH_SHA1; ++ } ++ else if (p->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1)) ++ { ++ aPassHash = p->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1); ++ eHashUsed = PASSHASH_XL; ++ } ++ } + SvXMLUnitConverter::encodeBase64(aBuffer, aPassHash); + if (aBuffer.getLength()) ++ { + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); ++ if (eHashUsed == PASSHASH_XL) ++ { ++ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, ++ ScPassHashHelper::getHashURI(PASSHASH_XL)); ++ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, ++ ScPassHashHelper::getHashURI(PASSHASH_SHA1)); ++ } ++ else if (eHashUsed == PASSHASH_SHA1) ++ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, ++ ScPassHashHelper::getHashURI(PASSHASH_SHA1)); ++ } + } + } + +@@ -1513,18 +1537,46 @@ void ScXMLExport::_ExportContent() + AddAttribute(sAttrName, sOUTableName); + AddAttribute(sAttrStyleName, aTableStyles[nTable]); + uno::Reference xProtectable (xTable, uno::UNO_QUERY); ++ ScTableProtection* pProtect = NULL; + if (xProtectable.is() && xProtectable->isProtected()) + { + AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE); +- rtl::OUStringBuffer aBuffer; + if (pDoc) + { +- ScTableProtection* pProtect = pDoc->GetTabProtection(static_cast(nTable)); ++ pProtect = pDoc->GetTabProtection(static_cast(nTable)); + if (pProtect) +- SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_OOO)); ++ { ++ rtl::OUStringBuffer aBuffer; ++ ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED; ++ if (pProtect->hasPasswordHash(PASSHASH_SHA1)) ++ { ++ SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_SHA1)); ++ eHashUsed = PASSHASH_SHA1; ++ } ++ else if (pProtect->hasPasswordHash(PASSHASH_XL, PASSHASH_SHA1)) ++ { ++ // Double-hash this by SHA1 on top of the legacy xls hash. ++ uno::Sequence aHash = pProtect->getPasswordHash(PASSHASH_XL, PASSHASH_SHA1); ++ SvXMLUnitConverter::encodeBase64(aBuffer, aHash); ++ eHashUsed = PASSHASH_XL; ++ } ++ if (aBuffer.getLength()) ++ { ++ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); ++ if (eHashUsed == PASSHASH_XL) ++ { ++ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, ++ ScPassHashHelper::getHashURI(PASSHASH_XL)); ++ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, ++ ScPassHashHelper::getHashURI(PASSHASH_SHA1)); ++ } ++ else if (eHashUsed == PASSHASH_SHA1) ++ AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, ++ ScPassHashHelper::getHashURI(PASSHASH_SHA1)); ++ ++ } ++ } + } +- if (aBuffer.getLength()) +- AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); + } + rtl::OUString sPrintRanges; + table::CellRangeAddress aColumnHeaderRange; +@@ -1535,6 +1587,20 @@ void ScXMLExport::_ExportContent() + else if (!pDoc->IsPrintEntireSheet(static_cast(nTable))) + AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE); + SvXMLElementExport aElemT(*this, sElemTab, sal_True, sal_True); ++ ++ if (pProtect && pProtect->isProtected()) ++ { ++ if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS)) ++ AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE); ++ if (pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS)) ++ AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TRUE); ++ ++ rtl::OUString aElemName = GetNamespaceMap().GetQNameByKey( ++ XML_NAMESPACE_TABLE, GetXMLToken(XML_TABLE_PROTECTION)); ++ ++ SvXMLElementExport aElemProtected(*this, aElemName, true, true); ++ } ++ + CheckAttrList(); + WriteTableSource(); + WriteScenario(); +diff --git sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx +index 4517591..728373e 100644 +--- sc/source/filter/xml/xmlimprt.cxx ++++ sc/source/filter/xml/xmlimprt.cxx +@@ -637,6 +637,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap() + { XML_NAMESPACE_TABLE, XML_TABLE_HEADER_COLUMNS, XML_TOK_TABLE_HEADER_COLS }, + { XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, XML_TOK_TABLE_COLS }, + { XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, XML_TOK_TABLE_COL }, ++ { XML_NAMESPACE_TABLE, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION }, + { XML_NAMESPACE_TABLE, XML_TABLE_ROW_GROUP, XML_TOK_TABLE_ROW_GROUP }, + { XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, XML_TOK_TABLE_HEADER_ROWS }, + { XML_NAMESPACE_TABLE, XML_TABLE_ROWS, XML_TOK_TABLE_ROWS }, +@@ -654,6 +655,22 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap() + return *pTableElemTokenMap; + } + ++const SvXMLTokenMap& ScXMLImport::GetTableProtectionAttrTokenMap() ++{ ++ if (!pTableProtectionElemTokenMap) ++ { ++ static __FAR_DATA SvXMLTokenMapEntry aTableProtectionTokenMap[] = ++ { ++ { XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS }, ++ { XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS }, ++ XML_TOKEN_MAP_END ++ }; ++ pTableProtectionElemTokenMap = new SvXMLTokenMap(aTableProtectionTokenMap); ++ } ++ ++ return *pTableProtectionElemTokenMap; ++} ++ + const SvXMLTokenMap& ScXMLImport::GetTableRowsElemTokenMap() + { + if( !pTableRowsElemTokenMap ) +@@ -700,9 +717,11 @@ const SvXMLTokenMap& ScXMLImport::GetTableAttrTokenMap() + { + { XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_TABLE_NAME }, + { XML_NAMESPACE_TABLE, XML_STYLE_NAME, XML_TOK_TABLE_STYLE_NAME }, +- { XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TOK_TABLE_PROTECTION }, ++ { XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TOK_TABLE_PROTECTED }, + { XML_NAMESPACE_TABLE, XML_PRINT_RANGES, XML_TOK_TABLE_PRINT_RANGES }, + { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, XML_TOK_TABLE_PASSWORD }, ++ { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, XML_TOK_TABLE_PASSHASH }, ++ { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, XML_TOK_TABLE_PASSHASH_2 }, + { XML_NAMESPACE_TABLE, XML_PRINT, XML_TOK_TABLE_PRINT }, + XML_TOKEN_MAP_END + }; +@@ -1685,6 +1704,7 @@ ScXMLImport::ScXMLImport( + pLabelRangesElemTokenMap( 0 ), + pLabelRangeAttrTokenMap( 0 ), + pTableElemTokenMap( 0 ), ++ pTableProtectionElemTokenMap(NULL), + pTableRowsElemTokenMap( 0 ), + pTableColsElemTokenMap( 0 ), + pTableScenarioAttrTokenMap( 0 ), +@@ -1811,6 +1831,7 @@ ScXMLImport::~ScXMLImport() throw() + delete pLabelRangesElemTokenMap; + delete pLabelRangeAttrTokenMap; + delete pTableElemTokenMap; ++ delete pTableProtectionElemTokenMap; + delete pTableRowsElemTokenMap; + delete pTableColsElemTokenMap; + delete pTableAttrTokenMap; +diff --git sc/source/filter/xml/xmlimprt.hxx sc/source/filter/xml/xmlimprt.hxx +index 093846a..8ff4178 100644 +--- sc/source/filter/xml/xmlimprt.hxx ++++ sc/source/filter/xml/xmlimprt.hxx +@@ -172,6 +172,7 @@ enum ScXMLTableTokens + XML_TOK_TABLE_COL, + XML_TOK_TABLE_ROW_GROUP, + XML_TOK_TABLE_HEADER_ROWS, ++ XML_TOK_TABLE_PROTECTION, + XML_TOK_TABLE_ROWS, + XML_TOK_TABLE_ROW, + XML_TOK_TABLE_SOURCE, +@@ -180,6 +181,12 @@ enum ScXMLTableTokens + XML_TOK_TABLE_FORMS + }; + ++enum ScXMLTokenProtectionTokens ++{ ++ XML_TOK_TABLE_SELECT_PROTECTED_CELLS, ++ XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS ++}; ++ + enum ScXMLTableRowsTokens + { + XML_TOK_TABLE_ROWS_ROW_GROUP, +@@ -200,9 +207,11 @@ enum ScXMLTableAttrTokens + { + XML_TOK_TABLE_NAME, + XML_TOK_TABLE_STYLE_NAME, +- XML_TOK_TABLE_PROTECTION, ++ XML_TOK_TABLE_PROTECTED, + XML_TOK_TABLE_PRINT_RANGES, + XML_TOK_TABLE_PASSWORD, ++ XML_TOK_TABLE_PASSHASH, ++ XML_TOK_TABLE_PASSHASH_2, + XML_TOK_TABLE_PRINT + }; + +@@ -699,6 +708,7 @@ class ScXMLImport: public SvXMLImport + SvXMLTokenMap *pLabelRangesElemTokenMap; + SvXMLTokenMap *pLabelRangeAttrTokenMap; + SvXMLTokenMap *pTableElemTokenMap; ++ SvXMLTokenMap *pTableProtectionElemTokenMap; + SvXMLTokenMap *pTableRowsElemTokenMap; + SvXMLTokenMap *pTableColsElemTokenMap; + SvXMLTokenMap *pTableScenarioAttrTokenMap; +@@ -865,6 +875,7 @@ public: + const SvXMLTokenMap& GetLabelRangesElemTokenMap(); + const SvXMLTokenMap& GetLabelRangeAttrTokenMap(); + const SvXMLTokenMap& GetTableElemTokenMap(); ++ const SvXMLTokenMap& GetTableProtectionAttrTokenMap(); + const SvXMLTokenMap& GetTableRowsElemTokenMap(); + const SvXMLTokenMap& GetTableColsElemTokenMap(); + const SvXMLTokenMap& GetTableAttrTokenMap(); +diff --git sc/source/filter/xml/xmlsubti.cxx sc/source/filter/xml/xmlsubti.cxx +index 72ddec3..3a001e9 100644 +--- sc/source/filter/xml/xmlsubti.cxx ++++ sc/source/filter/xml/xmlsubti.cxx +@@ -148,6 +148,15 @@ void ScMyTableData::SetChangedCols(const sal_Int32 nValue) + + /*******************************************************************************************************************************/ + ++ScXMLTabProtectionData::ScXMLTabProtectionData() : ++ meHash1(PASSHASH_SHA1), ++ meHash2(PASSHASH_UNSPECIFIED), ++ mbProtected(false), ++ mbSelectProtectedCells(true), ++ mbSelectUnprotectedCells(true) ++{ ++} ++ + ScMyTables::ScMyTables(ScXMLImport& rTempImport) + : rImport(rTempImport), + aResizeShapes(rTempImport), +@@ -173,7 +182,7 @@ ScMyTables::~ScMyTables() + } + + void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString& sStyleName, +- const sal_Bool bTempProtection, const rtl::OUString& sTempPassword) ++ const ScXMLTabProtectionData& rProtectData) + { + if (rImport.GetModel().is()) + { +@@ -189,8 +198,7 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString& + } + ++nCurrentSheet; + +- bProtection = bTempProtection; +- sPassword = sTempPassword; ++ maProtectionData = rProtectData; + uno::Reference xSpreadDoc( rImport.GetModel(), uno::UNO_QUERY ); + if ( xSpreadDoc.is() ) + { +@@ -617,13 +625,16 @@ void ScMyTables::DeleteTable() + aMatrixRangeList.clear(); + } + +- if (rImport.GetDocument() && bProtection) ++ if (rImport.GetDocument() && maProtectionData.mbProtected) + { +- uno::Sequence aPass; +- SvXMLUnitConverter::decodeBase64(aPass, sPassword); ++ uno::Sequence aHash; ++ SvXMLUnitConverter::decodeBase64(aHash, maProtectionData.maPassword); ++ + auto_ptr pProtect(new ScTableProtection); +- pProtect->setProtected(bProtection); +- pProtect->setPasswordHash(aPass, PASSHASH_OOO); ++ pProtect->setProtected(maProtectionData.mbProtected); ++ pProtect->setPasswordHash(aHash, maProtectionData.meHash1, maProtectionData.meHash2); ++ pProtect->setOption(ScTableProtection::SELECT_LOCKED_CELLS, maProtectionData.mbSelectProtectedCells); ++ pProtect->setOption(ScTableProtection::SELECT_UNLOCKED_CELLS, maProtectionData.mbSelectUnprotectedCells); + rImport.GetDocument()->SetTabProtection(static_cast(nCurrentSheet), pProtect.get()); + } + +diff --git sc/source/filter/xml/xmlsubti.hxx sc/source/filter/xml/xmlsubti.hxx +index 23dc5db..349b395 100644 +--- sc/source/filter/xml/xmlsubti.hxx ++++ sc/source/filter/xml/xmlsubti.hxx +@@ -43,6 +43,7 @@ + #include + #include "XMLTableShapeResizer.hxx" + #include "formula/grammar.hxx" ++#include "tabprotection.hxx" + + class ScXMLImport; + +@@ -107,6 +108,18 @@ struct ScMatrixRange + } + }; + ++struct ScXMLTabProtectionData ++{ ++ ::rtl::OUString maPassword; ++ ScPasswordHash meHash1; ++ ScPasswordHash meHash2; ++ bool mbProtected; ++ bool mbSelectProtectedCells; ++ bool mbSelectUnprotectedCells; ++ ++ ScXMLTabProtectionData(); ++}; ++ + class ScMyTables + { + private: +@@ -121,8 +134,8 @@ private: + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > xDrawPage; + ::com::sun::star::uno::Reference < ::com::sun::star::drawing::XShapes > xShapes; + rtl::OUString sCurrentSheetName; +- rtl::OUString sPassword; + std::vector aTableVec; ++ ScXMLTabProtectionData maProtectionData; + ScMyMatrixRangeList aMatrixRangeList; + com::sun::star::table::CellAddress aRealCellPos; + sal_Int32 nCurrentColStylePos; +@@ -130,7 +143,6 @@ private: + sal_Int16 nCurrentXShapes; + sal_Int32 nTableCount; + sal_Int32 nCurrentSheet; +- sal_Bool bProtection; + + sal_Bool IsMerged (const com::sun::star::uno::Reference & xCellRange, + const sal_Int32 nCol, const sal_Int32 nRow, +@@ -145,7 +157,7 @@ public: + ScMyTables(ScXMLImport& rImport); + ~ScMyTables(); + void NewSheet(const rtl::OUString& sTableName, const rtl::OUString& sStyleName, +- const sal_Bool bProtection, const rtl::OUString& sPassword); ++ const ScXMLTabProtectionData& rProtectData); + void AddRow(); + void SetRowStyle(const rtl::OUString& rCellStyleName); + void AddColumn(sal_Bool bIsCovered); +@@ -156,6 +168,7 @@ public: + com::sun::star::table::CellAddress GetRealCellPos(); + void AddColCount(sal_Int32 nTempColCount); + void AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCellStyleName); ++ ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; } + rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; } + sal_Int32 GetCurrentSheet() const { return nCurrentSheet; } + sal_Int32 GetCurrentColumn() const { return aTableVec[nTableCount - 1]->GetColCount(); } +diff --git sc/source/filter/xml/xmltabi.cxx sc/source/filter/xml/xmltabi.cxx +index fc09927..5229085 100644 +--- sc/source/filter/xml/xmltabi.cxx ++++ sc/source/filter/xml/xmltabi.cxx +@@ -64,6 +64,9 @@ + + using namespace com::sun::star; + using namespace xmloff::token; ++using ::com::sun::star::uno::Reference; ++using ::com::sun::star::xml::sax::XAttributeList; ++using ::rtl::OUString; + + /** + * Determine whether this table is an external reference cache from its +@@ -152,10 +155,9 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport, + { + if (!bTempIsSubTable) + { +- sal_Bool bProtection(sal_False); ++ ScXMLTabProtectionData aProtectData; + rtl::OUString sName; + rtl::OUString sStyleName; +- rtl::OUString sPassword; + sal_Int16 nAttrCount(xAttrList.is() ? xAttrList->getLength() : 0); + const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableAttrTokenMap(); + for( sal_Int16 i=0; i < nAttrCount; ++i ) +@@ -174,15 +176,21 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport, + case XML_TOK_TABLE_STYLE_NAME: + sStyleName = sValue; + break; +- case XML_TOK_TABLE_PROTECTION: +- bProtection = IsXMLToken(sValue, XML_TRUE); +- break; ++ case XML_TOK_TABLE_PROTECTED: ++ aProtectData.mbProtected = IsXMLToken(sValue, XML_TRUE); ++ break; + case XML_TOK_TABLE_PRINT_RANGES: + sPrintRanges = sValue; + break; + case XML_TOK_TABLE_PASSWORD: +- sPassword = sValue; +- break; ++ aProtectData.maPassword = sValue; ++ break; ++ case XML_TOK_TABLE_PASSHASH: ++ aProtectData.meHash1 = ScPassHashHelper::getHashTypeFromURI(sValue); ++ break; ++ case XML_TOK_TABLE_PASSHASH_2: ++ aProtectData.meHash2 = ScPassHashHelper::getHashTypeFromURI(sValue); ++ break; + case XML_TOK_TABLE_PRINT: + { + if (IsXMLToken(sValue, XML_FALSE)) +@@ -209,7 +217,7 @@ ScXMLTableContext::ScXMLTableContext( ScXMLImport& rImport, + else + { + // This is a regular table. +- GetScImport().GetTables().NewSheet(sName, sStyleName, bProtection, sPassword); ++ GetScImport().GetTables().NewSheet(sName, sStyleName, aProtectData); + } + } + else +@@ -271,6 +279,9 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( USHORT nPrefix, + pContext = new ScXMLTableColContext( GetScImport(), nPrefix, + rLName, xAttrList ); + break; ++ case XML_TOK_TABLE_PROTECTION: ++ pContext = new ScXMLTableProtectionContext( GetScImport(), nPrefix, rLName, xAttrList ); ++ break; + case XML_TOK_TABLE_ROW_GROUP: + pContext = new ScXMLTableRowsContext( GetScImport(), nPrefix, + rLName, xAttrList, +@@ -384,3 +395,61 @@ void ScXMLTableContext::EndElement() + GetScImport().UnlockSolarMutex(); + } + ++// ============================================================================ ++ ++ScXMLImport& ScXMLTableProtectionContext::GetScImport() ++{ ++ return static_cast(GetImport()); ++} ++ ++ScXMLTableProtectionContext::ScXMLTableProtectionContext( ++ ScXMLImport& rImport, USHORT nPrefix, const OUString& rLName, ++ const Reference& xAttrList ) : ++ SvXMLImportContext( rImport, nPrefix, rLName ) ++{ ++ const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetTableProtectionAttrTokenMap(); ++ bool bSelectProtectedCells = false; ++ bool bSelectUnprotectedCells = false; ++ ++ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; ++ ++ for (sal_Int16 i = 0; i < nAttrCount; ++i) ++ { ++ const OUString& aAttrName = xAttrList->getNameByIndex(i); ++ const OUString aValue = xAttrList->getValueByIndex(i); ++ ++ OUString aLocalName; ++ USHORT nLocalPrefix = GetScImport().GetNamespaceMap().GetKeyByAttrName( ++ aAttrName, &aLocalName); ++ ++ switch (rAttrTokenMap.Get(nLocalPrefix, aLocalName)) ++ { ++ case XML_TOK_TABLE_SELECT_PROTECTED_CELLS: ++ bSelectProtectedCells = IsXMLToken(aValue, XML_TRUE); ++ break; ++ case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS: ++ bSelectUnprotectedCells = IsXMLToken(aValue, XML_TRUE); ++ break; ++ default: ++ ; ++ } ++ } ++ ++ ScXMLTabProtectionData& rProtectData = GetScImport().GetTables().GetCurrentProtectionData(); ++ rProtectData.mbSelectProtectedCells = bSelectProtectedCells; ++ rProtectData.mbSelectUnprotectedCells = bSelectUnprotectedCells; ++} ++ ++ScXMLTableProtectionContext::~ScXMLTableProtectionContext() ++{ ++} ++ ++SvXMLImportContext* ScXMLTableProtectionContext::CreateChildContext( ++ USHORT /*nPrefix*/, const OUString& /*rLocalName*/, const Reference& /*xAttrList*/ ) ++{ ++ return NULL; ++} ++ ++void ScXMLTableProtectionContext::EndElement() ++{ ++} +diff --git sc/source/filter/xml/xmltabi.hxx sc/source/filter/xml/xmltabi.hxx +index 7fc6031..bd3482c 100644 +--- sc/source/filter/xml/xmltabi.hxx ++++ sc/source/filter/xml/xmltabi.hxx +@@ -77,4 +77,26 @@ public: + virtual void EndElement(); + }; + ++// ============================================================================ ++ ++class ScXMLTableProtectionContext : public SvXMLImportContext ++{ ++ ScXMLImport& GetScImport(); ++ ++public: ++ ScXMLTableProtectionContext( ScXMLImport& rImport, USHORT nPrefix, ++ const ::rtl::OUString& rLName, ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); ++ ++ virtual ~ScXMLTableProtectionContext(); ++ ++ virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, ++ const ::rtl::OUString& rLocalName, ++ const ::com::sun::star::uno::Reference< ++ ::com::sun::star::xml::sax::XAttributeList>& xAttrList ); ++ ++ virtual void EndElement(); ++}; ++ + #endif +diff --git sc/source/ui/docshell/docsh.cxx sc/source/ui/docshell/docsh.cxx +index 04825b9..9caaf5f 100644 +--- sc/source/ui/docshell/docsh.cxx ++++ sc/source/ui/docshell/docsh.cxx +@@ -1440,9 +1440,14 @@ BOOL __EXPORT ScDocShell::SaveAs( SfxMedium& rMedium ) + + #if ENABLE_SHEET_PROTECTION + ScTabViewShell* pViewShell = GetBestViewShell(); +- if (pViewShell && ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_OOO)) ++ bool bNeedsRehash = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_SHA1); ++ if (bNeedsRehash) ++ // legacy xls hash double-hashed by SHA1 is also supported. ++ bNeedsRehash = ScPassHashHelper::needsPassHashRegen(aDocument, PASSHASH_XL, PASSHASH_SHA1); ++ ++ if (pViewShell && bNeedsRehash) + { +- if (!pViewShell->ExecuteRetypePassDlg(PASSHASH_OOO)) ++ if (!pViewShell->ExecuteRetypePassDlg(PASSHASH_SHA1)) + // password re-type cancelled. Don't save the document. + return false; + } +diff --git sc/source/ui/miscdlgs/retypepassdlg.cxx sc/source/ui/miscdlgs/retypepassdlg.cxx +index 7786115..899ae0d 100644 +--- sc/source/ui/miscdlgs/retypepassdlg.cxx ++++ sc/source/ui/miscdlgs/retypepassdlg.cxx +@@ -77,7 +77,7 @@ ScRetypePassDlg::ScRetypePassDlg(Window* pParent) : + + mpDocItem(static_cast(NULL)), + mnCurScrollPos(0), +- meDesiredHash(PASSHASH_OOO) ++ meDesiredHash(PASSHASH_SHA1) + { + Init(); + } diff --git a/applied_patches/0457-calc-ods-sheet-protection-xmloff.diff b/applied_patches/0172-calc-ods-sheet-protection-xmloff.diff similarity index 100% rename from applied_patches/0457-calc-ods-sheet-protection-xmloff.diff rename to applied_patches/0172-calc-ods-sheet-protection-xmloff.diff diff --git a/applied_patches/0458-calc-ods-sheet-protection-svtools.diff b/applied_patches/0173-calc-ods-sheet-protection-svtools.diff similarity index 100% rename from applied_patches/0458-calc-ods-sheet-protection-svtools.diff rename to applied_patches/0173-calc-ods-sheet-protection-svtools.diff diff --git a/applied_patches/0174-calc-selection-fixed-cursor.diff b/applied_patches/0174-calc-selection-fixed-cursor.diff new file mode 100644 index 000000000..ba41ec1e3 --- /dev/null +++ b/applied_patches/0174-calc-selection-fixed-cursor.diff @@ -0,0 +1,904 @@ +diff --git sc/inc/document.hxx sc/inc/document.hxx +index 96b6809..cc91c1a 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -824,6 +824,7 @@ public: + ScRange* pLastRange = NULL, + Rectangle* pLastMM = NULL ) const; + ++ void SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const; + BOOL IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; + BOOL IsVerOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; + +diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx +index de89b1b..8ba6dfa 100644 +--- sc/source/core/data/document.cxx ++++ sc/source/core/data/document.cxx +@@ -4534,6 +4534,13 @@ BOOL ScDocument::RefreshAutoFilter( SCCOL nStartCol, SCROW nStartRow, + return bChange; + } + ++void ScDocument::SkipOverlapped( SCCOL& rCol, SCROW& rRow, SCTAB nTab ) const ++{ ++ while (IsHorOverlapped(rCol, rRow, nTab)) ++ --rCol; ++ while (IsVerOverlapped(rCol, rRow, nTab)) ++ --rRow; ++} + + BOOL ScDocument::IsHorOverlapped( SCCOL nCol, SCROW nRow, SCTAB nTab ) const + { +diff --git sc/source/ui/inc/cellsh.hxx sc/source/ui/inc/cellsh.hxx +index 97f6d0d..a42a336 100644 +--- sc/source/ui/inc/cellsh.hxx ++++ sc/source/ui/inc/cellsh.hxx +@@ -37,6 +37,7 @@ + #include + #include + #include "formatsh.hxx" ++#include "address.hxx" + + class SvxClipboardFmtItem; + class TransferableDataHelper; +diff --git sc/source/ui/inc/tabview.hxx sc/source/ui/inc/tabview.hxx +index 437b95b..804fbff 100644 +--- sc/source/ui/inc/tabview.hxx ++++ sc/source/ui/inc/tabview.hxx +@@ -179,7 +179,6 @@ private: + BOOL bInActivatePart; + BOOL bInZoomUpdate; + BOOL bMoveIsShift; +- BOOL bNewStartIfMarking; + + BOOL bOldSelection; // old style (inverting) of selection + +@@ -203,6 +202,10 @@ private: + static void SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, BOOL bLayoutRTL ); + static long GetScrollBarPos( ScrollBar& rScroll, BOOL bLayoutRTL ); + ++ void GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY); ++ void GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, ++ SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode); ++ + protected: + void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL, + const SCROW* pPosY = NULL ); +@@ -391,8 +394,6 @@ public: + + void FindNextUnprot( BOOL bShift, BOOL bInSelection = TRUE ); + +- void SetNewStartIfMarking(); +- + void SetTabNo( SCTAB nTab, BOOL bNew = FALSE, BOOL bExtendSelection = FALSE ); + void SelectNextTab( short nDir, BOOL bExtendSelection = FALSE ); + +@@ -483,6 +484,10 @@ public: + + BOOL IsBlockMode() const { return bIsBlockMode; } + ++ void ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode); ++ void ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY); ++ void ExpandBlockArea(SCsCOL nMovX, SCsROW nMovY); ++ + void MarkColumns(); + void MarkRows(); + void MarkDataArea( BOOL bIncludeCursor = TRUE ); +diff --git sc/source/ui/view/cellsh4.cxx sc/source/ui/view/cellsh4.cxx +index 4cb00fb..3f80397 100644 +--- sc/source/ui/view/cellsh4.cxx ++++ sc/source/ui/view/cellsh4.cxx +@@ -52,6 +52,7 @@ + #include "document.hxx" + #include "sc.hrc" + ++#include "vcl/svapp.hxx" + + //------------------------------------------------------------------ + +@@ -88,10 +88,56 @@ void ScCellShell::ExecuteCursor( SfxRequest& rReq ) + { + // ADD mode: keep the selection, start a new block when marking with shift again + bKeep = TRUE; +- pTabViewShell->SetNewStartIfMarking(); + } + } + ++ if (bSel) ++ { ++ switch (nSlotId) ++ { ++ case SID_CURSORDOWN: ++ rReq.SetSlot(SID_CURSORDOWN_SEL); ++ break; ++ case SID_CURSORUP: ++ rReq.SetSlot(SID_CURSORUP_SEL); ++ break; ++ case SID_CURSORRIGHT: ++ rReq.SetSlot(SID_CURSORRIGHT_SEL); ++ break; ++ case SID_CURSORLEFT: ++ rReq.SetSlot(SID_CURSORLEFT_SEL); ++ break; ++ case SID_CURSORPAGEDOWN: ++ rReq.SetSlot(SID_CURSORPAGEDOWN_SEL); ++ break; ++ case SID_CURSORPAGEUP: ++ rReq.SetSlot(SID_CURSORPAGEUP_SEL); ++ break; ++ case SID_CURSORPAGERIGHT: ++ rReq.SetSlot(SID_CURSORPAGERIGHT_SEL); ++ break; ++ case SID_CURSORPAGELEFT: ++ rReq.SetSlot(SID_CURSORPAGELEFT_SEL); ++ break; ++ case SID_CURSORBLKDOWN: ++ rReq.SetSlot(SID_CURSORBLKDOWN_SEL); ++ break; ++ case SID_CURSORBLKUP: ++ rReq.SetSlot(SID_CURSORBLKUP_SEL); ++ break; ++ case SID_CURSORBLKRIGHT: ++ rReq.SetSlot(SID_CURSORBLKRIGHT_SEL); ++ break; ++ case SID_CURSORBLKLEFT: ++ rReq.SetSlot(SID_CURSORBLKLEFT_SEL); ++ break; ++ default: ++ ; ++ } ++ ExecuteCursorSel(rReq); ++ return; ++ } ++ + SCsCOLROW nRTLSign = 1; + if ( pData->GetDocument()->IsLayoutRTL( pData->GetTabNo() ) ) + { +@@ -172,38 +218,61 @@ void ScCellShell::GetStateCursor( SfxItemSet& /* rSet */ ) + + void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) + { +- const SfxItemSet* pReqArgs = rReq.GetArgs(); +- USHORT nSlotId = rReq.GetSlot(); +- short nRepeat = 1; +- +- if ( pReqArgs != NULL ) +- { +- const SfxPoolItem* pItem; +- if( IS_AVAILABLE( FN_PARAM_1, &pItem ) ) +- nRepeat = ((const SfxInt16Item*)pItem)->GetValue(); +- } ++ sal_uInt16 nSlotId = rReq.GetSlot(); ++ ScTabViewShell* pViewShell = GetViewData()->GetViewShell(); ++ ScInputHandler* pInputHdl = pViewShell->GetInputHandler(); ++ pViewShell->HideAllCursors(); ++ if (pInputHdl && pInputHdl->IsInputMode()) ++ { ++ // the current cell is in edit mode. Commit the text before moving on. ++ pViewShell->ExecuteInputDirect(); ++ } + +- switch ( nSlotId ) ++ // Horizontal direction depends on whether or not the UI language is RTL. ++ SCsCOL nMovX = Application::GetSettings().GetLayoutRTL() ? -1 : 1; ++ ++ switch (nSlotId) + { +- case SID_CURSORDOWN_SEL: rReq.SetSlot( SID_CURSORDOWN ); break; +- case SID_CURSORBLKDOWN_SEL: rReq.SetSlot( SID_CURSORBLKDOWN ); break; +- case SID_CURSORUP_SEL: rReq.SetSlot( SID_CURSORUP ); break; +- case SID_CURSORBLKUP_SEL: rReq.SetSlot( SID_CURSORBLKUP ); break; +- case SID_CURSORLEFT_SEL: rReq.SetSlot( SID_CURSORLEFT ); break; +- case SID_CURSORBLKLEFT_SEL: rReq.SetSlot( SID_CURSORBLKLEFT ); break; +- case SID_CURSORRIGHT_SEL: rReq.SetSlot( SID_CURSORRIGHT ); break; +- case SID_CURSORBLKRIGHT_SEL: rReq.SetSlot( SID_CURSORBLKRIGHT ); break; +- case SID_CURSORPAGEDOWN_SEL: rReq.SetSlot( SID_CURSORPAGEDOWN ); break; +- case SID_CURSORPAGEUP_SEL: rReq.SetSlot( SID_CURSORPAGEUP ); break; +- case SID_CURSORPAGERIGHT_SEL: rReq.SetSlot( SID_CURSORPAGERIGHT_ ); break; +- case SID_CURSORPAGELEFT_SEL: rReq.SetSlot( SID_CURSORPAGELEFT_ ); break; ++ case SID_CURSORDOWN_SEL: ++ pViewShell->ExpandBlock(0, 1, SC_FOLLOW_LINE); ++ break; ++ case SID_CURSORUP_SEL: ++ pViewShell->ExpandBlock(0, -1, SC_FOLLOW_LINE); ++ break; ++ case SID_CURSORRIGHT_SEL: ++ pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE); ++ break; ++ case SID_CURSORLEFT_SEL: ++ pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE); ++ break; ++ case SID_CURSORPAGEUP_SEL: ++ pViewShell->ExpandBlockPage(0, -1); ++ break; ++ case SID_CURSORPAGEDOWN_SEL: ++ pViewShell->ExpandBlockPage(0, 1); ++ break; ++ case SID_CURSORPAGERIGHT_SEL: ++ pViewShell->ExpandBlockPage(nMovX, 0); ++ break; ++ case SID_CURSORPAGELEFT_SEL: ++ pViewShell->ExpandBlockPage(-nMovX, 0); ++ break; ++ case SID_CURSORBLKDOWN_SEL: ++ pViewShell->ExpandBlockArea(0, 1); ++ break; ++ case SID_CURSORBLKUP_SEL: ++ pViewShell->ExpandBlockArea(0, -1); ++ break; ++ case SID_CURSORBLKRIGHT_SEL: ++ pViewShell->ExpandBlockArea(nMovX, 0); ++ break; ++ case SID_CURSORBLKLEFT_SEL: ++ pViewShell->ExpandBlockArea(-nMovX, 0); ++ break; + default: +- DBG_ERROR("Unbekannte Message bei ViewShell (CursorSel)"); +- return; ++ ; + } +- rReq.AppendItem( SfxInt16Item(FN_PARAM_1, nRepeat ) ); +- rReq.AppendItem( SfxBoolItem(FN_PARAM_2, TRUE) ); +- ExecuteSlot( rReq, GetInterface() ); ++ pViewShell->ShowAllCursors(); + } + + void ScCellShell::ExecuteMove( SfxRequest& rReq ) +@@ -348,7 +406,6 @@ void ScCellShell::ExecutePage( SfxRequest& rReq ) + { + // ADD mode: keep the selection, start a new block when marking with shift again + bKeep = TRUE; +- pTabViewShell->SetNewStartIfMarking(); + } + } + +diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx +index ad12e86..b5bb7c6 100644 +--- sc/source/ui/view/gridwin.cxx ++++ sc/source/ui/view/gridwin.cxx +@@ -2200,8 +2200,12 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) + } + + SfxStringItem aPosItem( SID_CURRENTCELL, aAddr ); ++ // We don't want to align to the cursor position because if the ++ // cell cursor isn't visible after making selection, it would jump ++ // back to the origin of the selection where the cell cursor is. ++ SfxBoolItem aAlignCursorItem( FN_PARAM_2, false ); + pDisp->Execute( SID_CURRENTCELL, SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, +- &aPosItem, (void*)0L ); ++ &aPosItem, &aAlignCursorItem, (void*)0L ); + + pViewData->GetView()->InvalidateAttribs(); + } +@@ -3960,7 +3960,10 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos + if ( bDone ) + { + pView->MarkRange( aDest, FALSE, FALSE ); +- pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() ); ++ ++ SCCOL nDCol = pViewData->GetCurX() - aSource.aStart.Col(); ++ SCROW nDRow = pViewData->GetCurY() - aSource.aStart.Row(); ++ pView->SetCursor( aDest.aStart.Col() + nDCol, aDest.aStart.Row() + nDRow ); + } + + pDocSh->GetUndoManager()->LeaveListAction(); +@@ -4068,7 +4071,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos + pView->EnterMatrix( aFormula ); + + pView->MarkRange( aDest, FALSE, FALSE ); +- pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() ); ++ pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() ); + } + + pDocSh->GetUndoManager()->LeaveListAction(); +@@ -4102,7 +4105,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos + if ( bDone ) + { + pView->MarkRange( aDest, FALSE, FALSE ); +- pView->SetCursor( aDest.aEnd.Col(), aDest.aEnd.Row() ); ++ pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() ); + } + } + +diff --git sc/source/ui/view/select.cxx sc/source/ui/view/select.cxx +index d41fe45..e983ca9 100644 +--- sc/source/ui/view/select.cxx ++++ sc/source/ui/view/select.cxx +@@ -667,7 +667,10 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol + } + } + if (bStarted) ++ // If the selection is already started, don't set the cursor. + pView->MarkCursor( (SCCOL) nPosX, (SCROW) nPosY, nTab, FALSE, FALSE, TRUE ); ++ else ++ pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY ); + } + else + { +@@ -703,9 +706,9 @@ BOOL ScViewFunctionSet::SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, BOOL bScrol + + bStarted = TRUE; + } ++ pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY ); + } + +- pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY ); + pViewData->SetRefStart( nPosX, nPosY, nTab ); + if (bHideCur) + pView->ShowAllCursors(); +diff --git sc/source/ui/view/tabview.cxx sc/source/ui/view/tabview.cxx +index dacaee8..5274b50 100644 +--- sc/source/ui/view/tabview.cxx ++++ sc/source/ui/view/tabview.cxx +@@ -384,7 +384,6 @@ BOOL lcl_HasRowOutline( const ScViewData& rViewData ) + bInActivatePart( FALSE ), \ + bInZoomUpdate( FALSE ), \ +- bMoveIsShift( FALSE ), \ +- bNewStartIfMarking( FALSE ) ++ bMoveIsShift( FALSE ) + + + ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) : +diff --git sc/source/ui/view/tabview2.cxx sc/source/ui/view/tabview2.cxx +index bd9515c..bd744e4 100644 +--- sc/source/ui/view/tabview2.cxx ++++ sc/source/ui/view/tabview2.cxx +@@ -62,6 +62,7 @@ + #include "waitoff.hxx" + #include "globstr.hrc" + #include "scmod.hxx" ++#include "tabprotection.hxx" + + #define SC_BLOCKMODE_NONE 0 + #define SC_BLOCKMODE_NORMAL 1 +@@ -178,16 +179,9 @@ void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, + InvertBlockMark( nBlockStartX,nBlockStartY,nBlockEndX,nBlockEndY ); + #endif + UpdateSelectionOverlay(); +- +- bNewStartIfMarking = FALSE; // use only once + } + } + +-void ScTabView::SetNewStartIfMarking() +-{ +- bNewStartIfMarking = TRUE; +-} +- + void ScTabView::DoneBlockMode( BOOL bContinue ) // Default FALSE + { + // Wenn zwischen Tabellen- und Header SelectionEngine gewechselt wird, +@@ -414,6 +408,305 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, + aHdrFunc.SetAnchorFlag( FALSE ); + } + ++void ScTabView::GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY) ++{ ++ SCCOL nCurX; ++ SCROW nCurY; ++ aViewData.GetMoveCursor( nCurX,nCurY ); ++ ++ ScSplitPos eWhich = aViewData.GetActivePart(); ++ ScHSplitPos eWhichX = WhichH( eWhich ); ++ ScVSplitPos eWhichY = WhichV( eWhich ); ++ ++ SCsCOL nPageX; ++ SCsROW nPageY; ++ if (nMovX >= 0) ++ nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, 1, eWhichX )) * nMovX; ++ else ++ nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, -1, eWhichX )) * nMovX; ++ ++ if (nMovY >= 0) ++ nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY )) * nMovY; ++ else ++ nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY )) * nMovY; ++ ++ if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1; ++ if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1; ++ ++ rPageX = nPageX; ++ rPageY = nPageY; ++} ++ ++void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, ++ SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode) ++{ ++ SCCOL nNewX = -1; ++ SCROW nNewY = -1; ++ SCCOL nCurX = -1; ++ SCROW nCurY = -1; ++ ++ if (aViewData.IsRefMode()) ++ { ++ nNewX = aViewData.GetRefEndX(); ++ nNewY = aViewData.GetRefEndY(); ++ } ++ else if (IsBlockMode()) ++ { ++ nNewX = nBlockEndX; ++ nNewY = nBlockEndY; ++ } ++ else ++ { ++ nNewX = nCurX = aViewData.GetCurX(); ++ nNewY = nCurY = aViewData.GetCurY(); ++ } ++ ++ ScDocument* pDoc = aViewData.GetDocument(); ++ SCTAB nTab = aViewData.GetTabNo(); ++ ++ // FindAreaPos kennt nur -1 oder 1 als Richtung ++ ++ SCsCOLROW i; ++ if ( nMovX > 0 ) ++ for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 1, 0 ); ++ if ( nMovX < 0 ) ++ for ( i=0; i<-nMovX; i++ ) ++ pDoc->FindAreaPos( nNewX, nNewY, nTab, -1, 0 ); ++ if ( nMovY > 0 ) ++ for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 0, 1 ); ++ if ( nMovY < 0 ) ++ for ( i=0; i<-nMovY; i++ ) ++ pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, -1 ); ++ ++ if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen ++ { ++ if (nMovX != 0 && nNewX == MAXCOL) ++ eMode = SC_FOLLOW_LINE; ++ if (nMovY != 0 && nNewY == MAXROW) ++ eMode = SC_FOLLOW_LINE; ++ } ++ ++ if (aViewData.IsRefMode()) ++ { ++ rAreaX = nNewX - aViewData.GetRefEndX(); ++ rAreaY = nNewY - aViewData.GetRefEndY(); ++ } ++ else if (IsBlockMode()) ++ { ++ rAreaX = nNewX - nBlockEndX; ++ rAreaY = nNewY - nBlockEndY; ++ } ++ else ++ { ++ rAreaX = nNewX - nCurX; ++ rAreaY = nNewY - nCurY; ++ } ++ rMode = eMode; ++} ++ ++namespace { ++ ++bool lcl_isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked) ++{ ++ bool bCellProtected = pDoc->HasAttrib( ++ nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_PROTECTED); ++ ++ if (bCellProtected && !bSelectLocked) ++ return false; ++ ++ if (!bCellProtected && !bSelectUnlocked) ++ return false; ++ ++ return true; ++} ++ ++void lcl_moveCursorByProtRule( ++ SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCTAB nTab, ScDocument* pDoc) ++{ ++ bool bSelectLocked = true; ++ bool bSelectUnlocked = true; ++ ScTableProtection* pTabProtection = pDoc->GetTabProtection(nTab); ++ if (pTabProtection && pTabProtection->isProtected()) ++ { ++ bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); ++ bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); ++ } ++ ++ if (nMovX > 0) ++ { ++ if (rCol < MAXCOL) ++ { ++ for (SCCOL i = 0; i < nMovX; ++i) ++ { ++ if (!lcl_isCellQualified(pDoc, rCol+1, rRow, nTab, bSelectLocked, bSelectUnlocked)) ++ break; ++ ++rCol; ++ } ++ } ++ } ++ else if (nMovX < 0) ++ { ++ if (rCol > 0) ++ { ++ nMovX = -nMovX; ++ for (SCCOL i = 0; i < nMovX; ++i) ++ { ++ if (!lcl_isCellQualified(pDoc, rCol-1, rRow, nTab, bSelectLocked, bSelectUnlocked)) ++ break; ++ --rCol; ++ } ++ } ++ } ++ ++ if (nMovY > 0) ++ { ++ if (rRow < MAXROW) ++ { ++ for (SCROW i = 0; i < nMovY; ++i) ++ { ++ if (!lcl_isCellQualified(pDoc, rCol, rRow+1, nTab, bSelectLocked, bSelectUnlocked)) ++ break; ++ ++rRow; ++ } ++ } ++ } ++ else if (nMovY < 0) ++ { ++ if (rRow > 0) ++ { ++ nMovY = -nMovY; ++ for (SCROW i = 0; i < nMovY; ++i) ++ { ++ if (!lcl_isCellQualified(pDoc, rCol, rRow-1, nTab, bSelectLocked, bSelectUnlocked)) ++ break; ++ --rRow; ++ } ++ } ++ } ++} ++ ++} ++ ++void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode) ++{ ++ if (!nMovX && !nMovY) ++ // Nothing to do. Bail out. ++ return; ++ ++ ScTabViewShell* pViewShell = aViewData.GetViewShell(); ++ bool bRefInputMode = pViewShell && pViewShell->IsRefInputMode(); ++ if (bRefInputMode && !aViewData.IsRefMode()) ++ // initialize formula reference mode if it hasn't already. ++ InitRefMode(aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo(), SC_REFTYPE_REF); ++ ++ ScDocument* pDoc = aViewData.GetDocument(); ++ ++ if (aViewData.IsRefMode()) ++ { ++ // formula reference mode ++ ++ SCCOL nNewX = aViewData.GetRefEndX(); ++ SCROW nNewY = aViewData.GetRefEndY(); ++ SCTAB nRefTab = aViewData.GetRefEndZ(); ++ ++ bool bSelectLocked = true; ++ bool bSelectUnlocked = true; ++ ScTableProtection* pTabProtection = pDoc->GetTabProtection(nRefTab); ++ if (pTabProtection && pTabProtection->isProtected()) ++ { ++ bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); ++ bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); ++ } ++ ++ lcl_moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, pDoc); ++ ++ if (nMovX) ++ { ++ SCCOL nTempX = nNewX; ++ while (pDoc->IsHorOverlapped(nTempX, nNewY, nRefTab)) ++ { ++ if (nMovX > 0) ++ ++nTempX; ++ else ++ --nTempX; ++ } ++ if (lcl_isCellQualified(pDoc, nTempX, nNewY, nRefTab, bSelectLocked, bSelectUnlocked)) ++ nNewX = nTempX; ++ } ++ ++ if (nMovY) ++ { ++ SCROW nTempY = nNewY; ++ while (pDoc->IsVerOverlapped(nNewX, nTempY, nRefTab)) ++ { ++ if (nMovY > 0) ++ ++nTempY; ++ else ++ --nTempY; ++ } ++ if (lcl_isCellQualified(pDoc, nNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked)) ++ nNewY = nTempY; ++ } ++ ++ pDoc->SkipOverlapped(nNewX, nNewY, nRefTab); ++ UpdateRef(nNewX, nNewY, nRefTab); ++ AlignToCursor(nNewX, nNewY, eMode); ++ } ++ else ++ { ++ // normal selection mode ++ ++ SCTAB nTab = aViewData.GetTabNo(); ++ ++ if (!IsBlockMode()) ++ InitBlockMode(aViewData.GetCurX(), aViewData.GetCurY(), nTab, true); ++ ++ lcl_moveCursorByProtRule(nBlockEndX, nBlockEndY, nMovX, nMovY, nTab, pDoc); ++ ++ if (nBlockEndX < 0) ++ nBlockEndX = 0; ++ else if (nBlockEndX > MAXCOL) ++ nBlockEndX = MAXCOL; ++ ++ if (nBlockEndY < 0) ++ nBlockEndY = 0; ++ else if (nBlockEndY > MAXROW) ++ nBlockEndY = MAXROW; ++ ++ pDoc->SkipOverlapped(nBlockEndX, nBlockEndY, nTab); ++ MarkCursor(nBlockEndX, nBlockEndY, nTab, false, false, true); ++ ++ // Check if the entire row(s) or column(s) are selected. ++ ScSplitPos eActive = aViewData.GetActivePart(); ++ bool bRowSelected = (nBlockStartX == 0 && nBlockEndX == MAXCOL); ++ bool bColSelected = (nBlockStartY == 0 && nBlockEndY == MAXROW); ++ SCsCOL nAlignX = bRowSelected ? aViewData.GetPosX(WhichH(eActive)) : nBlockEndX; ++ SCsROW nAlignY = bColSelected ? aViewData.GetPosY(WhichV(eActive)) : nBlockEndY; ++ AlignToCursor(nAlignX, nAlignY, eMode); ++ ++ UpdateAutoFillMark(); ++ } ++} ++ ++void ScTabView::ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY) ++{ ++ SCsCOL nPageX; ++ SCsROW nPageY; ++ GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY); ++ ExpandBlock(nPageX, nPageY, SC_FOLLOW_FIX); ++} ++ ++void ScTabView::ExpandBlockArea(SCsCOL nMovX, SCsROW nMovY) ++{ ++ SCsCOL nAreaX; ++ SCsROW nAreaY; ++ ScFollowMode eMode; ++ GetAreaMoveEndPosition(nMovX, nMovY, SC_FOLLOW_JUMP, nAreaX, nAreaY, eMode); ++ ExpandBlock(nAreaX, nAreaY, eMode); ++} ++ + void ScTabView::UpdateSelectionOverlay() + { + for (USHORT i=0; i<4; i++) +diff --git sc/source/ui/view/tabview3.cxx sc/source/ui/view/tabview3.cxx +index 1b4879c..da85e44 100644 +--- sc/source/ui/view/tabview3.cxx ++++ sc/source/ui/view/tabview3.cxx +@@ -125,10 +125,7 @@ void ScTabView::ClickCursor( SCCOL nPosX, SCROW nPosY, BOOL bControl ) + { + ScDocument* pDoc = aViewData.GetDocument(); + SCTAB nTab = aViewData.GetTabNo(); +- while (pDoc->IsHorOverlapped( nPosX, nPosY, nTab )) //! ViewData !!! +- --nPosX; +- while (pDoc->IsVerOverlapped( nPosX, nPosY, nTab )) +- --nPosY; ++ pDoc->SkipOverlapped(nPosX, nPosY, nTab); + + BOOL bRefMode = SC_MOD()->IsFormulaMode(); + +@@ -921,22 +918,36 @@ void ScTabView::MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, + + HideAllCursors(); + +- if ( bShift && bNewStartIfMarking && IsBlockMode() ) +- { +- // used for ADD selection mode: start a new block from the cursor position +- DoneBlockMode( TRUE ); +- InitBlockMode( aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo(), TRUE ); +- } +- + // aktiven Teil umschalten jetzt in AlignToCursor + + AlignToCursor( nCurX, nCurY, eMode ); + //! auf OS/2: SC_FOLLOW_JUMP statt SC_FOLLOW_LINE, um Nachlaufen zu verhindern ??? + + if (bKeepSel) ++ { + SetCursor( nCurX, nCurY ); // Markierung stehenlassen ++ ++ // If the cursor is in existing selection, it's a cursor movement by ++ // ENTER or TAB. If not, then it's a new selection during ADD ++ // selection mode. ++ ++ const ScMarkData& rMark = aViewData.GetMarkData(); ++ ScRangeList aSelList; ++ rMark.FillRangeListWithMarks(&aSelList, false); ++ if (!aSelList.In(ScRange(nCurX, nCurY, aViewData.GetTabNo()))) ++ // Cursor not in existing selection. Start a new selection. ++ DoneBlockMode(true); ++ } + else + { ++ if (!bShift) ++ { ++ // Remove all marked data on cursor movement unless the Shift is locked. ++ ScMarkData aData(aViewData.GetMarkData()); ++ aData.ResetMark(); ++ SetMarkData(aData); ++ } ++ + BOOL bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() ); + bMoveIsShift = bShift; + pSelEngine->CursorPosChanging( bShift, bControl ); +@@ -1080,68 +1091,18 @@ void ScTabView::MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + + void ScTabView::MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, BOOL bShift, BOOL bKeepSel ) + { +- SCCOL nCurX; +- SCROW nCurY; +- aViewData.GetMoveCursor( nCurX,nCurY ); +- +- ScSplitPos eWhich = aViewData.GetActivePart(); +- ScHSplitPos eWhichX = WhichH( eWhich ); +- ScVSplitPos eWhichY = WhichV( eWhich ); +- + SCsCOL nPageX; + SCsROW nPageY; +- if (nMovX >= 0) +- nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, 1, eWhichX )) * nMovX; +- else +- nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, -1, eWhichX )) * nMovX; +- +- if (nMovY >= 0) +- nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY )) * nMovY; +- else +- nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY )) * nMovY; +- +- if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1; +- if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1; +- ++ GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY); + MoveCursorRel( nPageX, nPageY, eMode, bShift, bKeepSel ); + } + + void ScTabView::MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, BOOL bShift, BOOL bKeepSel ) + { +- SCCOL nCurX; +- SCROW nCurY; +- aViewData.GetMoveCursor( nCurX,nCurY ); +- SCCOL nNewX = nCurX; +- SCROW nNewY = nCurY; +- +- ScDocument* pDoc = aViewData.GetDocument(); +- SCTAB nTab = aViewData.GetTabNo(); +- +- // FindAreaPos kennt nur -1 oder 1 als Richtung +- +- SCsCOLROW i; +- if ( nMovX > 0 ) +- for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 1, 0 ); +- if ( nMovX < 0 ) +- for ( i=0; i<-nMovX; i++ ) +- pDoc->FindAreaPos( nNewX, nNewY, nTab, -1, 0 ); +- if ( nMovY > 0 ) +- for ( i=0; iFindAreaPos( nNewX, nNewY, nTab, 0, 1 ); +- if ( nMovY < 0 ) +- for ( i=0; i<-nMovY; i++ ) +- pDoc->FindAreaPos( nNewX, nNewY, nTab, 0, -1 ); +- +- if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen +- { +- if (nMovX != 0 && nNewX == MAXCOL) +- eMode = SC_FOLLOW_LINE; +- if (nMovY != 0 && nNewY == MAXROW) +- eMode = SC_FOLLOW_LINE; +- } +- +- MoveCursorRel( ((SCsCOL)nNewX)-(SCsCOL)nCurX, ((SCsROW)nNewY)-(SCsROW)nCurY, eMode, bShift, bKeepSel ); ++ SCsCOL nNewX; ++ SCsROW nNewY; ++ GetAreaMoveEndPosition(nMovX, nMovY, eMode, nNewX, nNewY, eMode); ++ MoveCursorRel(nNewX, nNewY, eMode, bShift, bKeepSel); + } + + void ScTabView::MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, BOOL bShift, BOOL bKeepSel ) +@@ -1206,14 +1167,8 @@ void ScTabView::MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode + else if (nMovY>0) + nNewY=nPosY+nAddY; + +-// aViewData.ResetOldCursor(); + aViewData.SetOldCursor( nNewX,nNewY ); +- +- while (pDoc->IsHorOverlapped( nNewX, nNewY, nTab )) +- --nNewX; +- while (pDoc->IsVerOverlapped( nNewX, nNewY, nTab )) +- --nNewY; +- ++ pDoc->SkipOverlapped(nNewX, nNewY, nTab); + MoveCursorAbs( nNewX, nNewY, eMode, bShift, FALSE, TRUE ); + } + +@@ -1497,11 +1452,7 @@ void ScTabView::MarkRange( const ScRange& rRange, BOOL bSetCursor, BOOL bContinu + SCCOL nPosX = rRange.aStart.Col(); + SCROW nPosY = rRange.aStart.Row(); + ScDocument* pDoc = aViewData.GetDocument(); +- +- while (pDoc->IsHorOverlapped( nPosX, nPosY, nTab )) //! ViewData !!! +- --nPosX; +- while (pDoc->IsVerOverlapped( nPosX, nPosY, nTab )) +- --nPosY; ++ pDoc->SkipOverlapped(nPosX, nPosY, nTab); + + aViewData.ResetOldCursor(); + SetCursor( nPosX, nPosY ); +diff --git sc/source/ui/view/tabvwsh3.cxx sc/source/ui/view/tabvwsh3.cxx +index caea267..74505f4 100644 +--- sc/source/ui/view/tabvwsh3.cxx ++++ sc/source/ui/view/tabvwsh3.cxx +@@ -276,6 +276,10 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) + if ( pReqArgs->GetItemState( FN_PARAM_1, TRUE, &pItem ) == SFX_ITEM_SET ) + bUnmark = ((const SfxBoolItem*)pItem)->GetValue(); + ++ bool bAlignToCursor = true; ++ if (pReqArgs->GetItemState(FN_PARAM_2, true, &pItem) == SFX_ITEM_SET) ++ bAlignToCursor = static_cast(pItem)->GetValue(); ++ + if ( nSlot == SID_JUMPTOMARK ) + { + // #106586# URL has to be decoded for escaped characters (%20) +@@ -396,10 +396,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) + // und Cursor setzen + + // zusammengefasste Zellen beruecksichtigen: +- while ( pDoc->IsHorOverlapped( nCol, nRow, nTab ) ) //! ViewData !!! +- --nCol; +- while ( pDoc->IsVerOverlapped( nCol, nRow, nTab ) ) +- --nRow; ++ pDoc->SkipOverlapped(nCol, nRow, nTab); + + // Navigator-Aufrufe sind nicht API!!! + +@@ -417,9 +421,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) + if (!rReq.IsAPI()) + rReq.Done(); + } +- // align to cursor even if the cursor position hasn't changed, +- // because the cursor may be set outside the visible area. +- AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); ++ ++ if (bAlignToCursor) ++ { ++ // align to cursor even if the cursor position hasn't changed, ++ // because the cursor may be set outside the visible area. ++ AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP ); ++ } + + rReq.SetReturnValue( SfxStringItem( SID_CURRENTCELL, aAddress ) ); + } +diff --git sc/source/ui/view/viewdata.cxx sc/source/ui/view/viewdata.cxx +index f69ab24..66c07c4 100644 +--- sc/source/ui/view/viewdata.cxx ++++ sc/source/ui/view/viewdata.cxx +@@ -1891,12 +1891,11 @@ BOOL ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich, + { + //! public Methode um Position anzupassen + +- BOOL bHOver = FALSE; +- while (pDoc->IsHorOverlapped( rPosX, rPosY, nTabNo )) +- { --rPosX; bHOver=TRUE; } +- BOOL bVOver = FALSE; +- while (pDoc->IsVerOverlapped( rPosX, rPosY, nTabNo )) +- { --rPosY; bVOver=TRUE; } ++ SCCOL nOrigX = rPosX; ++ SCROW nOrigY = rPosY; ++ pDoc->SkipOverlapped(rPosX, rPosY, nTabNo); ++ bool bHOver = (nOrigX != rPosX); ++ bool bVOver = (nOrigY != rPosY); + + if ( bRepair && ( bHOver || bVOver ) ) + { diff --git a/applied_patches/0462-calc-cursor-split-view.diff b/applied_patches/0175-calc-cursor-split-view.diff similarity index 100% rename from applied_patches/0462-calc-cursor-split-view.diff rename to applied_patches/0175-calc-cursor-split-view.diff diff --git a/applied_patches/0176-calc-autofilter-shrink-selection.diff b/applied_patches/0176-calc-autofilter-shrink-selection.diff new file mode 100644 index 000000000..a4c6df7aa --- /dev/null +++ b/applied_patches/0176-calc-autofilter-shrink-selection.diff @@ -0,0 +1,13 @@ +diff --git sc/source/ui/view/dbfunc.cxx sc/source/ui/view/dbfunc.cxx +index fa05fa6..326e611 100644 +--- sc/source/ui/view/dbfunc.cxx ++++ sc/source/ui/view/dbfunc.cxx +@@ -302,7 +302,7 @@ void ScDBFunc::ToggleAutoFilter() + + ScQueryParam aParam; + ScDocument* pDoc = GetViewData()->GetDocument(); +- ScDBData* pDBData = GetDBData( FALSE ); ++ ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, false, true); + + pDBData->SetByRow( TRUE ); //! Undo, vorher abfragen ?? + pDBData->GetQueryParam( aParam ); diff --git a/applied_patches/0177-calc-xls-import-array-size.diff b/applied_patches/0177-calc-xls-import-array-size.diff new file mode 100644 index 000000000..444415c68 --- /dev/null +++ b/applied_patches/0177-calc-xls-import-array-size.diff @@ -0,0 +1,289 @@ +diff --git sc/source/filter/excel/excform.cxx sc/source/filter/excel/excform.cxx +index e412270..e71c60e 100644 +--- sc/source/filter/excel/excform.cxx ++++ sc/source/filter/excel/excform.cxx +@@ -136,7 +136,7 @@ void ImportExcel::Formula( const XclAddress& rXclPos, + bConvert = TRUE; + + if( bConvert ) +- eErr = pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); ++ eErr = pFormConv->Convert( pErgebnis, maStrm, nFormLen, ExcelToSc::ConvertParam(), FT_CellFormula); + + ScFormulaCell* pZelle = NULL; + +@@ -201,7 +201,8 @@ void ExcelToSc::GetDummy( const ScTokenArray*& pErgebnis ) + // if bAllowArrays is false stream seeks to first byte after + // otherwise it will seek to the first byte after the additional content (eg + // inline arrays) following +-ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT ) ++ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, sal_Size nFormulaLen, ++ const ConvertParam& rParam, const FORMULA_TYPE eFT ) + { + RootData& rR = GetOldRoot(); + BYTE nOp, nLen, nByte; +@@ -472,7 +473,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s + case 0x20: // Array Constant [317 268] + aIn >> nByte >> nUINT16; + aIn.Ignore( (meBiff == EXC_BIFF2) ? 3 : 4 ); +- if( bAllowArrays ) ++ if( rParam.mbAllowArrays ) + { + SCSIZE nC = nByte ? nByte : 256; + SCSIZE nR = nUINT16; +diff --git sc/source/filter/excel/excform8.cxx sc/source/filter/excel/excform8.cxx +index 4edef1a..63fe148 100644 +--- sc/source/filter/excel/excform8.cxx ++++ sc/source/filter/excel/excform8.cxx +@@ -97,7 +97,8 @@ bool ExcelToSc8::Read3DTabReference( UINT16 nIxti, SCTAB& rFirstTab, SCTAB& rLas + + // if bAllowArrays is false stream seeks to first byte after + // otherwise it will seek to the first byte past additional content after +-ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT ) ++ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, sal_Size nFormulaLen, ++ const ConvertParam& rParam, const FORMULA_TYPE eFT ) + { + BYTE nOp, nLen, nByte; + UINT16 nUINT16; +@@ -393,12 +394,17 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, + case 0x20: // Array Constant [317 268] + aIn >> nByte >> nUINT16; + aIn.Ignore( 4 ); +- if( bAllowArrays ) ++ if (rParam.mbAllowArrays) + { +- SCSIZE nC = nByte + 1; +- SCSIZE nR = nUINT16 + 1; +- +- aStack << aPool.StoreMatrix( nC, nR ); ++ SCSIZE nC = rParam.mnArrayColSize; ++ SCSIZE nR = rParam.mnArrayRowSize; ++ if (!nC || !nR) ++ { ++ // Stored array size is invalid. Get that from the formula. ++ nC = nByte + 1; ++ nR = nUINT16 + 1; ++ } ++ aStack << aPool.StoreMatrix(nC, nR); + aExtensions.push_back( EXTENSION_ARRAY ); + } + else +diff --git sc/source/filter/excel/frmbase.cxx sc/source/filter/excel/frmbase.cxx +index 42f9037..a808a96 100644 +--- sc/source/filter/excel/frmbase.cxx ++++ sc/source/filter/excel/frmbase.cxx +@@ -258,6 +258,12 @@ void ExcelConverterBase::Reset() + aEingPos.Set( 0, 0, 0 ); + } + ++ExcelConverterBase::ConvertParam::ConvertParam() : ++ mbAllowArrays(true), ++ mnArrayColSize(0), ++ mnArrayRowSize(0) ++{ ++} + + + +diff --git sc/source/filter/excel/impop.cxx sc/source/filter/excel/impop.cxx +index b936e00..c8f397a 100644 +--- sc/source/filter/excel/impop.cxx ++++ sc/source/filter/excel/impop.cxx +@@ -498,7 +498,9 @@ void ImportExcel::Array25( void ) + + pFormConv->Reset( ScAddress( static_cast(nFirstCol), + static_cast(nFirstRow), GetCurrScTab() ) ); +- pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = true; ++ pFormConv->Convert( pErgebnis, maStrm, nFormLen, aParam, FT_CellFormula); + + DBG_ASSERT( pErgebnis, "*ImportExcel::Array25(): ScTokenArray ist NULL!" ); + +@@ -797,7 +799,9 @@ void ImportExcel::Shrfmla( void ) + const ScTokenArray* pErgebnis; + + pFormConv->Reset(); +- pFormConv->Convert( pErgebnis, maStrm, nLenExpr, true, FT_SharedFormula ); ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = true; ++ pFormConv->Convert( pErgebnis, maStrm, nLenExpr, aParam, FT_SharedFormula ); + + + DBG_ASSERT( pErgebnis, "+ImportExcel::Shrfmla(): ScTokenArray ist NULL!" ); +@@ -969,10 +973,14 @@ void ImportExcel::Array34( void ) + { + // jetzt steht Lesemarke auf Formel, Laenge in nFormLen + const ScTokenArray* pErgebnis; ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = true; ++ aParam.mnArrayColSize = nLastCol - nFirstCol + 1; ++ aParam.mnArrayRowSize = nLastRow - nFirstRow + 1; + + pFormConv->Reset( ScAddress( static_cast(nFirstCol), + static_cast(nFirstRow), GetCurrScTab() ) ); +- pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); ++ pFormConv->Convert( pErgebnis, maStrm, nFormLen, aParam, FT_CellFormula); + + DBG_ASSERT( pErgebnis, "+ImportExcel::Array34(): ScTokenArray ist NULL!" ); + +diff --git sc/source/filter/excel/xicontent.cxx sc/source/filter/excel/xicontent.cxx +index 24c1999..0ae264d 100644 +--- sc/source/filter/excel/xicontent.cxx ++++ sc/source/filter/excel/xicontent.cxx +@@ -597,12 +597,15 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) + const ScAddress& rPos = maRanges.GetObject( 0 )->aStart; // assured above that maRanges is not empty + ExcelToSc& rFmlaConv = GetOldFmlaConverter(); + ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = false; ++ + ::std::auto_ptr< ScTokenArray > xTokArr1; + if( nFmlaSize1 > 0 ) + { + const ScTokenArray* pTokArr = 0; + rFmlaConv.Reset( rPos ); +- rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize1, false, FT_RangeName ); ++ rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize1, aParam, FT_RangeName ); + // formula converter owns pTokArr -> create a copy of the token array + if( pTokArr ) + xTokArr1.reset( pTokArr->Clone() ); +@@ -613,7 +616,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) + { + const ScTokenArray* pTokArr = 0; + rFmlaConv.Reset( rPos ); +- rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize2, false, FT_RangeName ); ++ rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize2, aParam, FT_RangeName ); + // formula converter owns pTokArr -> create a copy of the token array + if( pTokArr ) + pTokArr2.reset( pTokArr->Clone() ); +@@ -721,6 +724,9 @@ void XclImpValidation::ReadDV( XclImpStream& rStrm ) + String aErrorMessage( rStrm.ReadUniString() ); + rStrm.SetNulSubstChar(); // back to default + ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = false; ++ + // formula(s) + if( rStrm.GetRecLeft() > 8 ) + { +@@ -736,7 +742,7 @@ void XclImpValidation::ReadDV( XclImpStream& rStrm ) + { + const ScTokenArray* pTokArr = 0; + rFmlaConv.Reset(); +- rFmlaConv.Convert( pTokArr, rStrm, nLen, false, FT_RangeName ); ++ rFmlaConv.Convert( pTokArr, rStrm, nLen, aParam, FT_RangeName ); + // formula converter owns pTokArr -> create a copy of the token array + if( pTokArr ) + xTokArr1.reset( pTokArr->Clone() ); +@@ -751,7 +757,7 @@ void XclImpValidation::ReadDV( XclImpStream& rStrm ) + { + const ScTokenArray* pTokArr = 0; + rFmlaConv.Reset(); +- rFmlaConv.Convert( pTokArr, rStrm, nLen, false, FT_RangeName ); ++ rFmlaConv.Convert( pTokArr, rStrm, nLen, aParam, FT_RangeName ); + // formula converter owns pTokArr -> create a copy of the token array + if( pTokArr ) + xTokArr2.reset( pTokArr->Clone() ); +diff --git sc/source/filter/excel/xiformula.cxx sc/source/filter/excel/xiformula.cxx +index 240358e..41ace53 100644 +--- sc/source/filter/excel/xiformula.cxx ++++ sc/source/filter/excel/xiformula.cxx +@@ -97,7 +97,9 @@ const ScTokenArray* XclImpFmlaCompImpl::CreateFormula( + aFmlaStrm.StartNextRecord(); + const ScTokenArray* pArray = NULL; + GetOldFmlaConverter().Reset(); +- GetOldFmlaConverter().Convert(pArray, aFmlaStrm, aFmlaStrm.GetRecSize(), true); ++ ExcelToSc::ConvertParam aParam; ++ aParam.mbAllowArrays = true; ++ GetOldFmlaConverter().Convert(pArray, aFmlaStrm, aFmlaStrm.GetRecSize(), aParam); + return pArray; + } + +diff --git sc/source/filter/excel/xiname.cxx sc/source/filter/excel/xiname.cxx +index 72f4701..0ad70d5 100644 +--- sc/source/filter/excel/xiname.cxx ++++ sc/source/filter/excel/xiname.cxx +@@ -180,7 +180,9 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : + // --- name formula --- + // JEG : double check this. It is clearly false for normal names + // but some of the builtins (sheettitle?) might be able to handle arrays +- rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize, false, FT_RangeName ); ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = false; ++ rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize, aParam, FT_RangeName ); + + // --- auto or advanced filter --- + if( (GetBiff() == EXC_BIFF8) && pTokArr && bBuiltIn ) +@@ -208,7 +210,9 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : + else if( nFmlaSize > 0 ) + { + // regular defined name +- rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize, true, FT_RangeName ); ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = true; ++ rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize, aParam, FT_RangeName ); + } + + // 4) *** create a defined name in the Calc document *** ------------------ +diff --git sc/source/filter/inc/excform.hxx sc/source/filter/inc/excform.hxx +index e80d67c..790174b 100644 +--- sc/source/filter/inc/excform.hxx ++++ sc/source/filter/inc/excform.hxx +@@ -62,7 +62,8 @@ public: + ExcelToSc( const XclImpRoot& rRoot ); + virtual ~ExcelToSc(); + virtual ConvErr Convert( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen, +- bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ); ++ const ConvertParam& rParam, ++ const FORMULA_TYPE eFT = FT_CellFormula ); + + virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ); + +@@ -138,7 +139,8 @@ public: + ExcelToSc8( const XclImpRoot& rRoot ); + virtual ~ExcelToSc8(); + +- virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ); ++ virtual ConvErr Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, ++ const ConvertParam& rParam, const FORMULA_TYPE eFT = FT_CellFormula ); + + virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, const FORMULA_TYPE eFT = FT_CellFormula ); + +diff --git sc/source/filter/inc/formel.hxx sc/source/filter/inc/formel.hxx +index 5d3f196..58aa2f4 100644 +--- sc/source/filter/inc/formel.hxx ++++ sc/source/filter/inc/formel.hxx +@@ -214,8 +214,17 @@ public: + void Reset(); + void Reset( const ScAddress& rEingPos ); + ++ struct ConvertParam ++ { ++ bool mbAllowArrays; ++ SCSIZE mnArrayColSize; ++ SCSIZE mnArrayRowSize; ++ ++ ConvertParam(); ++ }; ++ + virtual ConvErr Convert( const ScTokenArray*& rpErg, XclImpStream& rStrm, sal_Size nFormulaLen, +- bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula ) = 0; ++ const ConvertParam& rParam, const FORMULA_TYPE eFT = FT_CellFormula ) = 0; + virtual ConvErr Convert( _ScRangeListTabs&, XclImpStream& rStrm, sal_Size nFormulaLen, SCsTAB nTab, + const FORMULA_TYPE eFT = FT_CellFormula ) = 0; + }; +diff --git sc/source/filter/xcl97/XclImpChangeTrack.cxx sc/source/filter/xcl97/XclImpChangeTrack.cxx +index 0b6b3e3..c20c8ac 100644 +--- sc/source/filter/xcl97/XclImpChangeTrack.cxx ++++ sc/source/filter/xcl97/XclImpChangeTrack.cxx +@@ -210,7 +210,9 @@ void XclImpChangeTrack::ReadFormula( ScTokenArray*& rpTokenArray, const ScAddres + // read the formula, 3D tab refs from extended data + const ScTokenArray* pArray = NULL; + aFmlConv.Reset( rPosition ); +- BOOL bOK = (aFmlConv.Convert( pArray, aFmlaStrm, nFmlSize, false, FT_CellFormula) == ConvOK); // JEG : Check This ++ ExcelConverterBase::ConvertParam aParam; ++ aParam.mbAllowArrays = false; ++ BOOL bOK = (aFmlConv.Convert( pArray, aFmlaStrm, nFmlSize, aParam, FT_CellFormula) == ConvOK); // JEG : Check This + rpTokenArray = (bOK && pArray) ? new ScTokenArray( *pArray ) : NULL; + pStrm->Ignore( 1 ); + } diff --git a/applied_patches/0178-calc-html-csv-import-force-text-cell.diff b/applied_patches/0178-calc-html-csv-import-force-text-cell.diff new file mode 100644 index 000000000..88d28fdb2 --- /dev/null +++ b/applied_patches/0178-calc-html-csv-import-force-text-cell.diff @@ -0,0 +1,381 @@ +diff --git sc/inc/column.hxx sc/inc/column.hxx +index 606602c..a39a958 100644 +--- sc/inc/column.hxx ++++ sc/inc/column.hxx +@@ -72,6 +72,7 @@ struct ScFunctionData; + struct ScFunctionData; + struct ScLineFlags; + struct ScMergePatternState; ++struct ScSetStringParam; + + #define COLUMN_DELTA 4 + +@@ -244,8 +245,7 @@ public: + // TRUE = Zahlformat gesetzt + BOOL SetString( SCROW nRow, SCTAB nTab, const String& rString, + formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO, +- SvNumberFormatter* pFormatter = NULL, +- bool bDetectNumberFormat = true ); ++ ScSetStringParam* pParam = NULL ); + void SetValue( SCROW nRow, const double& rVal); + void SetError( SCROW nRow, const USHORT nError); + +diff --git sc/inc/document.hxx sc/inc/document.hxx +index 862682c..8d28d82 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -142,6 +142,7 @@ class ScLookupCache; + struct ScLookupCacheMapImpl; + struct ScClipParam; + struct ScClipRangeNameData; ++struct ScSetStringParam; + + namespace com { namespace sun { namespace star { + namespace lang { +@@ -736,8 +737,7 @@ public: + ULONG nFormatIndex, BOOL bForceTab = FALSE); + // return TRUE = Zahlformat gesetzt + SC_DLLPUBLIC BOOL SetString( +- SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, +- SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); ++ SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, ScSetStringParam* pParam = NULL ); + SC_DLLPUBLIC void SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal ); + void SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError); + +diff --git sc/inc/stringutil.hxx sc/inc/stringutil.hxx +index 4ca8629..fd2d7c3 100644 +--- sc/inc/stringutil.hxx ++++ sc/inc/stringutil.hxx +@@ -32,6 +32,41 @@ + #define SC_STRINGUTIL_HXX + + #include "rtl/ustring.hxx" ++#include "scdllapi.h" ++ ++class SvNumberFormatter; ++ ++/** ++ * Store parameters used in the ScDocument::SetString() method. Various ++ * options for string-setting operation are specified herein. ++ */ ++struct SC_DLLPUBLIC ScSetStringParam ++{ ++ /** ++ * Stores the pointer to the number formatter instance to be used during ++ * number format detection. The caller must manage the life cycle of the ++ * instance. ++ */ ++ SvNumberFormatter* mpNumFormatter; ++ ++ /** ++ * When true, we try to detect special number format (dates etc) from the ++ * input string, when false, we only try to detect a basic decimal number ++ * format. ++ */ ++ bool mbDetectNumberFormat; ++ ++ /** ++ * When true, set the format of the cell to Text when a string cell is ++ * requested for a number input. We may want to do this during text file ++ * import (csv, html etc). ++ */ ++ bool mbSetTextCellFormat; ++ ++ ScSetStringParam(); ++}; ++ ++// ============================================================================ + + class ScStringUtil + { +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 43163c4..7f8d968 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -85,7 +85,7 @@ struct ScLineFlags; + struct ScFunctionData; + struct ScLineFlags; + class CollatorWrapper; +- ++struct ScSetStringParam; + + class ScTable + { +@@ -274,7 +274,7 @@ public: + void PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell); + // TRUE = Zahlformat gesetzt + BOOL SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, +- SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true ); ++ ScSetStringParam* pParam = NULL ); + void SetValue( SCCOL nCol, SCROW nRow, const double& rVal ); + void SetError( SCCOL nCol, SCROW nRow, USHORT nError); + +diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx +index 56e7c1a..a37a53e 100644 +--- sc/source/core/data/column3.cxx ++++ sc/source/core/data/column3.cxx +@@ -55,6 +55,7 @@ + #include "detfunc.hxx" // fuer Notizen bei DeleteRange + #include "postit.hxx" + #include "stringutil.hxx" ++#include "docpool.hxx" + + #include + +@@ -1263,7 +1264,7 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 ) + // TRUE = Zahlformat gesetzt + BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + formula::FormulaGrammar::AddressConvention eConv, +- SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) ++ ScSetStringParam* pParam ) + { + BOOL bNumFmtSet = FALSE; + if (VALIDROW(nRow)) +@@ -1272,11 +1273,15 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + BOOL bIsLoading = FALSE; + if (rString.Len() > 0) + { ++ ScSetStringParam aParam; ++ if (pParam) ++ aParam = *pParam; ++ + double nVal; + sal_uInt32 nIndex, nOldIndex = 0; + sal_Unicode cFirstChar; +- if (!pFormatter) +- pFormatter = pDocument->GetFormatTable(); ++ if (!aParam.mpNumFormatter) ++ aParam.mpNumFormatter = pDocument->GetFormatTable(); + SfxObjectShell* pDocSh = pDocument->GetDocumentShell(); + if ( pDocSh ) + bIsLoading = pDocSh->IsLoading(); +@@ -1285,7 +1290,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + { + nIndex = nOldIndex = GetNumberFormat( nRow ); + if ( rString.Len() > 1 +- && pFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT ) ++ && aParam.mpNumFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT ) + cFirstChar = rString.GetChar(0); + else + cFirstChar = 0; // Text +@@ -1341,7 +1346,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + } + // nIndex fuer IsNumberFormat vorbelegen + if ( !bIsText ) +- nIndex = nOldIndex = pFormatter->GetStandardIndex(); ++ nIndex = nOldIndex = aParam.mpNumFormatter->GetStandardIndex(); + } + + do +@@ -1349,9 +1354,9 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + if (bIsText) + break; + +- if (bDetectNumberFormat) ++ if (aParam.mbDetectNumberFormat) + { +- if (!pFormatter->IsNumberFormat(rString, nIndex, nVal)) ++ if (!aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal)) + break; + + pNewCell = new ScValueCell( nVal ); +@@ -1362,21 +1367,21 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + // Exception: If the new format is boolean, always apply it. + + BOOL bOverwrite = FALSE; +- const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex ); ++ const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex ); + if ( pOldFormat ) + { + short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED; + if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE || + nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL ) + { +- if ( nOldIndex == pFormatter->GetStandardFormat( ++ if ( nOldIndex == aParam.mpNumFormatter->GetStandardFormat( + nOldType, pOldFormat->GetLanguage() ) ) + { + bOverwrite = TRUE; // default of these types can be overwritten + } + } + } +- if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL ) ++ if ( !bOverwrite && aParam.mpNumFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL ) + { + bOverwrite = TRUE; // overwrite anything if boolean was detected + } +@@ -1392,7 +1397,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + else + { + // Only check if the string is a regular number. +- const LocaleDataWrapper* pLocale = pFormatter->GetLocaleData(); ++ const LocaleDataWrapper* pLocale = aParam.mpNumFormatter->GetLocaleData(); + if (!pLocale) + break; + +@@ -1414,7 +1419,19 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, + while (false); + + if (!pNewCell) ++ { ++ if (aParam.mbSetTextCellFormat && aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal)) ++ { ++ // Set the cell format type to Text. ++ sal_uInt32 nFormat = aParam.mpNumFormatter->GetStandardFormat(NUMBERFORMAT_TEXT); ++ ScPatternAttr aNewAttrs(pDocument->GetPool()); ++ SfxItemSet& rSet = aNewAttrs.GetItemSet(); ++ rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) ); ++ ApplyPattern(nRow, aNewAttrs); ++ } ++ + pNewCell = new ScStringCell(rString); ++ } + } + } + +diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx +index 3c50c24..56f2158 100644 +--- sc/source/core/data/document.cxx ++++ sc/source/core/data/document.cxx +@@ -2512,10 +2512,10 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT + + + BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, +- SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) ++ ScSetStringParam* pParam ) + { + if ( ValidTab(nTab) && pTab[nTab] ) +- return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter, bDetectNumberFormat ); ++ return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pParam ); + else + return FALSE; + } +diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx +index 9505877..6a373e9 100644 +--- sc/source/core/data/table2.cxx ++++ sc/source/core/data/table2.cxx +@@ -904,11 +904,11 @@ void ScTable::PutCell( const ScAddress& rPos, ULONG nFormatIndex, ScBaseCell* pC + + + BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, +- SvNumberFormatter* pFormatter, bool bDetectNumberFormat ) ++ ScSetStringParam* pParam ) + { + if (ValidColRow(nCol,nRow)) + return aCol[nCol].SetString( +- nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat ); ++ nRow, nTabP, rString, pDocument->GetAddressConvention(), pParam ); + else + return FALSE; + } +diff --git sc/source/core/tool/stringutil.cxx sc/source/core/tool/stringutil.cxx +index ae6247f..d5e09a6 100644 +--- sc/source/core/tool/stringutil.cxx ++++ sc/source/core/tool/stringutil.cxx +@@ -40,6 +40,15 @@ + using ::rtl::OUString; + using ::rtl::OUStringBuffer; + ++ScSetStringParam::ScSetStringParam() : ++ mpNumFormatter(NULL), ++ mbDetectNumberFormat(true), ++ mbSetTextCellFormat(false) ++{ ++} ++ ++// ============================================================================- ++ + bool ScStringUtil::parseSimpleNumber( + const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal) + { +diff --git sc/source/filter/rtf/eeimpars.cxx sc/source/filter/rtf/eeimpars.cxx +index e78e371..b25ad37 100644 +--- sc/source/filter/rtf/eeimpars.cxx ++++ sc/source/filter/rtf/eeimpars.cxx +@@ -69,6 +69,7 @@ + #include "drwlayer.hxx" + #include "rangenam.hxx" + #include "progress.hxx" ++#include "stringutil.hxx" + + #include "globstr.hrc" + +@@ -331,12 +332,17 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu + // Daten eintragen + if (bSimple) + { ++ ScSetStringParam aParam; ++ aParam.mpNumFormatter = pFormatter; ++ aParam.mbDetectNumberFormat = true; ++ aParam.mbSetTextCellFormat = true; ++ + if ( aValStr.Len() ) + mpDoc->SetValue( nCol, nRow, nTab, fVal ); + else if ( !pE->aSel.HasRange() ) + { + // maybe ALT text of IMG or similar +- mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, pFormatter ); ++ mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, &aParam ); + // wenn SelRange komplett leer kann nachfolgender Text im gleichen Absatz liegen! + } + else +@@ -381,7 +387,10 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu + if (bNumbersEnglishUS && !bEnUsRecognized) + mpDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aStr)); + else +- mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter, bConvertDate ); ++ { ++ aParam.mbDetectNumberFormat = bConvertDate; ++ mpDoc->SetString( nCol, nRow, nTab, aStr, &aParam ); ++ } + } + } + else +diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx +index d388887..573443d 100644 +--- sc/source/ui/docshell/impex.cxx ++++ sc/source/ui/docshell/impex.cxx +@@ -85,6 +85,9 @@ class StarBASIC; + + // ause + #include "editutil.hxx" ++#include "patattr.hxx" ++#include "docpool.hxx" ++#include "stringutil.hxx" + + #include "globstr.hrc" + #include +@@ -804,6 +807,18 @@ static bool lcl_PutString( + + if ( nColFormat == SC_COL_TEXT ) + { ++ double fDummy; ++ sal_uInt32 nIndex; ++ if (pFormatter->IsNumberFormat(rStr, nIndex, fDummy)) ++ { ++ // Set the format of this cell to Text. ++ sal_uInt32 nFormat = pFormatter->GetStandardFormat(NUMBERFORMAT_TEXT); ++ ScPatternAttr aNewAttrs(pDoc->GetPool()); ++ SfxItemSet& rSet = aNewAttrs.GetItemSet(); ++ rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) ); ++ pDoc->ApplyPattern(nCol, nRow, nTab, aNewAttrs); ++ ++ } + pDoc->PutCell( nCol, nRow, nTab, ScBaseCell::CreateTextCell( rStr, pDoc ) ); + return bMultiLine; + } +@@ -1016,7 +1031,13 @@ static bool lcl_PutString( + + // Standard or date not determined -> SetString / EditCell + if( rStr.Search( _LF ) == STRING_NOTFOUND ) +- pDoc->SetString( nCol, nRow, nTab, rStr, pFormatter, bDetectNumFormat ); ++ { ++ ScSetStringParam aParam; ++ aParam.mpNumFormatter = pFormatter; ++ aParam.mbDetectNumberFormat = bDetectNumFormat; ++ aParam.mbSetTextCellFormat = true; ++ pDoc->SetString( nCol, nRow, nTab, rStr, &aParam ); ++ } + else + { + bMultiLine = true; diff --git a/applied_patches/0179-calc-find-replace-skip-filtered.diff b/applied_patches/0179-calc-find-replace-skip-filtered.diff new file mode 100644 index 000000000..5bde7bc57 --- /dev/null +++ b/applied_patches/0179-calc-find-replace-skip-filtered.diff @@ -0,0 +1,383 @@ +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 62207fb..192ca18 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -826,6 +826,8 @@ private: + // also invalidates script type, broadcasts for "calc as shown" + void InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, + BOOL bNumFormatChanged, BOOL bBroadcast ); ++ ++ void SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bForward); + }; + + +diff --git sc/source/core/data/table6.cxx sc/source/core/data/table6.cxx +index 272e049..be44ff1 100644 +--- sc/source/core/data/table6.cxx ++++ sc/source/core/data/table6.cxx +@@ -251,6 +251,42 @@ BOOL ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo + return bFound; + } + ++void ScTable::SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bForward) ++{ ++ if (bForward) ++ { ++ // forward search ++ ++ if (rRow <= rLastNonFilteredRow) ++ return; ++ ++ SCROW nLastRow = rRow; ++ if (RowFiltered(rRow, NULL, &nLastRow)) ++ // move to the first non-filtered row. ++ rRow = nLastRow + 1; ++ else ++ // record the last non-filtered row to avoid checking ++ // the filtered state for each and every row. ++ rLastNonFilteredRow = nLastRow; ++ } ++ else ++ { ++ // backward search ++ ++ if (rRow >= rLastNonFilteredRow) ++ return; ++ ++ SCROW nFirstRow = rRow; ++ if (RowFiltered(rRow, &nFirstRow, NULL)) ++ // move to the first non-filtered row. ++ rRow = nFirstRow - 1; ++ else ++ // record the last non-filtered row to avoid checking ++ // the filtered state for each and every row. ++ rLastNonFilteredRow = nFirstRow; ++ } ++} ++ + BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + const ScMarkData& rMark, String& rUndoStr, ScDocument* pUndoDoc) + { +@@ -264,6 +300,7 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + GetLastDataPos(nLastCol, nLastRow); + if (!bAll && rSearchItem.GetBackward()) + { ++ SCROW nLastNonFilteredRow = MAXROW + 1; + nCol = Min(nCol, (SCCOL)(nLastCol + 1)); + nRow = Min(nRow, (SCROW)(nLastRow + 1)); + if (rSearchItem.GetRowDirection()) +@@ -271,6 +308,8 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + nCol--; + while (!bFound && ((SCsROW)nRow >= 0)) + { ++ SkipFilteredRows(nRow, nLastNonFilteredRow, false); ++ + while (!bFound && ((SCsCOL)nCol >= 0)) + { + bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc); +@@ -302,6 +341,8 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + { + while (!bFound && ((SCsROW)nRow >= 0)) + { ++ SkipFilteredRows(nRow, nLastNonFilteredRow, false); ++ + bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc); + if (!bFound) + { +@@ -311,8 +352,10 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + } + if (!bFound) + { ++ // Not found in this column. Move to the next column. + BOOL bIsEmpty; + nRow = nLastRow; ++ nLastNonFilteredRow = MAXROW + 1; + do + { + nCol--; +@@ -328,11 +371,14 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + } + else + { ++ SCROW nLastNonFilteredRow = -1; + if (!bAll && rSearchItem.GetRowDirection()) + { + nCol++; + while (!bFound && (nRow <= nLastRow)) + { ++ SkipFilteredRows(nRow, nLastNonFilteredRow, true); ++ + while (!bFound && (nCol <= nLastCol)) + { + bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc); +@@ -356,6 +402,8 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + { + while (!bFound && (nRow <= nLastRow)) + { ++ SkipFilteredRows(nRow, nLastNonFilteredRow, true); ++ + bFound = SearchCell(rSearchItem, nCol, nRow, rMark, rUndoStr, pUndoDoc); + if (!bFound) + { +@@ -365,7 +413,9 @@ BOOL ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, + } + if (!bFound) + { ++ // Not found in this column. Move to the next column. + nRow = 0; ++ nLastNonFilteredRow = -1; + nCol++; + while ((nCol <= nLastCol) && aCol[nCol].IsEmptyData()) nCol++; + } +@@ -770,6 +820,30 @@ bool ScTable::SearchAndReplaceEmptyCells( + return false; + } + ++namespace { ++ ++bool lcl_maybeReplaceCellString( ++ ScColumn& rColObj, SCCOL& rCol, SCROW& rRow, String& rUndoStr, SCCOL nCol, SCROW nRow, const SvxSearchItem& rSearchItem) ++{ ++ ScBaseCell* pCell = rColObj.GetCell(nRow); ++ if (!pCell || pCell->GetCellType() == CELLTYPE_NOTE) ++ { ++ // empty cell found. ++ rCol = nCol; ++ rRow = nRow; ++ if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && ++ rSearchItem.GetReplaceString().Len()) ++ { ++ rColObj.Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); ++ rUndoStr = String(); ++ } ++ return true; ++ } ++ return false; ++} ++ ++} ++ + bool ScTable::SearchRangeForEmptyCell( + const ScRange& rRange, const SvxSearchItem& rSearchItem, + SCCOL& rCol, SCROW& rRow, String& rUndoStr, ScDocument* /*pUndoDoc*/) +@@ -781,9 +855,14 @@ bool ScTable::SearchRangeForEmptyCell( + if (rSearchItem.GetRowDirection()) + { + // row direction. ++ SCROW nLastNonFilteredRow = MAXROW + 1; + SCROW nBeginRow = rRange.aEnd.Row() > rRow ? rRow : rRange.aEnd.Row(); + for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) + { ++ SkipFilteredRows(nRow, nLastNonFilteredRow, false); ++ if (nRow < rRange.aStart.Row()) ++ break; ++ + SCCOL nBeginCol = rRange.aEnd.Col(); + if (nRow == rRow && nBeginCol >= rCol) + // always start from one cell before the cursor. +@@ -791,20 +870,8 @@ bool ScTable::SearchRangeForEmptyCell( + + for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol) + { +- ScBaseCell* pCell = aCol[nCol].GetCell(nRow); +- if (!pCell) +- { +- // empty cell found. +- rCol = nCol; +- rRow = nRow; +- if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && +- rSearchItem.GetReplaceString().Len()) +- { +- aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); +- rUndoStr = String(); +- } ++ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem)) + return true; +- } + } + } + } +@@ -814,26 +881,19 @@ bool ScTable::SearchRangeForEmptyCell( + SCCOL nBeginCol = rRange.aEnd.Col() > rCol ? rCol : rRange.aEnd.Col(); + for (SCCOL nCol = nBeginCol; nCol >= rRange.aStart.Col(); --nCol) + { ++ SCROW nLastNonFilteredRow = MAXROW + 1; + SCROW nBeginRow = rRange.aEnd.Row(); + if (nCol == rCol && nBeginRow >= rRow) + // always start from one cell before the cursor. + nBeginRow = rRow - (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); + for (SCROW nRow = nBeginRow; nRow >= rRange.aStart.Row(); --nRow) + { +- ScBaseCell* pCell = aCol[nCol].GetCell(nRow); +- if (!pCell) +- { +- // empty cell found. +- rCol = nCol; +- rRow = nRow; +- if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && +- rSearchItem.GetReplaceString().Len()) +- { +- aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); +- rUndoStr = String(); +- } ++ SkipFilteredRows(nRow, nLastNonFilteredRow, false); ++ if (nRow < rRange.aStart.Row()) ++ break; ++ ++ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem)) + return true; +- } + } + } + } +@@ -844,29 +904,22 @@ bool ScTable::SearchRangeForEmptyCell( + if (rSearchItem.GetRowDirection()) + { + // row direction. ++ SCROW nLastNonFilteredRow = -1; + SCROW nBeginRow = rRange.aStart.Row() < rRow ? rRow : rRange.aStart.Row(); + for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) + { ++ SkipFilteredRows(nRow, nLastNonFilteredRow, true); ++ if (nRow > rRange.aEnd.Row()) ++ break; ++ + SCCOL nBeginCol = rRange.aStart.Col(); + if (nRow == rRow && nBeginCol <= rCol) + // always start from one cell past the cursor. + nBeginCol = rCol + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); + for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol) + { +- ScBaseCell* pCell = aCol[nCol].GetCell(nRow); +- if (!pCell) +- { +- // empty cell found. +- rCol = nCol; +- rRow = nRow; +- if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && +- rSearchItem.GetReplaceString().Len()) +- { +- aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); +- rUndoStr = String(); +- } ++ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem)) + return true; +- } + } + } + } +@@ -876,26 +929,19 @@ bool ScTable::SearchRangeForEmptyCell( + SCCOL nBeginCol = rRange.aStart.Col() < rCol ? rCol : rRange.aStart.Col(); + for (SCCOL nCol = nBeginCol; nCol <= rRange.aEnd.Col(); ++nCol) + { ++ SCROW nLastNonFilteredRow = -1; + SCROW nBeginRow = rRange.aStart.Row(); + if (nCol == rCol && nBeginRow <= rRow) + // always start from one cell past the cursor. + nBeginRow = rRow + (nCmd == SVX_SEARCHCMD_FIND ? 1 : 0); + for (SCROW nRow = nBeginRow; nRow <= rRange.aEnd.Row(); ++nRow) + { +- ScBaseCell* pCell = aCol[nCol].GetCell(nRow); +- if (!pCell) +- { +- // empty cell found. +- rCol = nCol; +- rRow = nRow; +- if (rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE && +- rSearchItem.GetReplaceString().Len()) +- { +- aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); +- rUndoStr = String(); +- } ++ SkipFilteredRows(nRow, nLastNonFilteredRow, true); ++ if (nRow > rRange.aEnd.Row()) ++ break; ++ ++ if (lcl_maybeReplaceCellString(aCol[nCol], rCol, rRow, rUndoStr, nCol, nRow, rSearchItem)) + return true; +- } + } + } + } +@@ -913,32 +959,44 @@ bool ScTable::SearchRangeForAllEmptyCells( + + for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol) + { ++ SCROW nLastNonFilteredRow = -1; + if (aCol[nCol].IsEmptyData()) + { +- // The entire column is empty. Add the whole column and move on. +- rMark.SetMultiMarkArea( +- ScRange(nCol, rRange.aStart.Row(), nTab, nCol, rRange.aEnd.Row(), nTab)); +- bFound = true; +- +- if (bReplace) ++ // The entire column is empty. ++ for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) + { +- const String& rNewStr = rSearchItem.GetReplaceString(); +- for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) ++ SCROW nLastRow; ++ if (!RowFiltered(nRow, NULL, &nLastRow)) + { +- aCol[nCol].Insert(nRow, new ScStringCell(rNewStr)); +- if (pUndoDoc) +- // TODO: I'm using a string cell with empty content to +- // trigger deletion of cell instance on undo. Maybe I +- // should create a new cell type for this? +- pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String())); ++ rMark.SetMultiMarkArea(ScRange(nCol, nRow, nTab, nCol, nLastRow, nTab)); ++ if (bReplace) ++ { ++ const String& rNewStr = rSearchItem.GetReplaceString(); ++ for (SCROW i = nRow; i <= nLastRow; ++i) ++ { ++ aCol[nCol].Insert(i, new ScStringCell(rNewStr)); ++ if (pUndoDoc) ++ // TODO: I'm using a string cell with empty content to ++ // trigger deletion of cell instance on undo. Maybe I ++ // should create a new cell type for this? ++ pUndoDoc->PutCell(nCol, i, nTab, new ScStringCell(String())); ++ } ++ rUndoStr = String(); ++ } + } +- rUndoStr = String(); ++ ++ nRow = nLastRow; // move to the last filtered row. + } ++ bFound = true; + continue; + } + + for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) + { ++ SkipFilteredRows(nRow, nLastNonFilteredRow, true); ++ if (nRow > rRange.aEnd.Row()) ++ break; ++ + ScBaseCell* pCell = aCol[nCol].GetCell(nRow); + if (!pCell) + { +@@ -956,6 +1014,21 @@ bool ScTable::SearchRangeForAllEmptyCells( + pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String())); + } + } ++ else if (pCell->GetCellType() == CELLTYPE_NOTE) ++ { ++ rMark.SetMultiMarkArea(ScRange(nCol, nRow, nTab)); ++ bFound = true; ++ ++ if (bReplace) ++ { ++ if (pUndoDoc) ++ { ++ ScAddress aCellPos(nCol, nRow, nTab); ++ pUndoDoc->PutCell(nCol, nRow, nTab, pCell->CloneWithNote(aCellPos, *pUndoDoc, aCellPos)); ++ } ++ aCol[nCol].SetString(nRow, nTab, rSearchItem.GetReplaceString()); ++ } ++ } + } + } + return bFound; diff --git a/applied_patches/0180-calc-getpivotdata-force-interpret-formula.diff b/applied_patches/0180-calc-getpivotdata-force-interpret-formula.diff new file mode 100644 index 000000000..5464780b4 --- /dev/null +++ b/applied_patches/0180-calc-getpivotdata-force-interpret-formula.diff @@ -0,0 +1,44 @@ +diff --git sc/source/core/data/dpcachetable.cxx sc/source/core/data/dpcachetable.cxx +index a27c16d..5cb60ad 100644 +--- sc/source/core/data/dpcachetable.cxx ++++ sc/source/core/data/dpcachetable.cxx +@@ -209,9 +209,39 @@ sal_Int32 ScDPCacheTable::getColSize() const + return maTable.empty() ? 0 : maTable[0].size(); + } + ++namespace { ++ ++/** ++ * While the macro interpret level is incremented, the formula cells are ++ * (semi-)guaranteed to be interpreted. ++ */ ++class MacroInterpretIncrementer ++{ ++public: ++ MacroInterpretIncrementer(ScDocument* pDoc) : ++ mpDoc(pDoc) ++ { ++ mpDoc->IncMacroInterpretLevel(); ++ } ++ ~MacroInterpretIncrementer() ++ { ++ mpDoc->DecMacroInterpretLevel(); ++ } ++private: ++ ScDocument* mpDoc; ++}; ++ ++} ++ + void ScDPCacheTable::fillTable(ScDocument* pDoc, const ScRange& rRange, const ScQueryParam& rQuery, BOOL* pSpecial, + bool bIgnoreEmptyRows) + { ++ // Make sure the formula cells within the data range are interpreted ++ // during this call, for this method may be called from the interpretation ++ // of GETPIVOTDATA, which disables nested formula interpretation without ++ // an increased macro level. ++ MacroInterpretIncrementer aMacroInc(pDoc); ++ + SCTAB nTab = rRange.aStart.Tab(); + SCCOL nStartCol = rRange.aStart.Col(); + SCROW nStartRow = rRange.aStart.Row(); diff --git a/applied_patches/0181-calc-combo-listbox-export-fix.diff b/applied_patches/0181-calc-combo-listbox-export-fix.diff new file mode 100644 index 000000000..11b1e5df9 --- /dev/null +++ b/applied_patches/0181-calc-combo-listbox-export-fix.diff @@ -0,0 +1,13 @@ +diff --git sc/source/filter/excel/xeescher.cxx sc/source/filter/excel/xeescher.cxx +index 98eb5b7..78a0d2a 100644 +--- sc/source/filter/excel/xeescher.cxx ++++ sc/source/filter/excel/xeescher.cxx +@@ -696,6 +696,8 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm ) + else if( mnObjType == EXC_OBJTYPE_DROPDOWN ) + { + rStrm << sal_uInt16( 0 ) << mnLineCount; ++ // dxMin & zero length str ++ rStrm << sal_uInt16( 0 ) << sal_uInt16( 0 ); + } + + rStrm.EndRecord(); diff --git a/applied_patches/0182-calc-selection-protected-cells.diff b/applied_patches/0182-calc-selection-protected-cells.diff new file mode 100644 index 000000000..fa7a882e3 --- /dev/null +++ b/applied_patches/0182-calc-selection-protected-cells.diff @@ -0,0 +1,155 @@ +diff --git sc/source/ui/inc/gridwin.hxx sc/source/ui/inc/gridwin.hxx +index 3ab93fd..29cd088 100644 +--- sc/source/ui/inc/gridwin.hxx ++++ sc/source/ui/inc/gridwin.hxx +@@ -345,7 +345,7 @@ private: + + void PasteSelection( const Point& rPosPixel ); + +- void SelectForContextMenu( const Point& rPosPixel ); ++ void SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX, SCsROW nCellY ); + + void GetSelectionRects( ::std::vector< Rectangle >& rPixelRects ); + struct RectangleConverter { +diff --git sc/source/ui/inc/hdrcont.hxx sc/source/ui/inc/hdrcont.hxx +index 20cc822..497140f 100644 +--- sc/source/ui/inc/hdrcont.hxx ++++ sc/source/ui/inc/hdrcont.hxx +@@ -80,7 +80,7 @@ private: + + long GetScrPos( SCCOLROW nEntryNo ); + SCCOLROW GetMousePos( const MouseEvent& rMEvt, BOOL& rBorder ); +- ++ bool IsSelectionAllowed(SCCOLROW nPos) const; + void ShowDragHelp(); + + void DoPaint( SCCOLROW nStart, SCCOLROW nEnd ); +diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx +index adb2f20..1079b9d 100644 +--- sc/source/ui/view/gridwin.cxx ++++ sc/source/ui/view/gridwin.cxx +@@ -2753,9 +2753,32 @@ void __EXPORT ScGridWindow::Command( const CommandEvent& rCEvt ) + + if ( bMouse ) + { ++ SCsCOL nCellX = -1; ++ SCsROW nCellY = -1; ++ pViewData->GetPosFromPixel(aPosPixel.X(), aPosPixel.Y(), eWhich, nCellX, nCellY); ++ ScDocument* pDoc = pViewData->GetDocument(); ++ SCTAB nTab = pViewData->GetTabNo(); ++ const ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); ++ bool bSelectAllowed = true; ++ if ( pProtect && pProtect->isProtected() ) ++ { ++ // This sheet is protected. Check if a context menu is allowed on this cell. ++ bool bCellProtected = pDoc->HasAttrib(nCellX, nCellY, nTab, nCellX, nCellY, nTab, HASATTR_PROTECTED); ++ bool bSelProtected = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); ++ bool bSelUnprotected = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); ++ ++ if (bCellProtected) ++ bSelectAllowed = bSelProtected; ++ else ++ bSelectAllowed = bSelUnprotected; ++ } ++ if (!bSelectAllowed) ++ // Selecting this cell is not allowed, neither is context menu. ++ return; ++ + // #i18735# First select the item under the mouse pointer. + // This can change the selection, and the view state (edit mode, etc). +- SelectForContextMenu( aPosPixel ); ++ SelectForContextMenu( aPosPixel, nCellX, nCellY ); + } + + BOOL bDone = FALSE; +@@ -2850,15 +2873,12 @@ void __EXPORT ScGridWindow::Command( const CommandEvent& rCEvt ) + } + } + +-void ScGridWindow::SelectForContextMenu( const Point& rPosPixel ) ++void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX, SCsROW nCellY ) + { + // #i18735# if the click was outside of the current selection, + // the cursor is moved or an object at the click position selected. + // (see SwEditWin::SelectMenuPosition in Writer) + +- SCsCOL nCellX; +- SCsROW nCellY; +- pViewData->GetPosFromPixel( rPosPixel.X(), rPosPixel.Y(), eWhich, nCellX, nCellY ); + ScTabView* pView = pViewData->GetView(); + ScDrawView* pDrawView = pView->GetScDrawView(); + +diff --git sc/source/ui/view/hdrcont.cxx sc/source/ui/view/hdrcont.cxx +index 89e871c..5cfe8f8 100644 +--- sc/source/ui/view/hdrcont.cxx ++++ sc/source/ui/view/hdrcont.cxx +@@ -47,6 +47,7 @@ + #include "scmod.hxx" // Optionen + #include "inputopt.hxx" // Optionen + #include "gridmerg.hxx" ++#include "document.hxx" + + // ----------------------------------------------------------------------- + +@@ -655,6 +656,39 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, BOOL& rBorder ) + return nHitNo; + } + ++bool ScHeaderControl::IsSelectionAllowed(SCCOLROW nPos) const ++{ ++ ScTabViewShell* pViewSh = dynamic_cast(SfxViewShell::Current()); ++ if (!pViewSh) ++ return false; ++ ++ ScViewData* pViewData = pViewSh->GetViewData(); ++ USHORT nTab = pViewData->GetTabNo(); ++ ScDocument* pDoc = pViewData->GetDocument(); ++ const ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); ++ bool bSelectAllowed = true; ++ if ( pProtect && pProtect->isProtected() ) ++ { ++ // This sheet is protected. Check if a context menu is allowed on this cell. ++ bool bCellsProtected = false; ++ if (bVertical) ++ // row header ++ bCellsProtected = pDoc->HasAttrib(0, nPos, nTab, MAXCOL, nPos, nTab, HASATTR_PROTECTED); ++ else ++ // column header ++ bCellsProtected = pDoc->HasAttrib(nPos, 0, nTab, nPos, MAXROW, nTab, HASATTR_PROTECTED); ++ ++ bool bSelProtected = pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS); ++ bool bSelUnprotected = pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS); ++ ++ if (bCellsProtected) ++ bSelectAllowed = bSelProtected; ++ else ++ bSelectAllowed = bSelUnprotected; ++ } ++ return bSelectAllowed; ++} ++ + void __EXPORT ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt ) + { + if (IsDisabled()) +@@ -665,6 +699,8 @@ void __EXPORT ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt ) + + BOOL bFound; + SCCOLROW nHitNo = GetMousePos( rMEvt, bFound ); ++ if (!IsSelectionAllowed(nHitNo)) ++ return; + + if ( bFound && rMEvt.IsLeft() && ResizeAllowed() ) + { +@@ -848,8 +884,11 @@ void __EXPORT ScHeaderControl::Command( const CommandEvent& rCEvt ) + MouseEvent aMEvt( rCEvt.GetMousePosPixel() ); + BOOL bBorder; + SCCOLROW nPos = GetMousePos( aMEvt, bBorder ); +- USHORT nTab = pViewData->GetTabNo(); ++ if (!IsSelectionAllowed(nPos)) ++ // Selecting this cell is not allowed, neither is context menu. ++ return; + ++ SCTAB nTab = pViewData->GetTabNo(); + ScRange aNewRange; + if ( bVertical ) + aNewRange = ScRange( 0, sal::static_int_cast(nPos), nTab, diff --git a/applied_patches/0684-calc-increase-row-limit.diff b/applied_patches/0183-calc-increase-row-limit.diff similarity index 100% rename from applied_patches/0684-calc-increase-row-limit.diff rename to applied_patches/0183-calc-increase-row-limit.diff diff --git a/applied_patches/0685-calc-odf-export-autostyle-maxrow.diff b/applied_patches/0184-calc-odf-export-autostyle-maxrow.diff similarity index 100% rename from applied_patches/0685-calc-odf-export-autostyle-maxrow.diff rename to applied_patches/0184-calc-odf-export-autostyle-maxrow.diff diff --git a/applied_patches/0686-calc-perf-flat-segment-tree.diff b/applied_patches/0185-calc-perf-flat-segment-tree.diff similarity index 100% rename from applied_patches/0686-calc-perf-flat-segment-tree.diff rename to applied_patches/0185-calc-perf-flat-segment-tree.diff diff --git a/applied_patches/0186-calc-perf-ods-import-properties.diff b/applied_patches/0186-calc-perf-ods-import-properties.diff new file mode 100644 index 000000000..c5332c1df --- /dev/null +++ b/applied_patches/0186-calc-perf-ods-import-properties.diff @@ -0,0 +1,159 @@ +diff --git sc/inc/attarray.hxx sc/inc/attarray.hxx +index 2a8c515..82ea003 100644 +--- sc/inc/attarray.hxx ++++ sc/inc/attarray.hxx +@@ -39,6 +39,7 @@ class ScEditDataArray; + class ScMarkArray; + class ScPatternAttr; + class ScStyleSheet; ++class ScFlatBoolRowSegments; + + class Rectangle; + class SfxItemPoolCache; +@@ -162,7 +163,7 @@ public: + BOOL bRefresh, BOOL bAttrs ); + BOOL RemoveAreaMerge( SCROW nStartRow, SCROW nEndRow ); + +- void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset ); ++ void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ); + BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const; + + void DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow); +diff --git sc/inc/column.hxx sc/inc/column.hxx +index babda9e..0f9586e 100644 +--- sc/inc/column.hxx ++++ sc/inc/column.hxx +@@ -71,8 +71,8 @@ class ScPostIt; + struct ScFunctionData; + struct ScLineFlags; + struct ScMergePatternState; + struct ScSetStringParam; +- ++class ScFlatBoolRowSegments; + + #define COLUMN_DELTA 4 + +@@ -341,7 +341,7 @@ public: + const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, BOOL& rFound ) const; + const ScStyleSheet* GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRow2 ) const; + +- void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset ); ++ void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ); + BOOL IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const; + + /// May return -1 if not found +diff --git sc/source/core/data/attarray.cxx sc/source/core/data/attarray.cxx +index c02d595..a5f3607 100644 +--- sc/source/core/data/attarray.cxx ++++ sc/source/core/data/attarray.cxx +@@ -57,6 +57,7 @@ + #include "rechead.hxx" + #include "globstr.hrc" + #include "cell.hxx" ++#include "segmenttree.hxx" + + #undef DBG_INVALIDATE + #define DBGOUTPUT(s) \ +@@ -1749,8 +1750,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const + return nRet; + } + +- +-void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset ) ++void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ) + { + SCROW nStart = 0; + SCSIZE nPos = 0; +@@ -1762,7 +1762,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pU + // for (SCROW nRow = nStart; nRow <= nEnd; nRow++) + // pUsed[nRow] = TRUE; + +- memset( &pUsed[nStart], TRUE, nEnd-nStart+1 ); ++ rUsedRows.setTrue(nStart, nEnd); + + if (bReset) + { +diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx +index 39061a7..374606a 100644 +--- sc/source/core/data/column.cxx ++++ sc/source/core/data/column.cxx +@@ -620,13 +620,11 @@ const ScStyleSheet* ScColumn::GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRo + return bEqual ? pStyle : NULL; + } + +- +-void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset ) ++void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ) + { +- pAttrArray->FindStyleSheet( pStyleSheet, pUsed, bReset ); ++ pAttrArray->FindStyleSheet( pStyleSheet, rUsedRows, bReset ); + } + +- + BOOL ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const + { + return pAttrArray->IsStyleSheetUsed( rStyle, bGatherAllStyles ); +diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx +index 8cb6f7a..5a78469 100644 +--- sc/source/core/data/table2.cxx ++++ sc/source/core/data/table2.cxx +@@ -60,6 +60,7 @@ + #include "bcaslot.hxx" + #include "postit.hxx" + #include "globstr.hrc" ++#include "segmenttree.hxx" + + #include + +@@ -1830,36 +1831,24 @@ void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRem + double nPPTX, double nPPTY, + const Fraction& rZoomX, const Fraction& rZoomY ) + { +- BOOL* pUsed = new BOOL[MAXROWCOUNT]; +- memset( pUsed, 0, sizeof(BOOL) * (MAXROWCOUNT) ); ++ ScFlatBoolRowSegments aUsedRows; ++ for (SCCOL i = 0; i <= MAXCOL; ++i) ++ aCol[i].FindStyleSheet(pStyleSheet, aUsedRows, bRemoved); + +- SCCOL nCol; +- for (nCol=0; nCol<=MAXCOL; nCol++) +- aCol[nCol].FindStyleSheet( pStyleSheet, pUsed, bRemoved ); ++ SCROW nRow = 0; ++ while (nRow <= MAXROW) ++ { ++ ScFlatBoolRowSegments::RangeData aData; ++ if (!aUsedRows.getRangeData(nRow, aData)) ++ // search failed! ++ return; + +- BOOL bFound = FALSE; +- SCROW nStart = 0, nEnd = 0; +- for (SCROW i=0; i<=MAXROW; i++) +- { +- if (pUsed[i]) +- { +- if (!bFound) +- { +- nStart = i; +- bFound = TRUE; +- } +- nEnd = i; +- } +- else if (bFound) +- { +- SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE ); +- bFound = FALSE; +- } +- } +- if (bFound) +- SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE ); ++ SCROW nEndRow = aData.mnRow2; ++ if (aData.mbValue) ++ SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE); + +- delete[] pUsed; ++ nRow = nEndRow + 1; ++ } + } + + diff --git a/applied_patches/0688-calc-row-limit-bad-ushort.diff b/applied_patches/0187-calc-row-limit-bad-ushort.diff similarity index 100% rename from applied_patches/0688-calc-row-limit-bad-ushort.diff rename to applied_patches/0187-calc-row-limit-bad-ushort.diff diff --git a/applied_patches/0188-calc-perf-page-and-manual-breaks.diff b/applied_patches/0188-calc-perf-page-and-manual-breaks.diff new file mode 100644 index 000000000..c22680b5c --- /dev/null +++ b/applied_patches/0188-calc-perf-page-and-manual-breaks.diff @@ -0,0 +1,1646 @@ +diff --git sc/inc/document.hxx sc/inc/document.hxx +index 986bde8..c3e15ea 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -47,6 +47,7 @@ + + #include + #include ++#include + + class KeyEvent; + class OutputDevice; +@@ -156,6 +157,9 @@ namespace com { namespace sun { namespace star { + namespace embed { + class XEmbeddedObject; + } ++ namespace sheet { ++ struct TablePageBreakData; ++ } + } } } + + namespace com { namespace sun { namespace star { namespace document { +@@ -1296,6 +1300,24 @@ public: + SC_DLLPUBLIC const ScBitMaskCompressedArray< SCROW, BYTE> & GetRowFlagsArray( SCTAB nTab ) const; + SC_DLLPUBLIC ScBitMaskCompressedArray< SCROW, BYTE> & GetRowFlagsArrayModifiable( SCTAB nTab ); + ++ SC_DLLPUBLIC void GetAllRowBreaks(::std::set& rBreaks, SCTAB nTab, bool bPage, bool bManual) const; ++ SC_DLLPUBLIC void GetAllColBreaks(::std::set& rBreaks, SCTAB nTab, bool bPage, bool bManual) const; ++ SC_DLLPUBLIC ScBreakType HasRowBreak(SCROW nRow, SCTAB nTab) const; ++ SC_DLLPUBLIC ScBreakType HasColBreak(SCCOL nCol, SCTAB nTab) const; ++ SC_DLLPUBLIC void SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual); ++ SC_DLLPUBLIC void SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual); ++ void RemoveRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual); ++ void RemoveColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual); ++ ::com::sun::star::uno::Sequence< ++ ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const; ++ ++ /** ++ * Write all column row flags to table's flag data, because not all column ++ * row attributes are stored in the flag data members. This is necessary ++ * for ods export. ++ */ ++ void SyncColRowFlags(); ++ + /// @return the index of the last row with any set flags (auto-pagebreak is ignored). + SC_DLLPUBLIC SCROW GetLastFlaggedRow( SCTAB nTab ) const; + +@@ -1335,6 +1357,7 @@ public: + Size GetPageSize( SCTAB nTab ) const; + void SetPageSize( SCTAB nTab, const Size& rSize ); + void SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow ); ++ void InvalidatePageBreaks(SCTAB nTab); + void UpdatePageBreaks( SCTAB nTab, const ScRange* pUserArea = NULL ); + void RemoveManualBreaks( SCTAB nTab ); + BOOL HasManualBreaks( SCTAB nTab ) const; +diff --git sc/inc/global.hxx sc/inc/global.hxx +index b2d6e50..61d748d 100644 +--- sc/inc/global.hxx ++++ sc/inc/global.hxx +@@ -213,13 +213,16 @@ const SCSIZE PIVOT_MAXPAGEFIELD = 10; + // FILTERED und MANUALSIZE nur fuer Zeilen moeglich + const BYTE CR_HIDDEN = 1; + //const BYTE CR_MARKED = 2; +-const BYTE CR_PAGEBREAK = 4; ++//const BYTE CR_PAGEBREAK = 4; + const BYTE CR_MANUALBREAK = 8; + const BYTE CR_FILTERED = 16; + const BYTE CR_MANUALSIZE = 32; ++const BYTE CR_ALL = (CR_HIDDEN | CR_MANUALBREAK | CR_FILTERED | CR_MANUALSIZE); + +-// was davon kommt in die Datei: +-#define CR_SAVEMASK ( ~CR_PAGEBREAK ) ++typedef BYTE ScBreakType; ++const ScBreakType BREAK_NONE = 0; ++const ScBreakType BREAK_PAGE = 1; ++const ScBreakType BREAK_MANUAL = 2; + + // Insert-/Delete-Flags + const USHORT IDF_NONE = 0x0000; +diff --git sc/inc/table.hxx sc/inc/table.hxx +index ea24628..bfc4bf2 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -40,12 +40,19 @@ + #include "compressedarray.hxx" + + #include ++#include + + namespace utl { + class SearchParam; + class TextSearch; + } + ++namespace com { namespace sun { namespace star { ++ namespace sheet { ++ struct TablePageBreakData; ++ } ++} } } ++ + class SfxItemSet; + class SfxStyleSheetBase; + class SvxBoxInfoItem; +@@ -115,6 +122,11 @@ private: + BYTE* pColFlags; + ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags; + ++ ::std::set maRowPageBreaks; ++ ::std::set maRowManualBreaks; ++ ::std::set maColPageBreaks; ++ ::std::set maColManualBreaks; ++ + ScOutlineTable* pOutlineTable; + + SCCOL nTableAreaX; +@@ -150,6 +162,7 @@ private: + Color aScenarioColor; + USHORT nScenarioFlags; + BOOL bActiveScenario; ++ bool mbPageBreaksValid; + + friend class ScDocument; // fuer FillInfo + friend class ScDocumentIterator; +@@ -337,7 +350,8 @@ public: + + void CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const; + +- void InvalidateTableArea() { bTableAreaValid = FALSE; } ++ void InvalidateTableArea(); ++ void InvalidatePageBreaks(); + + BOOL GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const; // FALSE = leer + BOOL GetTableArea( SCCOL& rEndCol, SCROW& rEndRow ) const; +@@ -598,6 +612,21 @@ public: + void RemoveManualBreaks(); + BOOL HasManualBreaks() const; + ++ void GetAllRowBreaks(::std::set& rBreaks, bool bPage, bool bManual) const; ++ void GetAllColBreaks(::std::set& rBreaks, bool bPage, bool bManual) const; ++ bool HasRowPageBreak(SCROW nRow) const; ++ bool HasColPageBreak(SCCOL nCol) const; ++ bool HasRowManualBreak(SCROW nRow) const; ++ bool HasColManualBreak(SCCOL nCol) const; ++ void RemoveRowPageBreaks(SCROW nStartRow, SCROW nEndRow); ++ void RemoveRowBreak(SCROW nRow, bool bPage, bool bManual); ++ void RemoveColBreak(SCCOL nCol, bool bPage, bool bManual); ++ void SetRowBreak(SCROW nRow, bool bPage, bool bManual); ++ void SetColBreak(SCCOL nCol, bool bPage, bool bManual); ++ ::com::sun::star::uno::Sequence< ++ ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData() const; ++ void SyncColRowFlags(); ++ + void StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); + void ExtendHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); + +diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx +index 13c9e66..98001ef 100644 +--- sc/source/core/data/document.cxx ++++ sc/source/core/data/document.cxx +@@ -54,6 +54,7 @@ + #include + + #include ++#include + + #include "document.hxx" + #include "table.hxx" +@@ -103,6 +104,9 @@ + using namespace ::com::sun::star; + + namespace WritingMode2 = ::com::sun::star::text::WritingMode2; ++using ::com::sun::star::uno::Sequence; ++using ::com::sun::star::sheet::TablePageBreakData; ++using ::std::set; + + struct ScDefaultAttr + { +@@ -3189,6 +3193,102 @@ const ScBitMaskCompressedArray< SCROW, BYTE> & ScDocument::GetRowFlagsArray( + return *pFlags; + } + ++void ScDocument::GetAllRowBreaks(set& rBreaks, SCTAB nTab, bool bPage, bool bManual) const ++{ ++ if (!ValidTab(nTab) || !pTab[nTab]) ++ return; ++ ++ pTab[nTab]->GetAllRowBreaks(rBreaks, bPage, bManual); ++} ++ ++void ScDocument::GetAllColBreaks(set& rBreaks, SCTAB nTab, bool bPage, bool bManual) const ++{ ++ if (!ValidTab(nTab) || !pTab[nTab]) ++ return; ++ ++ pTab[nTab]->GetAllColBreaks(rBreaks, bPage, bManual); ++} ++ ++ScBreakType ScDocument::HasRowBreak(SCROW nRow, SCTAB nTab) const ++{ ++ ScBreakType nType = BREAK_NONE; ++ if (!ValidTab(nTab) || !pTab[nTab] || !ValidRow(nRow)) ++ return nType; ++ ++ if (pTab[nTab]->HasRowPageBreak(nRow)) ++ nType |= BREAK_PAGE; ++ ++ if (pTab[nTab]->HasRowManualBreak(nRow)) ++ nType |= BREAK_MANUAL; ++ ++ return nType; ++} ++ ++ScBreakType ScDocument::HasColBreak(SCCOL nCol, SCTAB nTab) const ++{ ++ ScBreakType nType = BREAK_NONE; ++ if (!ValidTab(nTab) || !pTab[nTab] || !ValidCol(nCol)) ++ return nType; ++ ++ if (pTab[nTab]->HasColPageBreak(nCol)) ++ nType |= BREAK_PAGE; ++ ++ if (pTab[nTab]->HasColManualBreak(nCol)) ++ nType |= BREAK_MANUAL; ++ ++ return nType; ++} ++ ++void ScDocument::SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual) ++{ ++ if (!ValidTab(nTab) || !pTab[nTab] || !ValidRow(nRow)) ++ return; ++ ++ pTab[nTab]->SetRowBreak(nRow, bPage, bManual); ++} ++ ++void ScDocument::SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual) ++{ ++ if (!ValidTab(nTab) || !pTab[nTab] || !ValidCol(nCol)) ++ return; ++ ++ pTab[nTab]->SetColBreak(nCol, bPage, bManual); ++} ++ ++void ScDocument::RemoveRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual) ++{ ++ if (!ValidTab(nTab) || !pTab[nTab] || !ValidRow(nRow)) ++ return; ++ ++ pTab[nTab]->RemoveRowBreak(nRow, bPage, bManual); ++} ++ ++void ScDocument::RemoveColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual) ++{ ++ if (!ValidTab(nTab) || !pTab[nTab] || !ValidCol(nCol)) ++ return; ++ ++ pTab[nTab]->RemoveColBreak(nCol, bPage, bManual); ++} ++ ++Sequence ScDocument::GetRowBreakData(SCTAB nTab) const ++{ ++ if (!ValidTab(nTab) || !pTab[nTab]) ++ return Sequence(); ++ ++ return pTab[nTab]->GetRowBreakData(); ++} ++ ++void ScDocument::SyncColRowFlags() ++{ ++ for (SCTAB i = 0; i <= nMaxTableNumber; ++i) ++ { ++ if (!ValidTab(i) || !pTab[i]) ++ continue; ++ ++ pTab[i]->SyncColRowFlags(); ++ } ++} + + SCROW ScDocument::GetLastFlaggedRow( SCTAB nTab ) const + { +@@ -4569,6 +4669,11 @@ void ScDocument::SetRepeatArea( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCRO + pTab[nTab]->SetRepeatArea( nStartCol, nEndCol, nStartRow, nEndRow ); + } + ++void ScDocument::InvalidatePageBreaks(SCTAB nTab) ++{ ++ if (ValidTab(nTab) && pTab[nTab]) ++ pTab[nTab]->InvalidatePageBreaks(); ++} + + void ScDocument::UpdatePageBreaks( SCTAB nTab, const ScRange* pUserArea ) + { +diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx +index ddd1bbb..51c3e5e 100644 +--- sc/source/core/data/table1.cxx ++++ sc/source/core/data/table1.cxx +@@ -155,7 +155,8 @@ ScTable::ScTable( ScDocument* pDoc, SCTAB nNewTab, const String& rNewName, + pScenarioRanges( NULL ), + aScenarioColor( COL_LIGHTGRAY ), + nScenarioFlags( 0 ), +- bActiveScenario( FALSE ) ++ bActiveScenario( FALSE ), ++ mbPageBreaksValid(false) + { + + if (bColInfo) +--- sc/source/core/data/table2.cxx ++++ sc/source/core/data/table2.cxx +@@ -137,6 +137,8 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE + aCol[j].InsertRow( nStartRow, nSize ); + if( !--nRecalcLvl ) + SetDrawPageSize(); ++ ++ InvalidatePageBreaks(); + } + + +@@ -164,6 +166,8 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE + } + if( !--nRecalcLvl ) + SetDrawPageSize(); ++ ++ InvalidatePageBreaks(); + } + + +@@ -230,6 +234,8 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE + } + if( !--nRecalcLvl ) + SetDrawPageSize(); ++ ++ InvalidatePageBreaks(); + } + + +@@ -272,6 +278,8 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE + } + if( !--nRecalcLvl ) + SetDrawPageSize(); ++ ++ InvalidatePageBreaks(); + } + + +@@ -638,29 +646,39 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, + if (bWidth) + for (SCCOL i=nCol1; i<=nCol2; i++) + { +- BOOL bChange = pCharts && +- ( pDestTab->pColFlags[i] & CR_HIDDEN ) != ( pColFlags[i] & CR_HIDDEN ); ++ bool bHiddenChange = ( pDestTab->pColFlags[i] & CR_HIDDEN ) != ( pColFlags[i] & CR_HIDDEN ); ++ bool bChange = bHiddenChange || (pDestTab->pColWidth[i] != pColWidth[i]); + pDestTab->pColWidth[i] = pColWidth[i]; + pDestTab->pColFlags[i] = pColFlags[i]; + //! Aenderungen zusammenfassen? +- if (bChange) ++ if (bHiddenChange && pCharts) + pCharts->SetRangeDirty(ScRange( i, 0, nTab, i, MAXROW, nTab )); ++ ++ if (bChange) ++ pDestTab->InvalidatePageBreaks(); + } + + if (bHeight) + { ++ bool bChange = pDestTab->pRowHeight->SumValues(nRow1, nRow2) != pRowHeight->SumValues(nRow1, nRow2); ++ ++ if (bChange) ++ pDestTab->InvalidatePageBreaks(); ++ + pDestTab->pRowHeight->CopyFrom( *pRowHeight, nRow1, nRow2); + for (SCROW i=nRow1; i<=nRow2; i++) + { + // TODO: might need some performance improvement, block + // operations instead of single GetValue()/SetValue() calls. + BYTE nThisRowFlags = pRowFlags->GetValue(i); +- BOOL bChange = pCharts && +- ( pDestTab->pRowFlags->GetValue(i) & CR_HIDDEN ) != ( nThisRowFlags & CR_HIDDEN ); ++ bool bHiddenChange = ( pDestTab->pRowFlags->GetValue(i) & CR_HIDDEN ) != ( nThisRowFlags & CR_HIDDEN ); + pDestTab->pRowFlags->SetValue( i, nThisRowFlags ); + //! Aenderungen zusammenfassen? +- if (bChange) ++ if (bHiddenChange && pCharts) + pCharts->SetRangeDirty(ScRange( 0, i, nTab, MAXCOL, i, nTab )); ++ ++ if (bHiddenChange) ++ pDestTab->InvalidatePageBreaks(); + } + } + pDestTab->DecRecalcLevel(); +@@ -711,6 +729,16 @@ void ScTable::CopyUpdated( const ScTable* pPosTab, ScTable* pDestTab ) const + aCol[i].CopyUpdated( pPosTab->aCol[i], pDestTab->aCol[i] ); + } + ++void ScTable::InvalidateTableArea() ++{ ++ bTableAreaValid = FALSE; ++} ++ ++void ScTable::InvalidatePageBreaks() ++{ ++ mbPageBreaksValid = false; ++} ++ + void ScTable::CopyScenarioTo( ScTable* pDestTab ) const + { + DBG_ASSERT( bScenario, "bScenario == FALSE" ); +@@ -1931,6 +1959,8 @@ void ScTable::SetColWidth( SCCOL nCol, USHORT nNewWidth ) + pColWidth[nCol] = nNewWidth; + if( !--nRecalcLvl ) + SetDrawPageSize(); ++ ++ InvalidatePageBreaks(); + } + } + else +@@ -1960,6 +1990,8 @@ void ScTable::SetRowHeight( SCROW nRow, USHORT nNewHeight ) + pRowHeight->SetValue( nRow, nNewHeight); + if( !--nRecalcLvl ) + SetDrawPageSize(); ++ ++ InvalidatePageBreaks(); + } + } + else +@@ -2041,6 +2073,9 @@ BOOL ScTable::SetRowHeightRange( SCROW nStartRow, SCROW nEndRow, USHORT nNewHeig + } + if( !--nRecalcLvl ) + SetDrawPageSize(); ++ ++ if (bChanged) ++ InvalidatePageBreaks(); + } + else + { +@@ -2280,6 +2315,8 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow) + ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection(); + if ( pCharts ) + pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab )); ++ ++ InvalidatePageBreaks(); + } + } + else +@@ -2324,6 +2361,8 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow) + + if (pOutlineTable) + UpdateOutlineRow( nRow, nRow, bShow ); ++ ++ InvalidatePageBreaks(); + } + } + else +@@ -2421,6 +2460,8 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow) + ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection(); + if ( pCharts ) + pCharts->SetRangeDirty(ScRange( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab )); ++ ++ InvalidatePageBreaks(); + } + + nStartRow = nEndRow + 1; +@@ -2496,7 +2537,7 @@ SCROW ScTable::GetLastFlaggedRow() const + if ( !pRowFlags ) + return 0; + +- SCROW nLastFound = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast(~CR_PAGEBREAK) ); ++ SCROW nLastFound = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast(CR_ALL) ); + return ValidRow(nLastFound) ? nLastFound : 0; + } + +@@ -2508,7 +2549,7 @@ SCCOL ScTable::GetLastChangedCol() const + + SCCOL nLastFound = 0; + for (SCCOL nCol = 1; nCol <= MAXCOL; nCol++) +- if ((pColFlags[nCol] & ~CR_PAGEBREAK) || (pColWidth[nCol] != STD_COL_WIDTH)) ++ if ((pColFlags[nCol] & CR_ALL) || (pColWidth[nCol] != STD_COL_WIDTH)) + nLastFound = nCol; + + return nLastFound; +@@ -2520,7 +2561,7 @@ SCROW ScTable::GetLastChangedRow() const + if ( !pRowFlags ) + return 0; + +- SCROW nLastFlags = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast(~CR_PAGEBREAK) ); ++ SCROW nLastFlags = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast(CR_ALL) ); + if (!ValidRow(nLastFlags)) + nLastFlags = 0; + +diff --git sc/source/core/data/table3.cxx sc/source/core/data/table3.cxx +index 5fca4bc..95f68fc 100644 +--- sc/source/core/data/table3.cxx ++++ sc/source/core/data/table3.cxx +@@ -771,7 +771,7 @@ void ScTable::RemoveSubTotals( ScSubTotalParam& rParam ) + if ( pCell->GetCellType() == CELLTYPE_FORMULA ) + if (((ScFormulaCell*)pCell)->IsSubTotal()) + { +- SetRowFlags(nRow+1,GetRowFlags(nRow+1)&(~CR_MANUALBREAK)); ++ RemoveRowBreak(nRow+1, false, true); + pDocument->DeleteRow( 0,nTab, MAXCOL,nTab, nRow, 1 ); + --nEndRow; + aIter = ScColumnIterator( &aCol[nCol],nRow,nEndRow ); +@@ -939,9 +939,7 @@ BOOL ScTable::DoSubTotals( ScSubTotalParam& rParam ) + bBlockVis = FALSE; + if ( rParam.bPagebreak && nRow < MAXROW && + aRowEntry.nSubStartRow != nStartRow && nLevel == 0) +- SetRowFlags( aRowEntry.nSubStartRow, +- GetRowFlags(aRowEntry.nSubStartRow) | +- CR_MANUALBREAK); ++ SetRowBreak(aRowEntry.nSubStartRow, false, true); + + if (bSpaceLeft) + { +diff --git sc/source/core/data/table5.cxx sc/source/core/data/table5.cxx +index 3bb433c..618fe75 100644 +--- sc/source/core/data/table5.cxx ++++ sc/source/core/data/table5.cxx +@@ -53,8 +53,13 @@ + #include "brdcst.hxx" + #include "tabprotection.hxx" + #include "globstr.hrc" ++#include ++ ++#include + + using ::com::sun::star::uno::Sequence; ++using ::com::sun::star::sheet::TablePageBreakData; ++using ::std::set; + + // STATIC DATA ----------------------------------------------------------- + +@@ -68,6 +73,9 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + if ( !pUserArea && !bPageSizeValid ) + return; + ++ if (mbPageBreaksValid) ++ return; ++ + SfxStyleSheetBase* pStyle = pDocument->GetStyleSheetPool()-> + Find( aPageStyle, SFX_STYLE_FAMILY_PAGE ); + if ( !pStyle ) +@@ -79,7 +87,6 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + const SfxPoolItem* pItem; + + SCCOL nX; +- SCROW nY; + SCCOL nStartCol = 0; + SCROW nStartRow = 0; + SCCOL nEndCol = MAXCOL; +@@ -99,8 +106,9 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + // bei mehreren Bereichen nichts anzeigen: + + for (nX=0; nXAndValue( 0, MAXROW-1, sal::static_int_cast(~CR_PAGEBREAK) ); ++ RemoveColBreak(nX, true, false); ++ ++ RemoveRowPageBreaks(0, MAXROW-1); + + return; + } +@@ -144,13 +152,13 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + // Anfang: Breaks loeschen + + for (nX=0; nXAndValue( 0, nStartRow-1, sal::static_int_cast(~CR_PAGEBREAK) ); ++ RemoveColBreak(nX, true, false); ++ RemoveRowPageBreaks(0, nStartRow-1); + + if (nStartCol > 0) +- pColFlags[nStartCol] |= CR_PAGEBREAK; //! AREABREAK ++ SetColBreak(nStartCol, true, false); // AREABREAK + if (nStartRow > 0) +- pRowFlags->OrValue( nStartRow, CR_PAGEBREAK); //! AREABREAK ++ SetRowBreak(nStartRow, true, false); // AREABREAK + + // Mittelteil: Breaks verteilen + +@@ -161,14 +169,15 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + { + BOOL bStartOfPage = FALSE; + long nThisX = ( pColFlags[nX] & CR_HIDDEN ) ? 0 : pColWidth[nX]; +- if ( (nSizeX+nThisX > nPageSizeX) || ((pColFlags[nX] & CR_MANUALBREAK) && !bSkipBreaks) ) ++ bool bManualBreak = HasColManualBreak(nX); ++ if ( (nSizeX+nThisX > nPageSizeX) || (bManualBreak && !bSkipBreaks) ) + { +- pColFlags[nX] |= CR_PAGEBREAK; ++ SetColBreak(nX, true, false); + nSizeX = 0; + bStartOfPage = TRUE; + } + else if (nX != nStartCol) +- pColFlags[nX] &= ~CR_PAGEBREAK; ++ RemoveColBreak(nX, true, false); + else + bStartOfPage = TRUE; + +@@ -178,7 +187,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + for (SCCOL i=nRepeatStartX; i<=nRepeatEndX; i++) + nPageSizeX -= ( pColFlags[i] & CR_HIDDEN ) ? 0 : pColWidth[i]; + while (nX<=nRepeatEndX) +- pColFlags[++nX] &= ~CR_PAGEBREAK; ++ RemoveColBreak(++nX, true, false); + bColFound = TRUE; + } + +@@ -186,23 +195,21 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + } + + // Remove all page breaks in range. +- pRowFlags->AndValue( nStartRow+1, nEndRow, sal::static_int_cast(~CR_PAGEBREAK) ); ++ RemoveRowPageBreaks(nStartRow+1, nEndRow); ++ + // And set new page breaks. + BOOL bRepeatRow = ( nRepeatStartY != SCROW_REPEAT_NONE ); + BOOL bRowFound = FALSE; + long nSizeY = 0; +- ScCompressedArrayIterator< SCROW, BYTE> aFlagsIter( *pRowFlags, nStartRow, nEndRow); +- ScCompressedArrayIterator< SCROW, USHORT> aHeightIter( *pRowHeight, nStartRow, nEndRow); +- for ( ; aFlagsIter; ++aFlagsIter, ++aHeightIter) +- { +- nY = aFlagsIter.GetPos(); ++ for (SCROW nY = nStartRow; nY <= nEndRow; ++nY) ++ { + BOOL bStartOfPage = FALSE; +- BYTE nFlags = *aFlagsIter; +- long nThisY = (nFlags & CR_HIDDEN) ? 0 : *aHeightIter; +- if ( (nSizeY+nThisY > nPageSizeY) || ((nFlags & CR_MANUALBREAK) && !bSkipBreaks) ) ++ BYTE nFlags = pRowFlags->GetValue(nY); ++ long nThisY = (nFlags & CR_HIDDEN) ? 0 : pRowHeight->GetValue(nY); ++ bool bManualBreak = HasRowManualBreak(nY); ++ if ( (nSizeY+nThisY > nPageSizeY) || (bManualBreak && !bSkipBreaks) ) + { +- pRowFlags->SetValue( nY, nFlags | CR_PAGEBREAK); +- aFlagsIter.Resync( nY); ++ SetRowBreak(nY, true, false); + nSizeY = 0; + bStartOfPage = TRUE; + } +@@ -222,12 +229,7 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + #endif + nPageSizeY -= nHeights; + if (nY <= nRepeatEndY) +- { +- pRowFlags->AndValue( nY, nRepeatEndY, sal::static_int_cast(~CR_PAGEBREAK) ); +- nY = nRepeatEndY + 1; +- aFlagsIter.Resync( nY); +- aHeightIter.Resync( nY); +- } ++ RemoveRowPageBreaks(nY, nRepeatEndY); + bRowFound = TRUE; + } + +@@ -238,46 +240,214 @@ void ScTable::UpdatePageBreaks( const ScRange* pUserArea ) + + if (nEndCol < MAXCOL) + { +- pColFlags[nEndCol+1] |= CR_PAGEBREAK; //! AREABREAK ++ SetColBreak(nEndCol+1, true, false); // AREABREAK + for (nX=nEndCol+2; nX<=MAXCOL; nX++) +- pColFlags[nX] &= ~CR_PAGEBREAK; ++ RemoveColBreak(nX, true, false); + } + if (nEndRow < MAXROW) + { +- pRowFlags->OrValue( nEndRow+1, CR_PAGEBREAK); //! AREABREAK ++ SetRowBreak(nEndRow+1, true, false); // AREABREAK + if (nEndRow+2 <= MAXROW) +- pRowFlags->AndValue( nEndRow+2, MAXROW, sal::static_int_cast(~CR_PAGEBREAK) ); ++ RemoveRowPageBreaks(nEndRow+2, MAXROW); + } ++ mbPageBreaksValid = true; + } + + void ScTable::RemoveManualBreaks() + { +- if (pColFlags) +- for (SCCOL nCol = 0; nCol <= MAXCOL; nCol++) +- pColFlags[nCol] &= ~CR_MANUALBREAK; +- +- if (pRowFlags) +- pRowFlags->AndValue( 0, MAXROW, sal::static_int_cast(~CR_MANUALBREAK) ); ++ maRowManualBreaks.clear(); ++ maColManualBreaks.clear(); ++ InvalidatePageBreaks(); + } + + BOOL ScTable::HasManualBreaks() const + { +- if (pColFlags) +- for (SCCOL nCol = 0; nCol <= MAXCOL; nCol++) +- if ( pColFlags[nCol] & CR_MANUALBREAK ) +- return TRUE; ++ return !maRowManualBreaks.empty() || !maColManualBreaks.empty(); ++} ++ ++void ScTable::GetAllRowBreaks(set& rBreaks, bool bPage, bool bManual) const ++{ ++ if (bPage) ++ rBreaks = maRowPageBreaks; ++ ++ if (bManual) ++ { ++ using namespace std; ++ copy(maRowManualBreaks.begin(), maRowManualBreaks.end(), inserter(rBreaks, rBreaks.begin())); ++ } ++} ++ ++void ScTable::GetAllColBreaks(set& rBreaks, bool bPage, bool bManual) const ++{ ++ if (bPage) ++ rBreaks = maColPageBreaks; ++ ++ if (bManual) ++ { ++ using namespace std; ++ copy(maColManualBreaks.begin(), maColManualBreaks.end(), inserter(rBreaks, rBreaks.begin())); ++ } ++} ++ ++bool ScTable::HasRowPageBreak(SCROW nRow) const ++{ ++ if (!ValidRow(nRow)) ++ return false; ++ ++ return maRowPageBreaks.count(nRow) > 0; ++} + +- if (pRowFlags) +- if (ValidRow( pRowFlags->GetLastAnyBitAccess( 0, CR_MANUALBREAK))) +- return TRUE; ++bool ScTable::HasColPageBreak(SCCOL nCol) const ++{ ++ if (!ValidCol(nCol)) ++ return false; + +- return FALSE; ++ return maColPageBreaks.count(nCol) > 0; ++} ++ ++bool ScTable::HasRowManualBreak(SCROW nRow) const ++{ ++ if (!ValidRow(nRow)) ++ return false; ++ ++ return maRowManualBreaks.count(nRow) > 0; ++} ++ ++bool ScTable::HasColManualBreak(SCCOL nCol) const ++{ ++ if (!ValidCol(nCol)) ++ return false; ++ ++ return (maColManualBreaks.count(nCol) > 0); ++} ++ ++void ScTable::RemoveRowPageBreaks(SCROW nStartRow, SCROW nEndRow) ++{ ++ using namespace std; ++ ++ if (!ValidRow(nStartRow) || !ValidRow(nEndRow)) ++ return; ++ ++ set::iterator low = maRowPageBreaks.lower_bound(nStartRow); ++ set::iterator high = maRowPageBreaks.upper_bound(nEndRow); ++ maRowPageBreaks.erase(low, high); ++} ++ ++void ScTable::RemoveRowBreak(SCROW nRow, bool bPage, bool bManual) ++{ ++ if (!ValidRow(nRow)) ++ return; ++ ++ if (bPage) ++ maRowPageBreaks.erase(nRow); ++ ++ if (bManual) ++ { ++ maRowManualBreaks.erase(nRow); ++ InvalidatePageBreaks(); ++ } ++} ++ ++void ScTable::RemoveColBreak(SCCOL nCol, bool bPage, bool bManual) ++{ ++ if (!ValidCol(nCol)) ++ return; ++ ++ if (bPage) ++ maColPageBreaks.erase(nCol); ++ ++ if (bManual) ++ { ++ maColManualBreaks.erase(nCol); ++ InvalidatePageBreaks(); ++ } ++} ++ ++void ScTable::SetRowBreak(SCROW nRow, bool bPage, bool bManual) ++{ ++ if (!ValidRow(nRow)) ++ return; ++ ++ if (bPage) ++ maRowPageBreaks.insert(nRow); ++ ++ if (bManual) ++ { ++ maRowManualBreaks.insert(nRow); ++ InvalidatePageBreaks(); ++ } ++} ++ ++void ScTable::SetColBreak(SCCOL nCol, bool bPage, bool bManual) ++{ ++ if (!ValidCol(nCol)) ++ return; ++ ++ if (bPage) ++ maColPageBreaks.insert(nCol); ++ ++ if (bManual) ++ { ++ maColManualBreaks.insert(nCol); ++ InvalidatePageBreaks(); ++ } ++} ++ ++Sequence ScTable::GetRowBreakData() const ++{ ++ using ::std::copy; ++ using ::std::inserter; ++ ++ set aRowBreaks = maRowPageBreaks; ++ copy(maRowManualBreaks.begin(), maRowManualBreaks.end(), inserter(aRowBreaks, aRowBreaks.begin())); ++ ++ set::const_iterator itr = aRowBreaks.begin(), itrEnd = aRowBreaks.end(); ++ Sequence aSeq(aRowBreaks.size()); ++ ++ for (sal_Int32 i = 0; itr != itrEnd; ++itr, ++i) ++ { ++ SCROW nRow = *itr; ++ TablePageBreakData aData; ++ aData.Position = nRow; ++ aData.ManualBreak = HasRowManualBreak(nRow); ++ aSeq[i] = aData; ++ } ++ ++ return aSeq; ++} ++ ++void ScTable::SyncColRowFlags() ++{ ++ using ::sal::static_int_cast; ++ ++ // For now, we only need to sync the manual breaks. ++ ++ pRowFlags->AndValue(0, MAXROW, static_int_cast(~CR_MANUALBREAK)); ++ for (SCCOL i = 0; i <= MAXCOL; ++i) ++ pColFlags[i] &= static_int_cast(~CR_MANUALBREAK); ++ ++ if (!maRowManualBreaks.empty()) ++ { ++ for (set::const_iterator itr = maRowManualBreaks.begin(), itrEnd = maRowManualBreaks.end(); ++ itr != itrEnd; ++itr) ++ pRowFlags->OrValue(*itr, static_int_cast(CR_MANUALBREAK)); ++ } ++ ++ if (!maColManualBreaks.empty()) ++ { ++ for (set::const_iterator itr = maColManualBreaks.begin(), itrEnd = maColManualBreaks.end(); ++ itr != itrEnd; ++itr) ++ pColFlags[*itr] |= CR_MANUALBREAK; ++ } + } + + void ScTable::SetPageSize( const Size& rSize ) + { + if ( rSize.Width() != 0 && rSize.Height() != 0 ) + { ++ if (aPageSizeTwips != rSize) ++ InvalidatePageBreaks(); ++ + bPageSizeValid = TRUE; + aPageSizeTwips = rSize; + } +diff --git sc/source/filter/excel/xepage.cxx sc/source/filter/excel/xepage.cxx +index 52aa775..f99b732 100644 +--- sc/source/filter/excel/xepage.cxx ++++ sc/source/filter/excel/xepage.cxx +@@ -48,9 +48,14 @@ + #include "xehelper.hxx" + #include "xeescher.hxx" + ++#include ++#include ++ + #include + + using ::rtl::OString; ++using ::std::set; ++using ::std::numeric_limits; + + // Page settings records ====================================================== + +@@ -302,17 +307,23 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) : + + // *** page breaks *** + +- ScCompressedArrayIterator< SCROW, BYTE> aIter( rDoc.GetRowFlagsArray( nScTab), 1, GetMaxPos().Row()); +- do ++ set aRowBreaks; ++ rDoc.GetAllRowBreaks(aRowBreaks, nScTab, false, true); ++ ++ SCROW nMaxRow = numeric_limits::max(); ++ for (set::const_iterator itr = aRowBreaks.begin(), itrEnd = aRowBreaks.end(); itr != itrEnd; ++itr) + { +- if (*aIter & CR_MANUALBREAK) +- for (SCROW j=aIter.GetRangeStart(); j<=aIter.GetRangeEnd(); ++j) +- maData.maHorPageBreaks.push_back( static_cast< sal_uInt16 >( j ) ); +- } while (aIter.NextRange()); +- +- for( SCCOL nScCol = 1, nScMaxCol = GetMaxPos().Col(); nScCol <= nScMaxCol; ++nScCol ) +- if( rDoc.GetColFlags( nScCol, nScTab ) & CR_MANUALBREAK ) +- maData.maVerPageBreaks.push_back( static_cast< sal_uInt16 >( nScCol ) ); ++ SCROW nRow = *itr; ++ if (nRow > nMaxRow) ++ break; ++ ++ maData.maHorPageBreaks.push_back(nRow); ++ } ++ ++ set aColBreaks; ++ rDoc.GetAllColBreaks(aColBreaks, nScTab, false, true); ++ for (set::const_iterator itr = aColBreaks.begin(), itrEnd = aColBreaks.end(); itr != itrEnd; ++itr) ++ maData.maVerPageBreaks.push_back(*itr); + } + + static void lcl_WriteHeaderFooter( XclExpXmlStream& rStrm ) +diff --git sc/source/filter/excel/xipage.cxx sc/source/filter/excel/xipage.cxx +index 2a52521..cb1aba2 100644 +--- sc/source/filter/excel/xipage.cxx ++++ sc/source/filter/excel/xipage.cxx +@@ -378,14 +378,14 @@ void XclImpPageSettings::Finalize() + { + SCROW nScRow = static_cast< SCROW >( *aIt ); + if( nScRow <= MAXROW ) +- rDoc.SetRowFlags( nScRow, nScTab, rDoc.GetRowFlags( nScRow, nScTab ) | CR_MANUALBREAK ); ++ rDoc.SetRowBreak(nScRow, nScTab, false, true); + } + + for( aIt = maData.maVerPageBreaks.begin(), aEnd = maData.maVerPageBreaks.end(); aIt != aEnd; ++aIt ) + { + SCCOL nScCol = static_cast< SCCOL >( *aIt ); + if( nScCol <= MAXCOL ) +- rDoc.SetColFlags( nScCol, nScTab, rDoc.GetColFlags( nScCol, nScTab ) | CR_MANUALBREAK ); ++ rDoc.SetColBreak(nScCol, nScTab, false, true); + } + } + +diff --git sc/source/filter/starcalc/scflt.cxx sc/source/filter/starcalc/scflt.cxx +index 444ed23..371ef48 100644 +--- sc/source/filter/starcalc/scflt.cxx ++++ sc/source/filter/starcalc/scflt.cxx +@@ -1552,13 +1552,15 @@ void Sc10Import::LoadTables() + if (DataValue != 0) + { + BYTE nFlags = 0; +- if ((DataValue & crfSoftBreak) == crfSoftBreak) +- nFlags |= CR_PAGEBREAK; +- if ((DataValue & crfHardBreak) == crfHardBreak) +- nFlags |= CR_MANUALBREAK; ++ bool bPageBreak = ((DataValue & crfSoftBreak) == crfSoftBreak); ++ bool bManualBreak = ((DataValue & crfHardBreak) == crfHardBreak); + if ((DataValue & crfHidden) == crfHidden) + nFlags |= CR_HIDDEN; +- for (SCCOL k = static_cast(DataStart); k <= static_cast(DataEnd); k++) pDoc->SetColFlags(k, static_cast (TabNo), nFlags); ++ for (SCCOL k = static_cast(DataStart); k <= static_cast(DataEnd); k++) ++ { ++ pDoc->SetColFlags(k, static_cast (TabNo), nFlags); ++ pDoc->SetColBreak(k, static_cast (TabNo), bPageBreak, bManualBreak); ++ } + } + DataStart = DataEnd + 1; + } +@@ -1602,13 +1604,15 @@ void Sc10Import::LoadTables() + if (DataValue != 0) + { + BYTE nFlags = 0; +- if ((DataValue & crfSoftBreak) == crfSoftBreak) +- nFlags |= CR_PAGEBREAK; +- if ((DataValue & crfHardBreak) == crfHardBreak) +- nFlags |= CR_MANUALBREAK; ++ bool bPageBreak = ((DataValue & crfSoftBreak) == crfSoftBreak); ++ bool bManualBreak = ((DataValue & crfHardBreak) == crfHardBreak); + if ((DataValue & crfHidden) == crfHidden) + nFlags |= CR_HIDDEN; +- for (SCROW l = static_cast(DataStart); l <= static_cast(DataEnd); l++) pDoc->SetRowFlags(l, static_cast (TabNo), nFlags); ++ for (SCROW l = static_cast(DataStart); l <= static_cast(DataEnd); l++) ++ { ++ pDoc->SetRowFlags(l, static_cast (TabNo), nFlags); ++ pDoc->SetRowBreak(l, static_cast (TabNo), bPageBreak, bManualBreak); ++ } + } + DataStart = DataEnd + 1; + } +diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx +index 089f12d..4dd19a1 100644 +--- sc/source/filter/xml/xmlexprt.cxx ++++ sc/source/filter/xml/xmlexprt.cxx +@@ -1947,6 +1947,7 @@ void ScXMLExport::_ExportAutoStyles() + { + if (pDoc) + { ++ pDoc->SyncColRowFlags(); + uno::Reference xTableColumns(xColumnRowRange->getColumns()); + if (xTableColumns.is()) + { +diff --git sc/source/ui/docshell/dbdocfun.cxx sc/source/ui/docshell/dbdocfun.cxx +index 9e2a647..0e670d8 100644 +--- sc/source/ui/docshell/dbdocfun.cxx ++++ sc/source/ui/docshell/dbdocfun.cxx +@@ -938,7 +938,10 @@ BOOL ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, + } + + if (!bCopy) ++ { ++ pDoc->InvalidatePageBreaks(nTab); + pDoc->UpdatePageBreaks( nTab ); ++ } + + // #i23299# because of Subtotal functions, the whole rows must be set dirty + ScRange aDirtyRange( 0 , aLocalParam.nRow1, nDestTab, +diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx +index 0d98486..1477025 100644 +--- sc/source/ui/docshell/docfunc.cxx ++++ sc/source/ui/docshell/docfunc.cxx +@@ -3033,20 +3033,22 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos, + if (nPos == 0) + return FALSE; // erste Spalte / Zeile + +- BYTE nFlags = bColumn ? pDoc->GetColFlags( static_cast(nPos), nTab ) +- : pDoc->GetRowFlags( static_cast(nPos), nTab ); +- if (nFlags & CR_MANUALBREAK) +- return TRUE; // Umbruch schon gesetzt ++ ScBreakType nBreak = bColumn ? ++ pDoc->HasColBreak(static_cast(nPos), nTab) : ++ pDoc->HasRowBreak(static_cast(nPos), nTab); ++ if (nBreak & BREAK_MANUAL) ++ return true; + + if (bRecord) + rDocShell.GetUndoManager()->AddUndoAction( + new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, TRUE ) ); + +- nFlags |= CR_MANUALBREAK; +- if (bColumn) +- pDoc->SetColFlags( static_cast(nPos), nTab, nFlags ); +- else +- pDoc->SetRowFlags( static_cast(nPos), nTab, nFlags ); ++ if (bColumn) ++ pDoc->SetColBreak(static_cast(nPos), nTab, false, true); ++ else ++ pDoc->SetRowBreak(static_cast(nPos), nTab, false, true); ++ ++ pDoc->InvalidatePageBreaks(nTab); + pDoc->UpdatePageBreaks( nTab ); + + if (bColumn) +@@ -3089,20 +3091,25 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos, + + SCCOLROW nPos = bColumn ? static_cast(rPos.Col()) : + static_cast(rPos.Row()); +- BYTE nFlags = bColumn ? pDoc->GetColFlags( static_cast(nPos), nTab ) +- : pDoc->GetRowFlags( static_cast(nPos), nTab ); +- if ((nFlags & CR_MANUALBREAK)==0) +- return FALSE; // kein Umbruch gesetzt ++ ++ ScBreakType nBreak; ++ if (bColumn) ++ nBreak = pDoc->HasColBreak(static_cast(nPos), nTab); ++ else ++ nBreak = pDoc->HasRowBreak(static_cast(nPos), nTab); ++ if ((nBreak & BREAK_MANUAL) == 0) ++ // There is no manual break. ++ return false; + + if (bRecord) + rDocShell.GetUndoManager()->AddUndoAction( + new ScUndoPageBreak( &rDocShell, rPos.Col(), rPos.Row(), nTab, bColumn, FALSE ) ); + +- nFlags &= ~CR_MANUALBREAK; +- if (bColumn) +- pDoc->SetColFlags( static_cast(nPos), nTab, nFlags ); +- else +- pDoc->SetRowFlags( static_cast(nPos), nTab, nFlags ); ++ if (bColumn) ++ pDoc->RemoveColBreak(static_cast(nPos), nTab, false, true); ++ else ++ pDoc->RemoveRowBreak(static_cast(nPos), nTab, false, true); ++ + pDoc->UpdatePageBreaks( nTab ); + + if (bColumn) +diff --git sc/source/ui/docshell/olinefun.cxx sc/source/ui/docshell/olinefun.cxx +index ed5fb52..37023e2 100644 +--- sc/source/ui/docshell/olinefun.cxx ++++ sc/source/ui/docshell/olinefun.cxx +@@ -692,6 +692,7 @@ BOOL ScOutlineDocFunc::ShowOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US + + pArray->SetVisibleBelow( nLevel, nEntry, TRUE, TRUE ); + ++ pDoc->InvalidatePageBreaks(nTab); + pDoc->UpdatePageBreaks( nTab ); + + if (bPaint) +@@ -757,6 +758,7 @@ BOOL ScOutlineDocFunc::HideOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US + + pArray->SetVisibleBelow( nLevel, nEntry, FALSE ); + ++ pDoc->InvalidatePageBreaks(nTab); + pDoc->UpdatePageBreaks( nTab ); + + if (bPaint) +diff --git sc/source/ui/undo/undocell.cxx sc/source/ui/undo/undocell.cxx +index 52c8bc0..9237578 100644 +--- sc/source/ui/undo/undocell.cxx ++++ sc/source/ui/undo/undocell.cxx +@@ -587,6 +587,8 @@ void ScUndoPageBreak::DoChange( BOOL bInsertP ) const + pViewShell->InsertPageBreak(bColumn, FALSE); + else + pViewShell->DeletePageBreak(bColumn, FALSE); ++ ++ pDocShell->GetDocument()->InvalidatePageBreaks(nTab); + } + } + +diff --git sc/source/ui/undo/undodat.cxx sc/source/ui/undo/undodat.cxx +index 36bb424..7420660 100644 +--- sc/source/ui/undo/undodat.cxx ++++ sc/source/ui/undo/undodat.cxx +@@ -1032,7 +1032,10 @@ void __EXPORT ScUndoQuery::Undo() + pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), TRUE ); + + if (!bCopy) ++ { ++ pDoc->InvalidatePageBreaks(nTab); + pDoc->UpdatePageBreaks( nTab ); ++ } + + ScRange aDirtyRange( 0 , aQueryParam.nRow1, nTab, + MAXCOL, aQueryParam.nRow2, nTab ); +--- sc/source/ui/unoobj/cellsuno.cxx ++++ sc/source/ui/unoobj/cellsuno.cxx +@@ -7150,7 +7150,7 @@ uno::Sequence SAL_CALL ScTableSheetObj::getColumnPage + SCCOL nCount = 0; + SCCOL nCol; + for (nCol=0; nCol<=MAXCOL; nCol++) +- if (pDoc->GetColFlags( nCol, nTab ) & ( CR_PAGEBREAK | CR_MANUALBREAK )) ++ if (pDoc->HasColBreak(nCol, nTab)) + ++nCount; + + sheet::TablePageBreakData aData; +@@ -7159,11 +7159,11 @@ uno::Sequence SAL_CALL ScTableSheetObj::getColumnPage + USHORT nPos = 0; + for (nCol=0; nCol<=MAXCOL; nCol++) + { +- BYTE nFlags = pDoc->GetColFlags( nCol, nTab ); +- if (nFlags & ( CR_PAGEBREAK | CR_MANUALBREAK )) ++ ScBreakType nBreak = pDoc->HasColBreak(nCol, nTab); ++ if (nBreak) + { + aData.Position = nCol; +- aData.ManualBreak = ( nFlags & CR_MANUALBREAK ) != 0; ++ aData.ManualBreak = (nBreak & BREAK_MANUAL); + pAry[nPos] = aData; + ++nPos; + } +@@ -7192,33 +7192,7 @@ uno::Sequence SAL_CALL ScTableSheetObj::getRowPageBre + ScPrintFunc aPrintFunc( pDocSh, pDocSh->GetPrinter(), nTab ); + aPrintFunc.UpdatePages(); + } +- +- SCROW nCount = pDoc->GetRowFlagsArray( nTab).CountForAnyBitCondition( +- 0, MAXROW, (CR_PAGEBREAK | CR_MANUALBREAK)); +- +- uno::Sequence aSeq(nCount); +- if (nCount) +- { +- sheet::TablePageBreakData aData; +- sheet::TablePageBreakData* pAry = aSeq.getArray(); +- size_t nPos = 0; +- ScCompressedArrayIterator< SCROW, BYTE> aIter( pDoc->GetRowFlagsArray( nTab), 0, MAXROW); +- do +- { +- BYTE nFlags = *aIter; +- if (nFlags & ( CR_PAGEBREAK | CR_MANUALBREAK )) +- { +- for (SCROW nRow = aIter.GetRangeStart(); nRow <= aIter.GetRangeEnd(); ++nRow) +- { +- aData.Position = nRow; +- aData.ManualBreak = ( nFlags & CR_MANUALBREAK ) != 0; +- pAry[nPos] = aData; +- ++nPos; +- } +- } +- } while (aIter.NextRange()); +- } +- return aSeq; ++ return pDoc->GetRowBreakData(nTab); + } + return uno::Sequence(0); + } +@@ -8987,13 +8961,13 @@ void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertyMap* pMap, + } + else if ( pEntry->nWID == SC_WID_UNO_NEWPAGE ) + { +- BOOL bBreak = ( 0 != (pDoc->GetColFlags( nCol, nTab ) & (CR_PAGEBREAK|CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( rAny, bBreak ); ++ ScBreakType nBreak = pDoc->HasColBreak(nCol, nTab); ++ ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak ); + } + else if ( pEntry->nWID == SC_WID_UNO_MANPAGE ) + { +- BOOL bBreak = ( 0 != (pDoc->GetColFlags( nCol, nTab ) & (CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( rAny, bBreak ); ++ ScBreakType nBreak = pDoc->HasColBreak(nCol, nTab); ++ ScUnoHelpFunctions::SetBoolInAny(rAny, (nBreak & BREAK_MANUAL)); + } + else + ScCellRangeObj::GetOnePropertyValue(pEntry, rAny); +@@ -9151,13 +9125,13 @@ void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertyMap* pMap, + } + else if ( pEntry->nWID == SC_WID_UNO_NEWPAGE ) + { +- BOOL bBreak = ( 0 != (pDoc->GetRowFlags( nRow, nTab ) & (CR_PAGEBREAK|CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( rAny, bBreak ); ++ ScBreakType nBreak = pDoc->HasRowBreak(nRow, nTab); ++ ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak ); + } + else if ( pEntry->nWID == SC_WID_UNO_MANPAGE ) + { +- BOOL bBreak = ( 0 != (pDoc->GetRowFlags( nRow, nTab ) & (CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( rAny, bBreak ); ++ ScBreakType nBreak = (pDoc->HasRowBreak(nRow, nTab) & BREAK_MANUAL); ++ ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak ); + } + else + ScCellRangeObj::GetOnePropertyValue(pEntry, rAny); +diff --git sc/source/ui/unoobj/docuno.cxx sc/source/ui/unoobj/docuno.cxx +index f14ab4a..f2f1eb5 100644 +--- sc/source/ui/unoobj/docuno.cxx ++++ sc/source/ui/unoobj/docuno.cxx +@@ -2685,13 +2685,13 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const rtl::OUString& aPro + } + else if ( aNameString.EqualsAscii( SC_UNONAME_NEWPAGE ) ) + { +- BOOL bBreak = ( 0 != (pDoc->GetColFlags( nStartCol, nTab ) & (CR_PAGEBREAK|CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( aAny, bBreak ); ++ ScBreakType nBreak = pDoc->HasColBreak(nStartCol, nTab); ++ ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak ); + } + else if ( aNameString.EqualsAscii( SC_UNONAME_MANPAGE ) ) + { +- BOOL bBreak = ( 0 != (pDoc->GetColFlags( nStartCol, nTab ) & (CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( aAny, bBreak ); ++ ScBreakType nBreak = pDoc->HasColBreak(nStartCol, nTab); ++ ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) ); + } + + return aAny; +@@ -2939,13 +2939,13 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const rtl::OUString& aProper + } + else if ( aNameString.EqualsAscii( SC_UNONAME_NEWPAGE ) ) + { +- BOOL bBreak = ( 0 != (pDoc->GetRowFlags( nStartRow, nTab ) & (CR_PAGEBREAK|CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( aAny, bBreak ); ++ ScBreakType nBreak = pDoc->HasRowBreak(nStartRow, nTab); ++ ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak ); + } + else if ( aNameString.EqualsAscii( SC_UNONAME_MANPAGE ) ) + { +- BOOL bBreak = ( 0 != (pDoc->GetRowFlags( nStartRow, nTab ) & (CR_MANUALBREAK)) ); +- ScUnoHelpFunctions::SetBoolInAny( aAny, bBreak ); ++ ScBreakType nBreak = pDoc->HasRowBreak(nStartRow, nTab); ++ ScUnoHelpFunctions::SetBoolInAny( aAny, (nBreak & BREAK_MANUAL) ); + } + else if ( aNameString.EqualsAscii( SC_UNONAME_CELLBACK ) || aNameString.EqualsAscii( SC_UNONAME_CELLTRAN ) ) + { +diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx +index 634443a..986c376 100644 +--- sc/source/ui/vba/vbarange.cxx ++++ sc/source/ui/vba/vbarange.cxx +@@ -3719,16 +3719,16 @@ ScVbaRange::getPageBreak() throw (uno::RuntimeException) + { + ScDocument* pDoc = getDocumentFromRange( mxRange ); + +- BYTE nFlag = 0; ++ ScBreakType nBreak = BREAK_NONE; + if ( !bColumn ) +- nFlag = pDoc -> GetRowFlags(thisAddress.StartRow, thisAddress.Sheet); ++ nBreak = pDoc->HasRowBreak(thisAddress.StartRow, thisAddress.Sheet); + else +- nFlag = pDoc -> GetColFlags(static_cast(thisAddress.StartColumn), thisAddress.Sheet); ++ nBreak = pDoc->HasColBreak(thisAddress.StartColumn, thisAddress.Sheet); + +- if ( nFlag & CR_PAGEBREAK) ++ if (nBreak & BREAK_PAGE) + nPageBreak = excel::XlPageBreak::xlPageBreakAutomatic; + +- if ( nFlag & CR_MANUALBREAK) ++ if (nBreak & BREAK_MANUAL) + nPageBreak = excel::XlPageBreak::xlPageBreakManual; + } + } +diff --git sc/source/ui/view/cellsh.cxx sc/source/ui/view/cellsh.cxx +index 3c047da..f228c30 100644 +--- sc/source/ui/view/cellsh.cxx ++++ sc/source/ui/view/cellsh.cxx +@@ -717,22 +717,22 @@ void ScCellShell::GetState(SfxItemSet &rSet) + break; + + case FID_INS_ROWBRK: +- if ( nPosY==0 || (pDoc->GetRowFlags(nPosY,nTab) & CR_MANUALBREAK) ) ++ if ( nPosY==0 || (pDoc->HasRowBreak(nPosY, nTab) & BREAK_MANUAL) ) + rSet.DisableItem( nWhich ); + break; + + case FID_INS_COLBRK: +- if ( nPosX==0 || (pDoc->GetColFlags(nPosX,nTab) & CR_MANUALBREAK) ) ++ if ( nPosX==0 || (pDoc->HasColBreak(nPosX, nTab) & BREAK_MANUAL) ) + rSet.DisableItem( nWhich ); + break; + + case FID_DEL_ROWBRK: +- if ( nPosY==0 || (pDoc->GetRowFlags(nPosY,nTab) & CR_MANUALBREAK)==0 ) ++ if ( nPosY==0 || (pDoc->HasRowBreak(nPosY, nTab) & BREAK_MANUAL) == 0 ) + rSet.DisableItem( nWhich ); + break; + + case FID_DEL_COLBRK: +- if ( nPosX==0 || (pDoc->GetColFlags(nPosX,nTab) & CR_MANUALBREAK)==0 ) ++ if ( nPosX==0 || (pDoc->HasColBreak(nPosX, nTab) & BREAK_MANUAL) == 0 ) + rSet.DisableItem( nWhich ); + break; + +diff --git sc/source/ui/view/gridwin2.cxx sc/source/ui/view/gridwin2.cxx +index 72a6606..4434440 100644 +--- sc/source/ui/view/gridwin2.cxx ++++ sc/source/ui/view/gridwin2.cxx +@@ -1278,7 +1278,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, BOOL bUp ) + BOOL bGrow = !bHide && nNew > nPagebreakBreak; + if ( bColumn ) + { +- if ( pDoc->GetColFlags( static_cast(nPagebreakBreak), nTab ) & CR_MANUALBREAK ) ++ if (pDoc->HasColBreak(static_cast(nPagebreakBreak), nTab) & BREAK_MANUAL) + { + ScAddress aOldAddr( static_cast(nPagebreakBreak), nPosY, nTab ); + pViewFunc->DeletePageBreak( TRUE, TRUE, &aOldAddr, FALSE ); +@@ -1291,8 +1291,8 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, BOOL bUp ) + if ( bGrow ) + { + // vorigen Break auf hart, und Skalierung aendern +- if ( static_cast(nPagebreakPrev) > aPagebreakSource.aStart.Col() && +- !(pDoc->GetColFlags( static_cast(nPagebreakPrev), nTab ) & CR_MANUALBREAK) ) ++ bool bManualBreak = (pDoc->HasColBreak(static_cast(nPagebreakPrev), nTab) & BREAK_MANUAL); ++ if ( static_cast(nPagebreakPrev) > aPagebreakSource.aStart.Col() && !bManualBreak ) + { + ScAddress aPrev( static_cast(nPagebreakPrev), nPosY, nTab ); + pViewFunc->InsertPageBreak( TRUE, TRUE, &aPrev, FALSE ); +@@ -1305,7 +1305,7 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, BOOL bUp ) + } + else + { +- if ( pDoc->GetRowFlags( nPagebreakBreak, nTab ) & CR_MANUALBREAK ) ++ if (pDoc->HasRowBreak(nPagebreakBreak, nTab) & BREAK_MANUAL) + { + ScAddress aOldAddr( nPosX, nPagebreakBreak, nTab ); + pViewFunc->DeletePageBreak( FALSE, TRUE, &aOldAddr, FALSE ); +@@ -1318,8 +1318,8 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, BOOL bUp ) + if ( bGrow ) + { + // vorigen Break auf hart, und Skalierung aendern +- if ( nPagebreakPrev > aPagebreakSource.aStart.Row() && +- !(pDoc->GetRowFlags( nPagebreakPrev, nTab ) & CR_MANUALBREAK) ) ++ bool bManualBreak = (pDoc->HasRowBreak(nPagebreakPrev, nTab) & BREAK_MANUAL); ++ if ( nPagebreakPrev > aPagebreakSource.aStart.Row() && !bManualBreak ) + { + ScAddress aPrev( nPosX, nPagebreakPrev, nTab ); + pViewFunc->InsertPageBreak( FALSE, TRUE, &aPrev, FALSE ); +diff --git sc/source/ui/view/gridwin4.cxx sc/source/ui/view/gridwin4.cxx +index 0e0742a..2e88791 100644 +--- sc/source/ui/view/gridwin4.cxx ++++ sc/source/ui/view/gridwin4.cxx +@@ -1090,7 +1090,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + if ( nBreak >= nX1 && nBreak <= nX2+1 ) + { + //! hidden suchen +- if ( pDoc->GetColFlags( nBreak, nTab ) & CR_MANUALBREAK ) ++ if (pDoc->HasColBreak(nBreak, nTab) & BREAK_MANUAL) + pContentDev->SetFillColor( aManual ); + else + pContentDev->SetFillColor( aAutomatic ); +@@ -1109,7 +1109,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + if ( nBreak >= nY1 && nBreak <= nY2+1 ) + { + //! hidden suchen +- if ( pDoc->GetRowFlags( nBreak, nTab ) & CR_MANUALBREAK ) ++ if (pDoc->HasRowBreak(nBreak, nTab) & BREAK_MANUAL) + pContentDev->SetFillColor( aManual ); + else + pContentDev->SetFillColor( aAutomatic ); +diff --git sc/source/ui/view/output.cxx sc/source/ui/view/output.cxx +index f320558..1585791 100644 +--- sc/source/ui/view/output.cxx ++++ sc/source/ui/view/output.cxx +@@ -325,8 +325,9 @@ void ScOutputData::DrawGrid( BOOL bGrid, BOOL bPage ) + long nPosX; + long nPosY; + SCSIZE nArrY; +- BYTE nOldFlags = 0; +- BYTE nFlags; ++ ScBreakType nBreak = BREAK_NONE; ++ ScBreakType nBreakOld = BREAK_NONE; ++ + BOOL bSingle; + Color aPageColor; + Color aManualColor; +@@ -381,27 +382,27 @@ void ScOutputData::DrawGrid( BOOL bGrid, BOOL bPage ) + if ( bPage ) + { + // Seitenumbrueche auch in ausgeblendeten suchen +- nFlags = 0; + SCCOL nCol = nXplus1; + while (nCol <= MAXCOL) + { + BYTE nDocFl = pDoc->GetColFlags( nCol, nTab ); +- nFlags = nDocFl & ( CR_PAGEBREAK | CR_MANUALBREAK ); +- if ( nFlags || !(nDocFl & CR_HIDDEN) ) ++ nBreak = pDoc->HasColBreak(nCol, nTab); ++ ++ if ( nBreak || !(nDocFl & CR_HIDDEN) ) + break; + ++nCol; + } + +- if (nFlags != nOldFlags) ++ if (nBreak != nBreakOld) + { + aGrid.Flush(); +- pDev->SetLineColor( (nFlags & CR_MANUALBREAK) ? aManualColor : +- (nFlags) ? aPageColor : aGridColor ); +- nOldFlags = nFlags; ++ pDev->SetLineColor( (nBreak & BREAK_MANUAL) ? aManualColor : ++ nBreak ? aPageColor : aGridColor ); ++ nBreakOld = nBreak; + } + } + +- BOOL bDraw = bGrid || nOldFlags; // einfaches Gitter nur wenn eingestellt ++ BOOL bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt + + //! Mit dieser Abfrage wird zuviel weggelassen, wenn ein automatischer + //! Umbruch mitten in den Wiederholungsspalten liegt. +@@ -412,7 +413,7 @@ void ScOutputData::DrawGrid( BOOL bGrid, BOOL bPage ) + { + if ( nX == MAXCOL ) + bDraw = FALSE; +- else if (pDoc->GetColFlags(nXplus1,nTab) & ( CR_PAGEBREAK | CR_MANUALBREAK )) ++ else if (pDoc->HasColBreak(nXplus1, nTab)) + bDraw = FALSE; + } + #endif +@@ -503,28 +504,24 @@ void ScOutputData::DrawGrid( BOOL bGrid, BOOL bPage ) + { + if ( bPage ) + { +- // Seitenumbrueche auch in ausgeblendeten suchen +- nFlags = 0; +- ScCompressedArrayIterator< SCROW, BYTE > aIter( +- pDoc->GetRowFlagsArray( nTab), nYplus1, MAXROW); +- do ++ for (SCROW i = nYplus1; i <= MAXROW; ++i) + { +- BYTE nDocFl = *aIter; +- nFlags = nDocFl & ( CR_PAGEBREAK | CR_MANUALBREAK ); +- if ( nFlags || !(nDocFl & CR_HIDDEN) ) +- break; +- } while (aIter.NextRange()); ++ nBreak = pDoc->HasRowBreak(i, nTab); ++ bool bHidden = (pDoc->GetRowFlags(i, nTab) & CR_HIDDEN); ++ if (nBreak || !bHidden) ++ break; ++ } + +- if (nFlags != nOldFlags) ++ if (nBreakOld != nBreak) + { + aGrid.Flush(); +- pDev->SetLineColor( (nFlags & CR_MANUALBREAK) ? aManualColor : +- (nFlags) ? aPageColor : aGridColor ); +- nOldFlags = nFlags; ++ pDev->SetLineColor( (nBreak & BREAK_MANUAL) ? aManualColor : ++ (nBreak) ? aPageColor : aGridColor ); ++ nBreakOld = nBreak; + } + } + +- BOOL bDraw = bGrid || nOldFlags; // einfaches Gitter nur wenn eingestellt ++ BOOL bDraw = bGrid || nBreakOld; // einfaches Gitter nur wenn eingestellt + + //! Mit dieser Abfrage wird zuviel weggelassen, wenn ein automatischer + //! Umbruch mitten in den Wiederholungszeilen liegt. +@@ -535,7 +532,7 @@ void ScOutputData::DrawGrid( BOOL bGrid, BOOL bPage ) + { + if ( nY == MAXROW ) + bDraw = FALSE; +- else if (pDoc->GetRowFlags(nYplus1,nTab) & ( CR_PAGEBREAK | CR_MANUALBREAK )) ++ else if (pDoc->HasRowBreak(nYplus1, nTab)) + bDraw = FALSE; + } + #endif +diff --git sc/source/ui/view/printfun.cxx sc/source/ui/view/printfun.cxx +index 020821d..2ddaa99 100644 +--- sc/source/ui/view/printfun.cxx ++++ sc/source/ui/view/printfun.cxx +@@ -2874,30 +2874,84 @@ void ScPrintFunc::CalcZoom( USHORT nRangeNo ) // Zoom berechnen + if (aTableParam.bScalePageNum) + { + nZoom = 100; +- BOOL bFound = FALSE; + USHORT nPagesToFit = aTableParam.nScalePageNum; +- while (!bFound) +- { +- CalcPages(); +- if ( nPagesX * nPagesY <= nPagesToFit || nZoom <= ZOOM_MIN ) +- bFound = TRUE; +- else +- --nZoom; +- } ++ ++ sal_uInt16 nLastFitZoom = 0, nLastNonFitZoom = 0; ++ while (true) ++ { ++ if (nZoom <= ZOOM_MIN) ++ break; ++ ++ CalcPages(); ++ bool bFitsPage = (nPagesX * nPagesY <= nPagesToFit); ++ ++ if (bFitsPage) ++ { ++ if (nZoom == 100) ++ // If it fits at 100 %, it's good enough for me. ++ break; ++ ++ nLastFitZoom = nZoom; ++ nZoom = (nLastNonFitZoom + nZoom) / 2; ++ ++ if (nLastFitZoom == nZoom) ++ // It converged. Use this zoom level. ++ break; ++ } ++ else ++ { ++ if (nZoom - nLastFitZoom <= 1) ++ { ++ nZoom = nLastFitZoom; ++ CalcPages(); ++ break; ++ } ++ ++ nLastNonFitZoom = nZoom; ++ nZoom = (nLastFitZoom + nZoom) / 2; ++ } ++ } + } + else if (aTableParam.bScaleTo) + { + nZoom = 100; +- BOOL bFound = FALSE; + USHORT nW = aTableParam.nScaleWidth; + USHORT nH = aTableParam.nScaleHeight; +- while (!bFound) ++ ++ sal_uInt16 nLastFitZoom = 0, nLastNonFitZoom = 0; ++ while (true) + { ++ if (nZoom <= ZOOM_MIN) ++ break; ++ + CalcPages(); +- if ( ((!nW || (nPagesX <= nW)) && (!nH || (nPagesY <= nH))) || (nZoom <= ZOOM_MIN) ) +- bFound = TRUE; ++ bool bFitsPage = ((!nW || (nPagesX <= nW)) && (!nH || (nPagesY <= nH))); ++ ++ if (bFitsPage) ++ { ++ if (nZoom == 100) ++ // If it fits at 100 %, it's good enough for me. ++ break; ++ ++ nLastFitZoom = nZoom; ++ nZoom = (nLastNonFitZoom + nZoom) / 2; ++ ++ if (nLastFitZoom == nZoom) ++ // It converged. Use this zoom level. ++ break; ++ } + else +- --nZoom; ++ { ++ if (nZoom - nLastFitZoom <= 1) ++ { ++ nZoom = nLastFitZoom; ++ CalcPages(); ++ break; ++ } ++ ++ nLastNonFitZoom = nZoom; ++ nZoom = (nLastFitZoom + nZoom) / 2; ++ } + } + } + else if (aTableParam.bScaleAll) +@@ -3021,7 +3075,8 @@ void ScPrintFunc::CalcPages() // berechnet aPageRect und Seiten aus nZoom + for (SCCOL i=nStartCol; i<=nEndCol; i++) + { + BYTE nFlags = pDoc->GetColFlags(i,nPrintTab); +- if ( i>nStartCol && bVisCol && (nFlags & CR_PAGEBREAK) ) ++ bool bPageBreak = (pDoc->HasColBreak(i, nPrintTab) & BREAK_PAGE); ++ if ( i>nStartCol && bVisCol && bPageBreak ) + { + pPageEndX[nPagesX] = i-1; + ++nPagesX; +@@ -3046,7 +3101,8 @@ void ScPrintFunc::CalcPages() // berechnet aPageRect und Seiten aus nZoom + SCROW nRangeEnd = aIter.GetRangeEnd(); + for (SCROW j=aIter.GetRangeStart(); j<=nRangeEnd; ++j) + { +- if ( j>nStartRow && bVisRow && (nFlags & CR_PAGEBREAK) ) ++ bool bPageBreak = (pDoc->HasRowBreak(j, nPrintTab) & BREAK_PAGE); ++ if ( j>nStartRow && bVisRow && bPageBreak ) + { + pPageEndY[nTotalY] = j-1; + ++nTotalY; diff --git a/applied_patches/0189-calc-perf-table-hidden-flags.diff b/applied_patches/0189-calc-perf-table-hidden-flags.diff new file mode 100644 index 000000000..df109a0ef --- /dev/null +++ b/applied_patches/0189-calc-perf-table-hidden-flags.diff @@ -0,0 +1,3846 @@ +diff --git sc/inc/column.hxx sc/inc/column.hxx +index 3aa524f..1d7cd5f 100644 +--- sc/inc/column.hxx ++++ sc/inc/column.hxx +@@ -213,10 +213,10 @@ public: + // UpdateSelectionFunction: Mehrfachselektion + void UpdateSelectionFunction( const ScMarkData& rMark, + ScFunctionData& rData, +- const ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags, ++ ScFlatBoolRowSegments& rHiddenRows, + BOOL bDoExclude, SCROW nExStartRow, SCROW nExEndRow ); + void UpdateAreaFunction( ScFunctionData& rData, +- const ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags, ++ ScFlatBoolRowSegments& rHiddenRows, + SCROW nStartRow, SCROW nEndRow ); + + void CopyToColumn(SCROW nRow1, SCROW nRow2, USHORT nFlags, BOOL bMarked, +diff --git sc/inc/document.hxx sc/inc/document.hxx +index 6fef3aa..9ef314f 100644 +--- sc/inc/document.hxx ++++ sc/inc/document.hxx +@@ -420,16 +420,11 @@ private: + + sal_Int16 mnNamedRangesLockCount; + +- inline BOOL RowHidden( SCROW nRow, SCTAB nTab ); // FillInfo +- + public: + SC_DLLPUBLIC ULONG GetCellCount() const; // alle Zellen + ULONG GetWeightedCount() const; // Formeln und Edit staerker gewichtet + ULONG GetCodeCount() const; // RPN-Code in Formeln + DECL_LINK( GetUserDefinedColor, USHORT * ); +- BOOL RowFiltered( SCROW nRow, SCTAB nTab ) const; // FillInfo +- BOOL ColFiltered( SCCOL nCol, SCTAB nTab ) const; // FillInfo +- // Numberformatter + + public: + SC_DLLPUBLIC ScDocument( ScDocumentMode eMode = SCDOCMODE_DOCUMENT, +@@ -1247,7 +1242,6 @@ public: + SCTAB nTab, double fScale ) const; + SC_DLLPUBLIC inline USHORT FastGetRowHeight( SCROW nRow, SCTAB nTab ) const; + inline SCROW FastGetRowForHeight( SCTAB nTab, ULONG nHeight ) const; +- inline SCROW FastGetFirstNonHiddenRow( SCROW nStartRow, SCTAB nTab ) const; + /** No check for flags whether row is hidden, height value + is returned unconditionally. */ + inline USHORT FastGetOriginalRowHeight( SCROW nRow, SCTAB nTab ) const; +@@ -1299,6 +1293,26 @@ public: + ::com::sun::star::uno::Sequence< + ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData(SCTAB nTab) const; + ++ SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); ++ SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW& rLastRow); ++ SC_DLLPUBLIC bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL& rLastCol); ++ SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); ++ SC_DLLPUBLIC void SetRowHidden(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bHidden); ++ SC_DLLPUBLIC void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden); ++ SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ SC_DLLPUBLIC SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ ++ bool RowFiltered(SCROW nRow, SCTAB nTab, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); ++ bool HasFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ bool ColFiltered(SCCOL nCol, SCTAB nTab, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); ++ SC_DLLPUBLIC void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bFiltered); ++ SC_DLLPUBLIC void SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bFiltered); ++ SCROW FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow, SCTAB nTab); ++ + /** + * Write all column row flags to table's flag data, because not all column + * row attributes are stored in the flag data members. This is necessary +@@ -1327,8 +1341,6 @@ public: + BOOL GetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, SCROW& nDefault); + BOOL GetRowDefault( SCTAB nTab, SCROW nRow, SCCOL nLastCol, SCCOL& nDefault); + +- BOOL IsFiltered( SCROW nRow, SCTAB nTab ) const; +- + BOOL UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, BOOL bShow ); + BOOL UpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bShow ); + +@@ -1807,58 +1819,24 @@ inline void ScDocument::SetSortParam( ScSortParam& rParam, SCTAB nTab ) + inline ULONG ScDocument::FastGetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, + SCTAB nTab, double fScale ) const + { +- return pTab[nTab]->pRowFlags->SumScaledCoupledArrayForCondition( nStartRow, +- nEndRow, CR_HIDDEN, 0, *(pTab[nTab]->pRowHeight), fScale); ++ ULONG nHeight = FastGetRowHeight(nStartRow, nEndRow, nTab); ++ return nHeight * fScale; + } + + inline USHORT ScDocument::FastGetRowHeight( SCROW nRow, SCTAB nTab ) const + { +- return ( pTab[nTab]->pRowFlags->GetValue(nRow) & CR_HIDDEN ) ? 0 : +- pTab[nTab]->pRowHeight->GetValue(nRow); ++ return pTab[nTab]->GetRowHeight(nRow); + } + + inline SCROW ScDocument::FastGetRowForHeight( SCTAB nTab, ULONG nHeight ) const + { +- ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter( +- *(pTab[nTab]->pRowFlags), 0, MAXROW, CR_HIDDEN, 0, +- *(pTab[nTab]->pRowHeight)); +- ULONG nSum = 0; +- for ( ; aIter; aIter.NextRange() ) +- { +- ULONG nNew = *aIter * (aIter.GetRangeEnd() - aIter.GetRangeStart() + 1); +- if (nSum + nNew > nHeight) +- { +- for ( ; aIter && nSum <= nHeight; ++aIter ) +- { +- nSum += *aIter; +- } +- return aIter.GetPos(); +- } +- nSum += nNew; +- } +- return aIter.GetPos(); +-} +- +-inline SCROW ScDocument::FastGetFirstNonHiddenRow( SCROW nStartRow, SCTAB nTab) const +-{ +- return pTab[nTab]->pRowFlags->GetFirstForCondition( nStartRow, MAXROW, +- CR_HIDDEN, 0); ++ return pTab[nTab]->GetRowForHeight(nHeight); + } + + inline USHORT ScDocument::FastGetOriginalRowHeight( SCROW nRow, SCTAB nTab ) const + { + return pTab[nTab]->pRowHeight->GetValue(nRow); + } +- +-inline BOOL ScDocument::ColFiltered( SCCOL nCol, SCTAB nTab ) const +-{ +- return ( pTab[nTab]->pColFlags[nCol] & CR_FILTERED) != 0; +-} +- +-inline BOOL ScDocument::RowFiltered( SCROW nRow, SCTAB nTab ) const +-{ +- return pTab[nTab]->IsFiltered(nRow); +-} + + #endif + +diff --git sc/inc/olinetab.hxx sc/inc/olinetab.hxx +index 456d223..a71519b 100644 +--- sc/inc/olinetab.hxx ++++ sc/inc/olinetab.hxx +@@ -39,6 +39,7 @@ + #define SC_OL_MAXDEPTH 7 + + class SvStream; ++class ScTable; + + + class ScOutlineEntry : public ScDataObject +@@ -126,9 +127,7 @@ public: + void InsertSpace( SCCOLROW nStartPos, SCSIZE nSize ); + BOOL DeleteSpace( SCCOLROW nStartPos, SCSIZE nSize ); + +- BOOL ManualAction( SCCOLROW nStartPos, SCCOLROW nEndPos, +- BOOL bShow, +- const ScBitMaskCompressedArray< SCCOLROW, BYTE>& rHiddenFlags ); ++ bool ManualAction( SCCOLROW nStartPos, SCCOLROW nEndPos, bool bShow, ScTable& rTable, bool bCol ); + + void RemoveAll(); + }; +diff --git sc/inc/table.hxx sc/inc/table.hxx +index 6045438..0ace618 100644 +--- sc/inc/table.hxx ++++ sc/inc/table.hxx +@@ -43,6 +43,7 @@ + + #include + #include ++#include + + namespace utl { + class SearchParam; +@@ -83,7 +84,9 @@ struct RowInfo; + struct ScFunctionData; + struct ScLineFlags; + class CollatorWrapper; + struct ScSetStringParam; ++class ScFlatBoolRowSegments; ++class ScFlatBoolColSegments; + + class ScTable + { +@@ -125,6 +128,10 @@ private: + + BYTE* pColFlags; + ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags; ++ ::boost::shared_ptr mpHiddenCols; ++ ::boost::shared_ptr mpHiddenRows; ++ ::boost::shared_ptr mpFilteredCols; ++ ::boost::shared_ptr mpFilteredRows; + + ::std::set maRowPageBreaks; + ::std::set maRowManualBreaks; +@@ -471,7 +478,7 @@ public: + SCCOL& rCol, SCROW& rRow, ScMarkData& rMark, + String& rUndoStr, ScDocument* pUndoDoc); + +- void FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 ) const; ++ void FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 ); + + void GetBorderLines( SCCOL nCol, SCROW nRow, + const SvxBorderLine** ppLeft, const SvxBorderLine** ppTop, +@@ -593,19 +600,29 @@ public: + // nPPT fuer Test auf Veraenderung + void SetManualHeight( SCROW nStartRow, SCROW nEndRow, BOOL bManual ); + +- USHORT GetColWidth( SCCOL nCol ) const; +- USHORT GetRowHeight( SCROW nRow ) const; +- ULONG GetRowHeight( SCROW nStartRow, SCROW nEndRow ) const; +- ULONG GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ) const; +- ULONG GetColOffset( SCCOL nCol ) const; +- ULONG GetRowOffset( SCROW nRow ) const; ++ USHORT GetColWidth( SCCOL nCol ); ++ SC_DLLPUBLIC USHORT GetRowHeight( SCROW nRow ); ++ ULONG GetRowHeight( SCROW nStartRow, SCROW nEndRow ); ++ ULONG GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fScale ); ++ ULONG GetColOffset( SCCOL nCol ); ++ ULONG GetRowOffset( SCROW nRow ); ++ ++ /** ++ * Get the last row such that the height of row 0 to the end row is as ++ * high as possible without exceeding the specified height value. ++ * ++ * @param nHeight maximum desired height ++ * ++ * @return SCROW last row of the range within specified height. ++ */ ++ SCROW GetRowForHeight(ULONG nHeight); + + USHORT GetOriginalWidth( SCCOL nCol ) const; + USHORT GetOriginalHeight( SCROW nRow ) const; + +- USHORT GetCommonWidth( SCCOL nEndCol ) const; ++ USHORT GetCommonWidth( SCCOL nEndCol ); + +- SCROW GetHiddenRowCount( SCROW nRow ) const; ++ SCROW GetHiddenRowCount( SCROW nRow ); + + void ShowCol(SCCOL nCol, BOOL bShow); + void ShowRow(SCROW nRow, BOOL bShow); +@@ -626,8 +643,6 @@ public: + /// @return the index of the last changed row (flags and row height, auto pagebreak is ignored). + SCROW GetLastChangedRow() const; + +- BOOL IsFiltered(SCROW nRow) const; +- + BYTE GetColFlags( SCCOL nCol ) const; + BYTE GetRowFlags( SCROW nRow ) const; + +@@ -656,6 +671,34 @@ public: + void SetColBreak(SCCOL nCol, bool bPage, bool bManual); + ::com::sun::star::uno::Sequence< + ::com::sun::star::sheet::TablePageBreakData> GetRowBreakData() const; ++ ++ bool RowHidden(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); ++ bool RowHidden(SCROW nRow, SCROW& rLastRow); ++ bool HasHiddenRows(SCROW nStartRow, SCROW nEndRow); ++ bool ColHidden(SCCOL nCol, SCCOL& rLastCol); ++ bool ColHidden(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); ++ void SetRowHidden(SCROW nStartRow, SCROW nEndRow, bool bHidden); ++ void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, bool bHidden); ++ void CopyColHidden(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol); ++ void CopyRowHidden(ScTable& rTable, SCROW nStartRow, SCROW nEndRow); ++ SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow); ++ SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow); ++ SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow); ++ sal_uInt32 GetTotalRowHeight(SCROW nStartRow, SCROW nEndRow); ++ ++ SCCOLROW LastHiddenColRow(SCCOLROW nPos, bool bCol); ++ ++ bool RowFiltered(SCROW nRow, SCROW* pFirstRow = NULL, SCROW* pLastRow = NULL); ++ bool ColFiltered(SCCOL nCol, SCCOL* pFirstCol = NULL, SCCOL* pLastCol = NULL); ++ bool HasFilteredRows(SCROW nStartRow, SCROW nEndRow); ++ void CopyColFiltered(ScTable& rTable, SCCOL nStartCol, SCCOL nEndCol); ++ void CopyRowFiltered(ScTable& rTable, SCROW nStartRow, SCROW nEndRow); ++ void SetRowFiltered(SCROW nStartRow, SCROW nEndRow, bool bFiltered); ++ void SetColFiltered(SCCOL nStartCol, SCCOL nEndCol, bool bFiltered); ++ SCROW FirstNonFilteredRow(SCROW nStartRow, SCROW nEndRow); ++ SCROW LastNonFilteredRow(SCROW nStartRow, SCROW nEndRow); ++ SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow); ++ + void SyncColRowFlags(); + + void StripHidden( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); +@@ -786,7 +829,7 @@ private: + + SCSIZE FillMaxRot( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2, + SCCOL nCol, SCROW nAttrRow1, SCROW nAttrRow2, SCSIZE nArrY, +- const ScPatternAttr* pPattern, const SfxItemSet* pCondSet ) const; ++ const ScPatternAttr* pPattern, const SfxItemSet* pCondSet ); + + // idle calculation of OutputDevice text width for cell + // also invalidates script type, broadcasts for "calc as shown" +diff --git sc/source/core/data/column2.cxx sc/source/core/data/column2.cxx +index 2291859..c97fbda 100644 +--- sc/source/core/data/column2.cxx ++++ sc/source/core/data/column2.cxx +@@ -69,6 +69,7 @@ + #include "compiler.hxx" // ScTokenArray GetCodeLen + #include "dbcolect.hxx" + #include "fillinfo.hxx" ++#include "segmenttree.hxx" + + #include + +@@ -1785,7 +1786,7 @@ void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell ) + // Mehrfachselektion: + void ScColumn::UpdateSelectionFunction( const ScMarkData& rMark, + ScFunctionData& rData, +- const ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags, ++ ScFlatBoolRowSegments& rHiddenRows, + BOOL bDoExclude, SCROW nExStartRow, SCROW nExEndRow ) + { + SCSIZE nIndex; +@@ -1793,7 +1794,8 @@ void ScColumn::UpdateSelectionFunction( const ScMarkData& rMark, + while (aDataIter.Next( nIndex )) + { + SCROW nRow = pItems[nIndex].nRow; +- if ( !pRowFlags || !( pRowFlags->GetValue(nRow) & CR_HIDDEN ) ) ++ bool bRowHidden = rHiddenRows.getValue(nRow); ++ if ( !bRowHidden ) + if ( !bDoExclude || nRow < nExStartRow || nRow > nExEndRow ) + lcl_UpdateSubTotal( rData, pItems[nIndex].pCell ); + } +@@ -1801,7 +1803,7 @@ void ScColumn::UpdateSelectionFunction( const ScMarkData& rMark, + + // bei bNoMarked die Mehrfachselektion weglassen + void ScColumn::UpdateAreaFunction( ScFunctionData& rData, +- const ScBitMaskCompressedArray< SCROW, BYTE>* pRowFlags, ++ ScFlatBoolRowSegments& rHiddenRows, + SCROW nStartRow, SCROW nEndRow ) + { + SCSIZE nIndex; +@@ -1809,7 +1811,8 @@ void ScColumn::UpdateAreaFunction( ScFunctionData& rData, + while ( nIndexGetValue(nRow) & CR_HIDDEN ) ) ++ bool bRowHidden = rHiddenRows.getValue(nRow); ++ if ( !bRowHidden ) + lcl_UpdateSubTotal( rData, pItems[nIndex].pCell ); + ++nIndex; + } +diff --git sc/source/core/data/dociter.cxx sc/source/core/data/dociter.cxx +index 911d473..055c64f 100644 +--- sc/source/core/data/dociter.cxx ++++ sc/source/core/data/dociter.cxx +@@ -334,7 +334,7 @@ BOOL ScValueIterator::GetThis(double& rValue, USHORT& rErr) + if ( nColRow < pCol->nCount && pCol->pItems[nColRow].nRow <= nEndRow ) + { + nRow = pCol->pItems[nColRow].nRow + 1; +- if ( !bSubTotal || !pDoc->pTab[nTab]->IsFiltered( nRow-1 ) ) ++ if ( !bSubTotal || !pDoc->pTab[nTab]->RowFiltered( nRow-1 ) ) + { + ScBaseCell* pCell = pCol->pItems[nColRow].pCell; + ++nColRow; +@@ -725,7 +725,7 @@ ScBaseCell* ScCellIterator::GetThis() + if ( nColRow < pCol->nCount && pCol->pItems[nColRow].nRow <= nEndRow ) + { + nRow = pCol->pItems[nColRow].nRow; +- if ( !bSubTotal || !pDoc->pTab[nTab]->IsFiltered( nRow ) ) ++ if ( !bSubTotal || !pDoc->pTab[nTab]->RowFiltered( nRow ) ) + { + ScBaseCell* pCell = pCol->pItems[nColRow].pCell; + +diff --git sc/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx +index 17ae763..4cff6f3 100644 +--- sc/source/core/data/documen3.cxx ++++ sc/source/core/data/documen3.cxx +@@ -1123,15 +1123,6 @@ BOOL ScDocument::SearchAndReplace(const SvxSearchItem& rSearchItem, + return bFound; + } + +-BOOL ScDocument::IsFiltered( SCROW nRow, SCTAB nTab ) const +-{ +- if (VALIDTAB(nTab)) +- if (pTab[nTab]) +- return pTab[nTab]->IsFiltered( nRow ); +- DBG_ERROR("Falsche Tabellennummer"); +- return 0; +-} +- + // Outline anpassen + + BOOL ScDocument::UpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, BOOL bShow ) +@@ -1558,46 +1549,43 @@ ScRange ScDocument::GetRange( SCTAB nTab, const Rectangle& rMMRect ) + nTwips = (long) (aPosRect.Top() / HMM_PER_TWIPS); + + SCROW nY1 = 0; +- ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT> aIter( +- *(pTable->GetRowFlagsArray()), nY1, MAXROW, CR_HIDDEN, 0, +- *(pTable->GetRowHeightArray())); + bEnd = FALSE; +- while (!bEnd && aIter) ++ for (SCROW i = nY1; i <= MAXROW && !bEnd; ++i) + { +- nY1 = aIter.GetPos(); +- nAdd = (long) *aIter; ++ if (pTable->RowHidden(i)) ++ continue; ++ ++ nY1 = i; ++ nAdd = static_cast(pTable->GetRowHeight(i)); + if (nSize+nAdd <= nTwips+1 && nY1