summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--Repository.mk4
-rw-r--r--RepositoryExternal.mk67
-rw-r--r--basctl/source/basicide/baside2.cxx2
-rw-r--r--basic/source/classes/sbxmod.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx2
-rwxr-xr-xbin/pack-debug20
-rw-r--r--chart2/qa/extras/chart2import.cxx37
-rw-r--r--chart2/qa/extras/data/xlsx/tdf140489.xlsxbin0 -> 32626 bytes
-rw-r--r--chart2/qa/extras/xshape/chart2xshape.cxx4
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx8
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx7
-rw-r--r--comphelper/CppunitTest_comphelper_test.mk1
-rw-r--r--comphelper/Library_comphelper.mk2
-rw-r--r--comphelper/qa/unit/test_traceevent.cxx127
-rw-r--r--comphelper/source/misc/lok.cxx15
-rw-r--r--comphelper/source/misc/profilezone.cxx104
-rw-r--r--comphelper/source/misc/traceevent.cxx144
-rw-r--r--config_host.mk.in1
-rw-r--r--configure.ac103
-rw-r--r--connectivity/Library_mysqlc.mk1
-rw-r--r--connectivity/source/commontools/dbconversion.cxx9
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx15
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx31
-rw-r--r--connectivity/source/parse/sqlbison.y6
-rw-r--r--cui/source/customize/cfgutil.cxx58
-rw-r--r--cui/source/customize/macropg.cxx2
-rw-r--r--cui/source/factory/dlgfact.cxx2
-rw-r--r--cui/source/inc/cfgutil.hxx8
-rw-r--r--cui/source/inc/grfpage.hxx3
-rw-r--r--cui/source/tabpages/grfpage.cxx32
-rw-r--r--cui/uiconfig/ui/macroselectordialog.ui139
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx9
-rw-r--r--desktop/inc/lib/init.hxx39
-rw-r--r--desktop/qa/data/table-selection.odtbin0 -> 10324 bytes
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx124
-rw-r--r--desktop/source/app/cmdlineargs.cxx10
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx36
-rw-r--r--desktop/source/lib/init.cxx686
-rw-r--r--desktop/source/lib/lokinteractionhandler.cxx50
-rw-r--r--desktop/source/lib/lokinteractionhandler.hxx2
-rw-r--r--distro-configs/CPAndroidBranding.conf1
-rw-r--r--distro-configs/LibreOfficeAndroid.conf1
-rw-r--r--distro-configs/LibreOfficeAndroidAarch64.conf1
-rw-r--r--distro-configs/LibreOfficeAndroidX86.conf1
-rw-r--r--distro-configs/LibreOfficeAndroidX86_64.conf1
-rw-r--r--distro-configs/LibreOfficeiOS.conf2
-rw-r--r--download.lst76
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx24
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx31
-rw-r--r--editeng/source/editeng/editview.cxx15
-rw-r--r--editeng/source/editeng/impedit.cxx23
-rw-r--r--editeng/source/items/textitem.cxx68
-rw-r--r--editeng/source/uno/unotext.cxx14
-rw-r--r--embeddedobj/source/commonembedding/embedobj.cxx60
-rw-r--r--embeddedobj/source/commonembedding/specialobject.cxx9
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx3
-rw-r--r--embeddedobj/source/inc/specialobject.hxx6
-rw-r--r--extensions/source/bibliography/framectr.cxx87
-rw-r--r--extensions/source/bibliography/framectr.hxx10
-rw-r--r--external/boost/UnpackedTarball_boost.mk2
-rw-r--r--external/boost/boost.between.warning.patch13
-rw-r--r--external/boost/boost.fallback.encoding.patch13
-rw-r--r--external/coinmp/UnpackedTarball_coinmp.mk2
-rw-r--r--external/coinmp/configure-exit.patch33
-rw-r--r--external/coinmp/register.patch369
-rw-r--r--external/curl/ExternalPackage_curl.mk4
-rw-r--r--external/curl/ExternalProject_curl.mk12
-rw-r--r--external/curl/UnpackedTarball_curl.mk2
-rw-r--r--external/curl/clang-cl.patch.02
-rw-r--r--external/curl/curl-7.26.0_win-proxy.patch27
-rw-r--r--external/curl/curl-ios.patch.117
-rw-r--r--external/curl/curl-msvc-disable-protocols.patch.19
-rw-r--r--external/curl/curl-msvc-zlib.patch.116
-rw-r--r--external/curl/curl-msvc.patch.14
-rw-r--r--external/curl/curl-nss.patch.115
-rw-r--r--external/curl/zlib.patch.024
-rw-r--r--external/expat/UnpackedTarball_expat.mk1
-rw-r--r--external/expat/expat-winapi.patch18
-rw-r--r--external/expat/ubsan.patch.011
-rw-r--r--external/gpgmepp/ExternalProject_gpgmepp.mk2
-rw-r--r--external/gpgmepp/UnpackedTarball_gpgmepp.mk1
-rw-r--r--external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.132
-rw-r--r--external/harfbuzz/62e803b36173fd096d7ad460dd1d1db9be542593.patch.129
-rw-r--r--external/harfbuzz/UnpackedTarball_harfbuzz.mk1
-rw-r--r--external/hsqldb/UnpackedTarball_hsqldb.mk1
-rw-r--r--external/hsqldb/patches/disable-dump-script.patch14
-rw-r--r--external/icu/UnpackedTarball_icu.mk2
-rw-r--r--external/icu/cec7de7a390dd6907b0ea0feb4488ed3934ee71d.patch.294
-rw-r--r--external/icu/e450fa50fc242282551f56b941dc93b9a8a0bcbb.patch.239
-rw-r--r--external/libassuan/ExternalProject_libassuan.mk2
-rw-r--r--external/libetonyek/0001-fix-build-with-MSVC.patch.128
-rw-r--r--external/libetonyek/0002-fix-build-with-MSVC.patch.155
-rw-r--r--external/libetonyek/Library_etonyek.mk1
-rw-r--r--external/libetonyek/UnpackedTarball_libetonyek.mk2
-rw-r--r--external/libetonyek/libetonyek-bundled-soname.patch.03
-rw-r--r--external/libffi/ExternalPackage_libffi.mk20
-rw-r--r--external/libffi/ExternalProject_libffi.mk29
-rw-r--r--external/libffi/Module_libffi.mk1
-rw-r--r--external/libgpg-error/ExternalProject_libgpg-error.mk2
-rw-r--r--external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk1
-rw-r--r--external/libjpeg-turbo/c76f4a08263b0cea40d2967560ac7c21f6959079.patch.138
-rw-r--r--external/liblangtag/UnpackedTarball_liblangtag.mk3
-rw-r--r--external/liblangtag/Wformat-overflow.patch17
-rw-r--r--external/libmwaw/Library_mwaw.mk4
-rw-r--r--external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.158
-rw-r--r--external/libodfgen/ExternalProject_libodfgen.mk4
-rw-r--r--external/libodfgen/Library_odfgen.mk3
-rw-r--r--external/libodfgen/UnpackedTarball_libodfgen.mk8
-rw-r--r--external/libodfgen/c++11.patch44
-rw-r--r--external/libodfgen/libodfgen-bundled-soname.patch.05
-rw-r--r--external/liborcus/UnpackedTarball_liborcus.mk5
-rw-r--r--external/liborcus/allow-utf-8-in-xml-names.patch301
-rw-r--r--external/liborcus/include.patch.030
-rw-r--r--external/libwpd/UnpackedTarball_libwpd.mk1
-rw-r--r--external/libwpd/include.patch10
-rw-r--r--external/libxml2/ExternalPackage_libxml2.mk2
-rw-r--r--external/libxml2/UnpackedTarball_libxml2.mk4
-rw-r--r--external/libxml2/libxml2-android.patch6
-rw-r--r--external/libxml2/libxml2-config.patch.143
-rw-r--r--external/libxml2/libxml2-global-symbols.patch4
-rw-r--r--external/libxml2/ubsan.patch.011
-rw-r--r--external/libxml2/xml2-config.in28
-rw-r--r--external/libxslt/UnpackedTarball_libxslt.mk1
-rw-r--r--external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.169
-rw-r--r--external/libxslt/rpath.patch.02
-rw-r--r--external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk17
-rw-r--r--external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk22
-rw-r--r--external/nss/ExternalProject_nss.mk15
-rw-r--r--external/nss/UnpackedTarball_nss.mk4
-rw-r--r--external/nss/asan.patch.16
-rw-r--r--external/nss/clang-cl.patch.012
-rw-r--r--external/nss/macos-dlopen.patch.02
-rw-r--r--external/nss/nsinstall.py12
-rw-r--r--external/nss/nss-android.patch.113
-rw-r--r--external/nss/nss-bz1646594.patch.12
-rw-r--r--external/nss/nss-ios.patch6
-rw-r--r--external/nss/nss-restore-manual-pre-dependencies.patch.183
-rw-r--r--external/nss/nss-win32-make.patch.14
-rw-r--r--external/nss/nss.aix.patch10
-rw-r--r--external/nss/nss.bzmozilla1238154.patch2
-rw-r--r--external/nss/nss.cygwin64.in32bit.patch2
-rw-r--r--external/nss/nss.getopt.patch.025
-rw-r--r--external/nss/nss.nowerror.patch2
-rw-r--r--external/nss/nss.patch22
-rw-r--r--external/nss/nss.utf8bom.patch.14
-rw-r--r--external/nss/nss.vs2015.patch2
-rw-r--r--external/nss/nss.vs2015.pdb.patch2
-rw-r--r--external/nss/nss.windows.patch6
-rw-r--r--external/nss/nss_macosx.patch20
-rw-r--r--external/nss/ubsan.patch.02
-rw-r--r--external/openldap/openldap-2.4.44.patch.112
-rw-r--r--external/openssl/ExternalPackage_openssl.mk12
-rw-r--r--external/openssl/ExternalProject_openssl.mk15
-rw-r--r--external/openssl/UnpackedTarball_openssl.mk12
-rw-r--r--external/openssl/openssl-1.0.1h-win64.patch.147
-rw-r--r--external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1578
-rw-r--r--external/openssl/openssl-3650-masm.patch.135
-rw-r--r--external/openssl/openssl-fixbuild.patch.123
-rw-r--r--external/openssl/openssl-no-multilib.patch.038
-rw-r--r--external/openssl/openssllnx.patch23
-rw-r--r--external/openssl/opensslsol.patch20
-rw-r--r--external/openssl/opensslwnt.patch167
-rw-r--r--external/openssl/opensslwnt_safeseh.patch23
-rw-r--r--external/pdfium/AndroidNDK19.patch.116
-rw-r--r--external/pdfium/Library_pdfium.mk14
-rw-r--r--external/pdfium/UnpackedTarball_pdfium.mk4
-rw-r--r--external/pdfium/cg-instead-of-carbon.patch.113
-rw-r--r--external/poppler/StaticLibrary_poppler.mk7
-rw-r--r--external/poppler/UnpackedTarball_poppler.mk2
-rw-r--r--external/poppler/disable-freetype.patch.141
-rw-r--r--external/poppler/gcc7-EntityInfo.patch.148
-rw-r--r--external/poppler/poppler-config.patch.169
-rw-r--r--external/postgresql/ExternalPackage_postgresql.mk16
-rw-r--r--external/postgresql/ExternalProject_postgresql.mk21
-rw-r--r--external/postgresql/Module_postgresql.mk6
-rw-r--r--external/postgresql/UnpackedTarball_postgresql.mk17
-rw-r--r--external/postgresql/arm64.patch.153
-rw-r--r--external/postgresql/config.pl1
-rw-r--r--external/postgresql/internal-zlib.patch.129
-rw-r--r--external/postgresql/postgres-msvc-build.patch.1110
-rw-r--r--external/postgresql/postgresql-9.2.1-libreoffice.patch74
-rw-r--r--external/postgresql/postgresql-libs-leak.patch40
-rw-r--r--external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.159
-rw-r--r--external/python3/ExternalPackage_python3.mk278
-rw-r--r--external/python3/ExternalProject_python3.mk49
-rw-r--r--external/python3/UnpackedTarball_python3.mk2
-rw-r--r--external/python3/i100492-freebsd.patch.16
-rw-r--r--external/python3/internal-zlib.patch.022
-rw-r--r--external/python3/macos-11.patch.079
-rw-r--r--external/python3/python-3.3.0-clang.patch.113
-rw-r--r--external/python3/python-3.3.0-darwin.patch.122
-rw-r--r--external/python3/python-3.3.3-disable-obmalloc.patch.04
-rw-r--r--external/python3/python-3.3.3-elf-rpath.patch.112
-rw-r--r--external/python3/python-3.5.4-msvc-disable.patch.18
-rw-r--r--external/python3/python-3.5.tweak.strip.soabi.patch2
-rw-r--r--external/python3/python-3.7.6-msvc-ssl.patch.127
-rw-r--r--external/python3/ubsan.patch.023
-rw-r--r--external/serf/ExternalProject_serf.mk48
-rw-r--r--external/serf/Module_serf.mk2
-rw-r--r--external/serf/StaticLibrary_serf.mk60
-rw-r--r--external/serf/UnpackedTarball_serf.mk5
-rw-r--r--external/serf/windows.build.patch.129
-rw-r--r--external/xmlsec/0001-xmlSecX509DataGetNodeContent-don-t-return-0-for-non-.patch.168
-rw-r--r--external/xmlsec/UnpackedTarball_xmlsec.mk1
-rw-r--r--external/zlib/UnpackedTarball_zlib.mk4
-rw-r--r--external/zlib/ubsan.patch11
-rw-r--r--filter/qa/unit/data/attributeRedefinedTest.odpbin0 -> 12610 bytes
-rw-r--r--filter/qa/unit/data/empty.doc0
-rw-r--r--filter/qa/unit/svg.cxx42
-rw-r--r--filter/qa/unit/textfilterdetect.cxx20
-rw-r--r--filter/source/config/fragments/types/writer_T602_Document.xcu2
-rw-r--r--filter/source/graphicfilter/icgm/bitmap.cxx10
-rw-r--r--filter/source/msfilter/eschesdo.cxx20
-rw-r--r--filter/source/msfilter/eschesdo.hxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx15
-rw-r--r--filter/source/storagefilterdetect/filterdetect.cxx7
-rw-r--r--filter/source/svg/presentation_engine.js314
-rw-r--r--filter/source/svg/svgexport.cxx14
-rw-r--r--filter/source/svg/svgfilter.cxx10
-rw-r--r--filter/source/svg/svgfilter.hxx1
-rw-r--r--filter/source/svg/svgwriter.cxx39
-rw-r--r--filter/source/svg/svgwriter.hxx2
-rw-r--r--filter/source/textfilterdetect/filterdetect.cxx13
-rw-r--r--filter/source/xsltfilter/LibXSLTTransformer.cxx26
-rw-r--r--filter/source/xsltfilter/LibXSLTTransformer.hxx3
-rw-r--r--formula/source/core/api/token.cxx13
-rw-r--r--fpicker/source/office/fileview.cxx10
-rw-r--r--fpicker/source/win32/asyncrequests.cxx2
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx4
-rw-r--r--framework/source/helper/persistentwindowstate.cxx4
-rw-r--r--framework/source/helper/statusindicator.cxx2
-rw-r--r--framework/source/helper/tagwindowasmodified.cxx3
-rw-r--r--framework/source/helper/titlebarupdate.cxx4
-rw-r--r--framework/source/loadenv/loadenv.cxx2
-rw-r--r--framework/source/uielement/generictoolbarcontroller.cxx8
-rw-r--r--framework/source/uielement/resourcemenucontroller.cxx6
-rw-r--r--hwpfilter/source/drawing.h13
-rw-r--r--hwpfilter/source/hcode.cxx2
-rw-r--r--hwpfilter/source/htags.cxx26
-rw-r--r--hwpfilter/source/hwpfile.cxx7
-rw-r--r--hwpfilter/source/hwpfile.h6
-rw-r--r--hwpfilter/source/hwpread.cxx21
-rw-r--r--hwpfilter/source/hwpreader.cxx91
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h8
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx38
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitEnums.h15
-rw-r--r--include/comphelper/lok.hxx8
-rw-r--r--include/comphelper/profilezone.hxx70
-rw-r--r--include/comphelper/traceevent.hxx222
-rw-r--r--include/editeng/colritem.hxx36
-rw-r--r--include/filter/msfilter/escherex.hxx4
-rw-r--r--include/o3tl/lru_map.hxx10
-rw-r--r--include/o3tl/safeint.hxx8
-rw-r--r--include/oox/core/contexthandler2.hxx19
-rw-r--r--include/oox/core/fragmenthandler2.hxx11
-rw-r--r--include/oox/drawingml/graphicshapecontext.hxx1
-rw-r--r--include/oox/drawingml/shape.hxx1
-rw-r--r--include/oox/export/drawingml.hxx37
-rw-r--r--include/oox/export/shapes.hxx2
-rw-r--r--include/oox/ole/oleobjecthelper.hxx1
-rw-r--r--include/oox/ppt/pptshape.hxx9
-rw-r--r--include/oox/token/relationship.hxx1
-rw-r--r--include/oox/vml/vmlshape.hxx6
-rw-r--r--include/rtl/xmlencode.hxx55
-rw-r--r--include/sal/log-areas.dox1
-rw-r--r--include/sal/log.hxx7
-rw-r--r--include/sax/tools/converter.hxx14
-rw-r--r--include/sfx2/LokControlHandler.hxx179
-rw-r--r--include/sfx2/dinfdlg.hxx4
-rw-r--r--include/sfx2/lokhelper.hxx8
-rw-r--r--include/sfx2/objsh.hxx16
-rw-r--r--include/sfx2/sfxsids.hrc2
-rw-r--r--include/sfx2/strings.hrc2
-rw-r--r--include/sfx2/tabdlg.hxx10
-rw-r--r--include/sfx2/tplpitem.hxx5
-rw-r--r--include/sfx2/viewfrm.hxx1
-rw-r--r--include/sfx2/viewsh.hxx6
-rw-r--r--include/svl/sigstruct.hxx39
-rw-r--r--include/svl/style.hxx2
-rw-r--r--include/svl/zforlist.hxx2
-rw-r--r--include/svx/GenericCheckDialog.hxx83
-rw-r--r--include/svx/sdr/table/tablecontroller.hxx1
-rw-r--r--include/svx/selectioncontroller.hxx2
-rw-r--r--include/svx/strings.hrc7
-rw-r--r--include/svx/svddrag.hxx12
-rw-r--r--include/svx/svdedtv.hxx13
-rw-r--r--include/svx/svdedxv.hxx67
-rw-r--r--include/svx/svdmodel.hxx2
-rw-r--r--include/svx/svdmrkv.hxx1
-rw-r--r--include/svx/svdoedge.hxx2
-rw-r--r--include/svx/svdoole2.hxx17
-rw-r--r--include/svx/svdview.hxx2
-rw-r--r--include/svx/unoshape.hxx2
-rw-r--r--include/unotest/macros_test.hxx5
-rw-r--r--include/vcl/BitmapTools.hxx8
-rw-r--r--include/vcl/ITiledRenderable.hxx4
-rw-r--r--include/vcl/WeldedTabbedNotebookbar.hxx4
-rw-r--r--include/vcl/ctrl.hxx4
-rw-r--r--include/vcl/customweld.hxx1
-rw-r--r--include/vcl/fixed.hxx2
-rw-r--r--include/vcl/layout.hxx7
-rw-r--r--include/vcl/lok.hxx4
-rw-r--r--include/vcl/outdev.hxx2
-rw-r--r--include/vcl/salvtables.hxx17
-rw-r--r--include/vcl/svapp.hxx4
-rw-r--r--include/vcl/transfer.hxx4
-rw-r--r--include/vcl/uitest/uiobject.hxx12
-rw-r--r--include/vcl/weld.hxx2
-rw-r--r--include/xmloff/xmlimp.hxx6
-rw-r--r--include/xmloff/xmlnmspe.hxx10
-rw-r--r--include/xmloff/xmltoken.hxx13
-rw-r--r--instsetoo_native/CustomTarget_install.mk1
-rw-r--r--instsetoo_native/inc_openoffice/unix/find-requires-x11.sh4
-rw-r--r--instsetoo_native/util/openoffice.lst.in2
-rw-r--r--ios/CustomTarget_iOS_setup.mk12
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx16
-rw-r--r--jvmfwk/source/framework.cxx8
-rw-r--r--jvmfwk/source/fwkbase.cxx6
-rw-r--r--librelogo/source/LibreLogo/LibreLogo.py34
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx5
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx2
-rw-r--r--lingucomponent/Module_lingucomponent.mk4
-rw-r--r--lingucomponent/source/lingutil/lingutil.cxx18
-rw-r--r--lingucomponent/source/spellcheck/macosxspell/macspellimp.mm32
-rw-r--r--lotuswordpro/qa/cppunit/data/pass/ofz20517-1.lwpbin0 -> 21429 bytes
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.cxx123
-rw-r--r--lotuswordpro/source/filter/lwpfribptr.cxx35
-rw-r--r--lotuswordpro/source/filter/lwpfribptr.hxx4
-rw-r--r--lotuswordpro/source/filter/lwprowlayout.cxx12
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx9
-rw-r--r--o3tl/qa/test-lru_map.cxx14
-rw-r--r--offapi/com/sun/star/document/XOOXMLDocumentPropertiesImporter.idl25
-rw-r--r--offapi/com/sun/star/frame/status/Template.idl7
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu8
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs16
-rw-r--r--oox/inc/drawingml/customshapeproperties.hxx6
-rw-r--r--oox/inc/drawingml/textbody.hxx19
-rw-r--r--oox/inc/drawingml/textcharacterproperties.hxx4
-rw-r--r--oox/inc/drawingml/textfield.hxx13
-rw-r--r--oox/inc/drawingml/textliststyle.hxx10
-rw-r--r--oox/inc/drawingml/textparagraph.hxx11
-rw-r--r--oox/inc/drawingml/textrun.hxx6
-rwxr-xr-xoox/qa/unit/data/camera-rotation-revolution-nonwps.pptxbin0 -> 31425 bytes
-rwxr-xr-xoox/qa/unit/data/endParaRPr-newline-textsize.pptxbin0 -> 13349 bytes
-rwxr-xr-xoox/qa/unit/data/testTdf132557_footerCustomShapes.pptxbin0 -> 20137 bytes
-rw-r--r--oox/qa/unit/data/watermark.docxbin0 -> 21621 bytes
-rw-r--r--oox/qa/unit/drawingml.cxx55
-rw-r--r--oox/qa/unit/vml.cxx22
-rw-r--r--oox/source/core/contexthandler2.cxx85
-rw-r--r--oox/source/core/fragmenthandler2.cxx70
-rw-r--r--oox/source/docprop/ooxmldocpropimport.cxx89
-rw-r--r--oox/source/docprop/ooxmldocpropimport.hxx6
-rw-r--r--oox/source/drawingml/chart/plotareaconverter.cxx8
-rw-r--r--oox/source/drawingml/chart/typegroupconverter.cxx13
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx7
-rw-r--r--oox/source/drawingml/fillproperties.cxx23
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx11
-rw-r--r--oox/source/drawingml/shape.cxx20
-rw-r--r--oox/source/drawingml/textbody.cxx22
-rw-r--r--oox/source/drawingml/textbodycontext.cxx5
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx2
-rw-r--r--oox/source/drawingml/textcharacterpropertiescontext.cxx26
-rw-r--r--oox/source/drawingml/textfield.cxx142
-rw-r--r--oox/source/drawingml/textliststyle.cxx2
-rw-r--r--oox/source/drawingml/textliststylecontext.cxx1
-rw-r--r--oox/source/drawingml/textparagraph.cxx11
-rw-r--r--oox/source/export/drawingml.cxx209
-rw-r--r--oox/source/export/shapes.cxx8
-rw-r--r--oox/source/ppt/pptshape.cxx128
-rw-r--r--oox/source/ppt/pptshapepropertiescontext.cxx5
-rw-r--r--oox/source/token/namespaces-strict.txt1
-rw-r--r--oox/source/token/namespaces.txt1
-rw-r--r--oox/source/token/relationship.inc1
-rw-r--r--oox/source/token/tokens.txt5
-rw-r--r--oox/source/vml/vmlshape.cxx7
-rw-r--r--oox/source/vml/vmlshapecontext.cxx28
-rw-r--r--postprocess/Rdb_services.mk6
-rw-r--r--pyuno/source/loader/pythonloader.py4
-rw-r--r--sal/osl/all/log.cxx63
-rw-r--r--sal/osl/unx/backtrace.c69
-rw-r--r--sal/util/sal.map1
-rw-r--r--sax/source/tools/converter.cxx15
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/cellsuno.hxx3
-rw-r--r--sc/inc/column.hxx2
-rw-r--r--sc/inc/document.hxx7
-rw-r--r--sc/inc/documentimport.hxx2
-rw-r--r--sc/inc/docuno.hxx6
-rw-r--r--sc/inc/dragdata.hxx7
-rw-r--r--sc/inc/fillinfo.hxx1
-rw-r--r--sc/inc/table.hxx4
-rw-r--r--sc/inc/unonames.hxx1
-rw-r--r--sc/qa/unit/data/xlsx/autofilternamedrange.xlsxbin0 -> 9685 bytes
-rw-r--r--sc/qa/unit/data/xlsx/escape-unicode.xlsxbin0 -> 6435 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx35
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx533
-rw-r--r--sc/source/core/data/colorscale.cxx6
-rw-r--r--sc/source/core/data/column2.cxx5
-rw-r--r--sc/source/core/data/column3.cxx54
-rw-r--r--sc/source/core/data/column4.cxx9
-rw-r--r--sc/source/core/data/dociter.cxx8
-rw-r--r--sc/source/core/data/documen2.cxx1
-rw-r--r--sc/source/core/data/documen3.cxx8
-rw-r--r--sc/source/core/data/document.cxx12
-rw-r--r--sc/source/core/data/documentimport.cxx14
-rw-r--r--sc/source/core/data/global.cxx3
-rw-r--r--sc/source/core/data/postit.cxx4
-rw-r--r--sc/source/core/data/table2.cxx15
-rw-r--r--sc/source/core/data/table3.cxx4
-rw-r--r--sc/source/core/inc/interpre.hxx12
-rw-r--r--sc/source/core/tool/compiler.cxx9
-rw-r--r--sc/source/core/tool/interpr1.cxx239
-rw-r--r--sc/source/core/tool/interpr3.cxx4
-rw-r--r--sc/source/core/tool/interpr4.cxx27
-rw-r--r--sc/source/core/tool/interpr7.cxx3
-rw-r--r--sc/source/filter/excel/xeescher.cxx4
-rw-r--r--sc/source/filter/inc/workbookhelper.hxx4
-rw-r--r--sc/source/filter/lotus/op.cxx11
-rw-r--r--sc/source/filter/oox/defnamesbuffer.cxx11
-rw-r--r--sc/source/filter/oox/richstring.cxx112
-rw-r--r--sc/source/filter/oox/sheetdatabuffer.cxx16
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx14
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx32
-rw-r--r--sc/source/filter/oox/worksheetfragment.cxx6
-rw-r--r--sc/source/ui/app/inputhdl.cxx48
-rw-r--r--sc/source/ui/app/inputwin.cxx14
-rw-r--r--sc/source/ui/app/scmod.cxx32
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListData.cxx13
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx3
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx39
-rw-r--r--sc/source/ui/docshell/docfunc.cxx3
-rw-r--r--sc/source/ui/docshell/docsh.cxx29
-rw-r--r--sc/source/ui/docshell/documentlinkmgr.cxx9
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx5
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx3
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx3
-rw-r--r--sc/source/ui/inc/drawview.hxx4
-rw-r--r--sc/source/ui/inc/inputwin.hxx2
-rw-r--r--sc/source/ui/inc/output.hxx2
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx6
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx2
-rw-r--r--sc/source/ui/unoobj/confuno.cxx14
-rw-r--r--sc/source/ui/unoobj/docuno.cxx51
-rw-r--r--sc/source/ui/view/cellsh.cxx3
-rw-r--r--sc/source/ui/view/cellsh2.cxx49
-rw-r--r--sc/source/ui/view/cliputil.cxx14
-rw-r--r--sc/source/ui/view/dbfunc3.cxx10
-rw-r--r--sc/source/ui/view/drawview.cxx9
-rw-r--r--sc/source/ui/view/gridwin.cxx21
-rw-r--r--sc/source/ui/view/gridwin2.cxx3
-rw-r--r--sc/source/ui/view/gridwin4.cxx117
-rw-r--r--sc/source/ui/view/gridwin5.cxx4
-rw-r--r--sc/source/ui/view/output.cxx69
-rw-r--r--sc/source/ui/view/tabview.cxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx34
-rw-r--r--sc/source/ui/view/tabvwsh2.cxx11
-rw-r--r--sc/source/ui/view/viewdata.cxx70
-rw-r--r--sc/source/ui/view/viewfun3.cxx9
-rw-r--r--sc/source/ui/view/viewfun5.cxx28
-rw-r--r--sc/source/ui/view/viewfunc.cxx19
-rw-r--r--sc/uiconfig/scalc/ui/notebookbar_online.ui93
-rw-r--r--sc/uiconfig/scalc/ui/textimportcsv.ui45
-rw-r--r--scp2/InstallModule_python.mk2
-rw-r--r--scripting/source/pyprov/pythonscript.py8
-rw-r--r--sd/Library_sd.mk1
-rw-r--r--sd/UIConfig_sdraw.mk1
-rw-r--r--sd/UIConfig_simpress.mk1
-rw-r--r--sd/inc/Outliner.hxx3
-rw-r--r--sd/inc/drawdoc.hxx5
-rw-r--r--sd/qa/unit/data/odp/numfmt.odpbin10608 -> 11438 bytes
-rw-r--r--sd/qa/unit/data/odp/search-all-notes.odpbin0 -> 12018 bytes
-rw-r--r--sd/qa/unit/data/pptx/numfmt.pptxbin41105 -> 44390 bytes
-rw-r--r--sd/qa/unit/data/pptx/pass/ofz35597-1.pptxbin0 -> 23316 bytes
-rw-r--r--sd/qa/unit/data/pptx/slidenum_field.pptxbin34130 -> 32715 bytes
-rw-r--r--sd/qa/unit/data/pptx/tdf140714.pptxbin0 -> 28384 bytes
-rw-r--r--sd/qa/unit/data/pptx/tdf142716.pptxbin0 -> 23281 bytes
-rw-r--r--sd/qa/unit/data/pptx/tdf143222.pptxbin0 -> 53172 bytes
-rwxr-xr-xsd/qa/unit/data/pptx/tdf59323.pptxbin0 -> 39322 bytes
-rw-r--r--sd/qa/unit/data/pptx/tdf96061.pptxbin0 -> 21022 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx138
-rw-r--r--sd/qa/unit/export-tests.cxx34
-rw-r--r--sd/qa/unit/import-tests.cxx2
-rw-r--r--sd/qa/unit/misc-tests.cxx34
-rw-r--r--sd/qa/unit/tiledrendering/data/TextBoxAndRect.odgbin0 -> 10474 bytes
-rw-r--r--sd/qa/unit/tiledrendering/data/duplicate-undo.odpbin0 -> 11346 bytes
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx607
-rw-r--r--sd/qa/unit/uiimpress.cxx83
-rw-r--r--sd/sdi/_drvwsh.sdi5
-rw-r--r--sd/sdi/sdraw.sdi2
-rw-r--r--sd/source/core/drawdoc.cxx1
-rw-r--r--sd/source/filter/eppt/epptooxml.hxx13
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx327
-rw-r--r--sd/source/filter/html/htmlex.cxx5
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx5
-rw-r--r--sd/source/ui/func/futransf.cxx13
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx2
-rw-r--r--sd/source/ui/inc/View.hxx3
-rw-r--r--sd/source/ui/inc/tools/GraphicSizeCheck.hxx103
-rw-r--r--sd/source/ui/inc/unomodel.hxx3
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx16
-rw-r--r--sd/source/ui/tools/GraphicSizeCheck.cxx211
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx20
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx50
-rw-r--r--sd/source/ui/view/Outliner.cxx75
-rw-r--r--sd/source/ui/view/drviews1.cxx27
-rw-r--r--sd/source/ui/view/drviews2.cxx18
-rw-r--r--sd/source/ui/view/drviews3.cxx14
-rw-r--r--sd/source/ui/view/drviews4.cxx33
-rw-r--r--sd/source/ui/view/drviewse.cxx4
-rw-r--r--sd/source/ui/view/drviewsj.cxx4
-rw-r--r--sd/source/ui/view/sdview.cxx10
-rw-r--r--sd/source/ui/view/sdview4.cxx39
-rw-r--r--sd/source/ui/view/sdwindow.cxx11
-rw-r--r--sd/uiconfig/sdraw/menubar/menubar.xml1
-rw-r--r--sd/uiconfig/sdraw/ui/notebookbar_online.ui69
-rw-r--r--sd/uiconfig/simpress/menubar/menubar.xml1
-rw-r--r--sd/uiconfig/simpress/ui/notebookbar.ui38
-rw-r--r--sd/uiconfig/simpress/ui/notebookbar_compact.ui26
-rw-r--r--sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui12
-rw-r--r--sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui20
-rw-r--r--sd/uiconfig/simpress/ui/notebookbar_online.ui69
-rw-r--r--sd/uiconfig/simpress/ui/notebookbar_single.ui8
-rw-r--r--sd/uiconfig/simpress/ui/sidebarslidebackground.ui2
-rw-r--r--sdext/Executable_xpdfimport.mk4
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx52
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx57
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx10
-rw-r--r--sdext/source/presenter/PresenterController.cxx12
-rw-r--r--setup_native/source/packinfo/finals_instsetoo.txt (renamed from setup_native/source/packinfo/finals_instsetoo.txt.in)1
-rw-r--r--sfx2/source/appl/app.cxx21
-rw-r--r--sfx2/source/appl/appserv.cxx3
-rw-r--r--sfx2/source/appl/macroloader.cxx9
-rw-r--r--sfx2/source/control/unoctitm.cxx23
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx59
-rw-r--r--sfx2/source/dialog/tabdlg.cxx7
-rw-r--r--sfx2/source/dialog/tplpitem.cxx11
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/doc/iframe.cxx80
-rw-r--r--sfx2/source/doc/objserv.cxx27
-rw-r--r--sfx2/source/doc/objstor.cxx63
-rw-r--r--sfx2/source/doc/printhelper.cxx4
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx60
-rw-r--r--sfx2/source/inc/macroloader.hxx2
-rw-r--r--sfx2/source/notebookbar/SfxNotebookBar.cxx11
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx3
-rw-r--r--sfx2/source/view/ipclient.cxx22
-rw-r--r--sfx2/source/view/lokhelper.cxx50
-rw-r--r--sfx2/source/view/viewfrm.cxx40
-rw-r--r--sfx2/source/view/viewsh.cxx22
-rw-r--r--sfx2/uiconfig/ui/documentinfopage.ui342
-rw-r--r--shell/source/unix/exec/shellexec.cxx5
-rw-r--r--shell/source/win32/SysShExec.cxx34
-rw-r--r--solenv/bin/modules/installer/download.pm2
-rw-r--r--solenv/bin/modules/installer/epmfile.pm6
-rw-r--r--solenv/bin/modules/installer/globals.pm4
-rw-r--r--solenv/bin/modules/installer/helppack.pm2
-rw-r--r--solenv/bin/modules/installer/languagepack.pm2
-rw-r--r--solenv/bin/modules/installer/parameter.pm2
-rw-r--r--solenv/bin/modules/installer/simplepackage.pm4
-rw-r--r--solenv/bin/modules/installer/windows/admin.pm3
-rw-r--r--solenv/bin/modules/installer/windows/msp.pm2
-rw-r--r--solenv/bin/modules/installer/worker.pm2
-rwxr-xr-xsolenv/bin/native-code.py23
-rw-r--r--solenv/clang-format/blacklist1
-rw-r--r--solenv/flatpak-manifest.in25
-rw-r--r--solenv/gdb/boost/util/printing.py2
-rw-r--r--solenv/gdb/libreoffice/util/printing.py2
-rw-r--r--solenv/sanitizers/ui/modules/swriter.suppr1
-rw-r--r--svl/source/config/languageoptions.cxx2
-rw-r--r--svl/source/crypto/cryptosign.cxx16
-rw-r--r--svl/source/items/style.cxx24
-rw-r--r--svl/source/numbers/zforlist.cxx8
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx166
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.hxx69
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx2
-rw-r--r--svtools/source/misc/langtab.cxx13
-rw-r--r--svtools/source/svhtml/parhtml.cxx6
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx25
-rw-r--r--svx/Library_svx.mk1
-rw-r--r--svx/UIConfig_svx.mk2
-rw-r--r--svx/sdi/svx.sdi21
-rw-r--r--svx/source/dialog/GenericCheckDialog.cxx70
-rw-r--r--svx/source/dialog/docrecovery.cxx2
-rw-r--r--svx/source/form/datanavi.cxx7
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx3
-rw-r--r--svx/source/sdr/contact/viewobjectcontact.cxx7
-rw-r--r--svx/source/svdraw/sdrpagewindow.cxx2
-rw-r--r--svx/source/svdraw/selectioncontroller.cxx4
-rw-r--r--svx/source/svdraw/svddrgmt.cxx2
-rw-r--r--svx/source/svdraw/svddrgv.cxx13
-rw-r--r--svx/source/svdraw/svdedtv.cxx31
-rw-r--r--svx/source/svdraw/svdedtv1.cxx32
-rw-r--r--svx/source/svdraw/svdedxv.cxx433
-rw-r--r--svx/source/svdraw/svdglue.cxx5
-rw-r--r--svx/source/svdraw/svdmrkv.cxx129
-rw-r--r--svx/source/svdraw/svdoedge.cxx22
-rw-r--r--svx/source/svdraw/svdoole2.cxx104
-rw-r--r--svx/source/svdraw/svdpntv.cxx12
-rw-r--r--svx/source/svdraw/svdview.cxx67
-rw-r--r--svx/source/svdraw/svdxcgv.cxx5
-rw-r--r--svx/source/table/svdotable.cxx7
-rw-r--r--svx/source/table/tablecontroller.cxx45
-rw-r--r--svx/source/tbxctrls/StylesPreviewWindow.cxx7
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx2
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx2
-rw-r--r--svx/source/unodraw/shapeimpl.hxx5
-rw-r--r--svx/source/unodraw/unoshap2.cxx3
-rw-r--r--svx/source/unodraw/unoshap4.cxx23
-rw-r--r--svx/uiconfig/ui/genericcheckdialog.ui132
-rw-r--r--svx/uiconfig/ui/genericcheckentry.ui56
-rw-r--r--sw/CppunitTest_sw_core_attr.mk74
-rw-r--r--sw/CppunitTest_sw_core_edit.mk74
-rw-r--r--sw/CppunitTest_sw_core_text.mk2
-rw-r--r--sw/Library_sw.mk2
-rw-r--r--sw/Module_sw.mk2
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/IDocumentContentOperations.hxx6
-rw-r--r--sw/inc/IDocumentMarkAccess.hxx5
-rw-r--r--sw/inc/IDocumentSettingAccess.hxx3
-rw-r--r--sw/inc/cmdid.h3
-rw-r--r--sw/inc/deletelistener.hxx92
-rw-r--r--sw/inc/docsh.hxx13
-rw-r--r--sw/inc/expfld.hxx6
-rw-r--r--sw/inc/ndole.hxx4
-rw-r--r--sw/inc/swrect.hxx35
-rw-r--r--sw/inc/unoprnms.hxx1
-rw-r--r--sw/inc/unosett.hxx5
-rw-r--r--sw/inc/unotxdoc.hxx2
-rw-r--r--sw/inc/view.hxx4
-rw-r--r--sw/qa/core/attr/attr.cxx64
-rw-r--r--sw/qa/core/attr/data/attr-set.docxbin0 -> 11582 bytes
-rw-r--r--sw/qa/core/crsr/crsr.cxx19
-rw-r--r--sw/qa/core/data/html/pass/ofz40593-1.htmlbin0 -> 5192 bytes
-rw-r--r--sw/qa/core/data/rtf/fail/forcepoint-82.rtf28
-rw-r--r--sw/qa/core/data/rtf/pass/forcepoint-96.rtf8
-rw-r--r--sw/qa/core/data/rtf/pass/forcepoint104.rtf571
-rw-r--r--sw/qa/core/data/ww5/pass/ooo37322-1-WW2.docbin0 -> 5559 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/ofz34749-1.docbin0 -> 49370 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/ofz38011-1.docbin0 -> 63022 bytes
-rw-r--r--sw/qa/core/doc/doc.cxx32
-rw-r--r--sw/qa/core/edit/data/redline-hidden.fodt32
-rw-r--r--sw/qa/core/edit/edit.cxx56
-rw-r--r--sw/qa/core/layout/data/tdf122894-4.docbin0 -> 214528 bytes
-rw-r--r--sw/qa/core/layout/layout.cxx5
-rw-r--r--sw/qa/core/text/text.cxx47
-rw-r--r--sw/qa/core/txtnode/data/title-field-invalidate.fodt25
-rw-r--r--sw/qa/core/txtnode/txtnode.cxx70
-rwxr-xr-xsw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf347
-rw-r--r--sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtfbin0 -> 109018 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint102.rtf178
-rw-r--r--sw/qa/extras/layout/data/forcepoint89.htmlbin0 -> 3321 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint90.rtf1
-rw-r--r--sw/qa/extras/layout/data/forcepoint91.htmlbin0 -> 49256 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint92.docbin0 -> 29200 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint93-1.rtfbin0 -> 88310 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint93-2.rtfbin0 -> 5456 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint94.htmlbin0 -> 12370 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint98.htmlbin0 -> 7171 bytes
-rw-r--r--sw/qa/extras/layout/data/forcepoint99.htmlbin0 -> 14034 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf141079.odtbin0 -> 8787 bytes
-rw-r--r--sw/qa/extras/layout/data/tdf147485-forcepoint.docbin0 -> 62544 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx220
-rw-r--r--sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odtbin0 -> 11544 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx10
-rw-r--r--sw/qa/extras/odfimport/data/PageAnchorZIndexFirstPage.fodt120
-rw-r--r--sw/qa/extras/odfimport/data/PageAnchorZIndexSecondPage.fodt120
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx28
-rw-r--r--sw/qa/extras/ooxmlexport/data/CommentDone.docxbin0 -> 20946 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf104823.docxbin0 -> 21260 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf137466.docxbin0 -> 20243 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf81507.docxbin0 -> 20183 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/test_sdt_datepicker.docxbin0 -> 20357 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx56
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx12
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx13
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx2
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx91
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlw14export.cxx2
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf118693.docxbin0 -> 26072 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx12
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport2.cxx37
-rw-r--r--sw/qa/extras/tiledrendering/data/shape.fodt20
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx256
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx144
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx131
-rw-r--r--sw/qa/extras/unowriter/unowriter.cxx33
-rw-r--r--sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odtbin0 -> 14081 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx6
-rw-r--r--sw/qa/inc/swmodeltestbase.hxx1
-rw-r--r--sw/sdi/_basesh.sdi7
-rw-r--r--sw/source/core/attr/swatrset.cxx3
-rw-r--r--sw/source/core/bastyp/swrect.cxx35
-rw-r--r--sw/source/core/crsr/crsrsh.cxx77
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx48
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx2
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx10
-rw-r--r--sw/source/core/doc/docbm.cxx22
-rw-r--r--sw/source/core/doc/docfmt.cxx9
-rw-r--r--sw/source/core/doc/extinput.cxx30
-rw-r--r--sw/source/core/draw/dview.cxx16
-rw-r--r--sw/source/core/edit/autofmt.cxx11
-rw-r--r--sw/source/core/edit/edatmisc.cxx2
-rw-r--r--sw/source/core/edit/edfcol.cxx13
-rw-r--r--sw/source/core/edit/editsh.cxx1
-rw-r--r--sw/source/core/fields/expfld.cxx7
-rw-r--r--sw/source/core/frmedt/feshview.cxx8
-rw-r--r--sw/source/core/graphic/GraphicSizeCheck.cxx163
-rw-r--r--sw/source/core/inc/DocumentContentOperationsManager.hxx6
-rw-r--r--sw/source/core/inc/DocumentSettingManager.hxx9
-rw-r--r--sw/source/core/inc/GraphicSizeCheck.hxx99
-rw-r--r--sw/source/core/inc/MarkManager.hxx2
-rw-r--r--sw/source/core/inc/ModelTraverser.hxx51
-rw-r--r--sw/source/core/inc/dview.hxx4
-rw-r--r--sw/source/core/inc/frame.hxx11
-rw-r--r--sw/source/core/inc/layact.hxx8
-rw-r--r--sw/source/core/inc/rootfrm.hxx2
-rw-r--r--sw/source/core/inc/unofldmid.h1
-rw-r--r--sw/source/core/layout/ftnfrm.cxx3
-rw-r--r--sw/source/core/layout/layact.cxx68
-rw-r--r--sw/source/core/layout/newfrm.cxx3
-rw-r--r--sw/source/core/layout/objectformattertxtfrm.cxx56
-rw-r--r--sw/source/core/layout/pagechg.cxx5
-rw-r--r--sw/source/core/layout/sectfrm.cxx3
-rw-r--r--sw/source/core/layout/tabfrm.cxx74
-rw-r--r--sw/source/core/layout/wsfrm.cxx2
-rw-r--r--sw/source/core/model/ModelTraverser.cxx61
-rw-r--r--sw/source/core/ole/ndole.cxx89
-rw-r--r--sw/source/core/table/swtable.cxx15
-rwxr-xr-xsw/source/core/text/frmform.cxx18
-rw-r--r--sw/source/core/text/itratr.cxx2
-rw-r--r--sw/source/core/text/itrcrsr.cxx8
-rw-r--r--sw/source/core/text/itrform2.cxx19
-rw-r--r--sw/source/core/text/itrform2.hxx2
-rw-r--r--sw/source/core/text/porfld.cxx13
-rw-r--r--sw/source/core/text/porlay.cxx4
-rw-r--r--sw/source/core/text/txtfrm.cxx10
-rw-r--r--sw/source/core/txtnode/atrfld.cxx26
-rw-r--r--sw/source/core/undo/unbkmk.cxx2
-rw-r--r--sw/source/core/undo/undobj.cxx13
-rw-r--r--sw/source/core/unocore/unoframe.cxx16
-rw-r--r--sw/source/core/unocore/unomap.cxx1
-rw-r--r--sw/source/core/unocore/unomap1.cxx1
-rw-r--r--sw/source/core/unocore/unosett.cxx22
-rw-r--r--sw/source/core/view/viewsh.cxx10
-rw-r--r--sw/source/filter/basflt/fltshell.cxx32
-rw-r--r--sw/source/filter/html/css1atr.cxx3
-rw-r--r--sw/source/filter/html/htmlfldw.cxx3
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/htmlplug.cxx7
-rw-r--r--sw/source/filter/html/htmltab.cxx67
-rw-r--r--sw/source/filter/html/swhtml.cxx21
-rw-r--r--sw/source/filter/html/swhtml.hxx11
-rw-r--r--sw/source/filter/inc/fltshell.hxx22
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx823
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx85
-rw-r--r--sw/source/filter/ww8/docxexport.cxx167
-rw-r--r--sw/source/filter/ww8/docxexport.hxx18
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx4
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.hxx3
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx11
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx28
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx5
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx7
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx16
-rw-r--r--sw/source/filter/ww8/ww8par.hxx14
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx21
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx5
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx37
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx6
-rw-r--r--sw/source/filter/xml/xmltbli.cxx2
-rw-r--r--sw/source/filter/xml/xmltexti.cxx9
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx3
-rw-r--r--sw/source/ui/dbui/mailmergewizard.cxx9
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx47
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.hxx3
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx29
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx5
-rw-r--r--sw/source/ui/fldui/flddb.cxx4
-rw-r--r--sw/source/ui/fldui/flddb.hxx1
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx4
-rw-r--r--sw/source/ui/frmdlg/frmdlg.cxx7
-rw-r--r--sw/source/ui/misc/bookmark.cxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx10
-rw-r--r--sw/source/uibase/app/docst.cxx26
-rw-r--r--sw/source/uibase/config/StoredChapterNumbering.cxx2
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx2
-rw-r--r--sw/source/uibase/dbui/dbtree.cxx13
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx4
-rw-r--r--sw/source/uibase/docvw/SidebarScrollBar.cxx3
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx3
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx8
-rw-r--r--sw/source/uibase/shells/basesh.cxx20
-rw-r--r--sw/source/uibase/shells/drawsh.cxx15
-rw-r--r--sw/source/uibase/shells/textsh1.cxx8
-rw-r--r--sw/source/uibase/uiview/uivwimp.cxx2
-rw-r--r--sw/source/uibase/uiview/view.cxx30
-rw-r--r--sw/source/uibase/uiview/view2.cxx15
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx3
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx51
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx17
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx12
-rw-r--r--sw/source/uibase/utlui/content.cxx63
-rw-r--r--sw/source/uibase/utlui/navipi.cxx2
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx19
-rw-r--r--sw/uiconfig/sglobal/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swriter/ui/mmselectpage.ui48
-rw-r--r--sw/uiconfig/swriter/ui/notebookbar_online.ui95
-rw-r--r--sysui/desktop/freedesktop/freedesktop-menus.spec2
-rw-r--r--test/source/xmltesttools.cxx2
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx6
-rw-r--r--tools/qa/cppunit/test_json_writer.cxx2
-rw-r--r--tools/source/generic/gen.cxx8
-rw-r--r--tools/source/generic/poly.cxx2
-rw-r--r--tools/source/misc/json_writer.cxx13
m---------translations0
-rw-r--r--ucb/source/ucp/webdav/SerfUri.cxx6
-rw-r--r--unotest/source/cpp/macros_test.cxx20
-rw-r--r--unoxml/source/xpath/xpathobject.cxx2
-rw-r--r--uui/source/iahndl-authentication.cxx5
-rw-r--r--uui/source/secmacrowarnings.cxx11
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx2
-rw-r--r--vcl/Library_vcl.mk2
-rw-r--r--vcl/headless/svpgdi.cxx5
-rw-r--r--vcl/headless/svpinst.cxx3
-rw-r--r--vcl/inc/jsdialog/enabled.hxx20
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx18
-rw-r--r--vcl/inc/pdf/ExternalPDFStreams.hxx12
-rw-r--r--vcl/inc/pdf/PdfConfig.hxx18
-rw-r--r--vcl/ios/DataFlavorMapping.cxx31
-rw-r--r--vcl/jsdialog/enabled.cxx75
-rw-r--r--vcl/jsdialog/executor.cxx33
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx76
-rw-r--r--vcl/qa/cppunit/PDFDocumentTest.cxx12
-rw-r--r--vcl/qa/cppunit/PDFiumLibraryTest.cxx39
-rw-r--r--vcl/qa/cppunit/data/DocumentWithNull.pdfbin0 -> 1080 bytes
-rw-r--r--vcl/qa/cppunit/data/form-fields.pdf95
-rw-r--r--vcl/qa/cppunit/filter/ipdf/data/comment-end.pdf69
-rw-r--r--vcl/qa/cppunit/filter/ipdf/ipdf.cxx19
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/bmp/pass/crash-1.bmp (renamed from vcl/qa/cppunit/graphicfilter/data/bmp/fail/crash-1.bmp)bin632 -> 632 bytes
-rw-r--r--vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odgbin0 -> 29714 bytes
-rw-r--r--vcl/qa/cppunit/pdfexport/data/pdf-image-hyperlink.odgbin0 -> 28633 bytes
-rw-r--r--vcl/qa/cppunit/pdfexport/data/pdf-image-rotate-180.pdfbin0 -> 1319 bytes
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx183
-rw-r--r--vcl/source/app/salvtables.cxx70
-rw-r--r--vcl/source/app/svapp.cxx13
-rw-r--r--vcl/source/bitmap/BitmapScaleSuperFilter.cxx5
-rw-r--r--vcl/source/control/WeldedTabbedNotebookbar.cxx2
-rw-r--r--vcl/source/control/ctrl.cxx15
-rw-r--r--vcl/source/control/fixed.cxx25
-rw-r--r--vcl/source/control/notebookbar.cxx6
-rw-r--r--vcl/source/control/prgsbar.cxx2
-rw-r--r--vcl/source/filter/ipdf/pdfdocument.cxx19
-rw-r--r--vcl/source/filter/ipdf/pdfread.cxx15
-rw-r--r--vcl/source/font/fontcharmap.cxx18
-rw-r--r--vcl/source/fontsubset/sft.cxx12
-rw-r--r--vcl/source/fontsubset/ttcr.cxx36
-rw-r--r--vcl/source/gdi/bmpacc.cxx2
-rw-r--r--vcl/source/gdi/dibtools.cxx34
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx180
-rw-r--r--vcl/source/graphic/Manager.cxx7
-rw-r--r--vcl/source/helper/strhelper.cxx3
-rw-r--r--vcl/source/outdev/hatch.cxx7
-rw-r--r--vcl/source/outdev/textline.cxx108
-rw-r--r--vcl/source/pdf/PdfConfig.cxx32
-rw-r--r--vcl/source/uitest/uiobject.cxx52
-rw-r--r--vcl/source/window/builder.cxx56
-rw-r--r--vcl/source/window/dialog.cxx36
-rw-r--r--vcl/source/window/dockwin.cxx5
-rw-r--r--vcl/source/window/event.cxx3
-rw-r--r--vcl/source/window/floatwin.cxx5
-rw-r--r--vcl/source/window/layout.cxx9
-rw-r--r--vcl/source/window/menufloatingwindow.cxx2
-rw-r--r--vcl/source/window/mouse.cxx25
-rw-r--r--vcl/source/window/paint.cxx19
-rw-r--r--vcl/source/window/seleng.cxx15
-rw-r--r--vcl/source/window/syswin.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx4
-rw-r--r--vcl/source/window/window.cxx12
-rw-r--r--vcl/source/window/window2.cxx10
-rw-r--r--vcl/source/window/winproc.cxx81
-rw-r--r--vcl/unx/generic/app/i18n_cb.cxx4
-rw-r--r--vcl/unx/generic/printer/cpdmgr.cxx49
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx2
-rw-r--r--wizards/source/access2base/DoCmd.xba2
-rw-r--r--writerfilter/CustomTarget_source.mk1
-rw-r--r--writerfilter/inc/dmapper/CommentProperties.hxx21
-rw-r--r--writerfilter/inc/dmapper/resourcemodel.hxx10
-rw-r--r--writerfilter/inc/ooxml/OOXMLDocument.hxx2
-rw-r--r--writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx45
-rw-r--r--writerfilter/qa/cppunittests/dmapper/data/textbox-textline-top.docxbin0 -> 12637 bytes
-rw-r--r--writerfilter/qa/cppunittests/dmapper/data/textbox-textline.docxbin0 -> 12934 bytes
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx170
-rw-r--r--writerfilter/source/dmapper/DomainMapper.hxx4
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx4
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx34
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx16
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx12
-rw-r--r--writerfilter/source/dmapper/LoggedResources.hxx2
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx4
-rw-r--r--writerfilter/source/dmapper/SdtHelper.cxx183
-rw-r--r--writerfilter/source/dmapper/SdtHelper.hxx59
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.cxx12
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.hxx4
-rw-r--r--writerfilter/source/ooxml/OOXMLFactory.hxx3
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx38
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx16
-rw-r--r--writerfilter/source/ooxml/OOXMLStreamImpl.cxx5
-rw-r--r--writerfilter/source/ooxml/model.xml98
-rw-r--r--xmloff/CppunitTest_xmloff_draw.mk45
-rw-r--r--xmloff/Module_xmloff.mk1
-rw-r--r--xmloff/qa/unit/data/textbox-loss.docxbin0 -> 42192 bytes
-rw-r--r--xmloff/qa/unit/draw.cxx79
-rw-r--r--xmloff/qa/unit/text.cxx19
-rw-r--r--xmloff/source/core/xmlimp.cxx26
-rw-r--r--xmloff/source/core/xmltoken.cxx13
-rw-r--r--xmloff/source/draw/shapeexport.cxx14
-rw-r--r--xmloff/source/draw/ximpshap.cxx33
-rw-r--r--xmloff/source/draw/ximpshap.hxx2
-rw-r--r--xmloff/source/token/tokens.txt10
-rw-r--r--xmlsecurity/inc/biginteger.hxx3
-rw-r--r--xmlsecurity/inc/certificateviewer.hxx2
-rw-r--r--xmlsecurity/inc/digitalsignaturesdialog.hxx5
-rw-r--r--xmlsecurity/inc/xmlsec-wrapper.h4
-rw-r--r--xmlsecurity/inc/xmlsignaturehelper.hxx12
-rw-r--r--xmlsecurity/inc/xsecctl.hxx20
-rw-r--r--xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odtbin0 -> 14045 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odtbin0 -> 13139 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odtbin0 -> 13160 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odtbin0 -> 13237 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/02_doc_signed_by_trusted_person_manipulated.odtbin0 -> 14003 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odtbin0 -> 13585 bytes
-rw-r--r--xmlsecurity/qa/unit/signing/signing.cxx289
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx186
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx13
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx48
-rw-r--r--xmlsecurity/source/helper/documentsignaturehelper.cxx65
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx12
-rw-r--r--xmlsecurity/source/helper/ooxmlsecexporter.cxx266
-rw-r--r--xmlsecurity/source/helper/ooxmlsecparser.cxx1457
-rw-r--r--xmlsecurity/source/helper/ooxmlsecparser.hxx74
-rw-r--r--xmlsecurity/source/helper/pdfsignaturehelper.cxx8
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx162
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx217
-rw-r--r--xmlsecurity/source/helper/xsecparser.cxx1706
-rw-r--r--xmlsecurity/source/helper/xsecparser.hxx106
-rw-r--r--xmlsecurity/source/helper/xsecsign.cxx74
-rw-r--r--xmlsecurity/source/helper/xsecverify.cxx227
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx4
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx47
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx6
-rw-r--r--xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx25
-rw-r--r--xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx8
958 files changed, 23966 insertions, 7550 deletions
diff --git a/.gitignore b/.gitignore
index fc0482e11d52..9dad1d4b26e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,7 +63,6 @@
/README
/AUTHORS
/MAINTAINERS
-/setup_native/source/packinfo/finals_instsetoo.txt
# make id
/ID
@@ -179,3 +178,7 @@ LibreOffice.VC.VC.opendb
# vim-ide-integration
/compile_commands.json
+
+#android builds
+/android/jniLibs/
+/android/obj/ \ No newline at end of file
diff --git a/Repository.mk b/Repository.mk
index 2d9bb907dd74..157e5c068dca 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -385,7 +385,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
localebe1 \
log \
lng \
- $(if $(filter-out iOS,$(OS)),lnth) \
+ lnth \
$(if $(filter $(OS),MACOSX),macbe1) \
$(if $(MERGELIBS),merged) \
migrationoo2 \
@@ -419,7 +419,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
simplecanvas \
slideshow \
sot \
- $(if $(filter-out iOS,$(OS)),spell) \
+ spell \
$(if $(DISABLE_GUI),,spl) \
storagefd \
$(call gb_Helper_optional,SCRIPTING,stringresource) \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 884bececcf08..6d61ef6eddc5 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1073,33 +1073,52 @@ $(call gb_LinkTarget_add_defs,$(1),\
-DAPR_DECLARE_STATIC \
-DAPU_DECLARE_STATIC \
)
-$(call gb_LinkTarget_use_external_project,$(1),apr_util)
+$(call gb_LinkTarget_use_external_project,$(1),apr_util,full)
endif
endef
define gb_ExternalProject__use_apr
ifeq ($(SYSTEM_APR),)
-$(call gb_ExternalProject_use_external_project,$(1),apr_util)
+$(call gb_ExternalProject_use_external_project,$(1),apr_util,full)
endif
endef
+ifneq ($(SYSTEM_SERF),)
+
define gb_LinkTarget__use_serf
+$(call gb_LinkTarget_add_defs,$(1),\
+ $(filter-out -I% -isystem%,$(subst -isystem /,-isystem/,$(SERF_CFLAGS))) \
+)
+
$(call gb_LinkTarget_set_include,$(1),\
- $(SERF_CFLAGS) \
+ $(subst -isystem/,-isystem /,$(filter -I% -isystem%,$(subst -isystem /,-isystem/,$(SERF_CFLAGS)))) \
$$(INCLUDE) \
)
+
$(call gb_LinkTarget_add_libs,$(1),\
$(SERF_LIBS) \
)
-ifeq ($(SYSTEM_SERF),)
-$(call gb_LinkTarget_use_external_project,$(1),serf)
-endif
+endef
+
+else # !SYSTEM_SERF
+
+define gb_LinkTarget__use_serf
+$(call gb_LinkTarget_set_include,$(1),\
+ -I$(call gb_UnpackedTarball_get_dir,serf) \
+ $$(INCLUDE) \
+)
+
+$(call gb_LinkTarget_use_static_libraries,$(1),\
+ serf \
+)
endef
+endif # SYSTEM_SERF
+
else ifeq ($(WITH_WEBDAV),neon)
ifneq ($(SYSTEM_NEON),)
@@ -1260,6 +1279,7 @@ $(call gb_LinkTarget_use_external,$(1),freetype_headers)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,cairo) \
-I$(call gb_UnpackedTarball_get_dir,cairo)/src \
+ -I$(call gb_UnpackedTarball_get_dir,pixman)/pixman \
$$(INCLUDE) \
)
$(call gb_LinkTarget_add_libs,$(1),\
@@ -1558,7 +1578,7 @@ $(call gb_ExternalProject_use_package,$(1),openssl)
endef
define gb_LinkTarget__use_openssl_headers
-$(call gb_LinkTarget_use_external_project,$(1),openssl)
+$(call gb_LinkTarget_use_external_project,$(1),openssl,full)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,openssl)/include \
$$(INCLUDE) \
@@ -1570,13 +1590,14 @@ define gb_LinkTarget__use_openssl
$(call gb_LinkTarget_use_package,$(1),openssl)
ifeq ($(OS),WNT)
$(call gb_LinkTarget_add_libs,$(1),\
- $(call gb_UnpackedTarball_get_dir,openssl)/out32dll/ssleay32.lib \
- $(call gb_UnpackedTarball_get_dir,openssl)/out32dll/libeay32.lib \
+ $(call gb_UnpackedTarball_get_dir,openssl)/libcrypto.lib \
+ $(call gb_UnpackedTarball_get_dir,openssl)/libssl.lib \
)
else
$(call gb_LinkTarget_add_libs,$(1),\
$(call gb_UnpackedTarball_get_dir,openssl)/libssl.a \
$(call gb_UnpackedTarball_get_dir,openssl)/libcrypto.a \
+ $(if $(filter $(OS),LINUX),-pthread) \
)
$(call gb_LinkTarget_use_external_project,$(1),openssl)
ifeq ($(OS),SOLARIS)
@@ -2725,7 +2746,7 @@ $(call gb_LinkTarget_set_include,$(1),\
ifeq ($(COM),MSC)
$(call gb_LinkTarget_add_libs,$(1),\
- $(call gb_UnpackedTarball_get_dir,curl)/builds/libcurl-vc12-$(if $(filter X86_64,$(CPUNAME)),x64,x86)-$(if $(MSVC_USE_DEBUG_RUNTIME),debug,release)-dll-ipv6-sspi-winssl/lib/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).lib \
+ $(call gb_UnpackedTarball_get_dir,curl)/builds/libcurl-vc12-$(if $(filter X86_64,$(CPUNAME)),x64,x86)-$(if $(MSVC_USE_DEBUG_RUNTIME),debug,release)-dll-zlib-static-ipv6-sspi-schannel/lib/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).lib \
)
else
$(call gb_LinkTarget_add_libs,$(1),\
@@ -3027,9 +3048,15 @@ endef
else # !SYSTEM_POSTGRESQL
+ifeq ($(OS),WNT)
+$(eval $(call gb_Helper_register_packages_for_install,postgresqlsdbc,\
+ postgresql \
+))
+endif # WNT
+
define gb_LinkTarget__use_postgresql
-$(call gb_LinkTarget_use_external_project,$(1),postgresql)
+$(call gb_LinkTarget_use_external_project,$(1),postgresql,full)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,postgresql)/src/include \
@@ -3037,19 +3064,21 @@ $(call gb_LinkTarget_set_include,$(1),\
$$(INCLUDE) \
)
+ifeq ($(OS),WNT)
+
$(call gb_LinkTarget_add_libs,$(1),\
- $(call gb_UnpackedTarball_get_dir,postgresql)/src/interfaces/libpq/libpq$(gb_StaticLibrary_PLAINEXT) \
+ $(call gb_UnpackedTarball_get_dir,postgresql)/$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)/libpq/libpq.lib \
)
-ifeq ($(OS),WNT)
-$(call gb_LinkTarget_use_external,$(1),openssl)
+else # WNT
-$(call gb_LinkTarget_use_system_win32_libs,$(1),\
- secur32 \
- ws2_32 \
+$(call gb_LinkTarget_add_libs,$(1),\
+ $(call gb_UnpackedTarball_get_dir,postgresql)/src/interfaces/libpq/libpq$(gb_StaticLibrary_PLAINEXT) \
+ $(call gb_UnpackedTarball_get_dir,postgresql)/src/common/libpgcommon$(gb_StaticLibrary_PLAINEXT) \
+ $(call gb_UnpackedTarball_get_dir,postgresql)/src/port/libpgport$(gb_StaticLibrary_PLAINEXT) \
)
-endif
+endif # WNT
endef
@@ -3170,7 +3199,7 @@ $(call gb_LinkTarget_add_libs,$(1),\
else
$(call gb_LinkTarget_add_libs,$(1),\
-L$(call gb_UnpackedTarball_get_dir,python3) \
- -lpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m \
+ -lpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
)
endif
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 4a9fc67c94d0..a49def4b0fe5 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -676,7 +676,7 @@ BasicDebugFlags ModulWindow::BasicBreakHdl()
InvalidateDebuggerSlots();
- while( m_aStatus.bIsRunning )
+ while( m_aStatus.bIsRunning && !Application::IsQuit())
Application::Yield();
m_aStatus.bIsInReschedule = false;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 0596e5ba87d9..c4e42b67b85c 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1122,7 +1122,7 @@ void SbModule::Run( SbMethod* pMeth )
if( bDelInst )
{
// Compare here with 1 instead of 0, because before nCallLvl--
- while (pSbData->pInst->nCallLvl != 1)
+ while (pSbData->pInst->nCallLvl != 1 && !Application::IsQuit())
Application::Yield();
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 19f0acaa8c0a..f0f1e3ded591 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -582,7 +582,7 @@ void Wait_Impl( bool bDurationBased, SbxArray& rPar )
Timer aTimer;
aTimer.SetTimeout( nWait );
aTimer.Start();
- while ( aTimer.IsActive() )
+ while ( aTimer.IsActive() && !Application::IsQuit())
{
Application::Yield();
}
diff --git a/bin/pack-debug b/bin/pack-debug
index 67c4cd50150d..312f59e6f81f 100755
--- a/bin/pack-debug
+++ b/bin/pack-debug
@@ -13,6 +13,12 @@
export BUILD_PATH=$PWD
export BUILD_LOG=$BUILD_PATH/pack-debug.log
+if type -P pigz &>/dev/null; then
+ GZIP=pigz
+else
+ GZIP=gzip
+fi
+
if [ $# -gt 0 ]
then
for i in "$@"
@@ -100,7 +106,7 @@ cat $DEBUGSRC | awk '
# debug build source package
- rpmbuild -bb --define "_unpackaged_files_terminate_build 0" ${DEBUGSRC}-debugsource --target $build_cpu --buildroot=$buildroot
+ rpmbuild -bb --define "_unpackaged_files_terminate_build 0" --define "_binary_payload w1T.xzdio" ${DEBUGSRC}-debugsource --target $build_cpu --buildroot=$buildroot
###################################################################
echo create rpm debug info packages by processing logged spec files
@@ -150,7 +156,7 @@ do
# stripped package
- rpmbuild -bb --define "_unpackaged_files_terminate_build 0" $i --target $build_cpu --buildroot=$buildroot
+ rpmbuild -bb --define "_unpackaged_files_terminate_build 0" --define "_binary_payload w1T.xzdio" $i --target $build_cpu --buildroot=$buildroot
rm -rf $buildroot
mv $buildroot.copy $buildroot
mkdir -p $topdir/RPMS/BUILD $topdir/RPMS/RPMS
@@ -168,7 +174,7 @@ do
# create debug info package
- rpmbuild -bb --define "_unpackaged_files_terminate_build 0" ${i}-debuginfo --target $build_cpu --buildroot=$buildroot
+ rpmbuild -bb --define "_unpackaged_files_terminate_build 0" --define "_binary_payload w1T.xzdio" ${i}-debuginfo --target $build_cpu --buildroot=$buildroot
fi
done
@@ -180,8 +186,8 @@ TARGET_RPM=$(ls *_download/*.tar.gz)
TARGET_DEBUG=$(echo $TARGET_RPM | sed 's/.tar.gz$/-debug.tar.gz/')
SOURCE_RPM=$(find *_rpm -type f | grep -v debug)
SOURCE_DEBUG=$(find *_rpm -type f | grep -E '(debug|readme|README)')
-tar c $SOURCE_RPM | gzip >$TARGET_RPM
-tar c $SOURCE_DEBUG | gzip >$TARGET_DEBUG
+tar c $SOURCE_RPM | $GZIP >$TARGET_RPM
+tar c $SOURCE_DEBUG | $GZIP >$TARGET_DEBUG
cd $BUILD_PATH
rm -rf $topdir
}
@@ -323,8 +329,8 @@ TARGET_DEB=$(ls *_download/*.tar.gz)
TARGET_DEBUG=$(echo $TARGET_DEB | sed 's/.tar.gz$/-debug.tar.gz/')
SOURCE_DEB=$(find *_deb -type f | grep -v debug)
SOURCE_DEBUG=$(find *_deb -type f | grep -E '(debug|readme|README)')
-tar c $SOURCE_DEB | gzip >$TARGET_DEB
-tar c $SOURCE_DEBUG | gzip >$TARGET_DEBUG
+tar c $SOURCE_DEB | $GZIP >$TARGET_DEB
+tar c $SOURCE_DEBUG | $GZIP >$TARGET_DEBUG
cd $BUILD_PATH
rm -rf DEBS
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 383196d774d4..99879c2ba397 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -115,6 +115,7 @@ public:
void testAxisTitleRotationXLSX();
void testAxisTitlePositionDOCX();
void testCombinedChartAttachedAxisXLSX();
+ void testTdf140489MultiSeriesChartAxisXLSX();
void testTdf90510(); // Pie chart label placement settings(XLS)
void testTdf109858(); // Pie chart label placement settings(XLSX)
@@ -219,6 +220,7 @@ public:
CPPUNIT_TEST(testAxisTitleRotationXLSX);
CPPUNIT_TEST(testAxisTitlePositionDOCX);
CPPUNIT_TEST(testCombinedChartAttachedAxisXLSX);
+ CPPUNIT_TEST(testTdf140489MultiSeriesChartAxisXLSX);
CPPUNIT_TEST(testTdf90510);
CPPUNIT_TEST(testTdf109858);
CPPUNIT_TEST(testTdf130105);
@@ -792,7 +794,7 @@ void Chart2ImportTest::testBnc864396()
void Chart2ImportTest::testBnc889755()
{
load("/chart2/qa/extras/data/pptx/", "bnc889755.pptx");
- uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 6), uno::UNO_QUERY_THROW);
+ uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 5), uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider());
uno::Reference< chart2::XInternalDataProvider > xDataProvider( xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
@@ -1635,6 +1637,39 @@ void Chart2ImportTest::testCombinedChartAttachedAxisXLSX()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex);
}
+void Chart2ImportTest::testTdf140489MultiSeriesChartAxisXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "tdf140489.xlsx");
+ Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ // First series
+ Reference<chart2::XDataSeries> xSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xSeries.is());
+
+ Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY_THROW);
+ sal_Int32 nAxisIndex = -1;
+ uno::Any aAny = xPropSet->getPropertyValue("AttachedAxisIndex");
+ CPPUNIT_ASSERT(aAny >>= nAxisIndex);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex);
+
+ // Second series
+ xSeries = getDataSeriesFromDoc(xChartDoc, 0, 1);
+ CPPUNIT_ASSERT(xSeries.is());
+
+ xPropSet.set(xSeries, uno::UNO_QUERY_THROW);
+ aAny = xPropSet->getPropertyValue("AttachedAxisIndex");
+ CPPUNIT_ASSERT(aAny >>= nAxisIndex);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nAxisIndex);
+
+ // Third series
+ xSeries = getDataSeriesFromDoc(xChartDoc, 0, 2);
+ CPPUNIT_ASSERT(xSeries.is());
+
+ xPropSet.set(xSeries, uno::UNO_QUERY_THROW);
+ aAny = xPropSet->getPropertyValue("AttachedAxisIndex");
+ CPPUNIT_ASSERT(aAny >>= nAxisIndex);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nAxisIndex);
+}
+
void Chart2ImportTest::testInternalDataProvider() {
uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromImpress("/chart2/qa/extras/data/odp/", "chart.odp"), uno::UNO_QUERY_THROW);
const uno::Reference< chart2::data::XDataProvider >& rxDataProvider = xChartDoc->getDataProvider();
diff --git a/chart2/qa/extras/data/xlsx/tdf140489.xlsx b/chart2/qa/extras/data/xlsx/tdf140489.xlsx
new file mode 100644
index 000000000000..bd24f40be7b5
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/tdf140489.xlsx
Binary files differ
diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx
index e68deadc2294..9b31f4d4195d 100644
--- a/chart2/qa/extras/xshape/chart2xshape.cxx
+++ b/chart2/qa/extras/xshape/chart2xshape.cxx
@@ -183,8 +183,8 @@ void Chart2XShapeTest::testTdf76649TrendLineBug()
void Chart2XShapeTest::testTdf88154LabelRotatedLayout()
{
load("chart2/qa/extras/xshape/data/pptx/", "tdf88154_LabelRotatedLayout.pptx");
- uno::Reference< chart::XChartDocument > xChartDoc = getChartDocFromDrawImpress(0,6);
- uno::Reference< qa::XDumper > xDumper( xChartDoc, UNO_QUERY_THROW );
+ uno::Reference<chart::XChartDocument> xChartDoc = getChartDocFromDrawImpress(0, 5);
+ uno::Reference<qa::XDumper> xDumper(xChartDoc, UNO_QUERY_THROW);
OUString rDump = xDumper->dump();
OString aXmlDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8);
xmlDocPtr pXmlDoc = xmlParseDoc(reinterpret_cast<const xmlChar*>(aXmlDump.getStr()));
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 0971fd079ca1..4c9e59542af3 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -283,11 +283,11 @@ void ChartWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
SfxViewShell* pCurrentShell = SfxViewShell::Current();
if ( nullptr == pCurrentShell )
return;
- OString sRectangle;
+ tools::Rectangle aResultRectangle;
if (!pRectangle)
{
// we have to invalidate the whole chart area not the whole document
- sRectangle = GetBoundingBox().toString();
+ aResultRectangle = GetBoundingBox();
}
else
{
@@ -325,9 +325,9 @@ void ChartWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
aRectangle = tools::Rectangle(aRectangle.TopLeft() + aOffset, aRectangle.GetSize());
}
- sRectangle = aRectangle.toString();
+ aResultRectangle = aRectangle;
}
- SfxLokHelper::notifyInvalidation(pCurrentShell, sRectangle);
+ SfxLokHelper::notifyInvalidation(pCurrentShell, &aResultRectangle);
}
FactoryFunction ChartWindow::GetUITestFactory() const
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index eec8280425b4..24d0c85b809b 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -1222,6 +1222,13 @@ OUString SAL_CALL InternalDataProvider::convertRangeToXML( const OUString& aRang
OUString SAL_CALL InternalDataProvider::convertRangeFromXML( const OUString& aXMLRange )
{
+ // Handle non-standards-conforming table:cell-range-address="PivotChart", see
+ // <https://bugs.documentfoundation.org/show_bug.cgi?id=112783> "PIVOT CHARTS: Save produces
+ // invalid file because of invalid cell address":
+ if (aXMLRange == "PivotChart") {
+ return "";
+ }
+
const OUString aPivotTableID("PT@");
if (aXMLRange.startsWith(aPivotTableID))
return aXMLRange.copy(aPivotTableID.getLength());
diff --git a/comphelper/CppunitTest_comphelper_test.mk b/comphelper/CppunitTest_comphelper_test.mk
index 8bb335aa24dc..39a08fbd17cb 100644
--- a/comphelper/CppunitTest_comphelper_test.mk
+++ b/comphelper/CppunitTest_comphelper_test.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,comphelper_test, \
comphelper/qa/unit/base64_test \
comphelper/qa/unit/types_test \
comphelper/qa/unit/test_guards \
+ comphelper/qa/unit/test_traceevent \
))
$(eval $(call gb_CppunitTest_use_sdk_api,comphelper_test))
diff --git a/comphelper/Library_comphelper.mk b/comphelper/Library_comphelper.mk
index 7388c88f3be4..943aac679af4 100644
--- a/comphelper/Library_comphelper.mk
+++ b/comphelper/Library_comphelper.mk
@@ -123,7 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,comphelper,\
comphelper/source/misc/numberedcollection \
comphelper/source/misc/numbers \
comphelper/source/misc/officerestartmanager \
- comphelper/source/misc/profilezone \
+ comphelper/source/misc/traceevent \
comphelper/source/misc/proxyaggregation \
comphelper/source/misc/random \
comphelper/source/misc/SelectionMultiplex \
diff --git a/comphelper/qa/unit/test_traceevent.cxx b/comphelper/qa/unit/test_traceevent.cxx
new file mode 100644
index 000000000000..6f768c09d466
--- /dev/null
+++ b/comphelper/qa/unit/test_traceevent.cxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <sal/config.h>
+
+#include <comphelper/profilezone.hxx>
+#include <comphelper/traceevent.hxx>
+
+#include <rtl/ustring.hxx>
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+class TestTraceEvent : public CppUnit::TestFixture
+{
+public:
+ void test();
+
+ CPPUNIT_TEST_SUITE(TestTraceEvent);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+namespace
+{
+void trace_event_test()
+{
+ std::shared_ptr<comphelper::AsyncEvent> pAsync7Locked;
+
+ {
+ // When we start recording is off and this will not generate any 'X' event when we leave the scope
+ comphelper::ProfileZone aZone0("test0");
+
+ // This will not generate any 'b' and 'e' events either
+ auto pAsync1(std::make_shared<comphelper::AsyncEvent>("async1"));
+
+ {
+ // No 'X' by this either
+ comphelper::ProfileZone aZone1("block1");
+
+ // Now we turn on recording
+ comphelper::TraceEvent::startRecording();
+ }
+
+ // This will generate an 'i' event for instant1
+ comphelper::TraceEvent::addInstantEvent("instant1");
+
+ std::shared_ptr<comphelper::AsyncEvent> pAsync25;
+ {
+ comphelper::ProfileZone aZone2("block2");
+
+ // This does not generate any 'e' event as it was created when recording was off
+ // And the nested async2 object will thus not generate anything either
+ pAsync1.reset();
+
+ // This will generate 'b' event and an 'e' event when the pointer is reset or goes out of scope
+ pAsync25 = std::make_shared<comphelper::AsyncEvent>("async2.5");
+
+ // Leaving this scope will generate an 'X' event for block2
+ }
+
+ // This will generate a 'b' event for async3
+ auto pAsync3(std::make_shared<comphelper::AsyncEvent>(
+ "async3", std::map<OUString, OUString>({ { "foo", "bar" }, { "tem", "42" } })));
+
+ {
+ comphelper::ProfileZone aZone3("block3");
+
+ // Leaving this scope will generate an 'X' event for block3
+ }
+
+ // This will generate an 'e' event for async2.5
+ pAsync25.reset();
+
+ comphelper::ProfileZone aZone4("test2");
+
+ // This will generate an 'i' event for instant2"
+ comphelper::TraceEvent::addInstantEvent(
+ "instant2", std::map<OUString, OUString>({ { "foo2", "bar2" }, { "tem2", "42" } }));
+
+ // Leaving this scope will generate 'X' events for test2 and a
+ // 'e' event for async4in3, async7in3, and async3.
+ }
+
+ // This incorrect use of overlapping (not nested) ProfileZones
+ // will generate a SAL_WARN but should not crash
+ auto p1 = new comphelper::ProfileZone("error1");
+ auto p2 = new comphelper::ProfileZone("error2");
+ delete p1;
+ delete p2;
+}
+}
+
+void TestTraceEvent::test()
+{
+ trace_event_test();
+ auto aEvents = comphelper::TraceEvent::getEventVectorAndClear();
+ for (const auto& s : aEvents)
+ {
+ std::cerr << s << "\n";
+ }
+
+ CPPUNIT_ASSERT_EQUAL(9, static_cast<int>(aEvents.size()));
+
+ CPPUNIT_ASSERT(aEvents[0].startsWith("{\"name:\"instant1\",\"ph\":\"i\","));
+ CPPUNIT_ASSERT(aEvents[1].startsWith("{\"name\":\"async2.5\",\"ph\":\"S\",\"id\":1,"));
+ CPPUNIT_ASSERT(aEvents[2].startsWith("{\"name\":\"block2\",\"ph\":\"X\","));
+ CPPUNIT_ASSERT(aEvents[3].startsWith(
+ "{\"name\":\"async3\",\"ph\":\"S\",\"id\":2,\"args\":{\"foo\":\"bar\",\"tem\":\"42\"},"));
+ CPPUNIT_ASSERT(aEvents[4].startsWith("{\"name\":\"block3\",\"ph\":\"X\","));
+ CPPUNIT_ASSERT(aEvents[5].startsWith("{\"name\":\"async2.5\",\"ph\":\"F\",\"id\":1,"));
+ CPPUNIT_ASSERT(aEvents[6].startsWith(
+ "{\"name:\"instant2\",\"ph\":\"i\",\"args\":{\"foo2\":\"bar2\",\"tem2\":\"42\"},"));
+ CPPUNIT_ASSERT(aEvents[7].startsWith("{\"name\":\"test2\",\"ph\":\"X\""));
+ CPPUNIT_ASSERT(aEvents[8].startsWith(
+ "{\"name\":\"async3\",\"ph\":\"F\",\"id\":2,\"args\":{\"foo\":\"bar\",\"tem\":\"42\"},"));
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(TestTraceEvent);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index 77c8c13a7e82..ee1faa4e0658 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -10,6 +10,7 @@
#include <comphelper/lok.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <sal/log.hxx>
+#include <algorithm>
#include <iostream>
#include <map>
@@ -214,7 +215,7 @@ bool isWhitelistedLanguage(const OUString& lang)
if (!isActive())
return true;
-#ifdef ANDROID
+#if defined ANDROID || defined IOS
(void) lang;
return true;
#else
@@ -261,31 +262,31 @@ bool isWhitelistedLanguage(const OUString& lang)
#endif
}
-static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent)(nullptr);
+static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent, const char* pText)(nullptr);
static void *pStatusIndicatorCallbackData(nullptr);
-void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data)
+void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent, const char* pText), void *data)
{
pStatusIndicatorCallback = callback;
pStatusIndicatorCallbackData = data;
}
-void statusIndicatorStart()
+void statusIndicatorStart(const OUString& sText)
{
if (pStatusIndicatorCallback)
- pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Start, 0);
+ pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Start, 0, sText.toUtf8().getStr());
}
void statusIndicatorSetValue(int percent)
{
if (pStatusIndicatorCallback)
- pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::SetValue, percent);
+ pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::SetValue, percent, nullptr);
}
void statusIndicatorFinish()
{
if (pStatusIndicatorCallback)
- pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0);
+ pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0, nullptr);
}
} // namespace LibreOfficeKit
diff --git a/comphelper/source/misc/profilezone.cxx b/comphelper/source/misc/profilezone.cxx
deleted file mode 100644
index ff76a4f35e8d..000000000000
--- a/comphelper/source/misc/profilezone.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <sal/config.h>
-
-#include <atomic>
-
-#include <comphelper/sequence.hxx>
-#include <comphelper/profilezone.hxx>
-#include <osl/time.h>
-#include <osl/thread.h>
-
-namespace comphelper
-{
-
-std::atomic<bool> ProfileZone::g_bRecording(false);
-
-namespace ProfileRecording
-{
-
-static std::vector<OUString> g_aRecording; // recorded data
-static long long g_aSumTime(0); // overall zone time in microsec
-static int g_aNesting; // level of overlapped zones
-static long long g_aStartTime; // start time of recording
-static ::osl::Mutex g_aMutex;
-
-void startRecording(bool bStartRecording)
-{
- if (bStartRecording)
- {
- TimeValue systemTime;
- osl_getSystemTime( &systemTime );
- ::osl::MutexGuard aGuard( g_aMutex );
- g_aStartTime = static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec/1000;
- g_aNesting = 0;
- }
- ProfileZone::g_bRecording = bStartRecording;
-}
-
-long long addRecording(const char * aProfileId, long long aCreateTime)
-{
- assert( ProfileZone::g_bRecording );
-
- TimeValue systemTime;
- osl_getSystemTime( &systemTime );
- long long aTime = static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec/1000;
-
- if (!aProfileId)
- aProfileId = "(null)";
- OUString aString(aProfileId, strlen(aProfileId), RTL_TEXTENCODING_UTF8);
-
- OUString sRecordingData(OUString::number(osl_getThreadIdentifier(nullptr)) + " " +
- OUString::number(aTime/1000000.0) + " " + aString + ": " +
- (aCreateTime == 0 ? OUStringLiteral("start") : OUStringLiteral("stop")) +
- (aCreateTime != 0 ? (" " + OUString::number((aTime - aCreateTime)/1000.0) + " ms") : OUString("")));
-
- ::osl::MutexGuard aGuard( g_aMutex );
-
- g_aRecording.emplace_back(sRecordingData);
- if (aCreateTime == 0)
- {
- g_aNesting++;
- return aTime;
- }
- // neglect ProfileZones created before startRecording
- else if (aCreateTime >= g_aStartTime)
- {
- if (g_aNesting > 0)
- g_aNesting--;
- if (g_aNesting == 0)
- g_aSumTime += aTime - aCreateTime;
- }
- return 0;
-}
-
-css::uno::Sequence<OUString> getRecordingAndClear()
-{
- bool bRecording;
- std::vector<OUString> aRecording;
- {
- ::osl::MutexGuard aGuard( g_aMutex );
- bRecording = ProfileZone::g_bRecording;
- startRecording(false);
- aRecording.swap(g_aRecording);
- long long aSumTime = g_aSumTime;
- aRecording.insert(aRecording.begin(), OUString::number(aSumTime/1000000.0));
- }
- // reset start time and nesting level
- startRecording(bRecording);
- return ::comphelper::containerToSequence(aRecording);
-}
-
-} // namespace ProfileRecording
-
-
-} // namespace comphelper
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx
new file mode 100644
index 000000000000..8b1a9c09427a
--- /dev/null
+++ b/comphelper/source/misc/traceevent.cxx
@@ -0,0 +1,144 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <sal/config.h>
+
+#include <atomic>
+#include <iostream>
+#include <string_view>
+
+#include <comphelper/profilezone.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/traceevent.hxx>
+
+namespace comphelper
+{
+#ifdef DBG_UTIL
+std::atomic<bool> TraceEvent::s_bRecording = (getenv("TRACE_EVENT_RECORDING") != nullptr);
+#else
+std::atomic<bool> TraceEvent::s_bRecording = false;
+#endif
+
+std::size_t TraceEvent::s_nBufferSize = 0;
+void (*TraceEvent::s_pBufferFullCallback)() = nullptr;
+
+int AsyncEvent::s_nIdCounter = 0;
+
+static thread_local int nProfileZoneNesting = 0; // Level of Nested Profile Zones
+
+namespace
+{
+std::vector<OUString> g_aRecording; // recorded data
+osl::Mutex g_aMutex;
+}
+
+void TraceEvent::addRecording(const OUString& sObject)
+{
+ osl::MutexGuard aGuard(g_aMutex);
+
+ g_aRecording.emplace_back(sObject);
+
+ if (s_nBufferSize > 0 && g_aRecording.size() >= s_nBufferSize)
+ {
+ if (s_pBufferFullCallback != nullptr)
+ (*s_pBufferFullCallback)();
+ }
+}
+
+void TraceEvent::addInstantEvent(const char* sName, const std::map<OUString, OUString>& args)
+{
+ long long nNow = getNow();
+
+ int nPid = 0;
+ oslProcessInfo aProcessInfo;
+ aProcessInfo.Size = sizeof(oslProcessInfo);
+ if (osl_getProcessInfo(nullptr, osl_Process_IDENTIFIER, &aProcessInfo) == osl_Process_E_None)
+ nPid = aProcessInfo.Ident;
+
+ addRecording("{"
+ "\"name:\""
+ + OUString(sName, strlen(sName), RTL_TEXTENCODING_UTF8)
+ + "\","
+ "\"ph\":\"i\""
+ + createArgsString(args) + ",\"ts\":" + OUString::number(nNow)
+ + ","
+ "\"pid\":"
+ + OUString::number(nPid)
+ + ","
+ "\"tid\":"
+ + OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
+}
+
+void TraceEvent::startRecording()
+{
+ osl::MutexGuard aGuard(g_aMutex);
+ s_bRecording = true;
+}
+
+void TraceEvent::stopRecording() { s_bRecording = false; }
+
+void TraceEvent::setBufferSizeAndCallback(std::size_t bufferSize, void (*bufferFullCallback)())
+{
+ s_nBufferSize = bufferSize;
+ s_pBufferFullCallback = bufferFullCallback;
+}
+
+std::vector<OUString> TraceEvent::getEventVectorAndClear()
+{
+ bool bRecording;
+ std::vector<OUString> aRecording;
+ {
+ osl::MutexGuard aGuard(g_aMutex);
+ bRecording = s_bRecording;
+ stopRecording();
+ aRecording.swap(g_aRecording);
+ }
+ // reset start time and nesting level
+ if (bRecording)
+ startRecording();
+ return aRecording;
+}
+
+css::uno::Sequence<OUString> TraceEvent::getRecordingAndClear()
+{
+ return comphelper::containerToSequence(getEventVectorAndClear());
+}
+
+void ProfileZone::addRecording()
+{
+ assert(s_bRecording);
+
+ long long nNow = getNow();
+
+ // Generate a single "Complete Event" (type X)
+ TraceEvent::addRecording("{"
+ "\"name\":\""
+ + OUString(m_sName, strlen(m_sName), RTL_TEXTENCODING_UTF8)
+ + "\","
+ "\"ph\":\"X\","
+ "\"ts\":"
+ + OUString::number(m_nCreateTime)
+ + ","
+ "\"dur\":"
+ + OUString::number(nNow - m_nCreateTime) + m_sArgs
+ + ","
+ "\"pid\":"
+ + OUString::number(m_nPid)
+ + ","
+ "\"tid\":"
+ + OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
+}
+
+int ProfileZone::getNestingLevel() { return nProfileZoneNesting; }
+
+void ProfileZone::setNestingLevel(int nNestingLevel) { nProfileZoneNesting = nNestingLevel; }
+
+} // namespace comphelper
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/config_host.mk.in b/config_host.mk.in
index 88ee44b16548..c1e81a6ee105 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -81,6 +81,7 @@ export COMPILER_PLUGINS_CXXFLAGS=@COMPILER_PLUGINS_CXXFLAGS@
export COMPILER_PLUGINS_CXX_LINKFLAGS=@COMPILER_PLUGINS_CXX_LINKFLAGS@
export COMPILER_PLUGINS_DEBUG=@COMPILER_PLUGINS_DEBUG@
export COMPILER_PLUGINS_TOOLING_ARGS=@COMPILER_PLUGINS_TOOLING_ARGS@
+export COMPRESSIONTOOL=@COMPRESSIONTOOL@
export COM_IS_CLANG=@COM_IS_CLANG@
export CPPUNIT_CFLAGS=$(gb_SPACE)@CPPUNIT_CFLAGS@
export CPPUNIT_LIBS=$(gb_SPACE)@CPPUNIT_LIBS@
diff --git a/configure.ac b/configure.ac
index cd5e7ee3e2b0..2ca1fb09c398 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
# several non-alphanumeric characters, those are split off and used only for the
# ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
-AC_INIT([Collabora Office],[6.4.10.28],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[6.4.10.68],[],[],[https://collaboraoffice.com/])
dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed
dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard
@@ -2537,6 +2537,16 @@ if test -z "$BASH"; then
fi
AC_SUBST(BASH)
+# prefer parallel comression tools, if available
+AC_PATH_PROG(COMPRESSIONTOOL, pigz)
+if test -z "$COMPRESSIONTOOL"; then
+ AC_PATH_PROG(COMPRESSIONTOOL, gzip)
+ if test -z "$COMPRESSIONTOOL"; then
+ AC_MSG_ERROR([gzip not found in \$PATH])
+ fi
+fi
+AC_SUBST(COMPRESSIONTOOL)
+
AC_MSG_CHECKING([for GNU or BSD tar])
for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
$a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
@@ -2628,11 +2638,7 @@ if test "$enable_extensions" = yes; then
fi
if test -z "$enable_scripting"; then
- # Disable scripting for iOS unless specifically overridden
- # with --enable-scripting.
- if test $_os != iOS; then
- enable_scripting=yes
- fi
+ enable_scripting=yes
fi
DISABLE_SCRIPTING=''
@@ -2854,7 +2860,7 @@ if test $_os = Darwin; then
# higher than or equal to the minimum required should be found.
AC_MSG_CHECKING([what macOS SDK to use])
- for _macosx_sdk in ${with_macosx_sdk-11.1 11.0 10.15 10.14 10.13 10.12}; do
+ for _macosx_sdk in ${with_macosx_sdk-12.1 12.0 11.3 11.1 11.0 10.15 10.14 10.13 10.12}; do
MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
if test -d "$MACOSX_SDK_PATH"; then
with_macosx_sdk="${_macosx_sdk}"
@@ -2892,8 +2898,17 @@ if test $_os = Darwin; then
11.1)
MACOSX_SDK_VERSION=110100
;;
+ 11.3)
+ MACOSX_SDK_VERSION=110300
+ ;;
+ 12.0)
+ MACOSX_SDK_VERSION=120000
+ ;;
+ 12.1)
+ MACOSX_SDK_VERSION=120100
+ ;;
*)
- AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--11.1])
+ AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--12.1])
;;
esac
@@ -2958,8 +2973,17 @@ if test $_os = Darwin; then
11.1)
MAC_OS_X_VERSION_MIN_REQUIRED="110100"
;;
+ 11.3)
+ MAC_OS_X_VERSION_MIN_REQUIRED="110300"
+ ;;
+ 12.0)
+ MAC_OS_X_VERSION_MIN_REQUIRED="120000"
+ ;;
+ 12.1)
+ MAC_OS_X_VERSION_MIN_REQUIRED="120100"
+ ;;
*)
- AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--11.1])
+ AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.10--12.1])
;;
esac
MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
@@ -3027,8 +3051,17 @@ if test $_os = Darwin; then
11.1)
MAC_OS_X_VERSION_MAX_ALLOWED="110100"
;;
+ 11.3)
+ MAC_OS_X_VERSION_MAX_ALLOWED="110100"
+ ;;
+ 12.0)
+ MAC_OS_X_VERSION_MAX_ALLOWED="120000"
+ ;;
+ 12.1)
+ MAC_OS_X_VERSION_MAX_ALLOWED="120100"
+ ;;
*)
- AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--11.1])
+ AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.10--12.1])
;;
esac
@@ -3148,8 +3181,8 @@ dnl ===================================================================
if test $_os = iOS; then
AC_MSG_CHECKING([what iOS SDK to use])
- current_sdk_ver=14.4
- older_sdk_vers="14.3 14.2 14.1 14.0 13.7 13.6 13.5 13.4 13.2 13.1 13.0 12.4 12.2"
+ current_sdk_ver=15.2
+ older_sdk_vers="15.0 14.5 14.0"
if test "$enable_ios_simulator" = "yes"; then
platform=iPhoneSimulator
versionmin=-mios-simulator-version-min=12.2
@@ -3354,10 +3387,10 @@ if test "$_os" = "WINNT"; then
BITNESS_OVERRIDE=64
fi
fi
-AC_SUBST(WINDOWS_SDK_ARCH)
-if test "$_os" = "iOS" -o "$build_cpu" != "$host_cpu"; then
+if test "$_os" = "iOS"; then
cross_compiling="yes"
fi
+
if test "$cross_compiling" = "yes"; then
export CROSS_COMPILING=TRUE
else
@@ -4844,7 +4877,6 @@ if test "$cross_compiling" = "yes"; then
bin/odfvalidator.sh.in \
bin/officeotron.sh.in \
instsetoo_native/util/openoffice.lst.in \
- setup_native/source/packinfo/finals_instsetoo.txt.in \
config_host/*.in \
sysui/desktop/macosx/Info.plist.in) \
| (cd CONF-FOR-BUILD && tar xf -)
@@ -6319,7 +6351,7 @@ HAVE_GCC_STACK_CLASH_PROTECTION=
if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
AC_MSG_CHECKING([whether $CC_BASE supports -fstack-clash-protection])
save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -fstack-clash-protection"
+ CFLAGS="$CFLAGS -Werror -fstack-clash-protection"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(, [[return 0;]])],
[AC_MSG_RESULT([yes]); HAVE_GCC_STACK_CLASH_PROTECTION=TRUE],
@@ -8242,7 +8274,11 @@ else
SYSTEM_ZLIB=
BUILD_TYPE="$BUILD_TYPE ZLIB"
ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
- ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
+ if test "$COM" = "MSC"; then
+ ZLIB_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/zlib.lib"
+ else
+ ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
+ fi
fi
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_LIBS)
@@ -8534,10 +8570,10 @@ libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
-libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.15])
+libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.16])
libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
-libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
+libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.10])
libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
@@ -8940,14 +8976,14 @@ int main(int argc, char **argv) {
internal)
SYSTEM_PYTHON=
PYTHON_VERSION_MAJOR=3
- PYTHON_VERSION_MINOR=7
- PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.7
+ PYTHON_VERSION_MINOR=8
+ PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.16
if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
fi
- AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
+ AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"3.7.7"])
BUILD_TYPE="$BUILD_TYPE PYTHON"
- if test "$OS" = LINUX; then
+ if test "$OS" = LINUX -o "$OS" = WNT ; then
BUILD_TYPE="$BUILD_TYPE LIBFFI"
fi
# Embedded Python dies without Home set
@@ -10006,13 +10042,7 @@ serf)
fi
# Check for system serf
- libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
- ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
- if test "$COM" = "MSC"; then
- SERF_LIB_DIR="Release"
- test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
- SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
- fi
+ libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.3.9])
;;
neon)
AC_MSG_RESULT([neon])
@@ -10172,9 +10202,7 @@ dnl ===================================================================
dnl Check for system hunspell
dnl ===================================================================
AC_MSG_CHECKING([which libhunspell to use])
-if test "$_os" = iOS; then
- AC_MSG_RESULT([none])
-elif test "$with_system_hunspell" = "yes"; then
+if test "$with_system_hunspell" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_HUNSPELL=TRUE
AC_LANG_PUSH([C++])
@@ -10286,9 +10314,7 @@ dnl ===================================================================
dnl Checking for mythes
dnl ===================================================================
AC_MSG_CHECKING([which mythes to use])
-if test "$_os" = iOS; then
- AC_MSG_RESULT([none])
-elif test "$with_system_mythes" = "yes"; then
+if test "$with_system_mythes" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_MYTHES=TRUE
AC_LANG_PUSH([C++])
@@ -10994,7 +11020,7 @@ AC_SUBST([ENABLE_DCONF])
# pdf import?
AC_MSG_CHECKING([whether to build the PDF import feature])
ENABLE_PDFIMPORT=
-if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
+if test \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
AC_MSG_RESULT([yes])
ENABLE_PDFIMPORT=TRUE
AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
@@ -12265,6 +12291,8 @@ if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
elif test -e /usr/share/java/hamcrest/core.jar; then
HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
+ elif test -e /usr/share/java/hamcrest/hamcrest.jar; then
+ HAMCREST_JAR=/usr/share/java/hamcrest/hamcrest.jar
else
HAMCREST_JAR=/usr/share/java/hamcrest.jar
fi
@@ -13090,7 +13118,6 @@ AC_CONFIG_FILES([config_host.mk
bin/odfvalidator.sh
bin/officeotron.sh
instsetoo_native/util/openoffice.lst
- setup_native/source/packinfo/finals_instsetoo.txt
sysui/desktop/macosx/Info.plist])
AC_CONFIG_HEADERS([config_host/config_buildid.h])
AC_CONFIG_HEADERS([config_host/config_clang.h])
diff --git a/connectivity/Library_mysqlc.mk b/connectivity/Library_mysqlc.mk
index 0999b46d3eec..f765fb1e305f 100644
--- a/connectivity/Library_mysqlc.mk
+++ b/connectivity/Library_mysqlc.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_Library_Library,mysqlc))
$(eval $(call gb_Library_use_externals,mysqlc,\
boost_headers \
mariadb-connector-c \
+ openssl \
))
$(eval $(call gb_Library_set_include,mysqlc,\
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 77e7c871123c..6cd27e46a5ff 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -27,6 +27,7 @@
#include <rtl/character.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
+#include <sal/log.hxx>
#include <unotools/datetime.hxx>
#include <sstream>
#include <iomanip>
@@ -167,10 +168,13 @@ namespace dbtools
;
}
-
static sal_Int32 implDaysInMonth(sal_Int32 _nMonth, sal_Int32 _nYear)
{
- OSL_ENSURE(_nMonth > 0 && _nMonth < 13,"Month as invalid value!");
+ SAL_WARN_IF(_nMonth < 1 || _nMonth > 12, "connectivity.commontools", "Month has invalid value: " << _nMonth);
+ if (_nMonth < 1)
+ _nMonth = 1;
+ else if (_nMonth > 12)
+ _nMonth = 12;
if (_nMonth != 2)
return aDaysInMonth[_nMonth-1];
else
@@ -182,7 +186,6 @@ namespace dbtools
}
}
-
static sal_Int32 implRelativeToAbsoluteNull(const css::util::Date& _rDate)
{
sal_Int32 nDays = 0;
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index ffd4eb2ab30f..f3c15904072e 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -773,10 +773,8 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool
for (std::size_t i = 1; aIter != aEnd && nByteOffset <= m_nBufferSize && i < nCount;++aIter, i++)
{
// Lengths depending on data type:
- sal_Int32 nLen = 0;
- sal_Int32 nType = 0;
- nLen = m_aPrecisions[i-1];
- nType = m_aTypes[i-1];
+ sal_Int32 nLen = m_aPrecisions[i-1];
+ sal_Int32 nType = m_aTypes[i-1];
switch(nType)
{
@@ -835,8 +833,13 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool
else if ( DataType::TIMESTAMP == nType )
{
sal_Int32 nDate = 0,nTime = 0;
+ if (nLen < 8)
+ {
+ SAL_WARN("connectivity.drivers", "short TIMESTAMP");
+ return false;
+ }
memcpy(&nDate, pData, 4);
- memcpy(&nTime, pData+ 4, 4);
+ memcpy(&nTime, pData + 4, 4);
if ( !nDate && !nTime )
{
(_rRow->get())[i]->setNull();
@@ -914,7 +917,7 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool
{
case DataType::DATE:
{
- if (aStr.getLength() != nLen)
+ if (nLen < 8 || aStr.getLength() != nLen)
{
(_rRow->get())[i]->setNull();
break;
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index de76ecbba29d..95c610843efa 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -300,6 +300,37 @@ namespace connectivity
} // if ( xStream.is() )
::comphelper::disposeComponent(xStream);
}
+
+ // disallow any database/script files that contain a "SCRIPT[.*]" entry (this is belt and braces
+ // in that bundled hsqldb 1.8.0 is patched to also reject them)
+ //
+ // hsqldb 2.6.0 release notes have: added system role SCRIPT_OPS for export / import of database structure and data
+ // which seems to provide a builtin way to do this with contemporary hsqldb
+ const OUString sScript( "script" );
+ if (!bIsNewDatabase && xStorage->isStreamElement(sScript))
+ {
+ Reference<XStream > xStream = xStorage->openStreamElement(sScript, ElementModes::READ);
+ if (xStream.is())
+ {
+ std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream(xStream));
+ if (pStream)
+ {
+ OString sLine;
+ while (pStream->ReadLine(sLine))
+ {
+ OString sText = sLine.trim();
+ if (sText.startsWithIgnoreAsciiCase("SCRIPT"))
+ {
+ ::connectivity::SharedResources aResources;
+ sMessage = aResources.getResourceString(STR_COULD_NOT_LOAD_FILE).replaceFirst("$filename$", sSystemPath);
+ break;
+ }
+ }
+ }
+ } // if ( xStream.is() )
+ ::comphelper::disposeComponent(xStream);
+ }
+
}
catch(Exception&)
{
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index c9d423e3219c..6fa996b5e474 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -74,9 +74,15 @@ inline connectivity::OSQLInternalNode* newNode(const OUString& _newValue,
// yyi is the internal number of the rule that is currently being reduced
// This can be mapped to external rule number via the yyrmap.
+#if defined YYBISON && YYBISON >= 30800
+#define SQL_NEW_RULE newNode("", SQLNodeType::Rule, yyr1[yyrule])
+#define SQL_NEW_LISTRULE newNode("", SQLNodeType::ListRule, yyr1[yyrule])
+#define SQL_NEW_COMMALISTRULE newNode("", SQLNodeType::CommaListRule, yyr1[yyrule])
+#else
#define SQL_NEW_RULE newNode("", SQLNodeType::Rule, yyr1[yyn])
#define SQL_NEW_LISTRULE newNode("", SQLNodeType::ListRule, yyr1[yyn])
#define SQL_NEW_COMMALISTRULE newNode("", SQLNodeType::CommaListRule, yyr1[yyn])
+#endif
extern connectivity::OSQLParser* xxx_pGLOBAL_SQLPARSER;
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index a980d4b7fa3f..758dd2adb700 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -481,7 +481,7 @@ void CuiConfigGroupListBox::InitModule()
}
void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode,
- const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand)
+ const weld::TreeIter* pParentEntry)
{
try {
if ( xRootNode->hasChildNodes() )
@@ -544,7 +544,7 @@ void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::scrip
theChild->acquire();
bool bChildOnDemand = false;
- if ( !bCheapChildrenOnDemand && children[n]->hasChildNodes() )
+ if ( children[n]->hasChildNodes() )
{
Sequence< Reference< browse::XBrowseNode > > grandchildren =
children[n]->getChildNodes();
@@ -558,14 +558,6 @@ void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::scrip
}
}
}
- else
- {
- /* i30923 - Would be nice if there was a better
- * way to determine if a basic lib had children
- * without having to ask for them (which forces
- * the library to be loaded */
- bChildOnDemand = true;
- }
OUString aImage = GetImage(theChild, m_xContext, bIsRootNode);
@@ -651,7 +643,7 @@ void CuiConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
{
//We are only showing scripts not slot APIs so skip
//Root node and show location nodes
- FillScriptList(rootNode, nullptr, false);
+ FillScriptList(rootNode, nullptr);
}
}
@@ -938,7 +930,7 @@ IMPL_LINK(CuiConfigGroupListBox, ExpandingHdl, const weld::TreeIter&, rIter, boo
{
Reference< browse::XBrowseNode > rootNode(
static_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ;
- FillScriptList(rootNode, &rIter, true /* i30923 */ );
+ FillScriptList(rootNode, &rIter);
}
break;
}
@@ -1050,37 +1042,28 @@ void CuiConfigGroupListBox::SelectMacro( const OUString& rBasic,
*/
SvxScriptSelectorDialog::SvxScriptSelectorDialog(
- weld::Window* pParent, bool bShowSlots, const css::uno::Reference< css::frame::XFrame >& xFrame)
+ weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& xFrame)
: GenericDialogController(pParent, "cui/ui/macroselectordialog.ui", "MacroSelectorDialog")
- , m_bShowSlots(bShowSlots)
- , m_xDialogDescription(m_xBuilder->weld_label(bShowSlots ? "helptoolbar" : "helpmacro"))
+ , m_xDialogDescription(m_xBuilder->weld_label("helpmacro"))
, m_xCategories(new CuiConfigGroupListBox(m_xBuilder->weld_tree_view("categories")))
, m_xCommands(new CuiConfigFunctionListBox(m_xBuilder->weld_tree_view("commands")))
, m_xLibraryFT(m_xBuilder->weld_label("libraryft"))
- , m_xCategoryFT(m_xBuilder->weld_label("categoryft"))
, m_xMacronameFT(m_xBuilder->weld_label("macronameft"))
- , m_xCommandsFT(m_xBuilder->weld_label("commandsft"))
- , m_xOKButton(m_xBuilder->weld_button(bShowSlots ? "add" : "ok"))
- , m_xCancelButton(m_xBuilder->weld_button(bShowSlots ? "close" : "cancel"))
+ , m_xOKButton(m_xBuilder->weld_button("ok"))
+ , m_xCancelButton(m_xBuilder->weld_button("cancel"))
, m_xDescriptionText(m_xBuilder->weld_text_view("description"))
+ , m_xDescriptionFrame(m_xBuilder->weld_frame("descriptionframe"))
{
- if (m_bShowSlots)
- {
- // If we are showing Slot API commands update labels in the UI
- m_xDialog->set_title(CuiResId(RID_SVXSTR_SELECTOR_ADD_COMMANDS));
- }
m_xCancelButton->show();
m_xDialogDescription->show();
m_xOKButton->show();
- m_xLibraryFT->set_visible(!m_bShowSlots);
- m_xCategoryFT->set_visible(m_bShowSlots);
- m_xMacronameFT->set_visible(!m_bShowSlots);
- m_xCommandsFT->set_visible(m_bShowSlots);
+ m_xLibraryFT->set_visible(true);
+ m_xMacronameFT->set_visible(true);
const OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame));
m_xCategories->SetFunctionListBox(m_xCommands.get());
- m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, aModuleName, bShowSlots);
+ m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, aModuleName, /*bShowSlots*/false);
m_xCategories->connect_changed(
LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
@@ -1104,6 +1087,9 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
m_xCategories->SetStylesInfo(&m_aStylesInfo);
UpdateUI();
+
+ if (comphelper::LibreOfficeKit::isActive())
+ m_xDescriptionFrame->hide();
}
SvxScriptSelectorDialog::~SvxScriptSelectorDialog()
@@ -1154,19 +1140,7 @@ IMPL_LINK(SvxScriptSelectorDialog, ClickHdl, weld::Button&, rButton, void)
}
else if (&rButton == m_xOKButton.get())
{
- // If we are displaying Slot API commands then this the dialog is being
- // run from Tools/Configure and we should not close it
- if ( !m_bShowSlots )
- {
- m_xDialog->response(RET_OK);
- }
- else
- {
- // Select the next entry in the list if possible
- std::unique_ptr<weld::TreeIter> xIter = m_xCommands->make_iterator();
- if (m_xCommands->get_selected(xIter.get()) && m_xCommands->iter_next_sibling(*xIter))
- m_xCommands->select(*xIter);
- }
+ m_xDialog->response(RET_OK);
}
}
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 2fb442dbdb24..cdf07498f83e 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -460,7 +460,7 @@ void SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::
else if( bAssEnabled )
{
// assign pressed
- SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), false, pThis->GetFrame());
+ SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), pThis->GetFrame());
short ret = aDlg.run();
if ( ret )
{
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f8399d259071..bdff2b9b0451 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1137,7 +1137,7 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateScriptErrorDialog(co
VclPtr<AbstractScriptSelectorDialog> AbstractDialogFactory_Impl::CreateScriptSelectorDialog(weld::Window* pParent,
const Reference<frame::XFrame>& rxFrame)
{
- return VclPtr<AbstractScriptSelectorDialog_Impl>::Create(std::make_shared<SvxScriptSelectorDialog>(pParent, false/*bShowSlots*/, rxFrame));
+ return VclPtr<AbstractScriptSelectorDialog_Impl>::Create(std::make_shared<SvxScriptSelectorDialog>(pParent, rxFrame));
}
OUString AbstractScriptSelectorDialog_Impl::GetScriptURL() const
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index e930c24ac3ec..f6301f4e09bb 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -203,7 +203,7 @@ class CuiConfigGroupListBox
void InitModule();
void FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode,
- const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand);
+ const weld::TreeIter* pParentEntry);
void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation >& xCommands);
OUString MapCommand2UIName(const OUString& sCommand);
@@ -234,18 +234,16 @@ class SvxScriptSelectorDialog : public weld::GenericDialogController
{
OUString m_sDefaultDesc;
SfxStylesInfo_Impl m_aStylesInfo;
- bool m_bShowSlots;
std::unique_ptr<weld::Label> m_xDialogDescription;
std::unique_ptr<CuiConfigGroupListBox> m_xCategories;
std::unique_ptr<CuiConfigFunctionListBox> m_xCommands;
std::unique_ptr<weld::Label> m_xLibraryFT;
- std::unique_ptr<weld::Label> m_xCategoryFT;
std::unique_ptr<weld::Label> m_xMacronameFT;
- std::unique_ptr<weld::Label> m_xCommandsFT;
std::unique_ptr<weld::Button> m_xOKButton;
std::unique_ptr<weld::Button> m_xCancelButton;
std::unique_ptr<weld::TextView> m_xDescriptionText;
+ std::unique_ptr<weld::Frame> m_xDescriptionFrame;
DECL_LINK(ClickHdl, weld::Button&, void);
DECL_LINK(SelectHdl, weld::TreeView&, void);
@@ -254,7 +252,7 @@ class SvxScriptSelectorDialog : public weld::GenericDialogController
void UpdateUI();
public:
- SvxScriptSelectorDialog(weld::Window* pParent, bool bShowSlots,
+ SvxScriptSelectorDialog(weld::Window* pParent,
const css::uno::Reference< css::frame::XFrame >& xFrame);
virtual ~SvxScriptSelectorDialog() override;
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index afdc7cb6ba6f..922126a1b6b7 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -57,6 +57,7 @@ class SvxGrfCropPage : public SfxTabPage
long nOldWidth;
long nOldHeight;
bool bSetOrigSize;
+ sal_Int32 m_aPreferredDPI;
SvxCropExample m_aExampleWN;
@@ -93,7 +94,7 @@ class SvxGrfCropPage : public SfxTabPage
void GraphicHasChanged(bool bFound);
virtual void ActivatePage(const SfxItemSet& rSet) override;
- static Size GetGrfOrigSize(const Graphic&);
+ Size GetGrfOrigSize(const Graphic& rGraphic);
public:
SvxGrfCropPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet);
static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet );
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 091ef70faddf..cf0f13e42350 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -57,6 +57,7 @@ SvxGrfCropPage::SvxGrfCropPage(weld::Container* pPage, weld::DialogController* p
, nOldWidth(0)
, nOldHeight(0)
, bSetOrigSize(false)
+ , m_aPreferredDPI(0)
, m_xCropFrame(m_xBuilder->weld_widget("cropframe"))
, m_xZoomConstRB(m_xBuilder->weld_radio_button("keepscale"))
, m_xSizeConstRB(m_xBuilder->weld_radio_button("keepsize"))
@@ -287,6 +288,10 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
DBG_ASSERT( pPool, "Where is the pool?" );
#endif
+ auto& aProperties = getAdditionalProperties();
+ if (aProperties.find("PreferredDPI") != aProperties.end())
+ m_aPreferredDPI = aProperties.at("PreferredDPI").get<sal_Int32>();
+
bSetOrigSize = false;
// Size
@@ -652,6 +657,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
}
sTemp = sTemp.replaceAll("%1", sPPI);
}
+ sTemp += "\n" + OUString::number(aOrigPixelSize.Width()) + u"\u00D7" + OUString::number(aOrigPixelSize.Height()) + " px";
m_xOrigSizeFT->set_label(sTemp);
}
@@ -664,13 +670,27 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
Size SvxGrfCropPage::GetGrfOrigSize(const Graphic& rGrf)
{
- const MapMode aMapTwip( MapUnit::MapTwip );
- Size aSize( rGrf.GetPrefSize() );
- if( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() )
- aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMapTwip);
+ Size aSize;
+
+ if (m_aPreferredDPI > 0)
+ {
+ Size aPixelSize = rGrf.GetSizePixel();
+ double fWidth = aPixelSize.Width() / double(m_aPreferredDPI);
+ double fHeight = aPixelSize.Height() / double(m_aPreferredDPI);
+ fWidth = fWidth * 1440.0;
+ fHeight = fHeight * 1440.0;
+ aSize = Size(fWidth, fHeight);
+ }
else
- aSize = OutputDevice::LogicToLogic( aSize,
- rGrf.GetPrefMapMode(), aMapTwip );
+ {
+ const MapMode aMapTwip( MapUnit::MapTwip );
+ aSize = rGrf.GetPrefSize();
+ if( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() )
+ aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMapTwip);
+ else
+ aSize = OutputDevice::LogicToLogic( aSize,
+ rGrf.GetPrefMapMode(), aMapTwip );
+ }
return aSize;
}
diff --git a/cui/uiconfig/ui/macroselectordialog.ui b/cui/uiconfig/ui/macroselectordialog.ui
index edc9fad32d9e..6b190e8cbde5 100644
--- a/cui/uiconfig/ui/macroselectordialog.ui
+++ b/cui/uiconfig/ui/macroselectordialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.20.4 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkTreeStore" id="liststore1">
@@ -28,9 +28,6 @@
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property>
- <child>
- <placeholder/>
- </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -41,23 +38,9 @@
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="add">
- <property name="label" translatable="yes" context="macroselectordialog|add">Add</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
@@ -74,6 +57,7 @@
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
@@ -86,20 +70,6 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="close">
- <property name="label">gtk-close</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
@@ -147,22 +117,6 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="helptoolbar">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="hexpand">True</property>
- <property name="label" translatable="yes" context="macroselectordialog|helptoolbar">To add a command to a toolbar, select the category and then the command. Then drag the command to the Commands list of the Toolbars tab page in the Customize dialog.</property>
- <property name="wrap">True</property>
- <property name="max_width_chars">60</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -182,7 +136,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
@@ -201,7 +154,6 @@
<property name="model">liststore1</property>
<property name="headers_visible">False</property>
<property name="search_column">1</property>
- <property name="show_expanders">True</property>
<property name="enable_tree_lines">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Macro Library List-selection1"/>
@@ -230,39 +182,13 @@
</object>
</child>
<child type="label">
- <object class="GtkBox" id="box3">
+ <object class="GtkLabel" id="libraryft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="libraryft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="macroselectordialog|libraryft">Library</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="categoryft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="macroselectordialog|categoryft">Category</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes" context="macroselectordialog|libraryft">Library</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
</object>
</child>
</object>
@@ -285,7 +211,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
@@ -324,41 +249,14 @@
</object>
</child>
<child type="label">
- <object class="GtkBox" id="box4">
+ <object class="GtkLabel" id="macronameft">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="macronameft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="macroselectordialog|macronameft">Macro Name</property>
- <property name="track_visited_links">False</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="commandsft">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="macroselectordialog|commandsft">Commands</property>
- <property name="track_visited_links">False</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="label" translatable="yes" context="macroselectordialog|macronameft">Macro Name</property>
+ <property name="track_visited_links">False</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
</object>
</child>
</object>
@@ -376,7 +274,7 @@
</packing>
</child>
<child>
- <object class="GtkFrame" id="frame1">
+ <object class="GtkFrame" id="descriptionframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
@@ -388,7 +286,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="height_request">100</property>
@@ -396,7 +293,6 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="description">
<property name="visible">True</property>
@@ -439,11 +335,12 @@
</object>
</child>
<action-widgets>
- <action-widget response="101">add</action-widget>
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
- <action-widget response="-7">close</action-widget>
<action-widget response="-11">help</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index c72d3a0b6e9b..f4cef5483f69 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -299,6 +299,11 @@ void SAL_CALL SbaTableQueryBrowser::disposing()
// remove ourself as status listener
implRemoveStatusListeners();
+ // check out from all the objects we are listening
+ // the frame
+ if (m_xCurrentFrameParent.is())
+ m_xCurrentFrameParent->removeFrameActionListener(static_cast<css::frame::XFrameActionListener*>(this));
+
// remove the container listener from the database context
try
{
@@ -310,10 +315,6 @@ void SAL_CALL SbaTableQueryBrowser::disposing()
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
- // check out from all the objects we are listening
- // the frame
- if (m_xCurrentFrameParent.is())
- m_xCurrentFrameParent->removeFrameActionListener(static_cast<css::frame::XFrameActionListener*>(this));
SbaXDataBrowserController::disposing();
}
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 1a927280e24b..ef8494ed7b0d 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -46,11 +46,10 @@ namespace desktop {
OString toString() const
{
- std::stringstream ss;
- ss << m_aRectangle.toString();
if (m_nPart >= -1)
- ss << ", " << m_nPart;
- return ss.str().c_str();
+ return m_aRectangle.toString() + ", " + OString::number(m_nPart);
+ else
+ return m_aRectangle.toString();
}
/// Infinite Rectangle is both sides are
@@ -93,9 +92,8 @@ namespace desktop {
struct CallbackData
{
- CallbackData(int type, const std::string& payload)
- : Type(type)
- , PayloadString(payload)
+ CallbackData(const std::string& payload)
+ : PayloadString(payload)
{
}
@@ -118,7 +116,6 @@ namespace desktop {
/// Returns true iff there is cached data.
bool isCached() const { return PayloadObject.which() != 0; }
- int Type;
std::string PayloadString;
private:
@@ -126,14 +123,19 @@ namespace desktop {
boost::variant<boost::blank, RectangleAndPart, boost::property_tree::ptree> PayloadObject;
};
- typedef std::vector<CallbackData> queue_type;
+ typedef std::vector<int> queue_type1;
+ typedef std::vector<CallbackData> queue_type2;
private:
- bool removeAll(const std::function<bool (const queue_type::value_type&)>& rTestFunc);
- bool processInvalidateTilesEvent(CallbackData& aCallbackData);
- bool processWindowEvent(CallbackData& aCallbackData);
-
- queue_type m_queue;
+ bool removeAll(const std::function<bool (int, const CallbackData&)>& rTestFunc);
+ bool processInvalidateTilesEvent(int type, CallbackData& aCallbackData);
+ bool processWindowEvent(int type, CallbackData& aCallbackData);
+ queue_type2::reverse_iterator toQueue2(queue_type1::reverse_iterator);
+
+ /** we frequently want to scan the queue, and mostly when we do so, we only care about the element type
+ so we split the queue in 2 to make the scanning cache friendly. */
+ queue_type1 m_queue1;
+ queue_type2 m_queue2;
std::map<int, std::string> m_states;
std::unordered_map<int, std::unordered_map<int, std::string>> m_viewStates;
LibreOfficeKitDocument* m_pDocument;
@@ -142,6 +144,15 @@ namespace desktop {
int m_nDisableCallbacks;
bool m_bEventLatch;
std::mutex m_mutex;
+ class TimeoutIdle : public Timer
+ {
+ public:
+ TimeoutIdle( CallbackFlushHandler* handler );
+ virtual void Invoke() override;
+ private:
+ CallbackFlushHandler* mHandler;
+ };
+ TimeoutIdle m_TimeoutIdle;
};
struct DESKTOP_DLLPUBLIC LibLODocument_Impl : public _LibreOfficeKitDocument
diff --git a/desktop/qa/data/table-selection.odt b/desktop/qa/data/table-selection.odt
new file mode 100644
index 000000000000..c19f8c79fc3a
--- /dev/null
+++ b/desktop/qa/data/table-selection.odt
Binary files differ
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index af9b93620351..ad351343295a 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -226,6 +226,8 @@ public:
void testMetricField();
void testMultiDocuments();
void testJumpCursor();
+ void testNoDuplicateTableSelection();
+ void testMultiViewTableSelection();
void testABI();
CPPUNIT_TEST_SUITE(DesktopLOKTest);
@@ -289,6 +291,8 @@ public:
CPPUNIT_TEST(testMetricField);
CPPUNIT_TEST(testMultiDocuments);
CPPUNIT_TEST(testJumpCursor);
+ CPPUNIT_TEST(testNoDuplicateTableSelection);
+ CPPUNIT_TEST(testMultiViewTableSelection);
CPPUNIT_TEST(testABI);
CPPUNIT_TEST_SUITE_END();
@@ -1946,6 +1950,8 @@ class ViewCallback
int mnView;
public:
OString m_aCellFormula;
+ int m_nTableSelectionCount;
+ bool m_bEmptyTableSelection;
bool m_bTilesInvalidated;
bool m_bZeroCursor;
tools::Rectangle m_aOwnCursor;
@@ -1954,6 +1960,8 @@ public:
ViewCallback(LibLODocument_Impl* pDocument)
: mpDocument(pDocument),
+ m_nTableSelectionCount(0),
+ m_bEmptyTableSelection(false),
m_bTilesInvalidated(false),
m_bZeroCursor(false)
{
@@ -2017,6 +2025,12 @@ public:
m_aCellFormula = aPayload;
}
break;
+ case LOK_CALLBACK_TABLE_SELECTED:
+ {
+ m_bEmptyTableSelection = (std::string(pPayload).compare("{ }") == 0);
+ ++m_nTableSelectionCount;
+ }
+ break;
}
}
};
@@ -3089,6 +3103,113 @@ void DesktopLOKTest::testJumpCursor()
comphelper::LibreOfficeKit::setTiledAnnotations(true);
}
+static void lcl_repeatKeyStroke(LibLODocument_Impl *pDocument, int nCharCode, int nKeyCode, size_t nCount)
+{
+ for (size_t nCtr = 0; nCtr < nCount; ++nCtr)
+ {
+ pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, nCharCode, nKeyCode);
+ pDocument->m_pDocumentClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, nCharCode, nKeyCode);
+ }
+}
+
+void DesktopLOKTest::testNoDuplicateTableSelection()
+{
+ comphelper::LibreOfficeKit::setActive();
+ LibLODocument_Impl* pDocument = loadDoc("table-selection.odt");
+
+ // Create view 1.
+ pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+ ViewCallback aView1(pDocument);
+
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 1);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(1, aView1.m_nTableSelectionCount);
+ CPPUNIT_ASSERT(aView1.m_bEmptyTableSelection);
+
+ aView1.m_nTableSelectionCount = 0;
+ // Go to Table1.
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 1);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(1, aView1.m_nTableSelectionCount);
+ CPPUNIT_ASSERT(!aView1.m_bEmptyTableSelection);
+
+ aView1.m_nTableSelectionCount = 0;
+ // Move to the last row in Table1.
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 2);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(0, aView1.m_nTableSelectionCount);
+
+ // Go outside Table1.
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 1);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(1, aView1.m_nTableSelectionCount);
+ CPPUNIT_ASSERT(aView1.m_bEmptyTableSelection);
+}
+
+void DesktopLOKTest::testMultiViewTableSelection()
+{
+ comphelper::LibreOfficeKit::setActive();
+ LibLODocument_Impl* pDocument = loadDoc("table-selection.odt");
+
+ // Create view 1.
+ pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+ ViewCallback aView1(pDocument);
+ int nView1 = pDocument->m_pDocumentClass->getView(pDocument);
+
+ // Create view 2.
+ pDocument->m_pDocumentClass->createView(pDocument);
+ pDocument->m_pDocumentClass->initializeForRendering(pDocument, "{}");
+ ViewCallback aView2(pDocument);
+ int nView2 = pDocument->m_pDocumentClass->getView(pDocument);
+
+ // switch to view 1.
+ pDocument->m_pDocumentClass->setView(pDocument, nView1);
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 1);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(1, aView1.m_nTableSelectionCount);
+ CPPUNIT_ASSERT_EQUAL(1, aView2.m_nTableSelectionCount);
+ CPPUNIT_ASSERT(aView1.m_bEmptyTableSelection);
+ CPPUNIT_ASSERT(aView2.m_bEmptyTableSelection);
+
+ aView1.m_nTableSelectionCount = 0;
+ aView2.m_nTableSelectionCount = 0;
+
+ pDocument->m_pDocumentClass->setView(pDocument, nView1);
+ // Go to Table1.
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 1);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(1, aView1.m_nTableSelectionCount);
+ CPPUNIT_ASSERT_EQUAL(0, aView2.m_nTableSelectionCount);
+
+ aView1.m_nTableSelectionCount = 0;
+ // Switch to view 2
+ pDocument->m_pDocumentClass->setView(pDocument, nView2);
+ // Go to Table2 in view 2.
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 7);
+ Scheduler::ProcessEventsToIdle();
+ // View1 should not get any table selection messages.
+ CPPUNIT_ASSERT_EQUAL(0, aView1.m_nTableSelectionCount);
+ // View2 will first get table selection of Table1, then emty selection, and finally on 7th down arrow keypress,
+ // it will get table-selection of Table2. So in total it should get 3 table selections.
+ CPPUNIT_ASSERT_EQUAL(3, aView2.m_nTableSelectionCount);
+ CPPUNIT_ASSERT(!aView2.m_bEmptyTableSelection);
+
+ aView1.m_nTableSelectionCount = 0;
+ aView2.m_nTableSelectionCount = 0;
+
+ // Switch to view 1
+ pDocument->m_pDocumentClass->setView(pDocument, nView1);
+ // Go out of Table1 and re-enter..
+ lcl_repeatKeyStroke(pDocument, 0, KEY_UP, 1);
+ lcl_repeatKeyStroke(pDocument, 0, KEY_DOWN, 1);
+ Scheduler::ProcessEventsToIdle();
+ // View1 should get one empty table selection, then get Table1 selection.
+ CPPUNIT_ASSERT_EQUAL(2, aView1.m_nTableSelectionCount);
+ // View2 should not get any table selection.
+ CPPUNIT_ASSERT_EQUAL(0, aView2.m_nTableSelectionCount);
+ CPPUNIT_ASSERT(!aView1.m_bEmptyTableSelection);
+}
+
namespace {
constexpr size_t classOffset(int i)
@@ -3186,10 +3307,11 @@ void DesktopLOKTest::testABI()
CPPUNIT_ASSERT_EQUAL(documentClassOffset(59), offsetof(struct _LibreOfficeKitDocumentClass, completeFunction));
CPPUNIT_ASSERT_EQUAL(documentClassOffset(60), offsetof(struct _LibreOfficeKitDocumentClass, setWindowTextSelection));
CPPUNIT_ASSERT_EQUAL(documentClassOffset(61), offsetof(struct _LibreOfficeKitDocumentClass, sendFormFieldEvent));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(62), offsetof(struct _LibreOfficeKitDocumentClass, setBlockedCommandList));
// Extending is fine, update this, and add new assert for the offsetof the
// new method
- CPPUNIT_ASSERT_EQUAL(documentClassOffset(62), sizeof(struct _LibreOfficeKitDocumentClass));
+ CPPUNIT_ASSERT_EQUAL(documentClassOffset(63), sizeof(struct _LibreOfficeKitDocumentClass));
}
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 381147cd534e..846714158e25 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -29,6 +29,7 @@
#include <tools/stream.hxx>
#include <vcl/svapp.hxx>
#include <rtl/uri.hxx>
+#include <tools/urlobj.hxx>
#include <rtl/ustring.hxx>
#include <rtl/process.h>
#include <comphelper/lok.hxx>
@@ -169,7 +170,14 @@ CommandLineEvent CheckOfficeURI(/* in,out */ OUString& arg, CommandLineEvent cur
}
if (nURIlen < 0)
nURIlen = rest2.getLength();
- arg = rest2.copy(0, nURIlen);
+ auto const uri = rest2.copy(0, nURIlen);
+ if (INetURLObject(uri).GetProtocol() == INetProtocol::Macro) {
+ // Let the "Open" machinery process the full command URI (leading to failure, by intention,
+ // as the "Open" machinery does not know about those command URI schemes):
+ curEvt = CommandLineEvent::Open;
+ } else {
+ arg = uri;
+ }
return curEvt;
}
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 40d0ee9c8b3c..241d466c5fd9 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -33,6 +33,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/uri.hxx>
#include <osl/file.hxx>
+#include <rtl/xmlencode.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/ucbhelper.hxx>
@@ -554,39 +555,6 @@ BackendImpl::PackageImpl::isRegistered_(
}
-OUString encodeForXml( OUString const & text )
-{
- // encode conforming xml:
- sal_Int32 len = text.getLength();
- OUStringBuffer buf;
- for ( sal_Int32 pos = 0; pos < len; ++pos )
- {
- sal_Unicode c = text[ pos ];
- switch (c) {
- case '<':
- buf.append( "&lt;" );
- break;
- case '>':
- buf.append( "&gt;" );
- break;
- case '&':
- buf.append( "&amp;" );
- break;
- case '\'':
- buf.append( "&apos;" );
- break;
- case '\"':
- buf.append( "&quot;" );
- break;
- default:
- buf.append( c );
- break;
- }
- }
- return buf.makeStringAndClear();
-}
-
-
OUString replaceOrigin(
OUString const & url, OUString const & destFolder, Reference< XCommandEnvironment > const & xCmdEnv, Reference< XComponentContext > const & xContext, bool & out_replaced)
{
@@ -639,7 +607,7 @@ OUString replaceOrigin(
if (origin.isEmpty()) {
// encode only once
origin = OUStringToOString(
- encodeForXml( url.copy( 0, url.lastIndexOf( '/' ) ) ),
+ rtl::encodeForXml( url.copy( 0, url.lastIndexOf( '/' ) ) ),
// xxx todo: encode always for UTF-8? => lookup doc-header?
RTL_TEXTENCODING_UTF8 );
}
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index af9c9ed1c41b..f1becd67d215 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -41,6 +41,7 @@
#include <sal/log.hxx>
#include <vcl/errinf.hxx>
#include <vcl/lok.hxx>
+#include <o3tl/any.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
#include <osl/thread.h>
@@ -143,6 +144,7 @@
#include <vcl/IDialogRenderable.hxx>
#include <vcl/dialog.hxx>
#include <unicode/uchar.h>
+#include <unotools/securityoptions.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/confignode.hxx>
#include <unotools/syslocaleoptions.hxx>
@@ -181,6 +183,7 @@
#include "lokinteractionhandler.hxx"
#include "lokclipboard.hxx"
+#include <officecfg/Office/Common.hxx>
#include <officecfg/Office/Impress.hxx>
using namespace css;
@@ -205,6 +208,43 @@ struct ExtensionMap
const char *filterName;
};
+class TraceEventDumper : public AutoTimer
+{
+ static const int dumpTimeoutMS = 5000;
+
+public:
+ TraceEventDumper() : AutoTimer( "Trace Event dumper" )
+ {
+ SetTimeout(dumpTimeoutMS);
+ Start();
+ }
+
+ virtual void Invoke() override
+ {
+ flushRecordings();
+ }
+
+ static void flushRecordings()
+ {
+ const css::uno::Sequence<OUString> aEvents =
+ comphelper::TraceEvent::getRecordingAndClear();
+ OStringBuffer aOutput;
+ for (const auto &s : aEvents)
+ {
+ aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8));
+ aOutput.append("\n");
+ }
+ if (aOutput.getLength() > 0)
+ {
+ OString aChunk = aOutput.makeStringAndClear();
+ if (gImpl && gImpl->mpCallback)
+ gImpl->mpCallback(LOK_CALLBACK_PROFILE_FRAME, aChunk.getStr(), gImpl->mpCallbackData);
+ }
+ }
+};
+
+static TraceEventDumper *traceEventDumper = nullptr;
+
static const ExtensionMap aWriterExtensionMap[] =
{
{ "doc", "MS Word 97" },
@@ -1044,6 +1084,10 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis,
int nType,
int nCharCode,
int nKeyCode);
+static void doc_setBlockedCommandList(LibreOfficeKitDocument* pThis,
+ int nViewId,
+ const char* bolckedCommandList);
+
static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis,
unsigned nWindowId,
int nType,
@@ -1218,6 +1262,26 @@ rtl::Reference<LOKClipboard> forceSetClipboardForCurrentView(LibreOfficeKitDocum
#endif
+const vcl::Font* FindFont(const OUString& rFontName)
+{
+ SfxObjectShell* pDocSh = SfxObjectShell::Current();
+ const SvxFontListItem* pFonts
+ = static_cast<const SvxFontListItem*>(pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST));
+ const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr;
+ if (pList && !rFontName.isEmpty())
+ if (sal_Handle hMetric = pList->GetFirstFontMetric(rFontName))
+ return &FontList::GetFontMetric(hMetric);
+ return nullptr;
+}
+
+vcl::Font FindFont_FallbackToDefault(const OUString& rFontName)
+{
+ if (auto pFound = FindFont(rFontName))
+ return *pFound;
+
+ return OutputDevice::GetDefaultFont(DefaultFontType::SANS_UNICODE, LANGUAGE_NONE,
+ GetDefaultFontFlags::NONE);
+}
} // anonymous namespace
LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent, int nDocumentId)
@@ -1307,6 +1371,8 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->sendFormFieldEvent = doc_sendFormFieldEvent;
+ m_pDocumentClass->setBlockedCommandList = doc_setBlockedCommandList;
+
gDocumentClass = m_pDocumentClass;
}
pClass = m_pDocumentClass.get();
@@ -1339,13 +1405,29 @@ static OUString getGenerator()
extern "C" {
+CallbackFlushHandler::TimeoutIdle::TimeoutIdle( CallbackFlushHandler* handler )
+ : Timer( "lokit timer callback" )
+ , mHandler( handler )
+{
+ // A second timer with higher priority, it'll ensure we flush in reasonable time if we get too busy
+ // to get POST_PAINT priority processing. Otherwise it could take a long time to flush.
+ SetPriority(TaskPriority::DEFAULT);
+ SetTimeout( 100 ); // 100 ms
+}
+
+void CallbackFlushHandler::TimeoutIdle::Invoke()
+{
+ mHandler->Invoke();
+}
+
CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, LibreOfficeKitCallback pCallback, void* pData)
- : Idle( "lokit timer callback" ),
+ : Idle( "lokit idle callback" ),
m_pDocument(pDocument),
m_pCallback(pCallback),
m_pData(pData),
m_nDisableCallbacks(0),
- m_bEventLatch(false)
+ m_bEventLatch(false),
+ m_TimeoutIdle( this )
{
SetPriority(TaskPriority::POST_PAINT);
@@ -1361,6 +1443,7 @@ CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li
m_states.emplace(LOK_CALLBACK_CELL_ADDRESS, "NIL");
m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL");
m_states.emplace(LOK_CALLBACK_SET_PART, "NIL");
+ m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL");
Start();
}
@@ -1379,22 +1462,33 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d
}
}
+CallbackFlushHandler::queue_type2::reverse_iterator CallbackFlushHandler::toQueue2(CallbackFlushHandler::queue_type1::reverse_iterator pos)
+{
+ int delta = std::distance(m_queue1.rbegin(), pos);
+ return m_queue2.rbegin() + delta;
+}
+
void CallbackFlushHandler::queue(const int type, const char* data)
{
comphelper::ProfileZone aZone("CallbackFlushHander::queue");
- CallbackData aCallbackData(type, (data ? data : "(nil)"));
+ CallbackData aCallbackData(data ? data : "(nil)");
const std::string& payload = aCallbackData.PayloadString;
- SAL_INFO("lok", "Queue: [" << type << "]: [" << payload << "] on " << m_queue.size() << " entries.");
+ SAL_INFO("lok", "Queue: [" << type << "]: [" << payload << "] on " << m_queue1.size() << " entries.");
bool bIsChartActive = false;
+ bool bIsComment = false;
if (type == LOK_CALLBACK_GRAPHIC_SELECTION)
{
LokChartHelper aChartHelper(SfxViewShell::Current());
bIsChartActive = aChartHelper.GetWindow() != nullptr;
}
+ else if (type == LOK_CALLBACK_COMMENT)
+ {
+ bIsComment = true;
+ }
- if (callbacksDisabled() && !bIsChartActive)
+ if (callbacksDisabled() && !bIsChartActive && !bIsComment)
{
// We drop notifications when this is set, except for important ones.
// When we issue a complex command (such as .uno:InsertAnnotation)
@@ -1454,6 +1548,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
case LOK_CALLBACK_CELL_VIEW_CURSOR:
case LOK_CALLBACK_CELL_FORMULA:
case LOK_CALLBACK_CELL_ADDRESS:
+ case LOK_CALLBACK_CELL_SELECTION_AREA:
case LOK_CALLBACK_CURSOR_VISIBLE:
case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
case LOK_CALLBACK_SET_PART:
@@ -1462,11 +1557,13 @@ void CallbackFlushHandler::queue(const int type, const char* data)
case LOK_CALLBACK_WINDOW:
case LOK_CALLBACK_CALC_FUNCTION_LIST:
case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
+ case LOK_CALLBACK_REFERENCE_MARKS:
+ case LOK_CALLBACK_CELL_AUTO_FILL_AREA:
{
- const auto& pos = std::find_if(m_queue.rbegin(), m_queue.rend(),
- [type] (const queue_type::value_type& elem) { return (elem.Type == type); });
-
- if (pos != m_queue.rend() && pos->PayloadString == payload)
+ const auto& pos = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
+ [type] (int elemType) { return (elemType == type); });
+ auto pos2 = toQueue2(pos);
+ if (pos != m_queue1.rend() && pos2->PayloadString == payload)
{
SAL_INFO("lok", "Skipping queue duplicate [" << type << + "]: [" << payload << "].");
return;
@@ -1477,15 +1574,17 @@ void CallbackFlushHandler::queue(const int type, const char* data)
if (type == LOK_CALLBACK_TEXT_SELECTION && payload.empty())
{
- const auto& posStart = std::find_if(m_queue.rbegin(), m_queue.rend(),
- [] (const queue_type::value_type& elem) { return (elem.Type == LOK_CALLBACK_TEXT_SELECTION_START); });
- if (posStart != m_queue.rend())
- posStart->PayloadString.clear();
+ const auto& posStart = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
+ [] (int elemType) { return (elemType == LOK_CALLBACK_TEXT_SELECTION_START); });
+ auto posStart2 = toQueue2(posStart);
+ if (posStart != m_queue1.rend())
+ posStart2->PayloadString.clear();
- const auto& posEnd = std::find_if(m_queue.rbegin(), m_queue.rend(),
- [] (const queue_type::value_type& elem) { return (elem.Type == LOK_CALLBACK_TEXT_SELECTION_END); });
- if (posEnd != m_queue.rend())
- posEnd->PayloadString.clear();
+ const auto& posEnd = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
+ [] (int elemType) { return (elemType == LOK_CALLBACK_TEXT_SELECTION_END); });
+ auto posEnd2 = toQueue2(posEnd);
+ if (posEnd != m_queue1.rend())
+ posEnd2->PayloadString.clear();
}
// When payload is empty discards any previous state.
@@ -1500,7 +1599,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
case LOK_CALLBACK_INVALIDATE_TILES:
if (removeAll(
- [type](const queue_type::value_type& elem) { return (elem.Type == type); }))
+ [type](int elemType, const CallbackData&) { return (elemType == type); }))
SAL_INFO("lok", "Removed dups of [" << type << "]: [" << payload << "].");
break;
}
@@ -1524,7 +1623,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
case LOK_CALLBACK_RULER_UPDATE:
{
if (removeAll(
- [type](const queue_type::value_type& elem) { return (elem.Type == type); }))
+ [type](int elemType, const CallbackData&) { return (elemType == type); }))
SAL_INFO("lok", "Removed dups of [" << type << "]: [" << payload << "].");
}
break;
@@ -1548,15 +1647,15 @@ void CallbackFlushHandler::queue(const int type, const char* data)
payload.find("\"hyperlink\": {}") == std::string::npos;
const int nViewId = lcl_getViewId(payload);
removeAll(
- [type, nViewId, hyperLinkException] (const queue_type::value_type& elem) {
- return (elem.Type == type && nViewId == lcl_getViewId(elem) && !hyperLinkException);
+ [type, nViewId, hyperLinkException] (int elemType, const CallbackData& elemData) {
+ return (elemType == type && nViewId == lcl_getViewId(elemData) && !hyperLinkException);
}
);
}
break;
case LOK_CALLBACK_INVALIDATE_TILES:
- if (processInvalidateTilesEvent(aCallbackData))
+ if (processInvalidateTilesEvent(type, aCallbackData))
return;
break;
@@ -1574,8 +1673,8 @@ void CallbackFlushHandler::queue(const int type, const char* data)
if (name != ".uno:ModifiedStatus=")
{
removeAll(
- [type, &name] (const queue_type::value_type& elem) {
- return (elem.Type == type) && (elem.PayloadString.compare(0, name.size(), name) == 0);
+ [type, &name] (int elemType, const CallbackData& elemData) {
+ return (elemType == type) && (elemData.PayloadString.compare(0, name.size(), name) == 0);
}
);
}
@@ -1584,7 +1683,7 @@ void CallbackFlushHandler::queue(const int type, const char* data)
break;
case LOK_CALLBACK_WINDOW:
- if (processWindowEvent(aCallbackData))
+ if (processWindowEvent(type, aCallbackData))
return;
break;
@@ -1592,8 +1691,8 @@ void CallbackFlushHandler::queue(const int type, const char* data)
{
// remove only selection ranges and 'EMPTY' messages
// always send 'INPLACE' and 'INPLACE EXIT' messages
- removeAll([type, payload] (const queue_type::value_type& elem)
- { return (elem.Type == type && elem.PayloadString[0] != 'I'); });
+ removeAll([type, payload] (int elemType, const CallbackData& elemData)
+ { return (elemType == type && elemData.PayloadString[0] != 'I'); });
}
break;
}
@@ -1601,23 +1700,26 @@ void CallbackFlushHandler::queue(const int type, const char* data)
// Validate that the cached data and the payload string are identical.
assert(aCallbackData.validate() && "Cached callback payload object and string mismatch!");
- m_queue.emplace_back(aCallbackData);
- SAL_INFO("lok", "Queued #" << (m_queue.size() - 1) <<
- " [" << type << "]: [" << payload << "] to have " << m_queue.size() << " entries.");
+ m_queue1.emplace_back(type);
+ m_queue2.emplace_back(aCallbackData);
+ SAL_INFO("lok", "Queued #" << (m_queue1.size() - 1) <<
+ " [" << type << "]: [" << payload << "] to have " << m_queue1.size() << " entries.");
#ifdef DBG_UTIL
{
// Dump the queue state and validate cached data.
int i = 1;
std::ostringstream oss;
- if (m_queue.empty())
+ if (m_queue1.empty())
oss << "Empty";
else
- oss << m_queue.size() << " items\n";
- for (const CallbackData& c : m_queue)
- oss << i++ << ": [" << c.Type << "] [" << c.PayloadString << "].\n";
+ oss << m_queue1.size() << " items\n";
+ auto it1 = m_queue1.begin();
+ auto it2 = m_queue2.begin();
+ for (; it1 != m_queue1.end(); ++it1, ++it2)
+ oss << i++ << ": [" << *it1 << "] [" << it2->PayloadString << "].\n";
SAL_INFO("lok", "Current Queue: " << oss.str());
- for (const CallbackData& c : m_queue)
+ for (const CallbackData& c : m_queue2)
assert(c.validate());
}
#endif
@@ -1627,12 +1729,13 @@ void CallbackFlushHandler::queue(const int type, const char* data)
{
Start();
}
+ if (!m_TimeoutIdle.IsActive())
+ m_TimeoutIdle.Start();
}
-bool CallbackFlushHandler::processInvalidateTilesEvent(CallbackData& aCallbackData)
+bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& aCallbackData)
{
const std::string& payload = aCallbackData.PayloadString;
- const int type = aCallbackData.Type;
RectangleAndPart& rcNew = aCallbackData.setRectangleAndPart(payload);
if (rcNew.isEmpty())
@@ -1644,12 +1747,13 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(CallbackData& aCallbackDa
// If we have to invalidate all tiles, we can skip any new tile invalidation.
// Find the last INVALIDATE_TILES entry, if any to see if it's invalidate-all.
const auto& pos
- = std::find_if(m_queue.rbegin(), m_queue.rend(), [](const queue_type::value_type& elem) {
- return (elem.Type == LOK_CALLBACK_INVALIDATE_TILES);
+ = std::find_if(m_queue1.rbegin(), m_queue1.rend(), [](int elemType) {
+ return (elemType == LOK_CALLBACK_INVALIDATE_TILES);
});
- if (pos != m_queue.rend())
+ if (pos != m_queue1.rend())
{
- const RectangleAndPart& rcOld = pos->getRectangleAndPart();
+ auto pos2 = toQueue2(pos);
+ const RectangleAndPart& rcOld = pos2->getRectangleAndPart();
if (rcOld.isInfinite() && (rcOld.m_nPart == -1 || rcOld.m_nPart == rcNew.m_nPart))
{
SAL_INFO("lok", "Skipping queue [" << type << "]: [" << payload
@@ -1673,11 +1777,11 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(CallbackData& aCallbackDa
{
SAL_INFO("lok", "Have Empty [" << type << "]: [" << payload
<< "] so removing all with part " << rcNew.m_nPart << ".");
- removeAll([&rcNew](const queue_type::value_type& elem) {
- if (elem.Type == LOK_CALLBACK_INVALIDATE_TILES)
+ removeAll([&rcNew](int elemType, const CallbackData& elemData) {
+ if (elemType == LOK_CALLBACK_INVALIDATE_TILES)
{
// Remove exiting if new is all-encompassing, or if of the same part.
- const RectangleAndPart rcOld = RectangleAndPart::Create(elem.PayloadString);
+ const RectangleAndPart rcOld = RectangleAndPart::Create(elemData.PayloadString);
return (rcNew.m_nPart == -1 || rcOld.m_nPart == rcNew.m_nPart);
}
@@ -1690,10 +1794,10 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(CallbackData& aCallbackDa
const auto rcOrig = rcNew;
SAL_INFO("lok", "Have [" << type << "]: [" << payload << "] so merging overlapping.");
- removeAll([&rcNew](const queue_type::value_type& elem) {
- if (elem.Type == LOK_CALLBACK_INVALIDATE_TILES)
+ removeAll([&rcNew](int elemType, const CallbackData& elemData) {
+ if (elemType == LOK_CALLBACK_INVALIDATE_TILES)
{
- const RectangleAndPart& rcOld = elem.getRectangleAndPart();
+ const RectangleAndPart& rcOld = elemData.getRectangleAndPart();
if (rcNew.m_nPart != -1 && rcOld.m_nPart != -1 && rcOld.m_nPart != rcNew.m_nPart)
{
SAL_INFO("lok", "Nothing to merge between new: "
@@ -1762,10 +1866,9 @@ bool CallbackFlushHandler::processInvalidateTilesEvent(CallbackData& aCallbackDa
return false;
}
-bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData)
+bool CallbackFlushHandler::processWindowEvent(int type, CallbackData& aCallbackData)
{
const std::string& payload = aCallbackData.PayloadString;
- const int type = aCallbackData.Type;
boost::property_tree::ptree& aTree = aCallbackData.setJson(payload);
const unsigned nLOKWindowId = aTree.get<unsigned>("id", 0);
@@ -1777,10 +1880,10 @@ bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData)
// remove all previous window part invalidations
if (aRectStr.empty())
{
- removeAll([&nLOKWindowId](const queue_type::value_type& elem) {
- if (elem.Type == LOK_CALLBACK_WINDOW)
+ removeAll([&nLOKWindowId](int elemType, const CallbackData& elemData) {
+ if (elemType == LOK_CALLBACK_WINDOW)
{
- const boost::property_tree::ptree& aOldTree = elem.getJson();
+ const boost::property_tree::ptree& aOldTree = elemData.getJson();
if (nLOKWindowId == aOldTree.get<unsigned>("id", 0)
&& aOldTree.get<std::string>("action", "") == "invalidate")
{
@@ -1794,17 +1897,22 @@ bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData)
{
// if we have to invalidate all of the window, ignore
// any part invalidation message
- const auto invAllExist = std::any_of(m_queue.rbegin(), m_queue.rend(),
- [&nLOKWindowId] (const queue_type::value_type& elem)
- {
- if (elem.Type != LOK_CALLBACK_WINDOW)
- return false;
-
- const boost::property_tree::ptree& aOldTree = elem.getJson();
- return nLOKWindowId == aOldTree.get<unsigned>("id", 0)
- && aOldTree.get<std::string>("action", "") == "invalidate"
- && aOldTree.get<std::string>("rectangle", "").empty();
- });
+ bool invAllExist = false;
+ auto it1 = m_queue1.rbegin();
+ auto it2 = m_queue2.rbegin();
+ for (;it1 != m_queue1.rend(); ++it1, ++it2)
+ {
+ if (*it1 != LOK_CALLBACK_WINDOW)
+ continue;
+ const boost::property_tree::ptree& aOldTree = it2->getJson();
+ if (nLOKWindowId == aOldTree.get<unsigned>("id", 0)
+ && aOldTree.get<std::string>("action", "") == "invalidate"
+ && aOldTree.get<std::string>("rectangle", "").empty())
+ {
+ invAllExist = true;
+ break;
+ }
+ }
// we found a invalidate-all window callback
if (invAllExist)
@@ -1822,11 +1930,11 @@ bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData)
tools::Rectangle aNewRect(nLeft, nTop, nLeft + nWidth, nTop + nHeight);
bool currentIsRedundant = false;
removeAll([&aNewRect, &nLOKWindowId,
- &currentIsRedundant](const queue_type::value_type& elem) {
- if (elem.Type != LOK_CALLBACK_WINDOW)
+ &currentIsRedundant](int elemType, const CallbackData& elemData) {
+ if (elemType != LOK_CALLBACK_WINDOW)
return false;
- const boost::property_tree::ptree& aOldTree = elem.getJson();
+ const boost::property_tree::ptree& aOldTree = elemData.getJson();
if (aOldTree.get<std::string>("action", "") == "invalidate")
{
// Not possible that we encounter an empty rectangle here; we already handled this case above.
@@ -1897,10 +2005,10 @@ bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData)
else if (aAction == "created")
{
// Remove all previous actions on same dialog, if we are creating it anew.
- removeAll([&nLOKWindowId](const queue_type::value_type& elem) {
- if (elem.Type == LOK_CALLBACK_WINDOW)
+ removeAll([&nLOKWindowId](int elemType, const CallbackData& elemData) {
+ if (elemType == LOK_CALLBACK_WINDOW)
{
- const boost::property_tree::ptree& aOldTree = elem.getJson();
+ const boost::property_tree::ptree& aOldTree = elemData.getJson();
if (nLOKWindowId == aOldTree.get<unsigned>("id", 0))
return true;
}
@@ -1925,10 +2033,10 @@ bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData)
{
// A size change is practically re-creation of the window.
// But at a minimum it's a full invalidation.
- removeAll([&nLOKWindowId](const queue_type::value_type& elem) {
- if (elem.Type == LOK_CALLBACK_WINDOW)
+ removeAll([&nLOKWindowId](int elemType, const CallbackData& elemData) {
+ if (elemType == LOK_CALLBACK_WINDOW)
{
- const boost::property_tree::ptree& aOldTree = elem.getJson();
+ const boost::property_tree::ptree& aOldTree = elemData.getJson();
if (nLOKWindowId == aOldTree.get<unsigned>("id", 0))
{
const std::string aOldAction = aOldTree.get<std::string>("action", "");
@@ -1952,12 +2060,14 @@ void CallbackFlushHandler::Invoke()
{
std::scoped_lock<std::mutex> lock(m_mutex);
- SAL_INFO("lok", "Flushing " << m_queue.size() << " elements.");
- for (const auto& rCallbackData : m_queue)
+ SAL_INFO("lok", "Flushing " << m_queue1.size() << " elements.");
+ auto it1 = m_queue1.begin();
+ auto it2 = m_queue2.begin();
+ for (; it1 != m_queue1.end(); ++it1, ++it2)
{
- const int type = rCallbackData.Type;
- const auto& payload = rCallbackData.PayloadString;
- const int viewId = lcl_isViewCallbackType(type) ? lcl_getViewId(rCallbackData) : -1;
+ const int type = *it1;
+ const auto& payload = it2->PayloadString;
+ const int viewId = lcl_isViewCallbackType(type) ? lcl_getViewId(*it2) : -1;
if (viewId == -1)
{
@@ -2005,20 +2115,32 @@ void CallbackFlushHandler::Invoke()
m_pCallback(type, payload.c_str(), m_pData);
}
- m_queue.clear();
+ m_queue1.clear();
+ m_queue2.clear();
+ m_TimeoutIdle.Stop();
}
}
-bool CallbackFlushHandler::removeAll(const std::function<bool (const CallbackFlushHandler::queue_type::value_type&)>& rTestFunc)
+bool CallbackFlushHandler::removeAll(const std::function<bool (int, const CallbackData&)>& rTestFunc)
{
- auto newEnd = std::remove_if(m_queue.begin(), m_queue.end(), rTestFunc);
- if (newEnd != m_queue.end())
+ bool bErased = false;
+ auto it1 = m_queue1.begin();
+ auto it2 = m_queue2.begin();
+ while (it1 != m_queue1.end())
{
- m_queue.erase(newEnd, m_queue.end());
- return true;
+ if (rTestFunc(*it1, *it2))
+ {
+ it1 = m_queue1.erase(it1);
+ it2 = m_queue2.erase(it2);
+ bErased = true;
+ }
+ else
+ {
+ ++it1;
+ ++it2;
+ }
}
-
- return false;
+ return bErased;
}
void CallbackFlushHandler::addViewStates(int viewId)
@@ -2083,6 +2205,8 @@ static void lo_sendDialogEvent(LibreOfficeKit* pThis,
unsigned long long int nLOKWindowId,
const char* pArguments);
+static void lo_setOption(LibreOfficeKit* pThis, const char* pOption, const char* pValue);
+
LibLibreOffice_Impl::LibLibreOffice_Impl()
: m_pOfficeClass( gOfficeClass.lock() )
, maThread(nullptr)
@@ -2108,6 +2232,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl()
m_pOfficeClass->signDocument = lo_signDocument;
m_pOfficeClass->runLoop = lo_runLoop;
m_pOfficeClass->sendDialogEvent = lo_sendDialogEvent;
+ m_pOfficeClass->setOption = lo_setOption;
gOfficeClass = m_pOfficeClass;
}
@@ -2255,7 +2380,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
Application::SetDialogCancelMode(DialogCancelMode::LOKSilent);
}
- uno::Sequence<css::beans::PropertyValue> aFilterOptions(3);
+ uno::Sequence<css::beans::PropertyValue> aFilterOptions(4);
aFilterOptions[0] = css::beans::PropertyValue( "FilterOptions",
0,
uno::makeAny(aOptions),
@@ -2274,7 +2399,25 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
aFilterOptions[1].Name = "InteractionHandler";
aFilterOptions[1].Value <<= xInteraction;
- sal_Int16 nMacroExecMode = document::MacroExecMode::NEVER_EXECUTE;
+ int nMacroSecurityLevel = 1;
+ const OUString aMacroSecurityLevel = extractParameter(aOptions, "MacroSecurityLevel");
+ if (!aMacroSecurityLevel.isEmpty())
+ {
+ double nNumber;
+ sal_uInt32 nFormat = 1;
+ SvNumberFormatter aFormatter(::comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US);
+ if (aFormatter.IsNumberFormat(aMacroSecurityLevel, nFormat, nNumber))
+ nMacroSecurityLevel = static_cast<int>(nNumber);
+ }
+ SvtSecurityOptions().SetMacroSecurityLevel(nMacroSecurityLevel);
+
+#if defined(ANDROID) && HAVE_FEATURE_ANDROID_LOK
+ sal_Int16 nMacroExecMode = document::MacroExecMode::USE_CONFIG;
+#else
+ const OUString aEnableMacrosExecution = extractParameter(aOptions, "EnableMacrosExecution");
+ sal_Int16 nMacroExecMode = aEnableMacrosExecution == "true" ? document::MacroExecMode::USE_CONFIG :
+ document::MacroExecMode::NEVER_EXECUTE;
+#endif
aFilterOptions[2].Name = "MacroExecutionMode";
aFilterOptions[2].Value <<= nMacroExecMode;
@@ -2284,6 +2427,13 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
aFilterOptions[3].Value <<= nUpdateDoc;
*/
+ // set this explicitly false to be able to load template files
+ // as regular files, otherwise we cannot save them; it will try
+ // to bring saveas dialog which cannot work with LOK case
+ aFilterOptions[3].Name = "AsTemplate";
+ aFilterOptions[3].Value <<= false;
+
+
const int nThisDocumentId = nDocumentIdCounter++;
SfxViewShell::SetCurrentDocId(ViewShellDocId(nThisDocumentId));
uno::Reference<lang::XComponent> xComponent = xComponentLoader->loadComponentFromURL(
@@ -2593,6 +2743,34 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
bool bFullSheetPreview = sFullSheetPreview == "true";
+ // Select a pdf version if specified a valid one. If invalid then fail.
+ // If not specified then ignore.
+ sal_Int32 pdfVer = 0;
+ if ((aIndex = aFilterOptions.indexOf(",PDFVer=")) >= 0)
+ {
+ int bIndex = aFilterOptions.indexOf("PDFVEREND");
+ OUString sPdfVer = aFilterOptions.copy(aIndex+8, bIndex-(aIndex+8));
+
+ OUString temp = aFilterOptions.copy(0, aIndex);
+ aFilterOptions = temp + aFilterOptions.copy(bIndex+9);
+
+ if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-1b"))
+ pdfVer = 1;
+ else if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-2b"))
+ pdfVer = 2;
+ else if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-3b"))
+ pdfVer = 3;
+ else if (sPdfVer.equalsIgnoreAsciiCase("PDF-1.5"))
+ pdfVer = 15;
+ else if (sPdfVer.equalsIgnoreAsciiCase("PDF-1.6"))
+ pdfVer = 16;
+ else
+ {
+ SetLastExceptionMsg("wrong PDF version");
+ return false;
+ }
+ }
+
// 'TakeOwnership' == this is a 'real' SaveAs (that is, the document
// gets a new name). When this is not provided, the meaning of
// saveAs() is more like save-a-copy, which allows saving to any
@@ -2629,6 +2807,9 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
if (bFullSheetPreview)
aFilterDataMap["SinglePageSheets"] <<= true;
+ if (pdfVer)
+ aFilterDataMap["SelectPdfVersion"] <<= pdfVer;
+
if (!aFilterDataMap.empty())
{
aSaveMediaDescriptor["FilterData"] <<= aFilterDataMap.getAsConstPropertyValueList();
@@ -2688,6 +2869,7 @@ static void doc_iniUnoCommands ()
OUString(".uno:IncrementIndent"),
OUString(".uno:Italic"),
OUString(".uno:JustifyPara"),
+ OUString(".uno:JumpToMark"),
OUString(".uno:OutlineFont"),
OUString(".uno:LeftPara"),
OUString(".uno:LanguageStatus"),
@@ -2704,6 +2886,9 @@ static void doc_iniUnoCommands ()
OUString(".uno:InsertPage"),
OUString(".uno:DeletePage"),
OUString(".uno:DuplicatePage"),
+ OUString(".uno:InsertSlide"),
+ OUString(".uno:DeleteSlide"),
+ OUString(".uno:DuplicateSlide"),
OUString(".uno:Cut"),
OUString(".uno:Copy"),
OUString(".uno:Paste"),
@@ -2964,7 +3149,7 @@ static int doc_getPart (LibreOfficeKitDocument* pThis)
return pDoc->getPart();
}
-static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
+static void doc_setPartImpl(LibreOfficeKitDocument* pThis, int nPart, bool bAllowChangeFocus = true)
{
comphelper::ProfileZone aZone("doc_setPart");
@@ -2978,7 +3163,12 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
return;
}
- pDoc->setPart( nPart );
+ pDoc->setPart( nPart, bAllowChangeFocus );
+}
+
+static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
+{
+ doc_setPartImpl(pThis, nPart, true);
}
static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart)
@@ -3271,6 +3461,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
int nOrigPart = 0;
const bool isText = (doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT);
int nViewId = nOrigViewId;
+ int nLastNonEditorView = nViewId;
if (!isText)
{
// Check if just switching to another view is enough, that has
@@ -3280,9 +3471,15 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
- if (pViewShell->getPart() == nPart)
+ bool bIsInEdit = pViewShell->GetDrawView() &&
+ pViewShell->GetDrawView()->GetTextEditOutliner();
+ if (!bIsInEdit)
+ nLastNonEditorView = pViewShell->GetViewShellId().get();
+
+ if (pViewShell->getPart() == nPart && !bIsInEdit)
{
nViewId = static_cast<sal_Int32>(pViewShell->GetViewShellId());
+ nLastNonEditorView = nViewId;
doc_setView(pThis, nViewId);
break;
}
@@ -3290,10 +3487,18 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
}
}
+ // if not found view with correct part - at least avoid rendering active textbox
+ SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
+ if (pCurrentViewShell && pCurrentViewShell->GetDrawView() &&
+ pCurrentViewShell->GetDrawView()->GetTextEditOutliner())
+ {
+ doc_setView(pThis, nLastNonEditorView);
+ }
+
nOrigPart = doc_getPart(pThis);
if (nPart != nOrigPart)
{
- doc_setPart(pThis, nPart);
+ doc_setPartImpl(pThis, nPart, false);
}
}
@@ -3301,7 +3506,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
if (!isText && nPart != nOrigPart)
{
- doc_setPart(pThis, nOrigPart);
+ doc_setPartImpl(pThis, nOrigPart, false);
}
if (!isText && nViewId != nOrigViewId)
{
@@ -3494,6 +3699,12 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
}
}
+static void doc_setBlockedCommandList(LibreOfficeKitDocument* /*pThis*/, int nViewId, const char* bolckedCommandList)
+{
+ SolarMutexGuard aGuard;
+ SfxLokHelper::setBlockedCommandList(nViewId, bolckedCommandList);
+}
+
static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText)
{
comphelper::ProfileZone aZone("doc_postWindowExtTextInputEvent");
@@ -3650,6 +3861,7 @@ static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOu
}
aMediaDescriptor["SelectionOnly"] <<= true;
aMediaDescriptor["OutputStream"] <<= xOut;
+ aMediaDescriptor["IsPreview"] <<= true; // will down-scale graphics
xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
@@ -3796,6 +4008,20 @@ static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* pA
aMap["VALUE"] = aMap["data"];
pUIWindow->execute(sValue, aMap);
}
+ else if (sAction == "click" && sControlType == "drawingarea")
+ {
+ int separatorPos = aMap["data"].indexOf(';');
+ if (separatorPos > 0)
+ {
+ // x;y
+ aMap["POSX"] = aMap["data"].copy(0, separatorPos);
+ aMap["POSY"] = aMap["data"].copy(separatorPos + 1);
+
+ pUIWindow->execute(sClickAction, aMap);
+ }
+ else
+ bIsClickAction = true;
+ }
else
bIsClickAction = true;
@@ -3822,6 +4048,38 @@ static void lo_sendDialogEvent(LibreOfficeKit* /*pThis*/, unsigned long long int
lcl_sendDialogEvent(nWindowId, pArguments);
}
+static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const char* pValue)
+{
+ static char* pCurrentSalLogOverride = nullptr;
+
+ if (strcmp(pOption, "traceeventrecording") == 0)
+ {
+ if (strcmp(pValue, "start") == 0)
+ {
+ comphelper::TraceEvent::setBufferSizeAndCallback(100, TraceEventDumper::flushRecordings);
+ comphelper::TraceEvent::startRecording();
+ if (traceEventDumper == nullptr)
+ traceEventDumper = new TraceEventDumper();
+ }
+ else if (strcmp(pValue, "stop") == 0)
+ comphelper::TraceEvent::stopRecording();
+ }
+ else if (strcmp(pOption, "sallogoverride") == 0)
+ {
+ if (pCurrentSalLogOverride != nullptr)
+ free(pCurrentSalLogOverride);
+ if (pValue == nullptr)
+ pCurrentSalLogOverride = nullptr;
+ else
+ pCurrentSalLogOverride = strdup(pValue);
+
+ if (pCurrentSalLogOverride == nullptr || strlen(pCurrentSalLogOverride) == 0)
+ sal_detail_set_log_selector(nullptr);
+ else
+ sal_detail_set_log_selector(pCurrentSalLogOverride);
+ }
+}
+
static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished)
{
comphelper::ProfileZone aZone("doc_postUnoCommand");
@@ -3964,17 +4222,16 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
int nLeft = OutputDevice::LogicToLogic(aChartBB.Left(), MapUnit::MapTwip, MapUnit::Map100thMM);
int nTop = OutputDevice::LogicToLogic(aChartBB.Top(), MapUnit::MapTwip, MapUnit::Map100thMM);
- sal_Int32 value;
for (beans::PropertyValue& rPropValue: aPropertyValuesVector)
{
if (rPropValue.Name == "TransformPosX" || rPropValue.Name == "TransformRotationX")
{
- rPropValue.Value >>= value;
+ auto const value = *o3tl::doAccess<sal_Int32>(rPropValue.Value);
rPropValue.Value <<= value - nLeft;
}
else if (rPropValue.Name == "TransformPosY" || rPropValue.Name == "TransformRotationY")
{
- rPropValue.Value >>= value;
+ auto const value = *o3tl::doAccess<sal_Int32>(rPropValue.Value);
rPropValue.Value <<= value - nTop;
}
}
@@ -4645,43 +4902,25 @@ static char* getFonts (const char* pCommand)
static char* getFontSubset (const OString& aFontName)
{
OUString aFoundFont(::rtl::Uri::decode(OStringToOUString(aFontName, RTL_TEXTENCODING_UTF8), rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8));
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- const SvxFontListItem* pFonts = static_cast<const SvxFontListItem*>(
- pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST));
- const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr;
boost::property_tree::ptree aTree;
aTree.put("commandName", ".uno:FontSubset");
boost::property_tree::ptree aValues;
- if ( pList && !aFoundFont.isEmpty() )
+ if (const vcl::Font* pFont = FindFont(aFoundFont))
{
- sal_uInt16 nFontCount = pList->GetFontNameCount();
- sal_uInt16 nItFont = 0;
- for (; nItFont < nFontCount; ++nItFont)
- {
- if (aFoundFont == pList->GetFontName(nItFont).GetFamilyName())
- {
- break;
- }
- }
+ FontCharMapRef xFontCharMap (new FontCharMap());
+ auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
- if ( nItFont < nFontCount )
- {
- FontCharMapRef xFontCharMap (new FontCharMap());
- auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
- const vcl::Font& aFont(pList->GetFontName(nItFont));
+ aDevice->SetFont(*pFont);
+ aDevice->GetFontCharMap(xFontCharMap);
+ SubsetMap aSubMap(xFontCharMap);
- aDevice->SetFont(aFont);
- aDevice->GetFontCharMap(xFontCharMap);
- SubsetMap aSubMap(xFontCharMap);
-
- for (auto const& subset : aSubMap.GetSubsetMap())
- {
- boost::property_tree::ptree aChild;
- aChild.put("", static_cast<int>(ublock_getCode(subset.GetRangeMin())));
- aValues.push_back(std::make_pair("", aChild));
- }
+ for (auto const& subset : aSubMap.GetSubsetMap())
+ {
+ boost::property_tree::ptree aChild;
+ aChild.put("", static_cast<int>(ublock_getCode(subset.GetRangeMin())));
+ aValues.push_back(std::make_pair("", aChild));
}
}
@@ -5194,6 +5433,8 @@ static int doc_createViewWithOptions(LibreOfficeKitDocument* pThis,
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
const int nId = SfxLokHelper::createView(pDocument->mnDocumentId);
+ vcl::lok::numberOfViewsChanged(SfxLokHelper::getViewsCount(pDocument->mnDocumentId));
+
#ifdef IOS
(void) pThis;
#else
@@ -5208,7 +5449,7 @@ static int doc_createView(LibreOfficeKitDocument* pThis)
return doc_createViewWithOptions(pThis, nullptr); // No options.
}
-static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
+static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* pThis, int nId)
{
comphelper::ProfileZone aZone("doc_destroyView");
@@ -5218,6 +5459,9 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis
LOKClipboardFactory::releaseClipboardForView(nId);
SfxLokHelper::destroyView(nId);
+
+ LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
+ vcl::lok::numberOfViewsChanged(SfxLokHelper::getViewsCount(pDocument->mnDocumentId));
}
static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
@@ -5297,98 +5541,80 @@ unsigned char* doc_renderFontOrientation(SAL_UNUSED_PARAMETER LibreOfficeKitDocu
SolarMutexGuard aGuard;
SetLastExceptionMsg();
- OString aSearchedFontName(pFontName);
- OUString aText(OStringToOUString(pChar, RTL_TEXTENCODING_UTF8));
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
- const SvxFontListItem* pFonts = static_cast<const SvxFontListItem*>(
- pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST));
- const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr;
-
const int nDefaultFontSize = 25;
- if ( pList )
- {
- sal_uInt16 nFontCount = pList->GetFontNameCount();
- for (sal_uInt16 i = 0; i < nFontCount; ++i)
- {
- const FontMetric& rFontMetric = pList->GetFontName(i);
- const OUString& aFontName = rFontMetric.GetFamilyName();
- if (aSearchedFontName != aFontName.toUtf8())
- continue;
-
- if (aText.isEmpty())
- aText = rFontMetric.GetFamilyName();
+ auto aFont = FindFont_FallbackToDefault(OStringToOUString(pFontName, RTL_TEXTENCODING_UTF8));
- auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
- ::tools::Rectangle aRect;
- vcl::Font aFont(rFontMetric);
- aFont.SetFontSize(Size(0, nDefaultFontSize));
- aFont.SetOrientation(pOrientation);
- aDevice->SetFont(aFont);
- aDevice->GetTextBoundRect(aRect, aText);
- if (aRect.IsEmpty())
- break;
+ OUString aText(OStringToOUString(pChar, RTL_TEXTENCODING_UTF8));
+ if (aText.isEmpty())
+ aText = aFont.GetFamilyName();
+
+ auto aDevice(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT));
+ ::tools::Rectangle aRect;
+ aFont.SetFontSize(Size(0, nDefaultFontSize));
+ aFont.SetOrientation(pOrientation);
+ aDevice->SetFont(aFont);
+ aDevice->GetTextBoundRect(aRect, aText);
+ if (aRect.IsEmpty())
+ return nullptr;
- int nFontWidth = aRect.BottomRight().X() + 1;
- int nFontHeight = aRect.BottomRight().Y() + 1;
+ int nFontWidth = aRect.BottomRight().X() + 1;
+ int nFontHeight = aRect.BottomRight().Y() + 1;
- if (!(nFontWidth > 0 && nFontHeight > 0))
- break;
+ if (!(nFontWidth > 0 && nFontHeight > 0))
+ return nullptr;
- if (*pFontWidth > 0 && *pFontHeight > 0)
- {
- double fScaleX = *pFontWidth / static_cast<double>(nFontWidth) / 1.5;
- double fScaleY = *pFontHeight / static_cast<double>(nFontHeight) / 1.5;
+ if (*pFontWidth > 0 && *pFontHeight > 0)
+ {
+ double fScaleX = *pFontWidth / static_cast<double>(nFontWidth) / 1.5;
+ double fScaleY = *pFontHeight / static_cast<double>(nFontHeight) / 1.5;
- double fScale = std::min(fScaleX, fScaleY);
+ double fScale = std::min(fScaleX, fScaleY);
- if (fScale >= 1.0)
- {
- int nFontSize = fScale * nDefaultFontSize;
- aFont.SetFontSize(Size(0, nFontSize));
- aDevice->SetFont(aFont);
- }
+ if (fScale >= 1.0)
+ {
+ int nFontSize = fScale * nDefaultFontSize;
+ aFont.SetFontSize(Size(0, nFontSize));
+ aDevice->SetFont(aFont);
+ }
- aRect = tools::Rectangle(0, 0, *pFontWidth, *pFontHeight);
+ aRect = tools::Rectangle(0, 0, *pFontWidth, *pFontHeight);
- nFontWidth = *pFontWidth;
- nFontHeight = *pFontHeight;
+ nFontWidth = *pFontWidth;
+ nFontHeight = *pFontHeight;
- }
+ }
- unsigned char* pBuffer = static_cast<unsigned char*>(malloc(4 * nFontWidth * nFontHeight));
- if (!pBuffer)
- break;
+ unsigned char* pBuffer = static_cast<unsigned char*>(malloc(4 * nFontWidth * nFontHeight));
+ if (!pBuffer)
+ return nullptr;
- memset(pBuffer, 0, nFontWidth * nFontHeight * 4);
- aDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice->SetOutputSizePixelScaleOffsetAndBuffer(
- Size(nFontWidth, nFontHeight), Fraction(1.0), Point(),
- pBuffer);
+ memset(pBuffer, 0, nFontWidth * nFontHeight * 4);
+ aDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ aDevice->SetOutputSizePixelScaleOffsetAndBuffer(
+ Size(nFontWidth, nFontHeight), Fraction(1.0), Point(),
+ pBuffer);
- if (*pFontWidth > 0 && *pFontHeight > 0)
- {
- DrawTextFlags const nStyle =
- DrawTextFlags::Center
- | DrawTextFlags::VCenter
- | DrawTextFlags::MultiLine
- | DrawTextFlags::WordBreak;// | DrawTextFlags::WordBreakHyphenation ;
+ if (*pFontWidth > 0 && *pFontHeight > 0)
+ {
+ DrawTextFlags const nStyle =
+ DrawTextFlags::Center
+ | DrawTextFlags::VCenter
+ | DrawTextFlags::MultiLine
+ | DrawTextFlags::WordBreak;// | DrawTextFlags::WordBreakHyphenation ;
- aDevice->DrawText(aRect, aText, nStyle);
- }
- else
- {
- *pFontWidth = nFontWidth;
- *pFontHeight = nFontHeight;
+ aDevice->DrawText(aRect, aText, nStyle);
+ }
+ else
+ {
+ *pFontWidth = nFontWidth;
+ *pFontHeight = nFontHeight;
- aDevice->DrawText(Point(0,0), aText);
- }
+ aDevice->DrawText(Point(0,0), aText);
+ }
- return pBuffer;
- }
- }
- return nullptr;
+ return pBuffer;
}
@@ -5933,7 +6159,7 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
static bool bInitialized = false;
-static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit::statusIndicatorCallbackType type, int percent)
+static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit::statusIndicatorCallbackType type, int percent, const char* pText)
{
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(data);
@@ -5943,7 +6169,7 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
switch (type)
{
case comphelper::LibreOfficeKit::statusIndicatorCallbackType::Start:
- pLib->mpCallback(LOK_CALLBACK_STATUS_INDICATOR_START, nullptr, pLib->mpCallbackData);
+ pLib->mpCallback(LOK_CALLBACK_STATUS_INDICATOR_START, pText, pLib->mpCallbackData);
break;
case comphelper::LibreOfficeKit::statusIndicatorCallbackType::SetValue:
pLib->mpCallback(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE,
@@ -6052,31 +6278,6 @@ static void preloadData()
rtl::Bootstrap::set("UserInstallation", sUserPath);
}
-class ProfileZoneDumper : public AutoTimer
-{
- static const int dumpTimeoutMS = 5000;
-public:
- ProfileZoneDumper() : AutoTimer( "zone dumper" )
- {
- SetTimeout(dumpTimeoutMS);
- Start();
- }
- virtual void Invoke() override
- {
- const css::uno::Sequence<OUString> aEvents =
- comphelper::ProfileRecording::getRecordingAndClear();
- OStringBuffer aOutput;
- for (const auto &s : aEvents)
- {
- aOutput.append(OUStringToOString(s, RTL_TEXTENCODING_UTF8));
- aOutput.append("\n");
- }
- OString aChunk = aOutput.makeStringAndClear();
- if (gImpl && gImpl->mpCallback)
- gImpl->mpCallback(LOK_CALLBACK_PROFILE_FRAME, aChunk.getStr(), gImpl->mpCallbackData);
- }
-};
-
static void activateNotebookbar(const OUString& rApp)
{
OUString aPath = "org.openoffice.Office.UI.ToolbarMode/Applications/" + rApp;
@@ -6085,10 +6286,29 @@ static void activateNotebookbar(const OUString& rApp)
if (aAppNode.isValid())
{
- aAppNode.setNodeValue("Active", makeAny(OUString("notebookbar.ui")));
+ aAppNode.setNodeValue("Active", makeAny(OUString("notebookbar_online.ui")));
aAppNode.commit();
}
}
+void setCertificateDir()
+{
+ const char* pEnvVarString = ::getenv("LO_CERTIFICATE_DATABASE_PATH");
+ if (pEnvVarString)
+ {
+ OUString aCertificateDatabasePath = OStringToOUString(pEnvVarString, RTL_TEXTENCODING_UTF8);
+ try
+ {
+ std::shared_ptr<comphelper::ConfigurationChanges> pBatch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::Common::Security::Scripting::CertDir::set(aCertificateDatabasePath, pBatch);
+ officecfg::Office::Common::Security::Scripting::ManualCertDir::set(aCertificateDatabasePath, pBatch);
+ pBatch->commit();
+ }
+ catch (uno::Exception const& rException)
+ {
+ SAL_WARN("lok", "Failed to set the NSS certificate database directory: " << rException.Message);
+ }
+ }
+}
static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char* pUserProfileUrl)
{
@@ -6144,16 +6364,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
// Turn profile zones on early
if (bProfileZones && eStage == SECOND_INIT)
{
- comphelper::ProfileRecording::startRecording(true);
- new ProfileZoneDumper();
+ comphelper::TraceEvent::startRecording();
+ traceEventDumper = new TraceEventDumper();
}
comphelper::ProfileZone aZone("lok-init");
if (eStage == PRE_INIT)
rtl_alloc_preInit(true);
- else if (eStage == SECOND_INIT)
- rtl_alloc_preInit(false);
if (eStage != SECOND_INIT)
comphelper::LibreOfficeKit::setActive();
@@ -6399,6 +6617,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
}
#endif
+ setCertificateDir();
+
if (bNotebookbar)
{
activateNotebookbar("Writer");
@@ -6407,6 +6627,10 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
activateNotebookbar("Draw");
}
+ // staticize all strings.
+ if (eStage == PRE_INIT)
+ rtl_alloc_preInit(false);
+
return bInitialized;
}
diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx
index 3ee9c891f6ea..13b6361d6436 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -41,6 +41,8 @@
#include <com/sun/star/task/DocumentPasswordRequest2.hpp>
#include <com/sun/star/task/DocumentMSPasswordRequest2.hpp>
+#include <com/sun/star/document/FilterOptionsRequest.hpp>
+
#include "../../inc/lib/init.hxx"
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -330,6 +332,41 @@ bool LOKInteractionHandler::handlePasswordRequest(const uno::Sequence<uno::Refer
return true;
}
+bool LOKInteractionHandler::handleFilterOptionsRequest(const uno::Reference<task::XInteractionRequest>& xRequest)
+{
+ document::FilterOptionsRequest aFilterOptionsRequest;
+ uno::Any const request(xRequest->getRequest());
+ if (request >>= aFilterOptionsRequest)
+ {
+ uno::Reference< task::XInteractionHandler2 > xInteraction(
+ task::InteractionHandler::createWithParent(
+ ::comphelper::getProcessComponentContext(), nullptr));
+
+ if (xInteraction.is())
+ xInteraction->handleInteractionRequest(xRequest);
+
+ return true;
+ }
+ return false;
+}
+
+bool LOKInteractionHandler::handleMacroConfirmationRequest(const uno::Reference<task::XInteractionRequest>& xRequest)
+{
+ uno::Any const request(xRequest->getRequest());
+
+ task::DocumentMacroConfirmationRequest aConfirmRequest;
+ if (request >>= aConfirmRequest)
+ {
+ auto xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr));
+
+ if (xInteraction.is())
+ xInteraction->handleInteractionRequest(xRequest);
+
+ return true;
+ }
+ return false;
+}
+
sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(
const uno::Reference<task::XInteractionRequest>& xRequest)
{
@@ -345,18 +382,11 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(
if (handlePasswordRequest(rContinuations, request))
return true;
- task::DocumentMacroConfirmationRequest aConfirmRequest;
- if (request >>= aConfirmRequest)
- {
- uno::Reference< task::XInteractionHandler2 > xInteraction(
- task::InteractionHandler::createWithParent(
- ::comphelper::getProcessComponentContext(), nullptr));
-
- if (xInteraction.is())
- xInteraction->handleInteractionRequest(xRequest);
+ if (handleFilterOptionsRequest(xRequest))
+ return true;
+ if (handleMacroConfirmationRequest(xRequest))
return true;
- }
// TODO: perform more interactions 'for real' like the above
selectApproved(rContinuations);
diff --git a/desktop/source/lib/lokinteractionhandler.hxx b/desktop/source/lib/lokinteractionhandler.hxx
index f6dc441327d8..20396386518f 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -76,6 +76,8 @@ private:
bool handleIOException(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
bool handleNetworkException(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
bool handlePasswordRequest(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
+ bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request);
+ bool handleMacroConfirmationRequest(const css::uno::Reference<css::task::XInteractionRequest>& xRequest);
public:
void SetPassword(char const* pPassword);
diff --git a/distro-configs/CPAndroidBranding.conf b/distro-configs/CPAndroidBranding.conf
index 7d242f78fd07..3331bd483702 100644
--- a/distro-configs/CPAndroidBranding.conf
+++ b/distro-configs/CPAndroidBranding.conf
@@ -9,4 +9,5 @@
--disable-scripting-javascript
--with-lang=de en-US es fr pt-BR zh-CN zh-TW
--with-myspell-dicts
+--enable-pdfimport
--enable-release-build
diff --git a/distro-configs/LibreOfficeAndroid.conf b/distro-configs/LibreOfficeAndroid.conf
index 3ff76a8d60a9..82bc4afe0029 100644
--- a/distro-configs/LibreOfficeAndroid.conf
+++ b/distro-configs/LibreOfficeAndroid.conf
@@ -8,3 +8,4 @@
--without-junit
--disable-largefile
--with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidAarch64.conf b/distro-configs/LibreOfficeAndroidAarch64.conf
index bfc948c021f7..27ad9d1c788c 100644
--- a/distro-configs/LibreOfficeAndroidAarch64.conf
+++ b/distro-configs/LibreOfficeAndroidAarch64.conf
@@ -7,3 +7,4 @@
--without-helppack-integration
--without-junit
--with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86.conf b/distro-configs/LibreOfficeAndroidX86.conf
index 8fc92786c5e7..2692d796195b 100644
--- a/distro-configs/LibreOfficeAndroidX86.conf
+++ b/distro-configs/LibreOfficeAndroidX86.conf
@@ -8,3 +8,4 @@
--without-junit
--disable-largefile
--with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeAndroidX86_64.conf b/distro-configs/LibreOfficeAndroidX86_64.conf
index efbbdbb1e945..afc917d9a3f7 100644
--- a/distro-configs/LibreOfficeAndroidX86_64.conf
+++ b/distro-configs/LibreOfficeAndroidX86_64.conf
@@ -8,3 +8,4 @@
--without-junit
--disable-largefile
--with-theme=colibre
+--disable-poppler
diff --git a/distro-configs/LibreOfficeiOS.conf b/distro-configs/LibreOfficeiOS.conf
index 33471127e14f..c08cb87ce920 100644
--- a/distro-configs/LibreOfficeiOS.conf
+++ b/distro-configs/LibreOfficeiOS.conf
@@ -22,7 +22,7 @@
--disable-kf5
--disable-odk
--disable-openssl
---disable-pdfium
+--disable-poppler
--disable-python
--without-tls
diff --git a/download.lst b/download.lst
index de6bc1d8b2f6..cbdcccf7fb55 100644
--- a/download.lst
+++ b/download.lst
@@ -12,8 +12,8 @@ export BREAKPAD_SHA256SUM := 7060149be16a8789b0ccf596bdeaf63115f03f520acb508f72a
export BREAKPAD_TARBALL := breakpad.zip
export BSH_SHA256SUM := 9e93c73e23aff644b17dfff656444474c14150e7f3b38b19635e622235e01c96
export BSH_TARBALL := beeca87be45ec87d241ddd0e1bad80c1-bsh-2.0b6-src.zip
-export BZIP2_SHA256SUM := a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd
-export BZIP2_TARBALL := 00b516f4704d4a7cb50a1d97e6e8e15b-bzip2-1.0.6.tar.gz
+export BZIP2_SHA256SUM := ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269
+export BZIP2_TARBALL := bzip2-1.0.8.tar.gz
export CAIRO_SHA256SUM := 5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331
export CAIRO_VERSION_MICRO := 0
export CAIRO_TARBALL := cairo-1.16.$(CAIRO_VERSION_MICRO).tar.xz
@@ -29,8 +29,14 @@ export CPPUNIT_SHA256SUM := 3d569869d27b48860210c758c4f313082103a5e58219a7669b52
export CPPUNIT_TARBALL := cppunit-1.14.0.tar.gz
export CT2N_SHA256SUM := 71b238efd2734be9800af07566daea8d6685aeed28db5eb5fa0e6453f4d85de3
export CT2N_TARBALL := 1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt
-export CURL_SHA256SUM := cdf18794393d8bead915312708a9e5d819c6e9919de14b20d5c8e7987abd9772
-export CURL_TARBALL := curl-7.71.0.tar.xz
+# three static lines
+# so that git cherry-pick
+# will not run into conflicts
+export CURL_SHA256SUM := 0a381cd82f4d00a9a334438b8ca239afea5bfefcfa9a1025f2bf118e79e0b5f0
+export CURL_TARBALL := curl-8.0.1.tar.xz
+# three static lines
+# so that git cherry-pick
+# will not run into conflicts
export EBOOK_SHA256SUM := 7e8d8ff34f27831aca3bc6f9cc532c2f90d2057c778963b884ff3d1e34dfe1f9
export EBOOK_TARBALL := libe-book-0.1.3.tar.xz
export EPOXY_SHA256SUM := 002958c5528321edd53440235d3c44e71b5b1e09b9177e8daf677450b6c4433d
@@ -39,11 +45,11 @@ export EPM_SHA256SUM := b3fc4c5445de6c9a801504a3ea3efb2d4ea9d5a622c9427e716736e7
export EPM_TARBALL := 3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz
export EPUBGEN_SHA256SUM := 03e084b994cbeffc8c3dd13303b2cb805f44d8f2c3b79f7690d7e3fc7f6215ad
export EPUBGEN_TARBALL := libepubgen-0.1.1.tar.xz
-export ETONYEK_SHA256SUM := e61677e8799ce6e55b25afc11aa5339113f6a49cff031f336e32fa58635b1a4a
-export ETONYEK_VERSION_MICRO := 9
+export ETONYEK_SHA256SUM := b430435a6e8487888b761dc848b7981626eb814884963ffe25eb26a139301e9a
+export ETONYEK_VERSION_MICRO := 10
export ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.xz
-export EXPAT_SHA256SUM := 9a130948b05a82da34e4171d5f5ae5d321d9630277af02c8fa51e431f6475102
-export EXPAT_TARBALL := expat-2.2.8.tar.bz2
+export EXPAT_SHA256SUM := ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe
+export EXPAT_TARBALL := expat-2.5.0.tar.xz
export FIREBIRD_SHA256SUM := 6994be3555e23226630c587444be19d309b25b0fcf1f87df3b4e3f88943e5860
export FIREBIRD_TARBALL := Firebird-3.0.0.32483-0.tar.bz2
export FONTCONFIG_SHA256SUM := 19e5b1bc9d013a52063a44e1307629711f0bfef35b9aca16f9c793971e2eb1e5
@@ -180,12 +186,12 @@ export LIBTOMMATH_SHA256SUM := 083daa92d8ee6f4af96a6143b12d7fc8fe1a547e14f862304
export LIBTOMMATH_TARBALL := ltm-1.0.zip
export XMLSEC_SHA256SUM := 13eec4811ea30e3f0e16a734d1dbf7f9d246a71d540b48d143a07b489f6222d4
export XMLSEC_TARBALL := xmlsec1-1.2.28.tar.gz
-export LIBXML_SHA256SUM := aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
-export LIBXML_VERSION_MICRO := 10
-export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz
-export LIBXSLT_SHA256SUM := 98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f
-export LIBXSLT_VERSION_MICRO := 34
-export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.gz
+export LIBXML_SHA256SUM := 5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c
+export LIBXML_VERSION_MICRO := 3
+export LIBXML_TARBALL := libxml2-2.10.$(LIBXML_VERSION_MICRO).tar.xz
+export LIBXSLT_SHA256SUM := 8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79
+export LIBXSLT_VERSION_MICRO := 35
+export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.xz
export LPSOLVE_SHA256SUM := 171816288f14215c69e730f7a4f1c325739873e21f946ff83884b350574e6695
export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz
export LXML_SHA256SUM := 940caef1ec7c78e0c34b0f6b94fe42d0f2022915ffc78643d28538a5cfd0f40e
@@ -198,26 +204,26 @@ export MDNSRESPONDER_SHA256SUM := e777b4d7dbf5eb1552cb80090ad1ede319067ab6e45e39
export MDNSRESPONDER_TARBALL := mDNSResponder-878.200.35.tar.gz
export MSPUB_SHA256SUM := ef36c1a1aabb2ba3b0bedaaafe717bf4480be2ba8de6f3894be5fd3702b013ba
export MSPUB_TARBALL := libmspub-0.1.4.tar.xz
-export MWAW_SHA256SUM := 0440bb09f05e3419423d8dfa36ee847056ebfd837f9cbc091fdb5b057daab0b1
-export MWAW_VERSION_MICRO := 15
+export MWAW_SHA256SUM := 0c639edba5297bde5575193bf5b5f2f469956beaff5c0206d91ce9df6bde1868
+export MWAW_VERSION_MICRO := 16
export MWAW_TARBALL := libmwaw-0.3.$(MWAW_VERSION_MICRO).tar.xz
export MYTHES_SHA256SUM := 1e81f395d8c851c3e4e75b568e20fa2fa549354e75ab397f9de4b0e0790a305f
export MYTHES_TARBALL := a8c2c5b8f09e7ede322d5c602ff6a4b6-mythes-1.2.4.tar.gz
export NEON_SHA256SUM := db0bd8cdec329b48f53a6f00199c92d5ba40b0f015b153718d1b15d3d967fbca
export NEON_TARBALL := neon-0.30.2.tar.gz
-export NSS_SHA256SUM := ec6032d78663c6ef90b4b83eb552dedf721d2bce208cec3bf527b8f637db7e45
-export NSS_TARBALL := nss-3.55-with-nspr-4.27.tar.gz
-export ODFGEN_SHA256SUM := 2c7b21892f84a4c67546f84611eccdad6259875c971e98ddb027da66ea0ac9c2
-export ODFGEN_VERSION_MICRO := 6
-export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.bz2
+export NSS_SHA256SUM := fcfa26d2738ec5b0cf72ab4be784eac832a75132cda2e295799c04d62a93607a
+export NSS_TARBALL := nss-3.88.1-with-nspr-4.35.tar.gz
+export ODFGEN_SHA256SUM := 55200027fd46623b9bdddd38d275e7452d1b0ff8aeddcad6f9ae6dc25f610625
+export ODFGEN_VERSION_MICRO := 8
+export ODFGEN_TARBALL := libodfgen-0.1.$(ODFGEN_VERSION_MICRO).tar.xz
export ODFVALIDATOR_SHA256SUM := d55495ab3a86544650587de2a72180ddf8bfc6376d14ddfa923992dbc86a06e0
export ODFVALIDATOR_JAR := odfvalidator-0.9.0-RC2-SNAPSHOT-jar-with-dependencies-2726ab578664434a545f8379a01a9faffac0ae73.jar
export OFFICEOTRON_SHA256SUM := f2443f27561af52324eee03a1892d9f569adc8db9e7bca55614898bc2a13a770
export OFFICEOTRON_JAR := 8249374c274932a21846fa7629c2aa9b-officeotron-0.7.4-master.jar
-export OPENLDAP_SHA256SUM := cdd6cffdebcd95161a73305ec13fc7a78e9707b46ca9f84fb897cd5626df3824
-export OPENLDAP_TARBALL := openldap-2.4.45.tgz
-export OPENSSL_SHA256SUM := 14cb464efe7ac6b54799b34456bd69558a749a4931ecfd9cf9f71d7881cac7bc
-export OPENSSL_TARBALL := openssl-1.0.2t.tar.gz
+export OPENLDAP_SHA256SUM := 99f37d6747d88206c470067eda624d5e48c1011e943ec0ab217bae8712e22f34
+export OPENLDAP_TARBALL := openldap-2.4.59.tgz
+export OPENSSL_SHA256SUM := 8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b
+export OPENSSL_TARBALL := openssl-1.1.1t.tar.gz
export ORCUS_SHA256SUM := 0dd26f3f2e611c51df9ee02d6dbf08887989eaa417b73f6877cd0d94df795fc2
export ORCUS_TARBALL := liborcus-0.15.3.tar.gz
export OWNCLOUD_ANDROID_LIB_SHA256SUM := b18b3e3ef7fae6a79b62f2bb43cc47a5346b6330f6a383dc4be34439aca5e9fb
@@ -230,12 +236,12 @@ export PIXMAN_SHA256SUM := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
export LIBPNG_SHA256SUM := 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
export LIBPNG_TARBALL := libpng-1.6.37.tar.xz
-export POPPLER_SHA256SUM := 016dde34e5f868ea98a32ca99b643325a9682281500942b7113f4ec88d20e2f3
-export POPPLER_TARBALL := poppler-21.01.0.tar.xz
-export POSTGRESQL_SHA256SUM := a754c02f7051c2f21e52f8669a421b50485afcde9a581674d6106326b189d126
-export POSTGRESQL_TARBALL := postgresql-9.2.24.tar.bz2
-export PYTHON_SHA256SUM := 06a0a9f1bf0d8cd1e4121194d666c4e28ddae4dd54346de6c343206599f02136
-export PYTHON_TARBALL := Python-3.7.7.tar.xz
+export POPPLER_SHA256SUM := d7a8f748211359cadb774ba3e18ecda6464b34027045c0648eb30d5852a41e2e
+export POPPLER_TARBALL := poppler-22.09.0.tar.xz
+export POSTGRESQL_SHA256SUM := 5bbcf5a56d85c44f3a8b058fb46862ff49cbc91834d07e295d02e6de3c216df2
+export POSTGRESQL_TARBALL := postgresql-13.10.tar.bz2
+export PYTHON_SHA256SUM := d85dbb3774132473d8081dcb158f34a10ccad7a90b96c7e50ea4bb61f5ce4562
+export PYTHON_TARBALL := Python-3.8.16.tar.xz
export QRCODEGEN_SHA256SUM := fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
export QXP_SHA256SUM := e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
@@ -251,8 +257,8 @@ export REVENGE_VERSION_MICRO := 4
export REVENGE_TARBALL := librevenge-0.0.$(REVENGE_VERSION_MICRO).tar.bz2
export RHINO_SHA256SUM := 1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131df34e21753
export RHINO_TARBALL := 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
-export SERF_SHA256SUM := 6988d394b62c3494635b6f0760bc3079f9a0cd380baf0f6b075af1eb9fa5e700
-export SERF_TARBALL := serf-1.2.1.tar.bz2
+export SERF_SHA256SUM := 549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc
+export SERF_TARBALL := serf-1.3.9.tar.bz2
export STAROFFICE_SHA256SUM := 6b00e1ed8194e6072be4441025d1b888e39365727ed5b23e0e8c92c4009d1ec4
export STAROFFICE_VERSION_MICRO := 6
export STAROFFICE_TARBALL := libstaroffice-0.0.$(STAROFFICE_VERSION_MICRO).tar.xz
@@ -275,8 +281,8 @@ export WPS_VERSION_MICRO := 10
export WPS_TARBALL := libwps-0.4.$(WPS_VERSION_MICRO).tar.xz
export XSLTML_SHA256SUM := 75823776fb51a9c526af904f1503a7afaaab900fba83eda64f8a41073724c870
export XSLTML_TARBALL := a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
-export ZLIB_SHA256SUM := 4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
-export ZLIB_TARBALL := zlib-1.2.11.tar.xz
+export ZLIB_SHA256SUM := d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98
+export ZLIB_TARBALL := zlib-1.2.13.tar.xz
export ZMF_SHA256SUM := 27051a30cb057fdb5d5de65a1f165c7153dc76e27fe62251cbb86639eb2caf22
export ZMF_TARBALL := libzmf-0.0.2.tar.xz
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 1cbd664d3eb1..46d58551ef34 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -917,13 +917,6 @@ GradientStyle convertGradientStyle(drawinglayer::attribute::GradientStyle eGradi
GradientStyle eGradientStyle = convertGradientStyle(rFillGradient.getStyle());
- basegfx::B2DRange aRange(rPrimitive.getOutputRange());
- aRange.transform(maCurrentTransformation);
-
- const tools::Rectangle aRectangle(
- sal_Int32(std::floor(aRange.getMinX())), sal_Int32(std::floor(aRange.getMinY())),
- sal_Int32(std::ceil(aRange.getMaxX())), sal_Int32(std::ceil(aRange.getMaxY())));
-
Gradient aGradient(eGradientStyle, Color(rFillGradient.getStartColor()),
Color(rFillGradient.getEndColor()));
@@ -933,7 +926,22 @@ GradientStyle convertGradientStyle(drawinglayer::attribute::GradientStyle eGradi
aGradient.SetOfsY(rFillGradient.getOffsetY() * 100.0);
aGradient.SetSteps(rFillGradient.getSteps());
- mpOutputDevice->DrawGradient(aRectangle, aGradient);
+ basegfx::B2DRange aOutputRange(rPrimitive.getOutputRange());
+ aOutputRange.transform(maCurrentTransformation);
+ basegfx::B2DRange aFullRange(rPrimitive.getDefinitionRange());
+ aFullRange.transform(maCurrentTransformation);
+
+ const tools::Rectangle aOutputRectangle(
+ std::floor(aOutputRange.getMinX()), std::floor(aOutputRange.getMinY()),
+ std::ceil(aOutputRange.getMaxX()), std::ceil(aOutputRange.getMaxY()));
+ const tools::Rectangle aFullRectangle(
+ std::floor(aFullRange.getMinX()), std::floor(aFullRange.getMinY()),
+ std::ceil(aFullRange.getMaxX()), std::ceil(aFullRange.getMaxY()));
+
+ mpOutputDevice->Push(PushFlags::CLIPREGION);
+ mpOutputDevice->IntersectClipRegion(aOutputRectangle);
+ mpOutputDevice->DrawGradient(aFullRectangle, aGradient);
+ mpOutputDevice->Pop();
}
} // end of namespace processor2d
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 69f9e33215a8..9ad9e1a78c26 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -346,7 +346,7 @@ namespace emfplushelper
}
else // we use a pen
{
- const EMFPPen* pen = static_cast<EMFPPen*>(maEMFPObjects[brushIndexOrColor & 0xff].get());
+ const EMFPPen* pen = dynamic_cast<EMFPPen*>(maEMFPObjects[brushIndexOrColor & 0xff].get());
if (pen)
{
color = pen->GetColor();
@@ -620,7 +620,7 @@ namespace emfplushelper
}
else // use Brush
{
- EMFPBrush* brush = static_cast<EMFPBrush*>( maEMFPObjects[brushIndexOrColor & 0xff].get() );
+ EMFPBrush* brush = dynamic_cast<EMFPBrush*>( maEMFPObjects[brushIndexOrColor & 0xff].get() );
SAL_INFO("drawinglayer", "EMF+\t Fill polygon, brush slot: " << brushIndexOrColor << " (brush type: " << (brush ? brush->GetType() : -1) << ")");
// give up in case something wrong happened
@@ -1120,7 +1120,11 @@ namespace emfplushelper
rMS.ReadUInt32(brushIndexOrColor);
SAL_INFO("drawinglayer", "EMF+ FillRegion slot: " << index);
- EMFPPlusFillPolygon(static_cast<EMFPRegion*>(maEMFPObjects[flags & 0xff].get())->regionPolyPolygon, flags & 0x8000, brushIndexOrColor);
+ EMFPRegion* region = dynamic_cast<EMFPRegion*>(maEMFPObjects[flags & 0xff].get());
+ if (region)
+ EMFPPlusFillPolygon(region->regionPolyPolygon, flags & 0x8000, brushIndexOrColor);
+ else
+ SAL_WARN("drawinglayer.emf", "EMF+\tEmfPlusRecordTypeFillRegion missing region");
}
break;
case EmfPlusRecordTypeDrawEllipse:
@@ -1295,9 +1299,10 @@ namespace emfplushelper
SAL_INFO("drawinglayer", "EMF+\tTODO: use image attributes");
// For DrawImage and DrawImagePoints, source unit of measurement type must be 1 pixel
- if (sourceUnit == UnitTypePixel && maEMFPObjects[flags & 0xff].get())
+ if (EMFPImage* image = sourceUnit == UnitTypePixel ?
+ dynamic_cast<EMFPImage*>(maEMFPObjects[flags & 0xff].get()) :
+ nullptr)
{
- EMFPImage& image = *static_cast<EMFPImage *>(maEMFPObjects[flags & 0xff].get());
float sx, sy, sw, sh;
ReadRectangle(rMS, sx, sy, sw, sh);
::tools::Rectangle aSource(Point(sx, sy), Size(sw, sh));
@@ -1352,9 +1357,9 @@ namespace emfplushelper
/* Row 1, Column 1 */ aDstSize.getY(),
/* Row 1, Column 2 */ aDstPoint.getY());
- if (image.type == ImageDataTypeBitmap)
+ if (image->type == ImageDataTypeBitmap)
{
- BitmapEx aBmp(image.graphic.GetBitmapEx());
+ BitmapEx aBmp(image->graphic.GetBitmapEx());
aBmp.Crop(aSource);
Size aSize(aBmp.GetSizePixel());
SAL_INFO("drawinglayer", "EMF+\t bitmap size: " << aSize.Width() << "x" << aSize.Height());
@@ -1369,9 +1374,9 @@ namespace emfplushelper
break;
}
}
- else if (image.type == ImageDataTypeMetafile)
+ else if (image->type == ImageDataTypeMetafile)
{
- GDIMetaFile aGDI(image.graphic.GetGDIMetaFile());
+ GDIMetaFile aGDI(image->graphic.GetGDIMetaFile());
aGDI.Clip(aSource);
mrTargetHolders.Current().append(
std::make_unique<drawinglayer::primitive2d::MetafilePrimitive2D>(aTransformMatrix, aGDI));
@@ -1405,7 +1410,7 @@ namespace emfplushelper
// get the stringFormat from the Object table ( this is OPTIONAL and may be nullptr )
const EMFPStringFormat *stringFormat = dynamic_cast<EMFPStringFormat*>(maEMFPObjects[formatId & 0xff].get());
// get the font from the flags
- const EMFPFont *font = static_cast< EMFPFont* >( maEMFPObjects[flags & 0xff].get() );
+ const EMFPFont *font = dynamic_cast<EMFPFont*>(maEMFPObjects[flags & 0xff].get());
if (!font)
{
break;
@@ -1770,7 +1775,7 @@ namespace emfplushelper
SAL_INFO("drawinglayer", "EMF+ SetClipPath combine mode: " << combineMode);
SAL_INFO("drawinglayer", "EMF+\tpath in slot: " << (flags & 0xff));
- EMFPPath *path = static_cast<EMFPPath*>(maEMFPObjects[flags & 0xff].get());
+ EMFPPath *path = dynamic_cast<EMFPPath*>(maEMFPObjects[flags & 0xff].get());
if (!path)
{
SAL_WARN("drawinglayer", "EMF+\t TODO Unable to find path in slot: " << (flags & 0xff));
@@ -1787,7 +1792,7 @@ namespace emfplushelper
int combineMode = (flags >> 8) & 0xf;
SAL_INFO("drawinglayer", "EMF+ SetClipRegion");
SAL_INFO("drawinglayer", "EMF+\tregion in slot: " << (flags & 0xff) << " combine mode: " << combineMode);
- EMFPRegion *region = static_cast<EMFPRegion*>(maEMFPObjects[flags & 0xff].get());
+ EMFPRegion *region = dynamic_cast<EMFPRegion*>(maEMFPObjects[flags & 0xff].get());
if (!region)
{
SAL_WARN("drawinglayer", "EMF+\t TODO Unable to find region in slot: " << (flags & 0xff));
@@ -1856,7 +1861,7 @@ namespace emfplushelper
}
// get the font from the flags
- EMFPFont *font = static_cast< EMFPFont* >( maEMFPObjects[flags & 0xff].get() );
+ EMFPFont *font = dynamic_cast<EMFPFont*>(maEMFPObjects[flags & 0xff].get());
if (!font)
{
break;
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index aa003718b139..3a179d009391 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1093,16 +1093,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
if (comphelper::LibreOfficeKit::isActive())
{
- // For mobile phones, send the context menu structure
- const SfxViewShell* pViewShell = SfxViewShell::Current();
- if (pViewShell && pViewShell->isLOKMobilePhone())
- {
- LOKSendSpellPopupMenu(aPopupMenu, nGuessLangWord, nGuessLangPara, nWords);
- return;
- }
- else // For desktop or tablet, we use the tunneled dialog
- aPopupMenu->SetLOKNotifier(SfxViewShell::Current());
+ aPopupMenu->RemoveItem(nAutoCorrId);
+ aPopupMenu->RemoveItem(nAutoCorrectDlgId);
+
+ LOKSendSpellPopupMenu(aPopupMenu, nGuessLangWord, nGuessLangPara, nWords);
+ return;
}
+
sal_uInt16 nId = aPopupMenu->Execute(pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose);
aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2);
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 00d947a7fcdd..c94197ba8853 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -660,9 +660,12 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD
{
MapUnit eDevUnit = _pTarget->GetMapMode().GetMapUnit();
tools::Rectangle aSelRect(rDocPosTopLeft, rDocPosBottomRight);
- aSelRect = mpLOKSpecialPositioning->GetWindowPos(aSelRect, eDevUnit);
- const Point aRefPoint = mpLOKSpecialPositioning->GetRefPoint();
- aSelRect.Move(-aRefPoint.X(), -aRefPoint.Y());
+ aSelRect = GetWindowPos(aSelRect);
+ Point aRefPointLogical = GetOutputArea().TopLeft();
+ // Get the relative coordinates w.r.t refpoint in display units.
+ aSelRect.Move(-aRefPointLogical.X(), -aRefPointLogical.Y());
+ // Convert from display unit to twips.
+ aSelRect = OutputDevice::LogicToLogic(aSelRect, MapMode(eDevUnit), MapMode(MapUnit::MapTwip));
tools::Polygon aTmpPoly(4);
aTmpPoly[0] = aSelRect.TopLeft();
@@ -1300,11 +1303,15 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
MapUnit eDevUnit = rOutDev.GetMapMode().GetMapUnit();
tools::Rectangle aCursorRectPureLogical(aEditCursor.TopLeft(), GetCursor()->GetSize());
- // Get rectangle in window-coordinates from editeng(doc) coordinates.
- aCursorRectPureLogical = mpLOKSpecialPositioning->GetWindowPos(aCursorRectPureLogical, eDevUnit);
+ // Get rectangle in window-coordinates from editeng(doc) coordinates in hmm.
+ aCursorRectPureLogical = GetWindowPos(aCursorRectPureLogical);
+ Point aRefPointLogical = GetOutputArea().TopLeft();
+ // Get the relative coordinates w.r.t refpoint in display hmm.
+ aCursorRectPureLogical.Move(-aRefPointLogical.X(), -aRefPointLogical.Y());
+ // Convert to twips.
+ aCursorRectPureLogical = OutputDevice::LogicToLogic(aCursorRectPureLogical, MapMode(eDevUnit), MapMode(MapUnit::MapTwip));
+ // "refpoint" in print twips.
const Point aRefPoint = mpLOKSpecialPositioning->GetRefPoint();
- // Get the relative coordinates w.r.t rRefPoint.
- aCursorRectPureLogical.Move(-aRefPoint.X(), -aRefPoint.Y());
aMessageParams.put("relrect", aCursorRectPureLogical.toString());
aMessageParams.put("refpoint", aRefPoint.toString());
}
@@ -1991,7 +1998,7 @@ void ImpEditView::DeselectAll()
SetEditSelection(aNewSelection);
// const_cast<EditPaM&>(GetEditSelection().Min()) = GetEditSelection().Max();
- if (comphelper::LibreOfficeKit::isActive() && mpViewShell)
+ if (comphelper::LibreOfficeKit::isActive() && mpViewShell && pOutWin)
{
VclPtr<vcl::Window> pParent = pOutWin->GetParentWithLOKNotifier();
if (pParent && pParent->GetLOKWindowId())
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 53c1baaa7223..ec800e9d5eb4 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1356,26 +1356,32 @@ bool SvxContourItem::GetPresentation
// class SvxBackgroundColorItem -----------------------------------------
SvxBackgroundColorItem::SvxBackgroundColorItem( const sal_uInt16 nId ) :
- SvxColorItem( nId )
+ SfxPoolItem( nId ),
+ mColor( COL_WHITE )
{
}
+SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol, const sal_uInt16 nId ) :
+ SfxPoolItem( nId ),
+ mColor( rCol )
+{
+}
-SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol,
- const sal_uInt16 nId ) :
- SvxColorItem( rCol, nId )
+SvxBackgroundColorItem::~SvxBackgroundColorItem()
{
}
-SfxPoolItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+bool SvxBackgroundColorItem::operator==( const SfxPoolItem& rAttr ) const
{
- return new SvxBackgroundColorItem(*this);
+ assert(SfxPoolItem::operator==(rAttr));
+
+ return mColor == static_cast<const SvxBackgroundColorItem&>( rAttr ).mColor;
}
bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{
nMemberId &= ~CONVERT_TWIPS;
- Color aColor = SvxColorItem::GetValue();
+ Color aColor = SvxBackgroundColorItem::GetValue();
switch( nMemberId )
{
@@ -1396,28 +1402,68 @@ bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) c
bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
nMemberId &= ~CONVERT_TWIPS;
- sal_Int32 nColor = 0;
- Color aColor = SvxColorItem::GetValue();
+ Color nColor;
+ Color aColor = SvxBackgroundColorItem::GetValue();
switch( nMemberId )
{
case MID_GRAPHIC_TRANSPARENT:
{
aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 );
- SvxColorItem::SetValue( aColor );
+ SvxBackgroundColorItem::SetValue( aColor );
break;
}
default:
{
if(!(rVal >>= nColor))
return false;
- SvxColorItem::SetValue( Color(nColor) );
+ SvxBackgroundColorItem::SetValue( nColor );
break;
}
}
return true;
}
+SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+{
+ return new SvxBackgroundColorItem(*this);
+}
+
+
+bool SvxBackgroundColorItem::GetPresentation
+(
+ SfxItemPresentation /*ePres*/,
+ MapUnit /*eCoreUnit*/,
+ MapUnit /*ePresUnit*/,
+ OUString& rText, const IntlWrapper& /*rIntl*/
+) const
+{
+ rText = ::GetColorString( mColor );
+ return true;
+}
+
+void SvxBackgroundColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxBackgroundColorItem"));
+ (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+
+ std::stringstream ss;
+ ss << mColor;
+ (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(ss.str().c_str()));
+
+ OUString aStr;
+ IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
+ GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, aStr, aIntlWrapper);
+ (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr()));
+ (void)xmlTextWriterEndElement(pWriter);
+}
+
+void SvxBackgroundColorItem::SetValue( const Color& rNewCol )
+{
+ mColor = rNewCol;
+}
+
+
// class SvxColorItem ----------------------------------------------------
SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
SfxPoolItem( nId ),
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 4796732b2c74..246bdc370be6 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1736,13 +1736,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const uno::Reference< text::XTextRan
if( !xRange.is() )
return;
- ESelection aSelection;
- if (GetEditSource())
- {
- ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
- SetSelection( aSelection );
- }
-
SvxUnoTextRangeBase* pRange = comphelper::getUnoTunnelImplementation<SvxUnoTextRange>( xRange );
if(pRange)
{
@@ -1757,6 +1750,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const uno::Reference< text::XTextRan
pRange->setString( aString );
pRange->CollapseToEnd();
+
+ ESelection aSelection;
+ if (GetEditSource())
+ {
+ ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+ SetSelection( aSelection );
+ }
}
}
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index e6e5bec2a316..b402dff22042 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -155,6 +155,37 @@ void OCommonEmbeddedObject::StateChangeNotification_Impl( bool bBeforeChange, sa
}
}
+void OCommonEmbeddedObject::SetInplaceActiveState()
+{
+ if ( !m_xClientSite.is() )
+ throw embed::WrongStateException( "client site not set, yet", *this );
+
+ uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
+ if ( !xInplaceClient.is() || !xInplaceClient->canInplaceActivate() )
+ throw embed::WrongStateException(); //TODO: can't activate inplace
+ xInplaceClient->activatingInplace();
+
+ uno::Reference< embed::XWindowSupplier > xClientWindowSupplier( xInplaceClient, uno::UNO_QUERY_THROW );
+
+ m_xClientWindow = xClientWindowSupplier->getWindow();
+ m_aOwnRectangle = xInplaceClient->getPlacement();
+ m_aClipRectangle = xInplaceClient->getClipRectangle();
+ awt::Rectangle aRectangleToShow = GetRectangleInterception( m_aOwnRectangle, m_aClipRectangle );
+
+ // create own window based on the client window
+ // place and resize the window according to the rectangles
+ uno::Reference< awt::XWindowPeer > xClientWindowPeer( m_xClientWindow, uno::UNO_QUERY_THROW );
+
+ // dispatch provider may not be provided
+ uno::Reference< frame::XDispatchProvider > xContainerDP = xInplaceClient->getInplaceDispatchProvider();
+ bool bOk = m_xDocHolder->ShowInplace( xClientWindowPeer, aRectangleToShow, xContainerDP );
+ m_nObjectState = embed::EmbedStates::INPLACE_ACTIVE;
+ if ( !bOk )
+ {
+ SwitchStateTo_Impl( embed::EmbedStates::RUNNING );
+ throw embed::WrongStateException(); //TODO: can't activate inplace
+ }
+}
void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
{
@@ -228,34 +259,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
{
if ( nNextState == embed::EmbedStates::INPLACE_ACTIVE )
{
- if ( !m_xClientSite.is() )
- throw embed::WrongStateException( "client site not set, yet", *this );
-
- uno::Reference< embed::XInplaceClient > xInplaceClient( m_xClientSite, uno::UNO_QUERY );
- if ( !xInplaceClient.is() || !xInplaceClient->canInplaceActivate() )
- throw embed::WrongStateException(); //TODO: can't activate inplace
- xInplaceClient->activatingInplace();
-
- uno::Reference< embed::XWindowSupplier > xClientWindowSupplier( xInplaceClient, uno::UNO_QUERY_THROW );
-
- m_xClientWindow = xClientWindowSupplier->getWindow();
- m_aOwnRectangle = xInplaceClient->getPlacement();
- m_aClipRectangle = xInplaceClient->getClipRectangle();
- awt::Rectangle aRectangleToShow = GetRectangleInterception( m_aOwnRectangle, m_aClipRectangle );
-
- // create own window based on the client window
- // place and resize the window according to the rectangles
- uno::Reference< awt::XWindowPeer > xClientWindowPeer( m_xClientWindow, uno::UNO_QUERY_THROW );
-
- // dispatch provider may not be provided
- uno::Reference< frame::XDispatchProvider > xContainerDP = xInplaceClient->getInplaceDispatchProvider();
- bool bOk = m_xDocHolder->ShowInplace( xClientWindowPeer, aRectangleToShow, xContainerDP );
- m_nObjectState = nNextState;
- if ( !bOk )
- {
- SwitchStateTo_Impl( embed::EmbedStates::RUNNING );
- throw embed::WrongStateException(); //TODO: can't activate inplace
- }
+ SetInplaceActiveState();
}
else if ( nNextState == embed::EmbedStates::ACTIVE )
{
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx b/embeddedobj/source/commonembedding/specialobject.cxx
index 683fe0aab3f2..c17a39accf2c 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -47,6 +47,7 @@ uno::Any SAL_CALL OSpecialEmbeddedObject::queryInterface( const uno::Type& rType
uno::Any aReturn = ::cppu::queryInterface( rType,
static_cast< embed::XEmbeddedObject* >( this ),
static_cast< embed::XInplaceObject* >( this ),
+ static_cast< embed::XCommonEmbedPersist* >( static_cast< embed::XEmbedPersist* >( this ) ),
static_cast< embed::XVisualObject* >( this ),
static_cast< embed::XClassifiedObject* >( this ),
static_cast< embed::XComponentSupplier* >( this ),
@@ -160,4 +161,12 @@ void SAL_CALL OSpecialEmbeddedObject::doVerb( sal_Int32 nVerbID )
OCommonEmbeddedObject::doVerb( nVerbID );
}
+void SAL_CALL OSpecialEmbeddedObject::reload(
+ const uno::Sequence< beans::PropertyValue >&,
+ const uno::Sequence< beans::PropertyValue >&)
+{
+ // Allow IFrames to reload their content
+ SetInplaceActiveState();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx
index b2c9acd9ec1e..73282a00deac 100644
--- a/embeddedobj/source/inc/commonembobj.hxx
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -226,6 +226,9 @@ private:
const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs );
+protected:
+ void SetInplaceActiveState();
+
public:
OCommonEmbeddedObject(
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
diff --git a/embeddedobj/source/inc/specialobject.hxx b/embeddedobj/source/inc/specialobject.hxx
index 32ad61a7a582..ce5c01b35ae7 100644
--- a/embeddedobj/source/inc/specialobject.hxx
+++ b/embeddedobj/source/inc/specialobject.hxx
@@ -48,6 +48,12 @@ public:
virtual void SAL_CALL changeState( sal_Int32 nNewState ) override;
virtual void SAL_CALL doVerb( sal_Int32 nVerbID ) override;
+
+// XCommonEmbedPersist
+
+ virtual void SAL_CALL reload(
+ const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
+ const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs ) override;
};
#endif
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index a36efe9b550a..ce1e77594f42 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -149,17 +149,17 @@ void BibFrameCtrl_Impl::disposing( const lang::EventObject& /*Source*/ )
BibFrameController_Impl::BibFrameController_Impl( const uno::Reference< awt::XWindow > & xComponent,
BibDataManager* pDataManager)
- :xWindow( xComponent )
+ :m_xWindow( xComponent )
,m_xDatMan( pDataManager )
{
- bDisposing=false;
- mxImpl = new BibFrameCtrl_Impl;
- mxImpl->pController = this;
+ m_bDisposing = false;
+ m_xImpl = new BibFrameCtrl_Impl;
+ m_xImpl->pController = this;
}
BibFrameController_Impl::~BibFrameController_Impl()
{
- mxImpl->pController = nullptr;
+ m_xImpl->pController = nullptr;
m_xDatMan.clear();
}
@@ -183,8 +183,8 @@ css::uno::Sequence< OUString > SAL_CALL BibFrameController_Impl::getSupportedSer
void BibFrameController_Impl::attachFrame( const uno::Reference< XFrame > & xArg )
{
- xFrame = xArg;
- xFrame->addFrameActionListener( mxImpl.get() );
+ m_xFrame = xArg;
+ m_xFrame->addFrameActionListener( m_xImpl.get() );
}
sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > & /*xModel*/ )
@@ -195,9 +195,9 @@ sal_Bool BibFrameController_Impl::attachModel( const uno::Reference< XModel > &
sal_Bool BibFrameController_Impl::suspend( sal_Bool bSuspend )
{
if ( bSuspend )
- getFrame()->removeFrameActionListener( mxImpl.get() );
+ getFrame()->removeFrameActionListener( m_xImpl.get() );
else
- getFrame()->addFrameActionListener( mxImpl.get() );
+ getFrame()->addFrameActionListener( m_xImpl.get() );
return true;
}
@@ -212,7 +212,7 @@ void BibFrameController_Impl::restoreViewData( const uno::Any& /*Value*/ )
uno::Reference< XFrame > BibFrameController_Impl::getFrame()
{
- return xFrame;
+ return m_xFrame;
}
uno::Reference< XModel > BibFrameController_Impl::getModel()
@@ -222,27 +222,32 @@ uno::Reference< XModel > BibFrameController_Impl::getModel()
void BibFrameController_Impl::dispose()
{
- bDisposing = true;
+ m_bDisposing = true;
lang::EventObject aObject;
+ uno::Reference< XFrame > xFrame = getFrame();
+
+ if (xFrame.is())
+ xFrame->removeFrameActionListener( m_xImpl.get() );
+
aObject.Source = static_cast<XController*>(this);
- mxImpl->aLC.disposeAndClear(aObject);
+ m_xImpl->aLC.disposeAndClear(aObject);
m_xDatMan.clear();
- aStatusListeners.clear();
- }
+ m_aStatusListeners.clear();
+}
void BibFrameController_Impl::addEventListener( const uno::Reference< lang::XEventListener > & aListener )
{
- mxImpl->aLC.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
+ m_xImpl->aLC.addInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
}
void BibFrameController_Impl::removeEventListener( const uno::Reference< lang::XEventListener > & aListener )
{
- mxImpl->aLC.removeInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
+ m_xImpl->aLC.removeInterface( cppu::UnoType<lang::XEventListener>::get(), aListener );
}
uno::Reference< frame::XDispatch > BibFrameController_Impl::queryDispatch( const util::URL& aURL, const OUString& /*aTarget*/, sal_Int32 /*nSearchFlags*/ )
{
- if ( !bDisposing )
+ if ( !m_bDisposing )
{
const CmdToInfoCache& rCmdCache = GetCommandToInfoCache();
CmdToInfoCache::const_iterator pIter = rCmdCache.find( aURL.Complete );
@@ -368,10 +373,10 @@ static vcl::Window* lcl_GetFocusChild( vcl::Window const * pParent )
//class XDispatch
void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequence< beans::PropertyValue >& aArgs)
{
- if ( !bDisposing )
+ if ( !m_bDisposing )
{
::SolarMutexGuard aGuard;
- weld::Window* pParent = Application::GetFrameWeld(xWindow);
+ weld::Window* pParent = Application::GetFrameWeld(m_xWindow);
weld::WaitObject aWaitObject(pParent);
OUString aCommand( _rURL.Path);
@@ -404,10 +409,10 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
else if(aCommand == "Bib/autoFilter")
{
- sal_uInt16 nCount = aStatusListeners.size();
+ sal_uInt16 nCount = m_aStatusListeners.size();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- BibStatusDispatch *pObj = aStatusListeners[n].get();
+ BibStatusDispatch *pObj = m_aStatusListeners[n].get();
if ( pObj->aURL.Path == "Bib/removeFilter" )
{
FeatureStateEvent aEvent;
@@ -440,7 +445,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
// create the dialog object
uno::Reference< ui::dialogs::XExecutableDialog > xDialog = sdb::FilterDialog::createWithQuery(xContext, m_xDatMan->getParser(),
- Reference<sdbc::XRowSet>(m_xDatMan->getForm(), uno::UNO_QUERY_THROW), xWindow);
+ Reference<sdbc::XRowSet>(m_xDatMan->getForm(), uno::UNO_QUERY_THROW), m_xWindow);
// execute it
if ( xDialog->execute( ) )
{
@@ -455,10 +460,10 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
OSL_FAIL( "BibFrameController_Impl::dispatch: caught an exception!" );
}
- sal_uInt16 nCount = aStatusListeners.size();
+ sal_uInt16 nCount = m_aStatusListeners.size();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- BibStatusDispatch *pObj = aStatusListeners[n].get();
+ BibStatusDispatch *pObj = m_aStatusListeners[n].get();
if ( pObj->aURL.Path == "Bib/removeFilter" && m_xDatMan->getParser().is())
{
FeatureStateEvent aEvent;
@@ -518,7 +523,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
bLeft = xCursor->isLast() && nCount > 1;
bRight= !xCursor->isLast();
// ask for confirmation
- Reference< frame::XController > xCtrl = mxImpl->pController;
+ Reference< frame::XController > xCtrl = m_xImpl->pController;
Reference< form::XConfirmDeleteListener > xConfirm(m_xDatMan->GetFormController(),UNO_QUERY);
if (xConfirm.is())
{
@@ -563,7 +568,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
else if(aCommand == "Cut")
{
- vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
+ vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( m_xWindow ) );
if(pChild)
{
KeyEvent aEvent( 0, KeyFuncType::CUT );
@@ -572,7 +577,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
else if(aCommand == "Copy")
{
- vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
+ vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( m_xWindow ) );
if(pChild)
{
KeyEvent aEvent( 0, KeyFuncType::COPY );
@@ -581,7 +586,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
else if(aCommand == "Paste")
{
- vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
+ vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( m_xWindow ) );
if(pChild)
{
KeyEvent aEvent( 0, KeyFuncType::PASTE );
@@ -592,7 +597,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
}
IMPL_LINK_NOARG( BibFrameController_Impl, DisposeHdl, void*, void )
{
- xFrame->dispose();
+ m_xFrame->dispose();
};
void BibFrameController_Impl::addStatusListener(
@@ -601,7 +606,7 @@ void BibFrameController_Impl::addStatusListener(
{
BibConfig* pConfig = BibModul::GetConfig();
// create a new Reference and insert into listener array
- aStatusListeners.push_back( std::make_unique<BibStatusDispatch>( aURL, aListener ) );
+ m_aStatusListeners.push_back( std::make_unique<BibStatusDispatch>( aURL, aListener ) );
// send first status synchronously
FeatureStateEvent aEvent;
@@ -652,14 +657,14 @@ void BibFrameController_Impl::addStatusListener(
}
else if(aURL.Path == "Cut")
{
- vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
+ vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( m_xWindow ) );
Edit* pEdit = dynamic_cast<Edit*>( pChild );
if( pEdit )
aEvent.IsEnabled = !pEdit->IsReadOnly() && pEdit->GetSelection().Len();
}
if(aURL.Path == "Copy")
{
- vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
+ vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( m_xWindow ) );
Edit* pEdit = dynamic_cast<Edit*>( pChild );
if( pEdit )
aEvent.IsEnabled = pEdit->GetSelection().Len() > 0;
@@ -667,7 +672,7 @@ void BibFrameController_Impl::addStatusListener(
else if(aURL.Path == "Paste" )
{
aEvent.IsEnabled = false;
- vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( xWindow ) );
+ vcl::Window* pChild = lcl_GetFocusChild( VCLUnoHelper::GetWindow( m_xWindow ) );
if(pChild)
{
uno::Reference< datatransfer::clipboard::XClipboard > xClip = pChild->GetClipboard();
@@ -726,17 +731,17 @@ void BibFrameController_Impl::removeStatusListener(
{
// search listener array for given listener
// for checking equality always "cast" to XInterface
- if ( !bDisposing )
+ if ( !m_bDisposing )
{
- sal_uInt16 nCount = aStatusListeners.size();
+ sal_uInt16 nCount = m_aStatusListeners.size();
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- BibStatusDispatch *pObj = aStatusListeners[n].get();
+ BibStatusDispatch *pObj = m_aStatusListeners[n].get();
bool bFlag=pObj->xListener.is();
if (!bFlag || (pObj->xListener == aObject &&
( aURL.Complete.isEmpty() || pObj->aURL.Path == aURL.Path )))
{
- aStatusListeners.erase( aStatusListeners.begin() + n );
+ m_aStatusListeners.erase( m_aStatusListeners.begin() + n );
break;
}
}
@@ -748,14 +753,14 @@ void BibFrameController_Impl::RemoveFilter()
OUString aQuery;
m_xDatMan->startQueryWith(aQuery);
- sal_uInt16 nCount = aStatusListeners.size();
+ sal_uInt16 nCount = m_aStatusListeners.size();
bool bRemoveFilter=false;
bool bQueryText=false;
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- BibStatusDispatch *pObj = aStatusListeners[n].get();
+ BibStatusDispatch *pObj = m_aStatusListeners[n].get();
if ( pObj->aURL.Path == "Bib/removeFilter" )
{
FeatureStateEvent aEvent;
@@ -810,13 +815,13 @@ void BibFrameController_Impl::ChangeDataSource(const uno::Sequence< beans::Prope
}
- sal_uInt16 nCount = aStatusListeners.size();
+ sal_uInt16 nCount = m_aStatusListeners.size();
bool bMenuFilter=false;
bool bQueryText=false;
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- BibStatusDispatch *pObj = aStatusListeners[n].get();
+ BibStatusDispatch *pObj = m_aStatusListeners[n].get();
if (pObj->aURL.Path == "Bib/MenuFilter")
{
FeatureStateEvent aEvent;
diff --git a/extensions/source/bibliography/framectr.hxx b/extensions/source/bibliography/framectr.hxx
index 21e5f7b23fae..40f930df510f 100644
--- a/extensions/source/bibliography/framectr.hxx
+++ b/extensions/source/bibliography/framectr.hxx
@@ -62,11 +62,11 @@ class BibFrameController_Impl : public cppu::WeakImplHelper <
>
{
friend class BibFrameCtrl_Impl;
- rtl::Reference<BibFrameCtrl_Impl> mxImpl;
- BibStatusDispatchArr aStatusListeners;
- css::uno::Reference< css::awt::XWindow > xWindow;
- css::uno::Reference< css::frame::XFrame > xFrame;
- bool bDisposing;
+ rtl::Reference<BibFrameCtrl_Impl> m_xImpl;
+ BibStatusDispatchArr m_aStatusListeners;
+ css::uno::Reference< css::awt::XWindow > m_xWindow;
+ css::uno::Reference< css::frame::XFrame > m_xFrame;
+ bool m_bDisposing;
rtl::Reference<BibDataManager> m_xDatMan;
DECL_LINK( DisposeHdl, void*, void );
diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index 33f2f2cd9b50..c9ba682af61e 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -16,6 +16,8 @@ boost_patches += boost.6142.warnings.patch.1
boost_patches += boost.utility.Wundef.warnings.patch
boost_patches += boost.noiconv.patch
+boost_patches += boost.between.warning.patch
+boost_patches += boost.fallback.encoding.patch
boost_patches += ubsan.patch.0
boost_patches += rtti.patch.0
diff --git a/external/boost/boost.between.warning.patch b/external/boost/boost.between.warning.patch
new file mode 100644
index 000000000000..bb4535708549
--- /dev/null
+++ b/external/boost/boost.between.warning.patch
@@ -0,0 +1,13 @@
+diff -ru boost.orig/boost/libs/locale/src/encoding/codepage.cpp boost/boost/libs/locale/src/encoding/codepage.cpp
+--- foo/misc/boost.orig/libs/locale/src/encoding/codepage.cpp
++++ foo/misc/boost/libs/locale/src/encoding/codepage.cpp
+@@ -58,6 +58,9 @@
+ return cvt->convert(begin,end);
+ #endif
+ #endif
++ // ensures we get a sensible warning in boost's gettext results about a real mismatch.
++ if (to_charset && from_charset && !strcmp(to_charset, from_charset))
++ return std::string(begin, end - begin);
+ throw invalid_charset_error(std::string(to_charset) + " or " + from_charset);
+ }
+
diff --git a/external/boost/boost.fallback.encoding.patch b/external/boost/boost.fallback.encoding.patch
new file mode 100644
index 000000000000..51ac7fc72308
--- /dev/null
+++ b/external/boost/boost.fallback.encoding.patch
@@ -0,0 +1,13 @@
+--- foo/misc/boost.orig/libs/locale/src/util/locale_data.cpp.new 2022-02-17 22:41:27.730549039 +0000
++++ foo/misc/boost/libs/locale/src/util/locale_data.cpp
+@@ -18,8 +18,8 @@
+ language = "C";
+ country.clear();
+ variant.clear();
+- encoding = "us-ascii";
+- utf8=false;
++ encoding = "UTF-8";
++ utf8=true;
+ parse_from_lang(locale_name);
+ }
+
diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk
index 35cfbfcdbae8..a918effb1203 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -40,6 +40,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
external/coinmp/ubsan.patch.0 \
external/coinmp/rpath.patch \
external/coinmp/libtool.patch \
+ external/coinmp/register.patch \
+ external/coinmp/configure-exit.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/coinmp/configure-exit.patch b/external/coinmp/configure-exit.patch
new file mode 100644
index 000000000000..0a81b8073fd2
--- /dev/null
+++ b/external/coinmp/configure-exit.patch
@@ -0,0 +1,33 @@
+--- Cgl/configure
++++ Cgl/configure
+@@ -3501,8 +3501,6 @@
+ fi
+ for ac_declaration in \
+ '' \
+- 'extern "C" void std::exit (int) throw (); using std::exit;' \
+- 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+--- Clp/configure
++++ Clp/configure
+@@ -3528,8 +3528,6 @@
+ fi
+ for ac_declaration in \
+ '' \
+- 'extern "C" void std::exit (int) throw (); using std::exit;' \
+- 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+--- CoinUtils/configure
++++ CoinUtils/configure
+@@ -3527,8 +3527,6 @@
+ fi
+ for ac_declaration in \
+ '' \
+- 'extern "C" void std::exit (int) throw (); using std::exit;' \
+- 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
diff --git a/external/coinmp/register.patch b/external/coinmp/register.patch
new file mode 100644
index 000000000000..cf4ca4d06c01
--- /dev/null
+++ b/external/coinmp/register.patch
@@ -0,0 +1,369 @@
+--- CoinUtils/src/CoinHelperFunctions.hpp
++++ CoinUtils/src/CoinHelperFunctions.hpp
+@@ -41,7 +41,7 @@
+ handled correctly. */
+
+ template <class T> inline void
+-CoinCopyN(register const T* from, const int size, register T* to)
++CoinCopyN(const T* from, const int size, T* to)
+ {
+ if (size == 0 || from == to)
+ return;
+@@ -52,10 +52,10 @@
+ "CoinCopyN", "");
+ #endif
+
+- register int n = (size + 7) / 8;
++ int n = (size + 7) / 8;
+ if (to > from) {
+- register const T* downfrom = from + size;
+- register T* downto = to + size;
++ const T* downfrom = from + size;
++ T* downto = to + size;
+ // Use Duff's device to copy
+ switch (size % 8) {
+ case 0: do{ *--downto = *--downfrom;
+@@ -99,7 +99,7 @@
+ the difference down to int. -- lh, 100823 --
+ */
+ template <class T> inline void
+-CoinCopy(register const T* first, register const T* last, register T* to)
++CoinCopy(const T* first, const T* last, T* to)
+ {
+ CoinCopyN(first, static_cast<int>(last-first), to);
+ }
+@@ -114,7 +114,7 @@
+ Note JJF - the speed claim seems to be false on IA32 so I have added
+ CoinMemcpyN which can be used for atomic data */
+ template <class T> inline void
+-CoinDisjointCopyN(register const T* from, const int size, register T* to)
++CoinDisjointCopyN(const T* from, const int size, T* to)
+ {
+ #ifndef _MSC_VER
+ if (size == 0 || from == to)
+@@ -135,7 +135,7 @@
+ throw CoinError("overlapping arrays", "CoinDisjointCopyN", "");
+ #endif
+
+- for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
++ for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
+ to[0] = from[0];
+ to[1] = from[1];
+ to[2] = from[2];
+@@ -167,8 +167,8 @@
+ are copied at a time. The source array is given by its first and "after
+ last" entry; the target array is given by its first entry. */
+ template <class T> inline void
+-CoinDisjointCopy(register const T* first, register const T* last,
+- register T* to)
++CoinDisjointCopy(const T* first, const T* last,
++ T* to)
+ {
+ CoinDisjointCopyN(first, static_cast<int>(last - first), to);
+ }
+@@ -256,7 +256,7 @@
+ alternative coding if USE_MEMCPY defined*/
+ #ifndef COIN_USE_RESTRICT
+ template <class T> inline void
+-CoinMemcpyN(register const T* from, const int size, register T* to)
++CoinMemcpyN(const T* from, const int size, T* to)
+ {
+ #ifndef _MSC_VER
+ #ifdef USE_MEMCPY
+@@ -296,7 +296,7 @@
+ throw CoinError("overlapping arrays", "CoinMemcpyN", "");
+ #endif
+
+- for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
++ for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
+ to[0] = from[0];
+ to[1] = from[1];
+ to[2] = from[2];
+@@ -343,8 +343,8 @@
+ are copied at a time. The source array is given by its first and "after
+ last" entry; the target array is given by its first entry. */
+ template <class T> inline void
+-CoinMemcpy(register const T* first, register const T* last,
+- register T* to)
++CoinMemcpy(const T* first, const T* last,
++ T* to)
+ {
+ CoinMemcpyN(first, static_cast<int>(last - first), to);
+ }
+@@ -358,7 +358,7 @@
+ Note JJF - the speed claim seems to be false on IA32 so I have added
+ CoinZero to allow for memset. */
+ template <class T> inline void
+-CoinFillN(register T* to, const int size, register const T value)
++CoinFillN(T* to, const int size, const T value)
+ {
+ if (size == 0)
+ return;
+@@ -369,7 +369,7 @@
+ "CoinFillN", "");
+ #endif
+ #if 1
+- for (register int n = size / 8; n > 0; --n, to += 8) {
++ for (int n = size / 8; n > 0; --n, to += 8) {
+ to[0] = value;
+ to[1] = value;
+ to[2] = value;
+@@ -413,7 +413,7 @@
+ entries are filled at a time. The array is given by its first and "after
+ last" entry. */
+ template <class T> inline void
+-CoinFill(register T* first, register T* last, const T value)
++CoinFill(T* first, T* last, const T value)
+ {
+ CoinFillN(first, last - first, value);
+ }
+@@ -427,7 +427,7 @@
+ Note JJF - the speed claim seems to be false on IA32 so I have allowed
+ for memset as an alternative */
+ template <class T> inline void
+-CoinZeroN(register T* to, const int size)
++CoinZeroN(T* to, const int size)
+ {
+ #ifdef USE_MEMCPY
+ // Use memset - seems faster on Intel with gcc
+@@ -448,7 +448,7 @@
+ "CoinZeroN", "");
+ #endif
+ #if 1
+- for (register int n = size / 8; n > 0; --n, to += 8) {
++ for (int n = size / 8; n > 0; --n, to += 8) {
+ to[0] = 0;
+ to[1] = 0;
+ to[2] = 0;
+@@ -519,7 +519,7 @@
+ entries are filled at a time. The array is given by its first and "after
+ last" entry. */
+ template <class T> inline void
+-CoinZero(register T* first, register T* last)
++CoinZero(T* first, T* last)
+ {
+ CoinZeroN(first, last - first);
+ }
+@@ -545,7 +545,7 @@
+ This function was introduced because for some reason compiler tend to
+ handle the <code>max()</code> function differently. */
+ template <class T> inline T
+-CoinMax(register const T x1, register const T x2)
++CoinMax(const T x1, const T x2)
+ {
+ return (x1 > x2) ? x1 : x2;
+ }
+@@ -556,7 +556,7 @@
+ This function was introduced because for some reason compiler tend to
+ handle the min() function differently. */
+ template <class T> inline T
+-CoinMin(register const T x1, register const T x2)
++CoinMin(const T x1, const T x2)
+ {
+ return (x1 < x2) ? x1 : x2;
+ }
+@@ -578,7 +578,7 @@
+ according to operator<. The array is given by a pointer to its first entry
+ and by its size. */
+ template <class T> inline bool
+-CoinIsSorted(register const T* first, const int size)
++CoinIsSorted(const T* first, const int size)
+ {
+ if (size == 0)
+ return true;
+@@ -590,7 +590,7 @@
+ #if 1
+ // size1 is the number of comparisons to be made
+ const int size1 = size - 1;
+- for (register int n = size1 / 8; n > 0; --n, first += 8) {
++ for (int n = size1 / 8; n > 0; --n, first += 8) {
+ if (first[8] < first[7]) return false;
+ if (first[7] < first[6]) return false;
+ if (first[6] < first[5]) return false;
+@@ -627,7 +627,7 @@
+ according to operator<. The array is given by its first and "after
+ last" entry. */
+ template <class T> inline bool
+-CoinIsSorted(register const T* first, register const T* last)
++CoinIsSorted(const T* first, const T* last)
+ {
+ return CoinIsSorted(first, static_cast<int>(last - first));
+ }
+@@ -638,7 +638,7 @@
+ etc. For speed 8 entries are filled at a time. The array is given by a
+ pointer to its first entry and its size. */
+ template <class T> inline void
+-CoinIotaN(register T* first, const int size, register T init)
++CoinIotaN(T* first, const int size, T init)
+ {
+ if (size == 0)
+ return;
+@@ -648,7 +648,7 @@
+ throw CoinError("negative number of entries", "CoinIotaN", "");
+ #endif
+ #if 1
+- for (register int n = size / 8; n > 0; --n, first += 8, init += 8) {
++ for (int n = size / 8; n > 0; --n, first += 8, init += 8) {
+ first[0] = init;
+ first[1] = init + 1;
+ first[2] = init + 2;
+@@ -706,7 +706,7 @@
+ integer array specified by the last two arguments (again, first and "after
+ last" entry). */
+ template <class T> inline T *
+-CoinDeleteEntriesFromArray(register T * arrayFirst, register T * arrayLast,
++CoinDeleteEntriesFromArray(T * arrayFirst, T * arrayLast,
+ const int * firstDelPos, const int * lastDelPos)
+ {
+ int delNum = static_cast<int>(lastDelPos - firstDelPos);
+--- CoinUtils/src/CoinModelUseful2.cpp
++++ CoinUtils/src/CoinModelUseful2.cpp
+@@ -917,8 +917,8 @@
+
+ int position=0;
+ int nEof=0; // Number of time send of string
+- register int yystate;
+- register int yyn;
++ int yystate;
++ int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+@@ -936,12 +936,12 @@
+ /* The state stack. */
+ short yyssa[YYINITDEPTH];
+ short *yyss = yyssa;
+- register short *yyssp;
++ short *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+- register YYSTYPE *yyvsp;
++ YYSTYPE *yyvsp;
+
+
+
+--- CoinUtils/src/CoinOslC.h
++++ CoinUtils/src/CoinOslC.h
+@@ -34,30 +34,30 @@
+ extern "C"{
+ #endif
+
+-int c_ekkbtrn( register const EKKfactinfo *fact,
++int c_ekkbtrn( const EKKfactinfo *fact,
+ double *dwork1,
+ int * mpt,int first_nonzero);
+-int c_ekkbtrn_ipivrw( register const EKKfactinfo *fact,
++int c_ekkbtrn_ipivrw( const EKKfactinfo *fact,
+ double *dwork1,
+ int * mpt, int ipivrw,int * spare);
+
+-int c_ekketsj( register /*const*/ EKKfactinfo *fact,
++int c_ekketsj( /*const*/ EKKfactinfo *fact,
+ double *dwork1,
+ int *mpt2, double dalpha, int orig_nincol,
+ int npivot, int *nuspikp,
+ const int ipivrw, int * spare);
+-int c_ekkftrn( register const EKKfactinfo *fact,
++int c_ekkftrn( const EKKfactinfo *fact,
+ double *dwork1,
+ double * dpermu,int * mpt, int numberNonZero);
+
+-int c_ekkftrn_ft( register EKKfactinfo *fact,
++int c_ekkftrn_ft( EKKfactinfo *fact,
+ double *dwork1, int *mpt, int *nincolp);
+-void c_ekkftrn2( register EKKfactinfo *fact, double *dwork1,
++void c_ekkftrn2( EKKfactinfo *fact, double *dwork1,
+ double * dpermu1,int * mpt1, int *nincolp,
+ double *dwork1_ft, int *mpt_ft, int *nincolp_ft);
+
+-int c_ekklfct( register EKKfactinfo *fact);
+-int c_ekkslcf( register const EKKfactinfo *fact);
++int c_ekklfct( EKKfactinfo *fact);
++int c_ekkslcf( const EKKfactinfo *fact);
+ inline void c_ekkscpy(int n, const int *marr1,int *marr2)
+ { CoinMemcpyN(marr1,n,marr2);}
+ inline void c_ekkdcpy(int n, const double *marr1,double *marr2)
+--- CoinUtils/src/CoinOslFactorization2.cpp
++++ CoinUtils/src/CoinOslFactorization2.cpp
+@@ -20,9 +20,9 @@
+ extern int ets_count;
+ extern int ets_check;
+ #endif
+-#define COIN_REGISTER register
++#define COIN_REGISTER
+ #define COIN_REGISTER2
+-#define COIN_REGISTER3 register
++#define COIN_REGISTER3
+ #ifdef COIN_USE_RESTRICT
+ # define COIN_RESTRICT2 __restrict
+ #else
+--- CoinUtils/src/CoinOslFactorization3.cpp
++++ CoinUtils/src/CoinOslFactorization3.cpp
+@@ -1378,7 +1378,7 @@
+ }
+ }
+ } /* c_ekkmltf */
+-int c_ekklfct( register EKKfactinfo *fact)
++int c_ekklfct( EKKfactinfo *fact)
+ {
+ const int nrow = fact->nrow;
+ int ninbas = fact->xcsadr[nrow+1]-1;
+@@ -2607,7 +2607,7 @@
+ }
+ }
+ } /* c_ekkclcp */
+-int c_ekkslcf( register const EKKfactinfo *fact)
++int c_ekkslcf( const EKKfactinfo *fact)
+ {
+ int * hrow = fact->xeradr;
+ int * hcol = fact->xecadr;
+--- CoinUtils/src/CoinPackedVectorBase.cpp
++++ CoinUtils/src/CoinPackedVectorBase.cpp
+@@ -194,8 +194,8 @@
+ double
+ CoinPackedVectorBase::oneNorm() const
+ {
+- register double norm = 0.0;
+- register const double* elements = getElements();
++ double norm = 0.0;
++ const double* elements = getElements();
+ for (int i = getNumElements() - 1; i >= 0; --i) {
+ norm += fabs(elements[i]);
+ }
+@@ -224,8 +224,8 @@
+ double
+ CoinPackedVectorBase::infNorm() const
+ {
+- register double norm = 0.0;
+- register const double* elements = getElements();
++ double norm = 0.0;
++ const double* elements = getElements();
+ for (int i = getNumElements() - 1; i >= 0; --i) {
+ norm = CoinMax(norm, fabs(elements[i]));
+ }
+--- CoinUtils/src/CoinSearchTree.hpp
++++ CoinUtils/src/CoinSearchTree.hpp
+@@ -153,8 +153,8 @@
+ static inline const char* name() { return "CoinSearchTreeComparePreferred"; }
+ inline bool operator()(const CoinTreeSiblings* x,
+ const CoinTreeSiblings* y) const {
+- register const CoinTreeNode* xNode = x->currentNode();
+- register const CoinTreeNode* yNode = y->currentNode();
++ const CoinTreeNode* xNode = x->currentNode();
++ const CoinTreeNode* yNode = y->currentNode();
+ const BitVector128 xPref = xNode->getPreferred();
+ const BitVector128 yPref = yNode->getPreferred();
+ bool retval = true;
+--- CoinUtils/src/CoinSimpFactorization.cpp
++++ CoinUtils/src/CoinSimpFactorization.cpp
+@@ -2440,7 +2440,7 @@
+ const int row=secRowOfU_[i];
+ const int column=colOfU_[i];
+ if ( denseVector_[column]==0.0 ) continue;
+- register const double multiplier=denseVector_[column]*invOfPivots_[row];
++ const double multiplier=denseVector_[column]*invOfPivots_[row];
+ denseVector_[column]=0.0;
+ const int rowBeg=UrowStarts_[row];
+ const int rowEnd=rowBeg+UrowLengths_[row];
diff --git a/external/curl/ExternalPackage_curl.mk b/external/curl/ExternalPackage_curl.mk
index 8da569e3e0cf..82979b110558 100644
--- a/external/curl/ExternalPackage_curl.mk
+++ b/external/curl/ExternalPackage_curl.mk
@@ -14,13 +14,13 @@ $(eval $(call gb_ExternalPackage_use_external_project,curl,curl))
ifneq ($(DISABLE_DYNLOADING),TRUE)
ifeq ($(COM),MSC)
-$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll,builds/libcurl-vc12-$(if $(filter X86_64,$(CPUNAME)),x64,x86)-$(if $(MSVC_USE_DEBUG_RUNTIME),debug,release)-dll-ipv6-sspi-winssl/bin/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll))
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll,builds/libcurl-vc12-$(if $(filter X86_64,$(CPUNAME)),x64,x86)-$(if $(MSVC_USE_DEBUG_RUNTIME),debug,release)-dll-zlib-static-ipv6-sspi-schannel/bin/libcurl$(if $(MSVC_USE_DEBUG_RUNTIME),_debug).dll))
else ifeq ($(OS),MACOSX)
$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.4.dylib,lib/.libs/libcurl.4.dylib))
else ifeq ($(OS),AIX)
$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so,lib/.libs/libcurl.so.4))
else
-$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so.4,lib/.libs/libcurl.so.4.6.0))
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so.4,lib/.libs/libcurl.so.4.8.0))
endif
endif # $(DISABLE_DYNLOADING)
diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk
index 5cbedac82d1a..43bb1cad0b93 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -35,21 +35,22 @@ ifeq ($(SYSTEM_NSS),)
curl_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss
endif
-# use --with-darwinssl on macOS >10.5 and iOS to get a native UI for SSL certs for CMIS usage
+# use --with-secure-transport on macOS >10.5 and iOS to get a native UI for SSL certs for CMIS usage
# use --with-nss only on platforms other than macOS and iOS
$(call gb_ExternalProject_get_state_target,curl,build):
$(call gb_ExternalProject_run,build,\
./configure \
$(if $(filter iOS MACOSX,$(OS)),\
- --with-darwinssl,\
- $(if $(ENABLE_NSS),--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out"),--without-nss)) \
- --without-ssl --without-gnutls --without-polarssl --without-cyassl --without-axtls --without-mbedtls \
+ --with-secure-transport,\
+ $(if $(ENABLE_NSS),--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out") --with-nss-deprecated,--without-nss)) \
+ --without-openssl --without-gnutls --without-polarssl --without-cyassl --without-axtls --without-mbedtls \
--enable-ftp --enable-http --enable-ipv6 \
--without-libidn2 --without-libpsl --without-librtmp \
--without-libssh2 --without-metalink --without-nghttp2 \
--without-libssh --without-brotli \
--without-ngtcp2 --without-quiche \
- --disable-ares \
+ --without-zstd --without-hyper --without-gsasl --without-gssapi \
+ --disable-mqtt --disable-ares \
--disable-dict --disable-file --disable-gopher --disable-imap \
--disable-ldap --disable-ldaps --disable-manual --disable-pop3 \
--disable-rtsp --disable-smb --disable-smtp --disable-telnet \
@@ -84,6 +85,7 @@ $(call gb_ExternalProject_get_state_target,curl,build):
ENABLE_IPV6=yes \
ENABLE_SSPI=yes \
ENABLE_WINSSL=yes \
+ WITH_ZLIB=static \
,winbuild)
endif
diff --git a/external/curl/UnpackedTarball_curl.mk b/external/curl/UnpackedTarball_curl.mk
index 6171f17cba48..a5421d253871 100644
--- a/external/curl/UnpackedTarball_curl.mk
+++ b/external/curl/UnpackedTarball_curl.mk
@@ -21,10 +21,10 @@ $(eval $(call gb_UnpackedTarball_fix_end_of_line,curl,\
$(eval $(call gb_UnpackedTarball_add_patches,curl,\
external/curl/curl-msvc.patch.1 \
+ external/curl/curl-msvc-zlib.patch.1 \
external/curl/curl-msvc-disable-protocols.patch.1 \
external/curl/curl-7.26.0_win-proxy.patch \
external/curl/zlib.patch.0 \
- external/curl/curl-ios.patch.1 \
))
ifeq ($(SYSTEM_NSS),)
diff --git a/external/curl/clang-cl.patch.0 b/external/curl/clang-cl.patch.0
index 2fbb10c2a9aa..5dfb19d5ba59 100644
--- a/external/curl/clang-cl.patch.0
+++ b/external/curl/clang-cl.patch.0
@@ -1,6 +1,6 @@
--- winbuild/MakefileBuild.vc
+++ winbuild/MakefileBuild.vc
-@@ -60,7 +60,7 @@
+@@ -52,7 +52,7 @@
!ELSE
CC_NODEBUG = $(CC) /O2 /DNDEBUG
CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd
diff --git a/external/curl/curl-7.26.0_win-proxy.patch b/external/curl/curl-7.26.0_win-proxy.patch
index 852881570e36..62016a70e8a0 100644
--- a/external/curl/curl-7.26.0_win-proxy.patch
+++ b/external/curl/curl-7.26.0_win-proxy.patch
@@ -12,18 +12,18 @@
--- curl-7.26.0/lib/url.c
+++ misc/build/curl-7.26.0/lib/url.c
@@ -78,6 +78,10 @@
- bool curl_win32_idn_to_ascii(const char *in, char **out);
- #endif /* USE_LIBIDN2 */
+
+ #include <limits.h>
+#ifdef _WIN32
+#include <WinHttp.h>
+#endif
+
+ #include "doh.h"
#include "urldata.h"
#include "netrc.h"
-
@@ -4586,6 +4590,21 @@
- }
+ #ifndef CURL_DISABLE_PROXY
#ifndef CURL_DISABLE_HTTP
+#ifdef _WIN32
@@ -31,7 +31,7 @@
+{
+ int bufSize;
+ char *out = NULL;
-+ if(wStr != NULL) {
++ if(wStr) {
+ bufSize = WideCharToMultiByte(
+ CP_ACP, 0, wStr, -1, NULL, 0, NULL, NULL);
+ out = (char *)malloc(bufSize * sizeof(char));
@@ -44,7 +44,7 @@
/****************************************************************
* Detect what (if any) proxy to use. Remember that this selects a host
* name and is not limited to HTTP proxies only.
-@@ -4613,6 +4633,66 @@
+@@ -4613,6 +4633,67 @@
* For compatibility, the all-uppercase versions of these variables are
* checked if the lowercase versions don't exist.
*/
@@ -58,28 +58,29 @@
+ char *ieProxy;
+ char *ieNoProxy;
+ char *pos;
++ bool spacesp;
+
+ ieProxy = wstrToCstr(ieProxyConfig->lpszProxy);
+ ieNoProxy = wstrToCstr(ieProxyConfig->lpszProxyBypass);
+
+ /* Convert the ieNoProxy into a proper no_proxy value */
-+ if(NULL != ieNoProxy) {
++ if(ieNoProxy) {
+ no_proxy = strdup(ieNoProxy);
+ pos = strpbrk(no_proxy, "; ");
-+ while(NULL != pos) {
++ while(pos) {
+ no_proxy[pos-no_proxy] = ',';
+ pos = strpbrk(no_proxy, "; ");
+ }
+ }
+
-+ if(!check_noproxy(conn->host.name, no_proxy)) {
++ if(!Curl_check_noproxy(conn->host.name, no_proxy, &spacesp)) {
+ /* Look for the http proxy setting */
+ char *tok;
+ char *saveptr;
+
-+ if(NULL != ieProxy) {
++ if(ieProxy) {
+ tok = strtok_s(ieProxy, ";", &saveptr);
-+ if(strchr(tok, '=') == NULL) {
++ if(!strchr(tok, '=')) {
+ proxy = strdup(ieProxy);
+ }
+ else {
@@ -90,7 +91,7 @@
+ }
+ tok = strtok_s(NULL, ";", &saveptr);
+ }
-+ while(NULL != tok);
++ while(tok);
+ }
+ }
+ }
@@ -114,7 +115,7 @@
@@ -4663,6 +4739,7 @@
}
if(proxy)
- infof(conn->data, "Uses proxy env variable %s == '%s'\n", envp, proxy);
+ infof(data, "Uses proxy env variable %s == '%s'", envp, proxy);
+#endif /* _WIN32 */
return proxy;
diff --git a/external/curl/curl-ios.patch.1 b/external/curl/curl-ios.patch.1
deleted file mode 100644
index 1c8fd8f70566..000000000000
--- a/external/curl/curl-ios.patch.1
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: Diff -*-
-#
-# We don't want curl's configure script to add a -mmacosx-version-min
-# option when it is for iOS we are building. In that case already $CC
-# contains a -miphoneos-version-min option.
-
---- curl/configure
-+++ curl/configure
-@@ -18976,7 +18976,7 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for *version-min in CFLAGS" >&5
- $as_echo_n "checking for *version-min in CFLAGS... " >&6; }
- min=""
-- if test -z "$(echo $CFLAGS | grep m.*os.*-version-min)"; then
-+ if test -z "$(echo $CC $CFLAGS | grep m.*os.*-version-min)"; then
- min="-mmacosx-version-min=10.8"
- CFLAGS="$CFLAGS $min"
- fi
diff --git a/external/curl/curl-msvc-disable-protocols.patch.1 b/external/curl/curl-msvc-disable-protocols.patch.1
index c8747a5fcc1d..71ff0c01a028 100644
--- a/external/curl/curl-msvc-disable-protocols.patch.1
+++ b/external/curl/curl-msvc-disable-protocols.patch.1
@@ -2,18 +2,19 @@ disable protocols nobody needs in MSVC build
--- curl/lib/config-win32.h.orig 2017-08-09 16:43:29.464000000 +0200
+++ curl/lib/config-win32.h 2017-08-09 16:47:38.549200000 +0200
-@@ -733,4 +733,19 @@
+@@ -654,4 +654,20 @@
# define ENABLE_IPV6 1
#endif
+#define CURL_DISABLE_DICT 1
+#define CURL_DISABLE_FILE 1
-+//#undef CURL_DISABLE_FTP
++#undef CURL_DISABLE_FTP
+#define CURL_DISABLE_GOPHER 1
-+//#undef CURL_DISABLE_HTTP
++#undef CURL_DISABLE_HTTP
+#define CURL_DISABLE_IMAP 1
+#define CURL_DISABLE_LDAP 1
+#define CURL_DISABLE_LDAPS 1
++#define CURL_DISABLE_MQTT 1
+#define CURL_DISABLE_POP3 1
+#define CURL_DISABLE_RTSP 1
+#define CURL_DISABLE_SMB 1
@@ -24,7 +25,7 @@ disable protocols nobody needs in MSVC build
#endif /* HEADER_CURL_CONFIG_WIN32_H */
--- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 23:41:21.393200000 +0200
+++ curl/winbuild/MakefileBuild.vc 2017-10-23 23:34:16.028000000 +0200
-@@ -431,7 +431,7 @@
+@@ -562,7 +562,7 @@
EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res
diff --git a/external/curl/curl-msvc-zlib.patch.1 b/external/curl/curl-msvc-zlib.patch.1
new file mode 100644
index 000000000000..a9ee0013d50b
--- /dev/null
+++ b/external/curl/curl-msvc-zlib.patch.1
@@ -0,0 +1,16 @@
+find internal zlib in nmake buildsystem
+
+--- curl/winbuild/MakefileBuild.vc.orig2 2021-10-27 20:44:48.685237000 +0200
++++ curl/winbuild/MakefileBuild.vc 2021-10-27 20:47:23.792407400 +0200
+@@ -244,8 +244,9 @@
+ ZLIB_LIB_DIR = $(ZLIB_PATH)\lib
+ ZLIB_LFLAGS = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)"
+ !ELSE
+-ZLIB_INC_DIR = $(DEVEL_INCLUDE)
+-ZLIB_LIB_DIR = $(DEVEL_LIB)
++ZLIB_INC_DIR = $(WORKDIR)/UnpackedTarball/zlib
++ZLIB_LIB_DIR = $(WORKDIR)/LinkTarget/StaticLibrary
++ZLIB_LFLAGS = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)"
+ !ENDIF
+
+ # Depending on how zlib is built the libraries have different names, we
diff --git a/external/curl/curl-msvc.patch.1 b/external/curl/curl-msvc.patch.1
index a5b79a8e9c49..54ad026ec8c7 100644
--- a/external/curl/curl-msvc.patch.1
+++ b/external/curl/curl-msvc.patch.1
@@ -2,7 +2,7 @@ MSVC: using SOLARINC
--- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 16:36:07.713550851 +0200
+++ curl/winbuild/MakefileBuild.vc 2017-10-23 16:38:19.301547594 +0200
-@@ -60,7 +60,7 @@
+@@ -52,7 +52,7 @@
!ELSE
CC_NODEBUG = $(CC) /O2 /DNDEBUG
CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd
@@ -11,7 +11,7 @@ MSVC: using SOLARINC
!ENDIF
LFLAGS = /nologo /machine:$(MACHINE)
-@@ -300,11 +300,11 @@
+@@ -426,11 +426,11 @@
# CURL_XX macros are for the curl.exe command
!IF "$(DEBUG)"=="yes"
diff --git a/external/curl/curl-nss.patch.1 b/external/curl/curl-nss.patch.1
index 69fde5f7f236..2e8766b3d45f 100644
--- a/external/curl/curl-nss.patch.1
+++ b/external/curl/curl-nss.patch.1
@@ -1,12 +1,17 @@
diff -ur curl.org/configure curl/configure
---- curl.org/configure 2016-03-13 15:14:07.177000076 +0100
-+++ curl/configure 2016-03-13 15:16:44.132000076 +0100
-@@ -24009,7 +24009,7 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired libraries and compilation flags for NSS." >&5
- $as_echo "$as_me: WARNING: Using hard-wired libraries and compilation flags for NSS." >&2;}
+--- curl.orig/configure 2023-02-20 16:11:55.000000000 +0900
++++ curl/configure 2023-02-23 15:40:58.617432471 +0900
+@@ -28675,7 +28675,12 @@
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired libraries and compilation flags for NSS." >&5
+ printf "%s\n" "$as_me: WARNING: Using hard-wired libraries and compilation flags for NSS." >&2;}
addld="-L$OPT_NSS/lib"
- addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
+ addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lnssutil3"
++ case $host_os in
++ *android*)
++ addlib="${addlib} -llog"
++ ;;
++ esac
addcflags="-I$OPT_NSS/include"
version="unknown"
nssprefix=$OPT_NSS
diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0
index 189e820d1afa..b4442ba262d1 100644
--- a/external/curl/zlib.patch.0
+++ b/external/curl/zlib.patch.0
@@ -1,22 +1,22 @@
--- configure
+++ configure
-@@ -20709,7 +20709,6 @@
+@@ -23035,7 +23035,6 @@
clean_CPPFLAGS=$CPPFLAGS
clean_LDFLAGS=$LDFLAGS
clean_LIBS=$LIBS
-ZLIB_LIBS=""
# Check whether --with-zlib was given.
- if test "${with_zlib+set}" = set; then :
-@@ -20718,6 +20719,7 @@
+ if test ${with_zlib+y}
+@@ -23045,6 +23044,7 @@
if test "$OPT_ZLIB" = "no" ; then
+ ZLIB_LIBS=""
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5
- $as_echo "$as_me: WARNING: zlib disabled" >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5
+ printf "%s\n" "$as_me: WARNING: zlib disabled" >&2;}
else
-@@ -20725,6 +20725,21 @@
+@@ -23052,6 +23052,21 @@
OPT_ZLIB=""
fi
@@ -38,8 +38,8 @@
if test -z "$OPT_ZLIB" ; then
if test -n "$PKG_CONFIG"; then
-@@ -21005,6 +21020,7 @@
- $as_echo "$as_me: found both libz and libz.h header" >&6;}
+@@ -23344,6 +23359,7 @@
+ printf "%s\n" "$as_me: found both libz and libz.h header" >&6;}
curl_zlib_msg="enabled"
fi
+ fi
@@ -48,14 +48,14 @@
if test x"$AMFIXLIB" = x1; then
--- configure.ac
+++ configure.ac
-@@ -880,19 +880,30 @@
+@@ -1243,19 +1243,30 @@
clean_CPPFLAGS=$CPPFLAGS
clean_LDFLAGS=$LDFLAGS
clean_LIBS=$LIBS
-ZLIB_LIBS=""
AC_ARG_WITH(zlib,
- AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
- AC_HELP_STRING([--without-zlib],[disable use of zlib]),
+ AS_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
+ AS_HELP_STRING([--without-zlib],[disable use of zlib]),
[OPT_ZLIB="$withval"])
if test "$OPT_ZLIB" = "no" ; then
@@ -80,7 +80,7 @@
if test -z "$OPT_ZLIB" ; then
CURL_CHECK_PKGCONFIG(zlib)
-@@ -975,6 +986,7 @@
+@@ -1336,6 +1347,7 @@
AC_MSG_NOTICE([found both libz and libz.h header])
curl_zlib_msg="enabled"
fi
diff --git a/external/expat/UnpackedTarball_expat.mk b/external/expat/UnpackedTarball_expat.mk
index 96f4e3ec8732..5d4f41f6d147 100644
--- a/external/expat/UnpackedTarball_expat.mk
+++ b/external/expat/UnpackedTarball_expat.mk
@@ -15,7 +15,6 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,expat,conftools))
$(eval $(call gb_UnpackedTarball_add_patches,expat,\
external/expat/expat-winapi.patch \
- external/expat/ubsan.patch.0 \
))
# This is a bit hackish.
diff --git a/external/expat/expat-winapi.patch b/external/expat/expat-winapi.patch
index b33c12b83b4c..fed65644a732 100644
--- a/external/expat/expat-winapi.patch
+++ b/external/expat/expat-winapi.patch
@@ -1,6 +1,6 @@
---- misc/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:17.375000000 +0000
-+++ misc/build/expat-2.1.0/lib/expat_external.h 2009-11-16 08:53:34.703125000 +0000
-@@ -81,10 +81,6 @@
+--- misc/expat-2.5.0/lib/expat_external.h 2022-10-25 01:32:54.000000000 +0900
++++ misc/build/expat-2.5.0/lib/expat_external.h 2022-10-30 23:09:47.339459134 +0900
+@@ -88,10 +88,6 @@
# ifndef XML_BUILDING_EXPAT
/* using Expat from an application */
@@ -11,3 +11,15 @@
# endif
#endif /* not defined XML_STATIC */
+--- misc/expat-2.5.0/lib/xmlparse.c 2022-10-26 00:09:08.000000000 +0900
++++ misc/build/expat-2.5.0/lib/xmlparse.c 2022-10-30 23:09:01.843006341 +0900
+@@ -67,6 +67,9 @@
+ #endif
+
+ #ifdef _WIN32
++# undef HAVE_ARC4RANDOM_BUF
++# undef HAVE_GETRANDOM
++# undef HAVE_SYSCALL_GETRANDOM
+ /* force stdlib to define rand_s() */
+ # if ! defined(_CRT_RAND_S)
+ # define _CRT_RAND_S
diff --git a/external/expat/ubsan.patch.0 b/external/expat/ubsan.patch.0
deleted file mode 100644
index 8317f922df88..000000000000
--- a/external/expat/ubsan.patch.0
+++ /dev/null
@@ -1,11 +0,0 @@
---- lib/xmlparse.c
-+++ lib/xmlparse.c
-@@ -6485,7 +6485,7 @@
- static void FASTCALL
- hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) {
- iter->p = table->v;
-- iter->end = iter->p + table->size;
-+ iter->end = table->size == 0 ? iter->p : iter->p + table->size;
- }
-
- static NAMED *FASTCALL
diff --git a/external/gpgmepp/ExternalProject_gpgmepp.mk b/external/gpgmepp/ExternalProject_gpgmepp.mk
index 8ecdf60e6f87..d7835622ca21 100644
--- a/external/gpgmepp/ExternalProject_gpgmepp.mk
+++ b/external/gpgmepp/ExternalProject_gpgmepp.mk
@@ -39,7 +39,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_
$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
$(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
--host=$(gb_ExternalProject_gpgmepp_host) \
- RC='windres -O COFF --target=$(gb_ExternalProject_gpgmepp_target) --preprocessor='\''$(call gb_Executable_get_target,cpp) -+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)'\' \
+ RC='windres -O COFF --target=$(gb_ExternalProject_gpgmepp_target) --preprocessor=$(call gb_Executable_get_target,cpp) --preprocessor-arg=-+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)' \
MAKE=$(MAKE) \
&& $(MAKE) \
)
diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
index 1b0468fc6f23..fc7ed88ac6d6 100644
--- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk
+++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk
@@ -33,5 +33,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \
external/gpgmepp/gcc9.patch \
external/gpgmepp/version.patch \
external/gpgmepp/ubsan.patch \
+ external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1 b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1
new file mode 100644
index 000000000000..538a5264bed4
--- /dev/null
+++ b/external/gpgmepp/gpgme.git-4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e.patch.1
@@ -0,0 +1,32 @@
+From 4b64774b6d13ffa4f59dddf947a97d61bcfa2f2e Mon Sep 17 00:00:00 2001
+From: Jiri Kucera <sanczes@gmail.com>
+Date: Sun, 25 Jul 2021 11:35:54 +0200
+Subject: [PATCH] core: Support closefrom also for glibc.
+
+* src/posix-io.c (_gpgme_io_spawn): Use glibc's closefrom.
+--
+
+Since 2.34, glibc introduces closefrom (the implementation
+follows *BSD standard).
+
+Signed-off-by: Werner Koch <wk@gnupg.org>
+---
+ src/posix-io.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/posix-io.c b/src/posix-io.c
+index e712ef28..2a3a81fc 100644
+--- a/src/posix-io.c
++++ b/src/posix-io.c
+@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
+ if (fd_list[i].fd > fd)
+ fd = fd_list[i].fd;
+ fd++;
+-#ifdef __sun
++#if defined(__sun) || defined(__GLIBC__)
+ closefrom (fd);
+ max_fds = fd;
+ #else /*!__sun */
+--
+2.11.0
+
diff --git a/external/harfbuzz/62e803b36173fd096d7ad460dd1d1db9be542593.patch.1 b/external/harfbuzz/62e803b36173fd096d7ad460dd1d1db9be542593.patch.1
new file mode 100644
index 000000000000..2aef204a26e1
--- /dev/null
+++ b/external/harfbuzz/62e803b36173fd096d7ad460dd1d1db9be542593.patch.1
@@ -0,0 +1,29 @@
+From 62e803b36173fd096d7ad460dd1d1db9be542593 Mon Sep 17 00:00:00 2001
+From: Behdad Esfahbod <behdad@behdad.org>
+Date: Wed, 1 Jun 2022 07:38:21 -0600
+Subject: [PATCH] [sbix] Limit glyph extents
+
+Fixes https://github.com/harfbuzz/harfbuzz/issues/3557
+---
+ src/hb-ot-color-sbix-table.hh | 6 ++++++
+ test/fuzzing/fonts/sbix-extents.ttf | Bin 0 -> 582 bytes
+ 2 files changed, 6 insertions(+)
+ create mode 100644 test/fuzzing/fonts/sbix-extents.ttf
+
+diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh
+index 9741ebd450..6efae43cda 100644
+--- a/src/hb-ot-color-sbix-table.hh
++++ b/src/hb-ot-color-sbix-table.hh
+@@ -298,6 +298,12 @@ struct sbix
+
+ const PNGHeader &png = *blob->as<PNGHeader>();
+
++ if (png.IHDR.height >= 65536 || png.IHDR.width >= 65536)
++ {
++ hb_blob_destroy (blob);
++ return false;
++ }
++
+ extents->x_bearing = x_offset;
+ extents->y_bearing = png.IHDR.height + y_offset;
+ extents->width = png.IHDR.width;
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index adec72ed0d57..9957f89e1b5c 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
external/harfbuzz/ubsan.patch \
external/harfbuzz/icu-65-api-macros-with-semicolon.patch.1 \
+ external/harfbuzz/62e803b36173fd096d7ad460dd1d1db9be542593.patch.1 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk b/external/hsqldb/UnpackedTarball_hsqldb.mk
index cbba770f19a0..ed262cccf4ca 100644
--- a/external/hsqldb/UnpackedTarball_hsqldb.mk
+++ b/external/hsqldb/UnpackedTarball_hsqldb.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\
external/hsqldb/patches/jdbc-4.1.patch \
external/hsqldb/patches/multipleResultSets.patch \
) \
+ external/hsqldb/patches/disable-dump-script.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/hsqldb/patches/disable-dump-script.patch b/external/hsqldb/patches/disable-dump-script.patch
new file mode 100644
index 000000000000..401dd38abc9a
--- /dev/null
+++ b/external/hsqldb/patches/disable-dump-script.patch
@@ -0,0 +1,14 @@
+--- a/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 11:08:11.297243034 +0000
++++ b/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 13:49:17.973089433 +0000
+@@ -403,6 +403,11 @@
+ throw Trace.error(Trace.INVALID_IDENTIFIER);
+ }
+
++ // added condition to avoid execution of spurious command in .script or .log file
++ if (session.isProcessingScript() || session.isProcessingLog()) {
++ return new Result(ResultConstants.UPDATECOUNT);
++ }
++
+ dsw = new ScriptWriterText(database, token, true, true, true);
+
+ dsw.writeAll();
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index d785264bebad..deeeb5171aaf 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -40,6 +40,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/c++20-comparison.patch \
external/icu/ubsan.patch \
external/icu/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca.patch.2 \
+ external/icu/cec7de7a390dd6907b0ea0feb4488ed3934ee71d.patch.2 \
+ external/icu/e450fa50fc242282551f56b941dc93b9a8a0bcbb.patch.2 \
))
$(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
diff --git a/external/icu/cec7de7a390dd6907b0ea0feb4488ed3934ee71d.patch.2 b/external/icu/cec7de7a390dd6907b0ea0feb4488ed3934ee71d.patch.2
new file mode 100644
index 000000000000..1ded56abf524
--- /dev/null
+++ b/external/icu/cec7de7a390dd6907b0ea0feb4488ed3934ee71d.patch.2
@@ -0,0 +1,94 @@
+From cec7de7a390dd6907b0ea0feb4488ed3934ee71d Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang@chromium.org>
+Date: Tue, 16 Mar 2021 22:08:29 -0700
+Subject: [PATCH] ICU-21537 Fix invalid free by long locale name
+
+Do not free baseName if it is pointing to fullNameBuffer.
+
+Better Fix
+---
+ icu4c/source/common/locid.cpp | 9 +++++----
+ icu4c/source/test/intltest/collationtest.cpp | 10 ++++++++++
+ 2 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp
+index 5d604350ecd..e16fbb724a4 100644
+--- a/icu4c/source/common/locid.cpp
++++ b/icu4c/source/common/locid.cpp
+@@ -254,7 +254,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(Locale)
+
+ Locale::~Locale()
+ {
+- if (baseName != fullName) {
++ if ((baseName != fullName) && (baseName != fullNameBuffer)) {
+ uprv_free(baseName);
+ }
+ baseName = NULL;
+@@ -466,7 +466,7 @@ Locale& Locale::operator=(const Locale& other) {
+ }
+
+ Locale& Locale::operator=(Locale&& other) U_NOEXCEPT {
+- if (baseName != fullName) uprv_free(baseName);
++ if ((baseName != fullName) && (baseName != fullNameBuffer)) uprv_free(baseName);
+ if (fullName != fullNameBuffer) uprv_free(fullName);
+
+ if (other.fullName == other.fullNameBuffer) {
+@@ -1850,7 +1850,7 @@ Locale& Locale::init(const char* localeID, UBool canonicalize)
+ {
+ fIsBogus = FALSE;
+ /* Free our current storage */
+- if (baseName != fullName) {
++ if ((baseName != fullName) && (baseName != fullNameBuffer)) {
+ uprv_free(baseName);
+ }
+ baseName = NULL;
+@@ -1886,6 +1886,7 @@ Locale& Locale::init(const char* localeID, UBool canonicalize)
+ uloc_getName(localeID, fullName, sizeof(fullNameBuffer), &err);
+
+ if(err == U_BUFFER_OVERFLOW_ERROR || length >= (int32_t)sizeof(fullNameBuffer)) {
++ U_ASSERT(baseName == nullptr);
+ /*Go to heap for the fullName if necessary*/
+ fullName = (char *)uprv_malloc(sizeof(char)*(length + 1));
+ if(fullName == 0) {
+@@ -2039,7 +2040,7 @@ Locale::hashCode() const
+ void
+ Locale::setToBogus() {
+ /* Free our current storage */
+- if(baseName != fullName) {
++ if((baseName != fullName) && (baseName != fullNameBuffer)) {
+ uprv_free(baseName);
+ }
+ baseName = NULL;
+diff --git a/icu4c/source/test/intltest/collationtest.cpp b/icu4c/source/test/intltest/collationtest.cpp
+index de51eece5c4..4f1fee9375e 100644
+--- a/icu4c/source/test/intltest/collationtest.cpp
++++ b/icu4c/source/test/intltest/collationtest.cpp
+@@ -78,6 +78,7 @@ class CollationTest : public IntlTest {
+ void TestRootElements();
+ void TestTailoredElements();
+ void TestDataDriven();
++ void TestLongLocale();
+
+ private:
+ void checkFCD(const char *name, CollationIterator &ci, CodePointIterator &cpi);
+@@ -148,6 +149,7 @@ void CollationTest::runIndexedTest(int32_t index, UBool exec, const char *&name,
+ TESTCASE_AUTO(TestRootElements);
+ TESTCASE_AUTO(TestTailoredElements);
+ TESTCASE_AUTO(TestDataDriven);
++ TESTCASE_AUTO(TestLongLocale);
+ TESTCASE_AUTO_END;
+ }
+
+@@ -1852,4 +1854,12 @@ void CollationTest::TestDataDriven() {
+ }
+ }
+
++void CollationTest::TestLongLocale() {
++ IcuTestErrorCode errorCode(*this, "TestLongLocale");
++ Locale longLocale("sie__1G_C_CEIE_CEZCX_CSUE_E_EIESZNI2_GB_LM_LMCSUE_LMCSX_"
++ "LVARIANT_MMCSIE_STEU_SU1GCEIE_SU6G_SU6SU6G_U_UBGE_UC_"
++ "UCEZCSI_UCIE_UZSIU_VARIANT_X@collation=bcs-ukvsz");
++ LocalPointer<Collator> coll(Collator::createInstance(longLocale, errorCode));
++}
++
+ #endif // !UCONFIG_NO_COLLATION
diff --git a/external/icu/e450fa50fc242282551f56b941dc93b9a8a0bcbb.patch.2 b/external/icu/e450fa50fc242282551f56b941dc93b9a8a0bcbb.patch.2
new file mode 100644
index 000000000000..4709cd8c37fd
--- /dev/null
+++ b/external/icu/e450fa50fc242282551f56b941dc93b9a8a0bcbb.patch.2
@@ -0,0 +1,39 @@
+From e450fa50fc242282551f56b941dc93b9a8a0bcbb Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang@chromium.org>
+Date: Tue, 13 Apr 2021 15:16:50 -0700
+Subject: [PATCH] ICU-21587 Fix memory bug w/ baseName
+
+Edge cases not fixed in assign and move assign operator
+while the locale is long and call setKeywordValue with incorrect
+keyword/values.
+---
+ icu4c/source/common/locid.cpp | 11 +++++++++--
+ icu4c/source/test/intltest/loctest.cpp | 26 ++++++++++++++++++++++++++
+ icu4c/source/test/intltest/loctest.h | 2 ++
+ 3 files changed, 37 insertions(+), 2 deletions(-)
+
+diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp
+index 02cd82a7b8e..3c6e5b06690 100644
+--- a/icu4c/source/common/locid.cpp
++++ b/icu4c/source/common/locid.cpp
+@@ -469,14 +469,18 @@ Locale& Locale::operator=(Locale&& other) U_NOEXCEPT {
+ if ((baseName != fullName) && (baseName != fullNameBuffer)) uprv_free(baseName);
+ if (fullName != fullNameBuffer) uprv_free(fullName);
+
+- if (other.fullName == other.fullNameBuffer) {
++ if (other.fullName == other.fullNameBuffer || other.baseName == other.fullNameBuffer) {
+ uprv_strcpy(fullNameBuffer, other.fullNameBuffer);
++ }
++ if (other.fullName == other.fullNameBuffer) {
+ fullName = fullNameBuffer;
+ } else {
+ fullName = other.fullName;
+ }
+
+- if (other.baseName == other.fullName) {
++ if (other.baseName == other.fullNameBuffer) {
++ baseName = fullNameBuffer;
++ } else if (other.baseName == other.fullName) {
+ baseName = fullName;
+ } else {
+ baseName = other.baseName;
diff --git a/external/libassuan/ExternalProject_libassuan.mk b/external/libassuan/ExternalProject_libassuan.mk
index 83d79a520988..899c21e4cec9 100644
--- a/external/libassuan/ExternalProject_libassuan.mk
+++ b/external/libassuan/ExternalProject_libassuan.mk
@@ -34,7 +34,7 @@ $(call gb_ExternalProject_get_state_target,libassuan,build): $(call gb_Executabl
GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \
GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
--host=$(gb_ExternalProject_libassuan_host) \
- RC='windres -O COFF --target=$(gb_ExternalProject_libassuan_target) --preprocessor='\''$(call gb_Executable_get_target,cpp) -+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)'\' \
+ RC='windres -O COFF --target=$(gb_ExternalProject_libassuan_target) --preprocessor=$(call gb_Executable_get_target,cpp) --preprocessor-arg=-+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)' \
MAKE=$(MAKE) \
&& $(MAKE) \
)
diff --git a/external/libetonyek/0001-fix-build-with-MSVC.patch.1 b/external/libetonyek/0001-fix-build-with-MSVC.patch.1
new file mode 100644
index 000000000000..2a72844dc79a
--- /dev/null
+++ b/external/libetonyek/0001-fix-build-with-MSVC.patch.1
@@ -0,0 +1,28 @@
+From 1aa22c746b41a688296f4daf4fc35710d2045a33 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Wed, 19 May 2021 19:43:43 +0200
+Subject: [PATCH] fix build with MSVC
+
+error C2664: 'libetonyek::IWORKFormula::IWORKFormula(const boost::optional<unsigned int> &)': cannot convert argument 1 from 'int' to 'const boost::optional<unsigned int> &'
+
+Change-Id: Iaa3de2d0ef8f960495e5d5afebb75c5063955177
+---
+ src/lib/IWAParser.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp
+index 7fd95c3..a2bd292 100644
+--- a/src/lib/IWAParser.cpp
++++ b/src/lib/IWAParser.cpp
+@@ -3403,7 +3403,7 @@ bool IWAParser::parseFormula(const IWAMessage &msg, IWORKFormulaPtr_t &formula)
+ }
+ else
+ {
+- formula.reset(new IWORKFormula(0));
++ formula.reset(new IWORKFormula(boost::make_optional(0u)));
+ formula->parse(stack[0]);
+ }
+ return ok;
+--
+2.31.1
+
diff --git a/external/libetonyek/0002-fix-build-with-MSVC.patch.1 b/external/libetonyek/0002-fix-build-with-MSVC.patch.1
new file mode 100644
index 000000000000..0eadb0912f6a
--- /dev/null
+++ b/external/libetonyek/0002-fix-build-with-MSVC.patch.1
@@ -0,0 +1,55 @@
+From 7b69af66227309e9c258beca3bc3934be454a221 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Wed, 19 May 2021 21:11:40 +0200
+Subject: [PATCH] fix build with MSVC
+
+C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\xutility(138): error C2668: 'libetonyek::IWORKStyle::IWORKStyle': ambiguous call to overloaded function
+C:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\workdir\UnpackedTarball\libetonyek\src\lib\IWORKStyle.h(32): note: could be 'libetonyek::IWORKStyle::IWORKStyle(const libetonyek::IWORKPropertyMap &,const boost::optional<std::string> &,const libetonyek::IWORKStylePtr_t &)'
+C:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\workdir\UnpackedTarball\libetonyek\src\lib\IWORKStyle.h(31): note: or 'libetonyek::IWORKStyle::IWORKStyle(const libetonyek::IWORKPropertyMap &,const boost::optional<std::string> &,const boost::optional<std::string> &)'
+C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\xutility(137): note: while trying to match the argument list '(libetonyek::IWORKPropertyMap, const boost::none_t, _Ty)'
+ with
+ [
+ _Ty=nullptr
+ ]
+C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\memory(2186): note: see reference to function template instantiation 'void std::_Construct_in_place<_Ty,libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(_Ty &,libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&) noexcept(false)' being compiled
+ with
+ [
+ _Ty=libetonyek::IWORKStyle
+ ]
+C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\memory(2906): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&)' being compiled
+ with
+ [
+ _Ty=libetonyek::IWORKStyle
+ ]
+C:/PROGRA~2/MIB055~1/2019/COMMUN~1/VC/Tools/MSVC/1428~1.299/Include\memory(2907): note: see reference to function template instantiation 'std::_Ref_count_obj2<_Ty>::_Ref_count_obj2<libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&)' being compiled
+ with
+ [
+ _Ty=libetonyek::IWORKStyle
+ ]
+C:/cygwin/home/tdf/lode/jenkins/workspace/gerrit_windows/workdir/UnpackedTarball/libetonyek/src/lib/IWAParser.cpp(2358): note: see reference to function template instantiation 'std::shared_ptr<libetonyek::IWORKStyle> std::make_shared<libetonyek::IWORKStyle,libetonyek::IWORKPropertyMap&,const boost::none_t&,nullptr>(libetonyek::IWORKPropertyMap &,const boost::none_t &,nullptr &&)' being compiled
+
+Change-Id: Idf871474b2a20f252073846388d018cccc15bc11
+---
+ src/lib/IWAParser.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib/IWAParser.cpp b/src/lib/IWAParser.cpp
+index a2bd292..1fdeae7 100644
+--- a/src/lib/IWAParser.cpp
++++ b/src/lib/IWAParser.cpp
+@@ -2355,10 +2355,10 @@ void IWAParser::parseAuthorInComment(unsigned id)
+ IWORKPropertyMap props;
+ // normally yellow, but blue may be better in LO
+ props.put<property::FontColor>(IWORKColor(0,0,1,1));
+- spans[0]=std::make_shared<IWORKStyle>(props, boost::none, nullptr);
++ spans[0]=std::make_shared<IWORKStyle>(props, boost::none, IWORKStylePtr_t());
+ // reset color to default, if not, comment will be blue colored
+ props.put<property::FontColor>(IWORKColor(0,0,0,1));
+- spans[unsigned(len)]=std::make_shared<IWORKStyle>(props, boost::none, nullptr);
++ spans[unsigned(len)]=std::make_shared<IWORKStyle>(props, boost::none, IWORKStylePtr_t());
+ text.setSpans(spans);
+ text.parse(*m_currentText);
+ }
+--
+2.31.1
+
diff --git a/external/libetonyek/Library_etonyek.mk b/external/libetonyek/Library_etonyek.mk
index cbbe08458410..87e21fc4b78a 100644
--- a/external/libetonyek/Library_etonyek.mk
+++ b/external/libetonyek/Library_etonyek.mk
@@ -118,6 +118,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,etonyek,\
UnpackedTarball/libetonyek/src/lib/contexts/IWORKBinaryElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKBrContext \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKCalcEngineContext \
+ UnpackedTarball/libetonyek/src/lib/contexts/IWORKCellCommentDrawableInfoElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKChartInfoElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKColorElement \
UnpackedTarball/libetonyek/src/lib/contexts/IWORKCoreImageFilterDescriptorElement \
diff --git a/external/libetonyek/UnpackedTarball_libetonyek.mk b/external/libetonyek/UnpackedTarball_libetonyek.mk
index cd7a30e8adea..de8c0dcd1cc5 100644
--- a/external/libetonyek/UnpackedTarball_libetonyek.mk
+++ b/external/libetonyek/UnpackedTarball_libetonyek.mk
@@ -20,6 +20,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\
external/libetonyek/ubsan.patch \
external/libetonyek/rpath.patch \
external/libetonyek/warnings.patch \
+ external/libetonyek/0001-fix-build-with-MSVC.patch.1 \
+ external/libetonyek/0002-fix-build-with-MSVC.patch.1 \
))
ifneq ($(OS),MACOSX)
diff --git a/external/libetonyek/libetonyek-bundled-soname.patch.0 b/external/libetonyek/libetonyek-bundled-soname.patch.0
index 5aaf61464edd..15a58fa83635 100644
--- a/external/libetonyek/libetonyek-bundled-soname.patch.0
+++ b/external/libetonyek/libetonyek-bundled-soname.patch.0
@@ -1,6 +1,7 @@
--- src/lib/Makefile.in.orig 2016-01-12 19:21:24.000000000 +0100
+++ src/lib/Makefile.in 2016-03-02 18:19:52.214551270 +0100
-@@ -538,6 +538,6 @@
+@@ -538,7 +538,7 @@
+ $(XML_CFLAGS) $(ZLIB_CFLAGS) $(DEBUG_CXXFLAGS) $(am__append_1)
libetonyek_@ETONYEK_MAJOR_VERSION@_@ETONYEK_MINOR_VERSION@_la_LIBADD = libetonyek_internal.la $(REVENGE_LIBS) $(LANGTAG_LIBS) $(XML_LIBS) $(ZLIB_LIBS) @LIBETONYEK_WIN32_RESOURCE@
libetonyek_@ETONYEK_MAJOR_VERSION@_@ETONYEK_MINOR_VERSION@_la_DEPENDENCIES = libetonyek_internal.la @LIBETONYEK_WIN32_RESOURCE@
-libetonyek_@ETONYEK_MAJOR_VERSION@_@ETONYEK_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined
diff --git a/external/libffi/ExternalPackage_libffi.mk b/external/libffi/ExternalPackage_libffi.mk
new file mode 100644
index 000000000000..212e63aa36af
--- /dev/null
+++ b/external/libffi/ExternalPackage_libffi.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,libffi,libffi))
+
+$(eval $(call gb_ExternalPackage_use_external_project,libffi,libffi))
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_ExternalPackage_add_files,libffi,$(LIBO_LIB_FOLDER),\
+ $(HOST_PLATFORM)/.libs/libffi-7.dll \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/libffi/ExternalProject_libffi.mk b/external/libffi/ExternalProject_libffi.mk
index bdf8fe61eb76..0ff625ea3e20 100644
--- a/external/libffi/ExternalProject_libffi.mk
+++ b/external/libffi/ExternalProject_libffi.mk
@@ -14,17 +14,34 @@ $(eval $(call gb_ExternalProject_register_targets,libffi,\
))
# set prefix so that it ends up in libffi.pc so that pkg-config in python3 works
+# For a static Windows build, change CPPFLAGS to include -D_LIB and --disable-static
+# Also remove the ExternalPackage in that case
+
+libffi_WIN_PLATFORM := $(strip \
+ $(if $(filter INTEL,$(CPUNAME)),32) \
+ $(if $(filter X86_64,$(CPUNAME)),64) \
+ $(if $(filter ARM64,$(CPUNAME)),arm64) \
+ )
$(call gb_ExternalProject_get_state_target,libffi,build):
$(call gb_ExternalProject_run,build,\
+ export LIB="$(ILIB)" && \
./configure \
--enable-option-checking=fatal \
- $(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
- --enable-static \
- --disable-shared \
- --with-pic \
- --enable-portable-binary \
- CC="$(CC) $(if $(filter LINUX,$(OS)),-fvisibility=hidden)" \
+ --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
+ $(if $(filter LINUX,$(OS)), \
+ --disable-shared \
+ CC="$(CC) -fvisibility=hidden" \
+ --with-pic \
+ --enable-portable-binary) \
+ $(if $(filter WNT,$(OS)), \
+ --disable-static \
+ CC="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \
+ CXX="$(call gb_UnpackedTarball_get_dir,libffi)/msvcc.sh -m$(libffi_WIN_PLATFORM)" \
+ LD='link' \
+ CPP='cl -nologo -EP' \
+ CXXCPP='cl -nologo -EP' \
+ CPPFLAGS="-DFFI_BUILDING_DLL $(SOLARINC)") \
--prefix=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM) \
--disable-docs \
&& $(MAKE) \
diff --git a/external/libffi/Module_libffi.mk b/external/libffi/Module_libffi.mk
index 739fd4197000..ace75480abe3 100644
--- a/external/libffi/Module_libffi.mk
+++ b/external/libffi/Module_libffi.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,libffi))
$(eval $(call gb_Module_add_targets,libffi,\
UnpackedTarball_libffi \
ExternalProject_libffi \
+ ExternalPackage_libffi \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/libgpg-error/ExternalProject_libgpg-error.mk b/external/libgpg-error/ExternalProject_libgpg-error.mk
index 1fcd63180e20..e5155aad94c1 100644
--- a/external/libgpg-error/ExternalProject_libgpg-error.mk
+++ b/external/libgpg-error/ExternalProject_libgpg-error.mk
@@ -28,7 +28,7 @@ $(call gb_ExternalProject_get_state_target,libgpg-error,build): $(call gb_Execut
--disable-doc \
--disable-tests \
--host=$(gb_ExternalProject_libgpg-error_host) \
- RC='windres -O COFF --target=$(gb_ExternalProject_libgpg-error_target) --preprocessor='\''$(call gb_Executable_get_target,cpp) -+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)'\' \
+ RC='windres -O COFF --target=$(gb_ExternalProject_libgpg-error_target) --preprocessor=$(call gb_Executable_get_target,cpp) --preprocessor-arg=-+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)' \
&& $(MAKE) \
)
else
diff --git a/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk b/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk
index a99df67bb011..5440d16ecfc1 100644
--- a/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk
+++ b/external/libjpeg-turbo/UnpackedTarball_libjpeg-turbo.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libjpeg-turbo,\
external/libjpeg-turbo/jpeg-turbo.build.patch.1 \
$(if $(filter WNT,$(OS)),external/libjpeg-turbo/jpeg-turbo.win_build.patch.1) \
external/libjpeg-turbo/ubsan.patch \
+ external/libjpeg-turbo/c76f4a08263b0cea40d2967560ac7c21f6959079.patch.1 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/libjpeg-turbo/c76f4a08263b0cea40d2967560ac7c21f6959079.patch.1 b/external/libjpeg-turbo/c76f4a08263b0cea40d2967560ac7c21f6959079.patch.1
new file mode 100644
index 000000000000..cc3da737e7b0
--- /dev/null
+++ b/external/libjpeg-turbo/c76f4a08263b0cea40d2967560ac7c21f6959079.patch.1
@@ -0,0 +1,38 @@
+From c76f4a08263b0cea40d2967560ac7c21f6959079 Mon Sep 17 00:00:00 2001
+From: DRC <information@libjpeg-turbo.org>
+Date: Thu, 5 Dec 2019 13:12:28 -0600
+Subject: [PATCH] Huffman enc.: Fix very rare local buffer overrun
+
+... detected by ASan. This is a similar issue to the issue that was
+fixed with 402a715f82313384ef4606660c32d8678c79f197. Apparently it is
+possible to create a malformed JPEG image that exceeds the Huffman
+encoder's 256-byte local buffer when attempting to losslessly tranform
+the image. That makes sense, given that it was necessary to extend the
+Huffman decoder's local buffer to 512 bytes in order to handle all
+pathological cases (refer to 0463f7c9aad060fcd56e98d025ce16185279e2bc.)
+
+Since this issue affected only lossless transformation, a workflow that
+isn't generally exposed to arbitrary data exploits, and since the
+overrun did not overflow the stack (i.e. it did not result in a segfault
+or other user-visible issue, and valgrind didn't even detect it), it did
+not likely pose a security risk.
+
+Fixes #392
+---
+ ChangeLog.md | 10 ++++++++++
+ jchuff.c | 2 +-
+ 2 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/jchuff.c b/jchuff.c
+index 206958e2f..cb05055d9 100644
+--- a/jchuff.c
++++ b/jchuff.c
+@@ -432,7 +432,7 @@ dump_buffer(working_state *state)
+ * scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
+ * larger than 200 bytes.
+ */
+-#define BUFSIZE (DCTSIZE2 * 4)
++#define BUFSIZE (DCTSIZE2 * 8)
+
+ #define LOAD_BUFFER() { \
+ if (state->free_in_buffer < BUFSIZE) { \
diff --git a/external/liblangtag/UnpackedTarball_liblangtag.mk b/external/liblangtag/UnpackedTarball_liblangtag.mk
index cd52b169fa57..66b8051782d0 100644
--- a/external/liblangtag/UnpackedTarball_liblangtag.mk
+++ b/external/liblangtag/UnpackedTarball_liblangtag.mk
@@ -17,6 +17,8 @@ $(eval $(call gb_UnpackedTarball_set_pre_action,liblangtag,\
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,liblangtag))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,liblangtag,0))
+
ifneq ($(OS),MACOSX)
ifneq ($(OS),WNT)
$(eval $(call gb_UnpackedTarball_add_patches,liblangtag,\
@@ -29,6 +31,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liblangtag, \
$(if $(SYSTEM_LIBXML),,external/liblangtag/langtag-libtool-rpath.patch.0) \
external/liblangtag/clang-cl.patch.0 \
external/liblangtag/langtag-valencia.patch.0 \
+ external/liblangtag/Wformat-overflow.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/liblangtag/Wformat-overflow.patch b/external/liblangtag/Wformat-overflow.patch
new file mode 100644
index 000000000000..f2d017e4b395
--- /dev/null
+++ b/external/liblangtag/Wformat-overflow.patch
@@ -0,0 +1,17 @@
+--- liblangtag/lt-script-db.c
++++ liblangtag/lt-script-db.c
+@@ -134,8 +134,12 @@
+ cnode = cnode->next;
+ }
+ if (!subtag) {
+- lt_warning("No subtag node: description = '%s'",
+- desc);
++ if (!desc) {
++ lt_warning("No subtag nor description node");
++ } else {
++ lt_warning("No subtag node: description = '%s'",
++ desc);
++ }
+ goto bail1;
+ }
+ if (!desc) {
diff --git a/external/libmwaw/Library_mwaw.mk b/external/libmwaw/Library_mwaw.mk
index fc874fcb5e45..880a70861e24 100644
--- a/external/libmwaw/Library_mwaw.mk
+++ b/external/libmwaw/Library_mwaw.mk
@@ -120,6 +120,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,mwaw,\
UnpackedTarball/libmwaw/src/lib/MWAWSpreadsheetDecoder \
UnpackedTarball/libmwaw/src/lib/MWAWSpreadsheetEncoder \
UnpackedTarball/libmwaw/src/lib/MWAWSpreadsheetListener \
+ UnpackedTarball/libmwaw/src/lib/MWAWStream \
UnpackedTarball/libmwaw/src/lib/MWAWStringStream \
UnpackedTarball/libmwaw/src/lib/MWAWSubDocument \
UnpackedTarball/libmwaw/src/lib/MWAWTable \
@@ -173,10 +174,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,mwaw,\
UnpackedTarball/libmwaw/src/lib/PowerPoint7Text \
UnpackedTarball/libmwaw/src/lib/RagTime5Chart \
UnpackedTarball/libmwaw/src/lib/RagTime5ClusterManager \
+ UnpackedTarball/libmwaw/src/lib/RagTime5Document \
+ UnpackedTarball/libmwaw/src/lib/RagTime5Formula \
UnpackedTarball/libmwaw/src/lib/RagTime5Graph \
UnpackedTarball/libmwaw/src/lib/RagTime5Layout \
UnpackedTarball/libmwaw/src/lib/RagTime5Parser \
UnpackedTarball/libmwaw/src/lib/RagTime5Pipeline \
+ UnpackedTarball/libmwaw/src/lib/RagTime5SSParser \
UnpackedTarball/libmwaw/src/lib/RagTime5Spreadsheet \
UnpackedTarball/libmwaw/src/lib/RagTime5StructManager \
UnpackedTarball/libmwaw/src/lib/RagTime5StyleManager \
diff --git a/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 b/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1
deleted file mode 100644
index 1fc4e6b9d261..000000000000
--- a/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1
+++ /dev/null
@@ -1,58 +0,0 @@
-From 68e0c8e4c834df57bc9a0e8da72151f69ff5e7a6 Mon Sep 17 00:00:00 2001
-From: David Tardon <dtardon@redhat.com>
-Date: Fri, 12 Aug 2016 12:50:39 +0200
-Subject: [PATCH] tdf#101077 make double->string conversion locale-agnostic
-
----
- src/OdsGenerator.cxx | 19 +++++++++++++++++--
- 1 file changed, 17 insertions(+), 2 deletions(-)
-
-diff --git a/src/OdsGenerator.cxx b/src/OdsGenerator.cxx
-index 52e135e..8cb7203 100644
---- a/src/OdsGenerator.cxx
-+++ b/src/OdsGenerator.cxx
-@@ -26,6 +26,8 @@
-
- #include <librevenge/librevenge.h>
-
-+#include <iomanip>
-+#include <locale>
- #include <map>
- #include <stack>
- #include <sstream>
-@@ -46,6 +48,19 @@
- #include "OdcGenerator.hxx"
- #include "OdfGenerator.hxx"
-
-+namespace
-+{
-+
-+librevenge::RVNGString makePreciseStr(const double value)
-+{
-+ std::ostringstream os;
-+ os.imbue(std::locale::classic());
-+ os << std::fixed << std::setprecision(8) << value;
-+ return os.str().c_str();
-+}
-+
-+}
-+
- class OdsGeneratorPrivate : public OdfGenerator
- {
- public:
-@@ -968,10 +983,10 @@ void OdsGenerator::openSheetCell(const librevenge::RVNGPropertyList &propList)
- // we need the maximum precision here, so we must avoid getStr() when possible
- librevenge::RVNGString value;
- if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_GENERIC)
-- value.sprintf("%.8f", propList["librevenge:value"]->getDouble());
-+ value = makePreciseStr(propList["librevenge:value"]->getDouble());
- else if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_PERCENT)
- {
-- value.sprintf("%.8f", propList["librevenge:value"]->getDouble()*100.);
-+ value = makePreciseStr(propList["librevenge:value"]->getDouble()*100.);
- value.append('%');
- }
- else
---
-2.7.4
-
diff --git a/external/libodfgen/ExternalProject_libodfgen.mk b/external/libodfgen/ExternalProject_libodfgen.mk
index c02b4f532d65..a173cdd47535 100644
--- a/external/libodfgen/ExternalProject_libodfgen.mk
+++ b/external/libodfgen/ExternalProject_libodfgen.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,libodfgen,\
))
$(eval $(call gb_ExternalProject_use_externals,libodfgen,\
+ libxml2 \
revenge \
))
@@ -33,10 +34,11 @@ $(call gb_ExternalProject_get_state_target,libodfgen,build) :
--disable-werror \
--disable-weffc \
--without-docs \
- --with-sharedptr=c++11 \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
CPPFLAGS="$(CPPFLAGS) $(if $(SYSTEM_REVENGE),,$(if $(filter-out MSC,$(COM)),-DLIBREVENGE_VISIBILITY))" \
+ XML_CFLAGS="$(LIBXML_CFLAGS)" \
+ XML_LIBS="$(LIBXML_LIBS)" \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
diff --git a/external/libodfgen/Library_odfgen.mk b/external/libodfgen/Library_odfgen.mk
index 946fa9081452..b67f5ad89715 100644
--- a/external/libodfgen/Library_odfgen.mk
+++ b/external/libodfgen/Library_odfgen.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_Library_Library,odfgen))
$(eval $(call gb_Library_use_unpacked,odfgen,libodfgen))
$(eval $(call gb_Library_use_externals,odfgen,\
+ libxml2 \
revenge \
))
@@ -26,7 +27,6 @@ $(eval $(call gb_Library_add_defs,odfgen,\
-DDLL_EXPORT \
-DLIBODFGEN_BUILD \
-DNDEBUG \
- -DSHAREDPTR_STD \
-DPACKAGE=\"libodfgen\" \
-DVERSION=\"0.1.$(ODFGEN_VERSION_MICRO)\" \
))
@@ -40,6 +40,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,odfgen,\
UnpackedTarball/libodfgen/src/GraphicStyle \
UnpackedTarball/libodfgen/src/InternalHandler \
UnpackedTarball/libodfgen/src/ListStyle \
+ UnpackedTarball/libodfgen/src/NumberingStyle \
UnpackedTarball/libodfgen/src/OdcGenerator \
UnpackedTarball/libodfgen/src/OdfGenerator \
UnpackedTarball/libodfgen/src/OdgGenerator \
diff --git a/external/libodfgen/UnpackedTarball_libodfgen.mk b/external/libodfgen/UnpackedTarball_libodfgen.mk
index c4ea2939f4cb..d6c84e517970 100644
--- a/external/libodfgen/UnpackedTarball_libodfgen.mk
+++ b/external/libodfgen/UnpackedTarball_libodfgen.mk
@@ -29,12 +29,4 @@ $(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
endif
endif
-# * external/libodfgen/c++11.patch: obsoleted upstream by
-# <https://sourceforge.net/p/libwpd/libodfgen/ci/e11112e50562de4f3252227bfba175ededf82194/>
-# "boost::shared_ptr -> std::shared_ptr"
-$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \
- external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 \
- external/libodfgen/c++11.patch \
-))
-
# vim: set noet sw=4 ts=4:
diff --git a/external/libodfgen/c++11.patch b/external/libodfgen/c++11.patch
deleted file mode 100644
index f41d1a166964..000000000000
--- a/external/libodfgen/c++11.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-# Add -std=c++11 before existing CXXFLAGS, in case those already contain some -std= (which will thus
-# override the preceding -std=c++11, which is likely what the caller passing in those CXXFLAGS
-# intends):
-#
-#--- configure.ac
-#+++ configure.ac
-#@@ -217,7 +217,7 @@
-# AS_IF([test "x$with_sharedptr" = "xc++11"], [
-# AC_MSG_CHECKING([for c++11 shared ptr])
-# save_CXXFLAGS="$CXXFLAGS"
-#- CXXFLAGS="$CXXFLAGS -std=c++11"
-#+ CXXFLAGS="-std=c++11 $CXXFLAGS"
-# AC_COMPILE_IFELSE([
-# AC_LANG_PROGRAM(
-# [[#include <memory>]],
-#@@ -241,7 +241,7 @@
-# AC_MSG_RESULT([no])
-# ], [
-# AC_MSG_RESULT([yes])
-#- CXXFLAGS="$CXXFLAGS -std=c++11"
-#+ CXXFLAGS="-std=c++11 $CXXFLAGS"
-# ])
-# ])
-# AS_IF([test "x$with_sharedptr" = "xtr1"], [
---- configure
-+++ configure
-@@ -16723,7 +16723,7 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for c++11 shared ptr" >&5
- $as_echo_n "checking for c++11 shared ptr... " >&6; }
- save_CXXFLAGS="$CXXFLAGS"
-- CXXFLAGS="$CXXFLAGS -std=c++11"
-+ CXXFLAGS="-std=c++11 $CXXFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-@@ -16780,7 +16780,7 @@
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-- CXXFLAGS="$CXXFLAGS -std=c++11"
-+ CXXFLAGS="-std=c++11 $CXXFLAGS"
-
- fi
- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
diff --git a/external/libodfgen/libodfgen-bundled-soname.patch.0 b/external/libodfgen/libodfgen-bundled-soname.patch.0
index 052ba795e40e..d012fe3a8f65 100644
--- a/external/libodfgen/libodfgen-bundled-soname.patch.0
+++ b/external/libodfgen/libodfgen-bundled-soname.patch.0
@@ -1,9 +1,10 @@
+-*- Mode: Diff -*-
diff -urN src/Makefile.in.orig src/Makefile.in
--- src/Makefile.in.orig 2016-03-02 17:17:02.812606210 +0100
+++ src/Makefile.in 2016-03-02 17:17:25.176670151 +0100
@@ -355,7 +355,7 @@
- AM_CXXFLAGS = -I$(top_srcdir)/inc/ $(REVENGE_CFLAGS) $(DEBUG_CXXFLAGS) -DLIBODFGEN_BUILD
- libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LIBADD = @LIBODFGEN_WIN32_RESOURCE@ $(REVENGE_LIBS)
+ $(XML_CFLAGS) -DLIBODFGEN_BUILD $(am__append_1)
+ libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LIBADD = @LIBODFGEN_WIN32_RESOURCE@ $(REVENGE_LIBS) $(XML_LIBS)
libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_DEPENDENCIES = @LIBODFGEN_WIN32_RESOURCE@
-libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined
+libodfgen_@LIBODFGEN_MAJOR_VERSION@_@LIBODFGEN_MINOR_VERSION@_la_LDFLAGS = $(version_info) -export-dynamic -no-undefined -release lo
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index e5e33b0b1249..3b54db0e49ce 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -20,6 +20,11 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
external/liborcus/gcc9.patch.0 \
external/liborcus/libtool.patch.0 \
external/liborcus/fix-pch.patch.0 \
+ external/liborcus/include.patch.0 \
+))
+
+$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
+ external/liborcus/allow-utf-8-in-xml-names.patch \
))
ifeq ($(OS),WNT)
diff --git a/external/liborcus/allow-utf-8-in-xml-names.patch b/external/liborcus/allow-utf-8-in-xml-names.patch
new file mode 100644
index 000000000000..e3430881053d
--- /dev/null
+++ b/external/liborcus/allow-utf-8-in-xml-names.patch
@@ -0,0 +1,301 @@
+From fa9b6845ed583f5486372c6ffbc59e02a140d303 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak@centrum.cz>
+Date: Thu, 29 Apr 2021 19:12:20 +0200
+Subject: [PATCH] allow utf-8 in xml names (#137)
+
+https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-NameStartChar
+has a list of all allowed characters.
+---
+ include/orcus/sax_parser_base.hpp | 3 +
+ src/orcus_test_xml.cpp | 1 +
+ src/parser/sax_parser_base.cpp | 201 ++++++++++++++++++++++++++++--
+ test/xml/non-ascii/check.txt | 4 +
+ test/xml/non-ascii/input.xml | 4 +
+ 5 files changed, 201 insertions(+), 12 deletions(-)
+ create mode 100644 test/xml/non-ascii/check.txt
+ create mode 100644 test/xml/non-ascii/input.xml
+
+diff --git a/include/orcus/sax_parser_base.hpp b/include/orcus/sax_parser_base.hpp
+index 9939e133..8394c07b 100644
+--- a/include/orcus/sax_parser_base.hpp
++++ b/include/orcus/sax_parser_base.hpp
+@@ -218,6 +218,9 @@ protected:
+ void element_name(parser_element& elem, std::ptrdiff_t begin_pos);
+ void attribute_name(pstring& attr_ns, pstring& attr_name);
+ void characters_with_encoded_char(cell_buffer& buf);
++
++ int is_name_char();
++ int is_name_start_char();
+ };
+
+ }}
+diff --git a/src/orcus_test_xml.cpp b/src/orcus_test_xml.cpp
+index 8a864d68..35f3dea7 100644
+--- a/src/orcus_test_xml.cpp
++++ b/src/orcus_test_xml.cpp
+@@ -77,6 +77,7 @@ const char* sax_parser_test_dirs[] = {
+ SRCDIR"/test/xml/no-decl-1/",
+ SRCDIR"/test/xml/underscore-identifier/",
+ SRCDIR"/test/xml/self-closing-root/",
++ SRCDIR"/test/xml/non-ascii/",
+ };
+
+ const char* sax_parser_parse_only_test_dirs[] = {
+diff --git a/src/parser/sax_parser_base.cpp b/src/parser/sax_parser_base.cpp
+index 97aa34ec..db51ff94 100644
+--- a/src/parser/sax_parser_base.cpp
++++ b/src/parser/sax_parser_base.cpp
+@@ -328,20 +328,182 @@ bool parser_base::value(pstring& str, bool decode)
+ return transient_stream();
+ }
+
++// https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-NameStartChar
++// Return length of the character in bytes, otherwise 0.
++template< bool only_start_name >
++static
++int is_name_char_helper(const char* mp_char, const char* mp_end)
++{
++ const unsigned char first = mp_char[0];
++ // Note that ':' technically is an allowed name character, but it is handled separately
++ // e.g. in element_name(), so here pretend it isn't.
++ if (/*first == ':' ||*/ first == '_' || (first >= 'A' && first <= 'Z') || (first >= 'a' && first <= 'z'))
++ return 1;
++ if (!only_start_name && (first == '-' || first == '.' || (first >= '0' && first <= '9')))
++ return 1;
++
++ if (first < 0x7f) // other ascii characters are not allowed
++ return 0;
++ if (mp_end < mp_char + 1)
++ return 0;
++ const unsigned char second = mp_char[1];
++
++ // 0xb7 = 0xc2 0xb7 utf-8
++ if (!only_start_name && first == 0xc2 && second == 0xb7)
++ return 2;
++
++ // [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF]
++ // 0xc0 = 0xc3 0x80 utf-8
++ if (first < 0xc3)
++ return 0;
++ // xd7 = 0xc3 0x97 utf-8, 0xf7 = 0xc3 0xb7 utf-8
++ if (first == 0xc3)
++ return second >= 0x80 && second <= 0xff && second != 0x97 && second != 0xb7 ? 2 : 0;
++ // 0x2ff = 0xcb 0xbf utf-8, 0x300 = 0xcc 0x80 utf-8
++ if (first >= 0xc4 && first <= 0xcb)
++ return 2;
++
++ // [#x0300-#x036F]
++ // 0x0300 = 0xcc 0x80 utf-8, 0x36f = 0xcd 0xaf utf-8
++ if (!only_start_name && first == 0xcc)
++ return 2;
++ if (!only_start_name && first == 0xcd && second <= 0xaf)
++ return 2;
++
++ // [#x370-#x37D] | [#x37F-#x1FFF]
++ // 0x370 = 0xcd 0xb0 utf-8, 0x37e = 0xcd 0xbe
++ if (first < 0xcd)
++ return 0;
++ if (first == 0xcd)
++ return second >= 0xb0 && second != 0xbe ? 2 : 0;
++ // 0x07ff = 0xdf 0xbf utf-8 (the last 2-byte utf-8)
++ if (first <= 0xdf)
++ return 2;
++
++ if (first < 0xe0)
++ return 0;
++ if (mp_end < mp_char + 2)
++ return 0;
++ const unsigned char third = mp_char[2];
++
++ // 0x0800 = 0xe0 0xa0 0x80 utf-8, 0x1fff = 0xe1 0xbf 0xbf utf-8, 0x2000 = 0xe2 0x80 0x80
++ if (first == 0xe0 || first == 0xe1)
++ return 3;
++
++ // [#x200C-#x200D]
++ // 0x200c = 0xe2 0x80 0x8c utf-8, 0x200d = 0xe2 0x80 0x8d utf-8
++ if (first < 0xe2)
++ return 0;
++ if (first == 0xe2 && second == 0x80 && (third == 0x8c || third == 0x8d))
++ return 3;
++
++ // [#x203F-#x2040]
++ // 0x203f = 0xe2 0x80 0xbf utf-8, 0x2040 = 0xe2 0x81 0x80 utf-8
++ if (!only_start_name && first == 0xe2 && second == 0x80 && third == 0xbf)
++ return 3;
++ if (!only_start_name && first == 0xe2 && second == 0x81 && third == 0x80)
++ return 3;
++
++ // [#x2070-#x218F]
++ // 0x2070 = 0xe2 0x81 0xb0 utf-8, 0x218f = 0xe2 0x86 0x8f utf-8
++ if (first == 0xe2)
++ {
++ if (second < 0x81)
++ return 0;
++ if (second >= 0x81 && second < 0x86)
++ return 3;
++ if (second == 0x86 && third <= 0x8f)
++ return 3;
++ }
++
++ // [#x2C00-#x2FEF]
++ // 0x2c00 = 0xe2 0xb0 0x80 utf-8, 0x2fef = 0xe2 0xbf 0xaf utf-8
++ if (first == 0xe2)
++ {
++ if (second < 0xb0)
++ return 0;
++ if (second < 0xbf)
++ return 3;
++ if (second == 0xbf && third <= 0xaf)
++ return 3;
++ }
++
++ // [#x3001-#xD7FF]
++ // 0x3001 = 0xe3 0x80 0x81 utf-8, 0xd7ff = 0xed 0x9f 0xbf utf-8, 0xd800 = 0xed 0xa0 0x80 utf-8
++ if (first < 0xe3)
++ return 0;
++ if (first < 0xed)
++ return 3;
++ if (first == 0xed && second <= 0x9f)
++ return 3;
++
++ // [#xF900-#xFDCF]
++ // 0xf900 = 0xef 0xa4 0x80 utf-8, 0xfdcf = 0xef 0xb7 0x8f utf-8
++ if (first == 0xef)
++ {
++ if (second < 0xa4)
++ return 0;
++ if (second < 0xb7)
++ return 3;
++ if (second == 0xb7 && third <= 0x8f)
++ return 3;
++ }
++
++ // [#xFDF0-#xFFFD]
++ // 0xfdf0 = 0xef 0xb7 0xb0 utf-8, 0xfffd = 0xef 0xbf 0xbd utf-8
++ if (first == 0xef)
++ {
++ assert(second >= 0xb7);
++ if (second == 0xb7 && third < 0xb0)
++ return 0;
++ if (second < 0xbe)
++ return 3;
++ if (second == 0xbf && third <= 0xbd)
++ return 3;
++ }
++
++ if (first < 0xf0)
++ return 0;
++ if (mp_end < mp_char + 3)
++ return 0;
++ // const unsigned char fourth = mp_char[3];
++
++ // [#x10000-#xEFFFF]
++ // 0x10000 = 0xf0 0x90 0x80 0x80 utf-8, 0xeffff = 0xf3 0xaf 0xbf 0xbf utf-8,
++ // 0xf0000 = 0xf3 0xb0 0x80 0x80 utf-8
++ if (first >= 0xf0 && first < 0xf2)
++ return 4;
++ if (first == 0xf3 && second < 0xb0)
++ return 4;
++
++ return 0;
++}
++
++int parser_base::is_name_char()
++{
++ return is_name_char_helper<false>(mp_char, mp_end);
++}
++
++int parser_base::is_name_start_char()
++{
++ return is_name_char_helper<true>(mp_char, mp_end);
++}
++
+ void parser_base::name(pstring& str)
+ {
+ const char* p0 = mp_char;
+- char c = cur_char();
+- if (!is_alpha(c) && c != '_')
++ int skip = is_name_start_char();
++ if (skip == 0)
+ {
+ ::std::ostringstream os;
+- os << "name must begin with an alphabet, but got this instead '" << c << "'";
++ os << "name must begin with an alphabet, but got this instead '" << cur_char() << "'";
+ throw malformed_xml_error(os.str(), offset());
+ }
++ next(skip);
+
+ #if defined(__ORCUS_CPU_FEATURES) && defined(__SSE4_2__)
+
+- const __m128i match = _mm_loadu_si128((const __m128i*)"azAZ09--__");
++ const __m128i match = _mm_loadu_si128((const __m128i*)"azAZ09--__..");
+ const int mode = _SIDD_LEAST_SIGNIFICANT | _SIDD_CMP_RANGES | _SIDD_UBYTE_OPS | _SIDD_NEGATIVE_POLARITY;
+
+ size_t n_total = available_size();
+@@ -351,20 +513,35 @@ void parser_base::name(pstring& str)
+ __m128i char_block = _mm_loadu_si128((const __m128i*)mp_char);
+
+ int n = std::min<size_t>(16u, n_total);
+- int r = _mm_cmpestri(match, 10, char_block, n, mode);
++ int r = _mm_cmpestri(match, 12, char_block, n, mode);
+ mp_char += r; // Move the current char position.
++ n_total -= r;
+
+- if (r < 16)
+- // No need to move to the next segment. Stop here.
+- break;
++ if (r < 16 && n_total)
++ {
++ // There is a character that does not match the SSE-based ASCII-only check.
++ // It may either by an ascii character that is not allowed, in which case stop,
++ // or it may possibly be an allowed utf-8 character, in which case move over it
++ // using the slow function.
++ skip = is_name_char();
++ if(skip == 0)
++ break;
++ next(skip);
++ n_total -= skip;
++ }
+
+- // Skip 16 chars to the next segment.
+- n_total -= 16;
+ }
++ cur_char_checked(); // check end of xml stream
+
+ #else
+- while (is_alpha(c) || is_numeric(c) || is_name_char(c))
+- c = next_char_checked();
++ for(;;)
++ {
++ cur_char_checked(); // check end of xml stream
++ skip = is_name_char();
++ if(skip == 0)
++ break;
++ next(skip);
++ }
+ #endif
+
+ str = pstring(p0, mp_char-p0);
+diff --git a/test/xml/non-ascii/check.txt b/test/xml/non-ascii/check.txt
+new file mode 100644
+index 00000000..77b7c003
+--- /dev/null
++++ b/test/xml/non-ascii/check.txt
+@@ -0,0 +1,4 @@
++/Myšička
++/Myšička@jméno="Žužla"
++/Myšička/Nožičky
++/Myšička/Nožičky"4"
+diff --git a/test/xml/non-ascii/input.xml b/test/xml/non-ascii/input.xml
+new file mode 100644
+index 00000000..c516744b
+--- /dev/null
++++ b/test/xml/non-ascii/input.xml
+@@ -0,0 +1,4 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<Myšička jméno="Žužla">
++ <Nožičky>4</Nožičky>
++</Myšička>
+--
+2.26.2
+
diff --git a/external/liborcus/include.patch.0 b/external/liborcus/include.patch.0
new file mode 100644
index 000000000000..7f876463a988
--- /dev/null
+++ b/external/liborcus/include.patch.0
@@ -0,0 +1,30 @@
+--- src/liborcus/orcus_xlsx.cpp
++++ src/liborcus/orcus_xlsx.cpp
+@@ -32,6 +32,7 @@
+
+ #include <cstdlib>
+ #include <iostream>
++#include <limits>
+ #include <string>
+ #include <cstring>
+ #include <sstream>
+--- src/liborcus/xls_xml_context.cpp
++++ src/liborcus/xls_xml_context.cpp
+@@ -16,6 +16,7 @@
+ #include <mdds/sorted_string_map.hpp>
+
+ #include <iostream>
++#include <limits>
+
+ using namespace std;
+
+--- src/liborcus/xlsx_revision_context.cpp
++++ src/liborcus/xlsx_revision_context.cpp
+@@ -16,6 +16,7 @@
+ #include "orcus/global.hpp"
+
+ #include <iostream>
++#include <limits>
+
+ using namespace std;
+
diff --git a/external/libwpd/UnpackedTarball_libwpd.mk b/external/libwpd/UnpackedTarball_libwpd.mk
index 8d0227b9379d..eefa9331c8d6 100644
--- a/external/libwpd/UnpackedTarball_libwpd.mk
+++ b/external/libwpd/UnpackedTarball_libwpd.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libwpd))
$(eval $(call gb_UnpackedTarball_add_patches,libwpd,\
external/libwpd/libwpd-vs2013.patch.1 \
$(if $(SYSTEM_REVENGE),,external/libwpd/rpath.patch) \
+ external/libwpd/include.patch \
))
ifneq ($(OS),MACOSX)
diff --git a/external/libwpd/include.patch b/external/libwpd/include.patch
new file mode 100644
index 000000000000..57f52b4b0aa5
--- /dev/null
+++ b/external/libwpd/include.patch
@@ -0,0 +1,10 @@
+--- src/lib/WPXTable.h
++++ src/lib/WPXTable.h
+@@ -36,6 +36,7 @@
+ #ifndef _WPXTABLE_H
+ #define _WPXTABLE_H
+
++#include <stddef.h>
+ #include <vector>
+
+ struct WPXTableCell
diff --git a/external/libxml2/ExternalPackage_libxml2.mk b/external/libxml2/ExternalPackage_libxml2.mk
index d38eb68df0cb..6338fb20b9df 100644
--- a/external/libxml2/ExternalPackage_libxml2.mk
+++ b/external/libxml2/ExternalPackage_libxml2.mk
@@ -21,7 +21,7 @@ else # COM=MSC
$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,win32/bin.msvc/libxml2.dll))
endif
else # OS!=WNT
-$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.9.$(LIBXML_VERSION_MICRO)))
+$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.10.$(LIBXML_VERSION_MICRO)))
endif
endif # DISABLE_DYNLOADING
diff --git a/external/libxml2/UnpackedTarball_libxml2.mk b/external/libxml2/UnpackedTarball_libxml2.mk
index 37b5bad97549..8c81c3d26e4c 100644
--- a/external/libxml2/UnpackedTarball_libxml2.mk
+++ b/external/libxml2/UnpackedTarball_libxml2.mk
@@ -14,14 +14,14 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libxml2,$(LIBXML_TARBALL),,libxml2)
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,libxml2))
$(eval $(call gb_UnpackedTarball_add_patches,libxml2,\
- external/libxml2/libxml2-config.patch.1 \
external/libxml2/libxml2-global-symbols.patch \
external/libxml2/libxml2-vc10.patch \
$(if $(filter ANDROID,$(OS)),external/libxml2/libxml2-android.patch) \
$(if $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED), \
external/libxml2/libxml2-icu-sym.patch.0, \
external/libxml2/libxml2-icu.patch.0) \
- external/libxml2/ubsan.patch.0 \
))
+$(eval $(call gb_UnpackedTarball_add_file,libxml2,xml2-config.in,external/libxml2/xml2-config.in))
+
# vim: set noet sw=4 ts=4:
diff --git a/external/libxml2/libxml2-android.patch b/external/libxml2/libxml2-android.patch
index 42af83274026..acf9b17e02db 100644
--- a/external/libxml2/libxml2-android.patch
+++ b/external/libxml2/libxml2-android.patch
@@ -2,9 +2,9 @@
+++ misc/build/libxml2-2.7.6/Makefile.in
@@ -1635,7 +1635,7 @@
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
- check: $(BUILT_SOURCES)
- $(MAKE) $(AM_MAKEFLAGS) check-recursive
--all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+ check: check-recursive
+-all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(DATA) \
+all-am: Makefile $(LTLIBRARIES) \
config.h
install-binPROGRAMS: install-libLTLIBRARIES
diff --git a/external/libxml2/libxml2-config.patch.1 b/external/libxml2/libxml2-config.patch.1
deleted file mode 100644
index 8c28fb6a7806..000000000000
--- a/external/libxml2/libxml2-config.patch.1
+++ /dev/null
@@ -1,43 +0,0 @@
-Hack the xml2-config to return paths into WORKDIR.
-
---- a/xml2-config.in 2009-12-17 11:45:20.000000000 +0000
-+++ b/xml2-config.in 2009-12-17 11:45:36.000000000 +0000
-@@ -1,9 +1,14 @@
- #! /bin/sh
-
--prefix=@prefix@
--exec_prefix=@exec_prefix@
--includedir=@includedir@
--libdir=@libdir@
-+#prefix=@prefix@
-+#exec_prefix=@exec_prefix@
-+#includedir=@includedir@
-+#libdir=@libdir@
-+
-+prefix=${WORKDIR}/UnpackedTarball/libxml2
-+exec_prefix=${WORKDIR}/UnpackedTarball/libxml2
-+includedir=${WORKDIR}/UnpackedTarball/libxml2/include
-+libdir=${WORKDIR}/UnpackedTarball/libxml2/.libs
-
- usage()
- {
-@@ -67,7 +72,8 @@
- ;;
-
- --cflags)
-- cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
-+ #cflags="@XML_INCLUDEDIR@ @XML_CFLAGS@"
-+ cflags="-I${includedir}"
- ;;
-
- --libtool-libs)
-@@ -91,7 +96,8 @@
- libs="@XML_LIBDIR@ $libs"
- fi
-
-- libs="$libs @WIN32_EXTRA_LIBADD@"
-+ #libs="$libs @WIN32_EXTRA_LIBADD@"
-+ libs="-L${libdir} -lxml2 -lm"
- ;;
-
- *)
diff --git a/external/libxml2/libxml2-global-symbols.patch b/external/libxml2/libxml2-global-symbols.patch
index 49ee73731562..cfec9c530281 100644
--- a/external/libxml2/libxml2-global-symbols.patch
+++ b/external/libxml2/libxml2-global-symbols.patch
@@ -14,8 +14,8 @@
LIBXML2_2.6.32 {
@@ -2231,3 +2231,43 @@
- xmlHashDefaultDeallocator;
- } LIBXML2_2.9.1;
+ xmlPopOutputCallbacks;
+ } LIBXML2_2.9.8;
+# HACK: export global variable accessor functions (globals.h)
+LIBXML2_GLOBAL_VARIABLES {
diff --git a/external/libxml2/ubsan.patch.0 b/external/libxml2/ubsan.patch.0
deleted file mode 100644
index b52259719673..000000000000
--- a/external/libxml2/ubsan.patch.0
+++ /dev/null
@@ -1,11 +0,0 @@
---- xpath.c
-+++ xpath.c
-@@ -14529,7 +14529,7 @@
- }
-
- stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH,
-- &namespaces[0]);
-+ namespaces); // i.e., &namespaces[0] if namespaces != NULL
- if (namespaces != NULL) {
- xmlFree((xmlChar **)namespaces);
- }
diff --git a/external/libxml2/xml2-config.in b/external/libxml2/xml2-config.in
new file mode 100644
index 000000000000..164508e47e67
--- /dev/null
+++ b/external/libxml2/xml2-config.in
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case "$1" in
+ --version)
+ echo @VERSION@
+ exit 0
+ ;;
+ --cflags)
+ cflags="$LIBXML_CFLAGS"
+ ;;
+ --libs)
+ libs="$LIBXML_LIBS"
+ ;;
+ esac
+ shift
+done
+
+if test -n "$cflags$libs"; then
+ echo $cflags $libs
+fi
+
+exit 0
diff --git a/external/libxslt/UnpackedTarball_libxslt.mk b/external/libxslt/UnpackedTarball_libxslt.mk
index 5bde97637e25..7d39cb1e3478 100644
--- a/external/libxslt/UnpackedTarball_libxslt.mk
+++ b/external/libxslt/UnpackedTarball_libxslt.mk
@@ -21,7 +21,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxslt,\
external/libxslt/libxslt-msvc.patch.2) \
external/libxslt/libxslt-1.1.26-memdump.patch \
external/libxslt/rpath.patch.0 \
- external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 b/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1
deleted file mode 100644
index f82c2e4f77ee..000000000000
--- a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1
+++ /dev/null
@@ -1,69 +0,0 @@
-From e2584eed1c84c18f16e42188c30d2c3d8e3e8853 Mon Sep 17 00:00:00 2001
-From: Chun-wei Fan <fanchunwei@src.gnome.org>
-Date: Tue, 12 Nov 2019 17:37:05 +0800
-Subject: [PATCH] win32: Add configuration for profiler
-
-Without this the generated xsltconfig.h will not be complete as there
-will be a configuration variable that is left in the header, breaking
-builds.
-
-This will allow one to enable or disable profiler support in Windows
-builds, and the default is to enable this.
----
- win32/configure.js | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/win32/configure.js b/win32/configure.js
-index 56694cce..12c99f30 100644
---- a/win32/configure.js
-+++ b/win32/configure.js
-@@ -47,6 +47,7 @@ var withIconv = true;
- var withZlib = false;
- var withCrypto = true;
- var withModules = false;
-+var withProfiler = true;
- /* Win32 build options. */
- var dirSep = "\\";
- var compiler = "msvc";
-@@ -106,6 +107,7 @@ function usage()
- txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n";
- txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n";
- txt += " modules: Enable Module support (" + (withModules? "yes" : "no") + ")\n";
-+ txt += " profiler: Enable Profiler support (" + (withProfiler? "yes" : "no") + ")\n";
- txt += "\nWin32 build options, default value given in parentheses:\n\n";
- txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n";
- txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n";
-@@ -192,6 +194,7 @@ function discoverVersion()
- vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0"));
- vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0"));
- vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0"));
-+ vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0"));
- vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0"));
- vf.WriteLine("STATIC=" + (buildStatic? "1" : "0"));
- vf.WriteLine("PREFIX=" + buildPrefix);
-@@ -240,6 +243,8 @@ function configureXslt()
- of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0"));
- } else if (s.search(/\@WITH_MODULES\@/) != -1) {
- of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0"));
-+ } else if (s.search(/\@WITH_PROFILER\@/) != -1) {
-+ of.WriteLine(s.replace(/\@WITH_PROFILER\@/, withProfiler? "1" : "0"));
- } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) {
- of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL"));
- } else
-@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
- withCrypto = strToBool(arg.substring(opt.length + 1, arg.length));
- else if (opt == "modules")
- withModules = strToBool(arg.substring(opt.length + 1, arg.length));
-+ else if (opt == "profiler")
-+ withProfiler = strToBool(arg.substring(opt.length + 1, arg.length));
- else if (opt == "compiler")
- compiler = arg.substring(opt.length + 1, arg.length);
- else if (opt == "cruntime")
-@@ -477,6 +484,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n";
- txtOut += " With zlib: " + boolToStr(withZlib) + "\n";
- txtOut += " Crypto: " + boolToStr(withCrypto) + "\n";
- txtOut += " Modules: " + boolToStr(withModules) + "\n";
-+txtOut += " Profiler: " + boolToStr(withProfiler) + "\n";
- txtOut += "\n";
- txtOut += "Win32 build configuration\n";
- txtOut += "-------------------------\n";
diff --git a/external/libxslt/rpath.patch.0 b/external/libxslt/rpath.patch.0
index 78c4859251df..798bccec750e 100644
--- a/external/libxslt/rpath.patch.0
+++ b/external/libxslt/rpath.patch.0
@@ -7,4 +7,4 @@
+hardcode_libdir_flag_spec=
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
diff --git a/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk b/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk
index b0c62e1b160e..3458089ce99e 100644
--- a/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk
+++ b/external/mariadb-connector-c/StaticLibrary_mariadb-connector-c.mk
@@ -21,8 +21,8 @@ $(eval $(call gb_StaticLibrary_set_include,mariadb-connector-c,\
# This is needed for MSVC 2008: it somehow finds a dlopen somewhere
# but the static library then contains unreferenced symbols.
# This macro enables a re-definition to native Win32 APIs in my_global.h.
-## TODO missing enable: -DHAVE_OPENSSL -D HAVE_COMPRESS
-## (but then need to add "-lssl -lcrypto -lz" to mysqlcppconn linking)
+## TODO missing enable: -D HAVE_COMPRESS
+## (but then need to add "-lz" to mysqlcppconn linking)
$(eval $(call gb_StaticLibrary_add_cflags,mariadb-connector-c,-DHAVE_DLOPEN -D ENABLED_LOCAL_INFILE -D LIBMARIADB -D THREAD -DSQLITE_ENABLE_COLUMN_METADATA=1))
ifeq ($(OS),WNT)
@@ -31,10 +31,12 @@ $(eval $(call gb_StaticLibrary_set_include,mariadb-connector-c,\
$$(INCLUDE) \
-I$(call gb_UnpackedTarball_get_dir,mariadb-connector-c)/win-iconv \
))
+else
+$(eval $(call gb_StaticLibrary_use_external,mariadb-connector-c,openssl_headers))
+$(eval $(call gb_StaticLibrary_add_cflags,mariadb-connector-c,-DHAVE_OPENSSL))
endif
$(eval $(call gb_StaticLibrary_add_generated_cobjects,mariadb-connector-c,\
- UnpackedTarball/mariadb-connector-c/libmariadb/bmove_upp \
UnpackedTarball/mariadb-connector-c/libmariadb/get_password \
UnpackedTarball/mariadb-connector-c/libmariadb/ma_alloc \
UnpackedTarball/mariadb-connector-c/libmariadb/ma_array \
@@ -64,10 +66,17 @@ $(eval $(call gb_StaticLibrary_add_generated_cobjects,mariadb-connector-c,\
UnpackedTarball/mariadb-connector-c/libmariadb/mariadb_stmt \
UnpackedTarball/mariadb-connector-c/libmariadb/ma_client_plugin \
UnpackedTarball/mariadb-connector-c/plugins/auth/my_auth \
+ UnpackedTarball/mariadb-connector-c/plugins/auth/caching_sha2_pw \
UnpackedTarball/mariadb-connector-c/plugins/pvio/pvio_socket \
$(if $(filter $(OS),WNT), \
UnpackedTarball/mariadb-connector-c/libmariadb/win32_errmsg \
- UnpackedTarball/mariadb-connector-c/win-iconv/win_iconv) \
+ UnpackedTarball/mariadb-connector-c/libmariadb/secure/win_crypt \
+ UnpackedTarball/mariadb-connector-c/win-iconv/win_iconv \
+ UnpackedTarball/mariadb-connector-c/plugins/pvio/pvio_npipe \
+ UnpackedTarball/mariadb-connector-c/plugins/pvio/pvio_shmem \
+ , \
+ UnpackedTarball/mariadb-connector-c/libmariadb/secure/openssl_crypt \
+ ) \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk b/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk
index 3d8ca9295131..241e12db6581 100644
--- a/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk
+++ b/external/mariadb-connector-c/UnpackedTarball_mariadb-connector-c.mk
@@ -32,9 +32,25 @@ $(eval $(call gb_UnpackedTarball_add_patches,mariadb-connector-c,\
# TODO are any "plugins" needed?
$(eval $(call gb_UnpackedTarball_set_post_action,mariadb-connector-c, \
< libmariadb/ma_client_plugin.c.in sed \
- -e 's/@EXTERNAL_PLUGINS@/extern struct st_mysql_client_plugin pvio_socket_client_plugin;/' \
- -e 's/@BUILTIN_PLUGINS@/(struct st_mysql_client_plugin *)\&pvio_socket_client_plugin$(COMMA)/' \
- > libmariadb/ma_client_plugin.c \
+ -e 's/@EXTERNAL_PLUGINS@/ \
+ extern struct st_mysql_client_plugin pvio_socket_client_plugin\; \
+ extern struct st_mysql_client_plugin caching_sha2_password_client_plugin\; \
+ extern struct st_mysql_client_plugin mysql_native_password_client_plugin\; \
+ $(if $(filter WNT,$(OS)), \
+ extern struct st_mysql_client_plugin pvio_shmem_client_plugin\; \
+ extern struct st_mysql_client_plugin pvio_npipe_client_plugin\; \
+ ) \
+ /' \
+ -e 's/@BUILTIN_PLUGINS@/ \
+ (struct st_mysql_client_plugin *)\&pvio_socket_client_plugin$(COMMA) \
+ (struct st_mysql_client_plugin *)\&caching_sha2_password_client_plugin$(COMMA) \
+ (struct st_mysql_client_plugin *)\&mysql_native_password_client_plugin$(COMMA) \
+ $(if $(filter WNT,$(OS)), \
+ (struct st_mysql_client_plugin *)\&pvio_shmem_client_plugin$(COMMA) \
+ (struct st_mysql_client_plugin *)\&pvio_npipe_client_plugin$(COMMA) \
+ ) \
+ /' \
+ > libmariadb/ma_client_plugin.c \
))
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index 5150a27b6a62..cfe535c6dcf1 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -15,8 +15,14 @@ $(eval $(call gb_ExternalProject_register_targets,nss,\
build \
))
+$(eval $(call gb_ExternalProject_use_externals,nss,\
+ zlib \
+))
+
ifeq ($(OS),WNT)
-$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecutable_get_dependencies,python)
+$(call gb_ExternalProject_get_state_target,nss,build): \
+ $(call gb_ExternalExecutable_get_dependencies,python) \
+ $(SRCDIR)/external/nss/nsinstall.py
$(call gb_ExternalProject_run,build,\
$(if $(MSVC_USE_DEBUG_RUNTIME),USE_DEBUG_RTL=1,BUILD_OPT=1) \
$(if $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED), \
@@ -24,9 +30,10 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta
MOZ_DEBUG_FLAGS=" " \
OPT_CODE_SIZE=0) \
OS_TARGET=WIN95 \
+ USE_SYSTEM_ZLIB=1 \
$(if $(filter X86_64,$(CPUNAME)),USE_64=1) \
LIB="$(ILIB)" \
- XCFLAGS="-arch:SSE $(SOLARINC)" \
+ XCFLAGS="-arch:SSE $(SOLARINC) $(ZLIB_CFLAGS)" \
$(MAKE) nss_build_all RC="rc.exe $(SOLARINC)" \
NSINSTALL='$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \
NSS_DISABLE_GTESTS=1 \
@@ -35,7 +42,9 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta
else # OS!=WNT
# make sure to specify NSPR_CONFIGURE_OPTS as env (before make command), so nss can append it's own defaults
# OTOH specify e.g. CC and NSINSTALL as arguments (after make command), so they will overrule nss makefile values
-$(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecutable_get_dependencies,python)
+$(call gb_ExternalProject_get_state_target,nss,build): \
+ $(call gb_ExternalExecutable_get_dependencies,python) \
+ $(SRCDIR)/external/nss/nsinstall.py
$(call gb_ExternalProject_run,build,\
$(if $(filter ANDROID FREEBSD LINUX MACOSX,$(OS)),$(if $(filter X86_64,$(CPUNAME)),USE_64=1)) \
$(if $(filter ANDROID,$(OS)),$(if $(filter AARCH64,$(CPUNAME)),USE_64=1)) \
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index 4aaa70fc2131..c6e2b8510db0 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -24,9 +24,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
external/nss/nss.vs2015.patch \
external/nss/nss.vs2015.pdb.patch \
external/nss/nss.bzmozilla1238154.patch \
- external/nss/nss-bz1646594.patch.1 \
+ external/nss/nss-bz1646594.patch.1 \
external/nss/macos-dlopen.patch.0 \
- external/nss/nss.getopt.patch.0 \
+ external/nss/nss-restore-manual-pre-dependencies.patch.1 \
$(if $(filter iOS,$(OS)), \
external/nss/nss-ios.patch) \
$(if $(filter ANDROID,$(OS)), \
diff --git a/external/nss/asan.patch.1 b/external/nss/asan.patch.1
index 7dfd6ed4e782..ccabd446ebac 100644
--- a/external/nss/asan.patch.1
+++ b/external/nss/asan.patch.1
@@ -1,12 +1,12 @@
diff -ur nss.org/nss/coreconf/Linux.mk nss/nss/coreconf/Linux.mk
--- nss.org/nss/coreconf/Linux.mk 2014-05-06 04:36:01.817838877 +0200
+++ nss/nss/coreconf/Linux.mk 2014-05-06 04:37:25.387835456 +0200
-@@ -146,7 +146,7 @@
+@@ -157,7 +157,7 @@
# we don't use -z defs there.
# Also, -z defs conflicts with Address Sanitizer, which emits relocations
# against the libsanitizer runtime built into the main executable.
-ZDEFS_FLAG = -Wl,-z,defs
+ZDEFS_FLAG =
- DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN')
- LDFLAGS += $(ARCHFLAG) -z noexecstack
+ DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell $(LD) -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN')
+ LDFLAGS += $(ARCHFLAG) -z noexecstack
diff --git a/external/nss/clang-cl.patch.0 b/external/nss/clang-cl.patch.0
index 1d615c2397d8..04e21e7003d0 100644
--- a/external/nss/clang-cl.patch.0
+++ b/external/nss/clang-cl.patch.0
@@ -14,7 +14,7 @@
#pragma intrinsic(_InterlockedExchange)
--- nspr/pr/include/prbit.h
+++ nspr/pr/include/prbit.h
-@@ -14,7 +14,7 @@
+@@ -15,7 +15,7 @@
*/
#if defined(_WIN32) && (_MSC_VER >= 1300) && \
(defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || \
@@ -23,7 +23,7 @@
# include <intrin.h>
# pragma intrinsic(_BitScanForward,_BitScanReverse)
__forceinline static int __prBitScanForward32(unsigned int val)
-@@ -32,7 +32,7 @@
+@@ -33,7 +33,7 @@
# define pr_bitscan_ctz32(val) __prBitScanForward32(val)
# define pr_bitscan_clz32(val) __prBitScanReverse32(val)
# define PR_HAVE_BUILTIN_BITSCAN32
@@ -32,7 +32,7 @@
(defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
defined(__aarch64__))
# define pr_bitscan_ctz32(val) __builtin_ctz(val)
-@@ -136,7 +136,7 @@
+@@ -138,7 +138,7 @@
*/
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \
@@ -63,7 +63,7 @@
#define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD
--- nss/lib/util/pkcs11n.h
+++ nss/lib/util/pkcs11n.h
-@@ -426,7 +426,7 @@
+@@ -563,7 +563,7 @@
/* keep the old value for compatibility reasons*/
#define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS + 4))
#else
@@ -80,7 +80,7 @@
# in the outer pkcs11t.h:
--- nss/lib/util/pkcs11t.h
+++ nss/lib/util/pkcs11t.h
-@@ -72,7 +72,14 @@
+@@ -78,7 +78,14 @@
#define CK_INVALID_HANDLE 0
/* pack */
@@ -95,7 +95,7 @@
typedef struct CK_VERSION {
CK_BYTE major; /* integer portion of version number */
-@@ -1795,6 +1802,13 @@
+@@ -2586,6 +2593,13 @@
#include "pkcs11n.h"
/* undo packing */
diff --git a/external/nss/macos-dlopen.patch.0 b/external/nss/macos-dlopen.patch.0
index 1889b8df7cd3..e8abc8f59c69 100644
--- a/external/nss/macos-dlopen.patch.0
+++ b/external/nss/macos-dlopen.patch.0
@@ -1,6 +1,6 @@
--- nspr/pr/src/linking/prlink.c
+++ nspr/pr/src/linking/prlink.c
-@@ -799,7 +799,7 @@
+@@ -555,7 +555,7 @@
* The reason is that DARWIN's dlopen ignores the provided path
* and checks for the plain filename in DYLD_LIBRARY_PATH,
* which could load an unexpected version of a library. */
diff --git a/external/nss/nsinstall.py b/external/nss/nsinstall.py
index 80e9c1679373..d90a85e6c540 100644
--- a/external/nss/nsinstall.py
+++ b/external/nss/nsinstall.py
@@ -99,17 +99,17 @@ def nsinstall(argv):
if options.D:
if len(args) != 1:
return 1
- if os.path.exists(args[0]):
+ try:
+ if options.m:
+ os.makedirs(args[0], options.m)
+ else:
+ os.makedirs(args[0])
+ except FileExistsError:
if not os.path.isdir(args[0]):
sys.stderr.write('nsinstall: ' + args[0] + ' is not a directory\n')
sys.exit(1)
if options.m:
os.chmod(args[0], options.m)
- sys.exit()
- if options.m:
- os.makedirs(args[0], options.m)
- else:
- os.makedirs(args[0])
return 0
# nsinstall arg1 [...] directory
diff --git a/external/nss/nss-android.patch.1 b/external/nss/nss-android.patch.1
index 73882e61f3f6..ebb1df2d00f9 100644
--- a/external/nss/nss-android.patch.1
+++ b/external/nss/nss-android.patch.1
@@ -1,7 +1,7 @@
diff -ur nss.org/nspr/build/autoconf/config.sub nss/nspr/build/autoconf/config.sub
--- nss.org/nspr/build/autoconf/config.sub 2017-09-07 15:29:45.031246453 +0200
+++ nss/nspr/build/autoconf/config.sub 2017-09-07 15:32:13.087235423 +0200
-@@ -111,6 +111,11 @@
+@@ -110,6 +110,11 @@
exit 1;;
esac
@@ -10,13 +10,13 @@ diff -ur nss.org/nspr/build/autoconf/config.sub nss/nspr/build/autoconf/config.s
+if test $1 = "i686-pc-linux-android"; then echo $1; exit; fi
+if test $1 = "x86_64-pc-linux-android"; then echo $1; exit; fi
+
- # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ # Split fields of configuration type
+ # shellcheck disable=SC2162
+ IFS="-" read field1 field2 field3 field4 <<EOF
diff -ur nss.org/nspr/configure nss/nspr/configure
--- nss.org/nspr/configure 2017-09-07 15:29:45.018246359 +0200
+++ nss/nspr/configure 2017-09-07 15:31:47.604075663 +0200
-@@ -2737,18 +2739,15 @@
+@@ -2728,18 +2728,15 @@
esac
AS="$android_toolchain"/bin/"$android_tool_prefix"-as
@@ -41,7 +41,8 @@ diff -ur nss.org/nspr/configure nss/nspr/configure
diff -ur nss.org/nss/Makefile nss/nss/Makefile
--- nss.org/nss/Makefile 2017-09-07 15:29:44.933245745 +0200
+++ nss/nss/Makefile 2017-09-07 15:32:04.347181076 +0200
-@@ -62,6 +62,6 @@
+@@ -65,7 +65,7 @@
+
ifeq ($(OS_TARGET),Android)
NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) \
- --target=$(ANDROID_PREFIX) \
diff --git a/external/nss/nss-bz1646594.patch.1 b/external/nss/nss-bz1646594.patch.1
index e6c75922a7dc..cffb9f5fe61d 100644
--- a/external/nss/nss-bz1646594.patch.1
+++ b/external/nss/nss-bz1646594.patch.1
@@ -2,7 +2,7 @@ regression from https://bugzilla.mozilla.org/show_bug.cgi?id=1646594
--- nss/nss/coreconf/arch.mk.orig2 2020-08-18 14:33:21.295252404 +0200
+++ nss/nss/coreconf/arch.mk 2020-08-18 14:33:46.360320806 +0200
-@@ -116,8 +116,10 @@
+@@ -94,8 +94,10 @@
OS_RELEASE := $(word 1,$(OS_RELEASE)).$(word 2,$(OS_RELEASE))
endif
KERNEL = Linux
diff --git a/external/nss/nss-ios.patch b/external/nss/nss-ios.patch
index 65115a96e806..da09b8d8edf8 100644
--- a/external/nss/nss-ios.patch
+++ b/external/nss/nss-ios.patch
@@ -193,9 +193,9 @@
+if test $1 = "arm64-apple-darwin"; then echo $1; exit; fi
+if test $1 = "aarch64-apple-darwin"; then echo $1; exit; fi
+
- # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
- # Here we must recognize all the valid KERNEL-OS combinations.
- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ # Split fields of configuration type
+ # shellcheck disable=SC2162
+ IFS="-" read field1 field2 field3 field4 <<EOF
--- a/a/nspr/config/autoconf.mk.in
+++ a/a/nspr/config/autoconf.mk.in
@@ -67,7 +67,7 @@
diff --git a/external/nss/nss-restore-manual-pre-dependencies.patch.1 b/external/nss/nss-restore-manual-pre-dependencies.patch.1
new file mode 100644
index 000000000000..ea034f0dc80f
--- /dev/null
+++ b/external/nss/nss-restore-manual-pre-dependencies.patch.1
@@ -0,0 +1,83 @@
+Revert of upstream:
+
+changeset: 15608:744881490c78
+user: Jan-Marek Glogowski <glogow@fbihome.de>
+date: Wed May 13 19:00:40 2020 +0000
+summary: Bug 1637083 Replace pre-dependency with shell hack r=rrelyea
+
+--- b/nss/coreconf/rules.mk Wed May 13 19:00:40 2020 +0000
++++ a/nss/coreconf/rules.mk Tue May 12 21:33:43 2020 +0000
+@@ -31,21 +31,10 @@
+ USE_NT_C_SYNTAX=1
+ endif
+
+-# For whatever reason, "." can't be handled using make conditionals.
+-# Based on automake's SUBDIRS "." handling.
+ ifdef DIRS
+ ifndef IGNORE_DIRS
+-ifneq (,$(filter .,$(DIRS)))
+-TARGETS = $(NULL)
+-ALL_TRASH = $(NULL)
+-endif
+-
+ $(DIRS):
++ $(IGNORE_ERROR)@$(MAKE) -C $@ $(MAKECMDGOALS)
+- $(IGNORE_ERROR)@if [ "$@" != "." ]; then \
+- $(MAKE) -C $@ $(MAKECMDGOALS) ; \
+- else \
+- IGNORE_DIRS=1 $(MAKE) -C $@ $(MAKECMDGOALS) ; \
+- fi
+ @$(CLICK_STOPWATCH)
+ endif
+ endif
+@@ -84,9 +73,7 @@
+ check: $(DIRS)
+
+ clean clobber: $(DIRS)
+-ifneq (,$(ALL_TRASH))
+ rm -rf $(ALL_TRASH)
+-endif
+
+ realclean clobber_all: $(DIRS)
+ rm -rf $(wildcard *.OBJ) dist $(ALL_TRASH)
+--- b/nss/lib/ckfw/builtins/manifest.mn Wed May 13 19:00:40 2020 +0000
++++ a/nss/lib/ckfw/builtins/manifest.mn Tue May 12 21:33:43 2020 +0000
+@@ -5,9 +5,7 @@
+
+ CORE_DEPTH = ../../..
+
++DIRS = testlib
+-DIRS = . testlib
+-
+-testlib: .
+
+ MODULE = nss
+
+--- b/nss/lib/ckfw/manifest.mn Wed May 13 19:00:40 2020 +0000
++++ a/nss/lib/ckfw/manifest.mn Tue May 12 21:33:43 2020 +0000
+@@ -5,9 +5,7 @@
+
+ CORE_DEPTH = ../..
+
++DIRS = builtins
+-DIRS = . builtins
+-
+-builtins: .
+
+ PRIVATE_EXPORTS = \
+ ck.h \
+--- b/nss/manifest.mn Wed May 13 19:00:40 2020 +0000
++++ a/nss/manifest.mn Tue May 12 21:33:43 2020 +0000
+@@ -24,6 +24,12 @@
+ # no real way to encode these in any sensible way
+ $(MAKE) -C coreconf/nsinstall program
+ $(MAKE) export
++ # pre-build child dir -> parent dir dependencies
++ # ckfw/builtins -> ckfw
++ IGNORE_DIRS=1 $(MAKE) -C lib/ckfw libs
++ # ckfw/builtins/testlib -> ckfw/builtins + base
++ $(MAKE) -C lib/base libs
++ IGNORE_DIRS=1 $(MAKE) -C lib/ckfw/builtins libs
+
+ lib: coreconf
+ cmd: lib
diff --git a/external/nss/nss-win32-make.patch.1 b/external/nss/nss-win32-make.patch.1
index 7ba3df451ee6..6a3201a082a1 100644
--- a/external/nss/nss-win32-make.patch.1
+++ b/external/nss/nss-win32-make.patch.1
@@ -1,6 +1,6 @@
--- nss/nss/coreconf/rules.mk.orig2 2014-06-03 15:30:01.667200000 +0200
+++ nss/nss/coreconf/rules.mk 2014-06-03 15:30:14.537200000 +0200
-@@ -259,7 +259,7 @@
+@@ -174,7 +174,7 @@
$(LIBRARY): $(OBJS) | $$(@D)/d
rm -f $@
ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
@@ -9,7 +9,7 @@
else
$(AR) cr $@ $(OBJS)
endif
-@@ -297,7 +297,7 @@
+@@ -214,7 +214,7 @@
ifdef NS_USE_GCC
$(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)
else
diff --git a/external/nss/nss.aix.patch b/external/nss/nss.aix.patch
index 4b0c6bfb3261..10572f94717a 100644
--- a/external/nss/nss.aix.patch
+++ b/external/nss/nss.aix.patch
@@ -1,7 +1,7 @@
diff -ru a/nspr/configure b/nspr/configure
--- a/a/nspr/configure 2014-09-29 16:47:42.984012225 +0100
+++ b/b/nspr/configure 2014-09-29 16:50:33.907375937 +0100
-@@ -6369,7 +6369,6 @@
+@@ -6325,7 +6325,6 @@
AIX_LINK_OPTS='-brtl -bnso -berok'
;;
esac
@@ -12,7 +12,7 @@ diff -ru a/nspr/configure b/nspr/configure
diff -ru a/nspr/configure.in b/nspr/configure.in
--- a/a/nspr/configure.in 2014-09-29 16:46:35.257394860 +0100
+++ b/b/nspr/configure.in 2014-09-29 16:50:33.908375942 +0100
-@@ -1229,7 +1229,8 @@
+@@ -1180,7 +1180,8 @@
AC_DEFINE(XP_UNIX)
AC_DEFINE(AIX)
AC_DEFINE(SYSV)
@@ -22,7 +22,7 @@ diff -ru a/nspr/configure.in b/nspr/configure.in
AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
case "${target_os}" in
aix3.2*)
-@@ -1269,10 +1270,9 @@
+@@ -1220,10 +1221,9 @@
AC_DEFINE(HAVE_SOCKLEN_T)
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
USE_IPV6=1
@@ -48,7 +48,7 @@ diff -ru a/nspr/pr/src/Makefile.in b/nspr/pr/src/Makefile.in
diff -ru a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
--- a/a/nss/cmd/platlibs.mk 2014-09-29 16:47:42.987012253 +0100
+++ b/b/nss/cmd/platlibs.mk 2014-09-29 16:50:33.910375955 +0100
-@@ -134,7 +134,7 @@
+@@ -171,7 +171,7 @@
$(NULL)
ifeq ($(OS_ARCH), AIX)
@@ -57,7 +57,7 @@ diff -ru a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
endif
# $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
-@@ -180,7 +180,7 @@
+@@ -217,7 +217,7 @@
$(NULL)
ifeq ($(OS_ARCH), AIX)
diff --git a/external/nss/nss.bzmozilla1238154.patch b/external/nss/nss.bzmozilla1238154.patch
index 468ff810b9ca..425f38257892 100644
--- a/external/nss/nss.bzmozilla1238154.patch
+++ b/external/nss/nss.bzmozilla1238154.patch
@@ -1,7 +1,7 @@
diff -ru a/nspr/configure b/nspr/configure
--- a/a/nspr/configure 2019-01-26 12:23:06.589389910 +0100
+++ b/b/nspr/configure 2019-01-26 12:26:56.566222293 +0100
-@@ -7127,7 +7127,7 @@
+@@ -6883,7 +6883,7 @@
# Determine compiler version
diff --git a/external/nss/nss.cygwin64.in32bit.patch b/external/nss/nss.cygwin64.in32bit.patch
index b00761a0e85b..bce0f1d09403 100644
--- a/external/nss/nss.cygwin64.in32bit.patch
+++ b/external/nss/nss.cygwin64.in32bit.patch
@@ -3,7 +3,7 @@ on Cygwin 64bit and in 32bit mode
diff -ru nss.orig/nss/Makefile nss/nss/Makefile
--- a/nss.orig/nss/Makefile 2016-02-26 01:00:52.146713100 +0100
+++ b/nss/nss/Makefile 2016-02-26 01:02:05.303560100 +0100
-@@ -59,6 +59,8 @@
+@@ -63,6 +63,8 @@
# Translate coreconf build options to NSPR configure options.
#
diff --git a/external/nss/nss.getopt.patch.0 b/external/nss/nss.getopt.patch.0
deleted file mode 100644
index aeabb33f9b97..000000000000
--- a/external/nss/nss.getopt.patch.0
+++ /dev/null
@@ -1,25 +0,0 @@
-# pr/tests/sel_spd.c:427:20: error: implicit declaration of function 'getopt' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
---- nspr/pr/tests/sel_spd.c
-+++ nspr/pr/tests/sel_spd.c
-@@ -15,6 +15,9 @@
- #include <stdio.h>
- #include <errno.h>
- #include <string.h>
-+
-+extern char *optarg;
-+int getopt(int argc, char *const argv[], const char *optstring);
-
- #ifdef DEBUG
- #define PORT_INC_DO +100
---- nspr/pr/tests/testfile.c
-+++ nspr/pr/tests/testfile.c
-@@ -23,6 +23,9 @@
- #include <getopt.h>
- #include <errno.h>
- #endif /* XP_OS2 */
-+
-+extern char *optarg;
-+int getopt(int argc, char *const argv[], const char *optstring);
-
- static int _debug_on = 0;
-
diff --git a/external/nss/nss.nowerror.patch b/external/nss/nss.nowerror.patch
index ff81a9b33539..bdf7a33a874c 100644
--- a/external/nss/nss.nowerror.patch
+++ b/external/nss/nss.nowerror.patch
@@ -1,7 +1,7 @@
diff -ur nss.org/nss/coreconf/WIN32.mk nss/nss/coreconf/WIN32.mk
--- a/nss.org/nss/coreconf/WIN32.mk 2016-04-13 11:33:09.322294523 +0200
+++ b/nss/nss/coreconf/WIN32.mk 2016-04-13 11:33:27.744323969 +0200
-@@ -127,7 +127,7 @@
+@@ -121,7 +121,7 @@
-D_CRT_NONSTDC_NO_WARNINGS
OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS
ifndef NSS_ENABLE_WERROR
diff --git a/external/nss/nss.patch b/external/nss/nss.patch
index d9aaee5199bb..cc9eeed1b009 100644
--- a/external/nss/nss.patch
+++ b/external/nss/nss.patch
@@ -1,6 +1,6 @@
--- a/a/nspr/configure 2017-08-29 23:44:13.686045013 +0530
+++ b/b/nspr/configure 2017-08-29 23:46:53.774768655 +0530
-@@ -7034,7 +7034,7 @@
+@@ -6794,7 +6794,7 @@
PR_MD_CSRCS=linux.c
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
@@ -11,7 +11,7 @@
# combo is not yet good at debugging inlined
--- a/nss.orig/nspr/pr/src/misc/prnetdb.c 2017-08-29 23:44:13.690045031 +0530
+++ b/nss/nspr/pr/src/misc/prnetdb.c 2017-08-29 23:47:03.810814019 +0530
-@@ -438,7 +438,7 @@
+@@ -441,7 +441,7 @@
char *buf = *bufp;
PRIntn buflen = *buflenp;
@@ -51,7 +51,7 @@
--- a/nss.org/nss/coreconf/arch.mk 2017-08-29 23:44:13.646044832 +0530
+++ b/nss/nss/coreconf/arch.mk 2017-08-29 23:45:51.494487134 +0530
-@@ -305,11 +305,17 @@
+@@ -284,11 +284,17 @@
OBJDIR_NAME_COMPILER = $(COMPILER_TAG)
endif
OBJDIR_NAME_BASE = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(OBJDIR_NAME_COMPILER)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG)
@@ -83,16 +83,16 @@
# The default implementation strategy for FreeBSD is pthreads.
--- a/nss.org/nss/coreconf/Linux.mk 2017-08-29 23:44:13.642044814 +0530
+++ b/nss/nss/coreconf/Linux.mk 2017-08-29 23:47:26.318915759 +0530
-@@ -147,7 +147,7 @@
+@@ -158,7 +158,7 @@
# Also, -z defs conflicts with Address Sanitizer, which emits relocations
# against the libsanitizer runtime built into the main executable.
ZDEFS_FLAG = -Wl,-z,defs
--DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
-+DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN')
- LDFLAGS += $(ARCHFLAG) -z noexecstack
+-DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell $(LD) -v)),,$(ZDEFS_FLAG))
++DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell $(LD) -v)),,$(ZDEFS_FLAG)) $(if $(filter-out $(OS),ANDROID),-Wl$(COMMA)-z$(COMMA)origin '-Wl$(COMMA)-rpath$(COMMA)$$ORIGIN')
+ LDFLAGS += $(ARCHFLAG) -z noexecstack
# On Maemo, we need to use the -rpath-link flag for even the standard system
-@@ -177,8 +177,13 @@
+@@ -188,8 +188,13 @@
endif
endif
@@ -108,7 +108,7 @@
# dependencies in the same directory where it resides.
--- a/nss.org/nss/coreconf/rules.mk 2017-08-29 23:44:13.646044832 +0530
+++ b/nss/nss/coreconf/rules.mk 2017-08-29 23:47:37.442966042 +0530
-@@ -261,7 +261,7 @@
+@@ -176,7 +176,7 @@
ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
$(AR) $(subst /,\\,$(OBJS))
else
@@ -119,7 +119,7 @@
--- a/nss.org/nss/coreconf/SunOS5.mk 2017-08-29 23:44:13.646044832 +0530
+++ b/nss/nss/coreconf/SunOS5.mk 2017-08-29 23:45:00.902258445 +0530
-@@ -48,8 +48,11 @@
+@@ -46,8 +46,11 @@
# OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
endif
else
@@ -135,7 +135,7 @@
ifndef BUILD_OPT
--- a/nss.org/nss/coreconf/Werror.mk 2017-08-29 23:44:13.646044832 +0530
+++ b/nss/nss/coreconf/Werror.mk 2017-08-29 23:44:23.994091608 +0530
-@@ -94,7 +94,8 @@
+@@ -96,7 +96,8 @@
endif #ndef NSS_ENABLE_WERROR
ifeq ($(NSS_ENABLE_WERROR),1)
diff --git a/external/nss/nss.utf8bom.patch.1 b/external/nss/nss.utf8bom.patch.1
index e8c56abefcde..f474adf6f932 100644
--- a/external/nss/nss.utf8bom.patch.1
+++ b/external/nss/nss.utf8bom.patch.1
@@ -1,7 +1,7 @@
diff -ur nss.org/nss/lib/ckfw/builtins/certdata.perl nss/nss/lib/ckfw/builtins/certdata.perl
--- nss.org/nss/lib/ckfw/builtins/certdata.perl 2016-03-31 18:26:07.890190900 +0800
+++ nss/nss/lib/ckfw/builtins/certdata.perl 2016-03-31 19:16:16.727269600 +0800
-@@ -110,6 +110,9 @@
+@@ -122,6 +122,9 @@
sub doprint {
my $i;
@@ -11,7 +11,7 @@ diff -ur nss.org/nss/lib/ckfw/builtins/certdata.perl nss/nss/lib/ckfw/builtins/c
print <<EOD
/* THIS IS A GENERATED FILE */
/* This Source Code Form is subject to the terms of the Mozilla Public
-@@ -119,6 +122,7 @@
+@@ -131,6 +134,7 @@
#ifndef BUILTINS_H
#include "builtins.h"
#endif /* BUILTINS_H */
diff --git a/external/nss/nss.vs2015.patch b/external/nss/nss.vs2015.patch
index de4f8762fd5b..73cff7c833fb 100644
--- a/external/nss/nss.vs2015.patch
+++ b/external/nss/nss.vs2015.patch
@@ -1,7 +1,7 @@
diff -ru nss.org/nss/coreconf/WIN32.mk nss/nss/coreconf/WIN32.mk
--- a/nss.org/nss/coreconf/WIN32.mk 2016-02-12 15:36:18.000000000 +0100
+++ b/nss/nss/coreconf/WIN32.mk 2016-02-26 00:42:43.170809600 +0100
-@@ -199,7 +199,7 @@
+@@ -192,7 +192,7 @@
# Disable C4244: conversion from 'type1' to 'type2', possible loss of data
# Disable C4018: 'expression' : signed/unsigned mismatch
# Disable C4312: 'type cast': conversion from 'type1' to 'type2' of greater size
diff --git a/external/nss/nss.vs2015.pdb.patch b/external/nss/nss.vs2015.pdb.patch
index c66940132cdd..3b498f976ac6 100644
--- a/external/nss/nss.vs2015.pdb.patch
+++ b/external/nss/nss.vs2015.pdb.patch
@@ -1,7 +1,7 @@
diff -ru nss.orig/nss/coreconf/WIN32.mk nss/nss/coreconf/WIN32.mk
--- a/nss.orig/nss/coreconf/WIN32.mk 2016-03-04 08:30:16.306639400 +0100
+++ b/nss/nss/coreconf/WIN32.mk 2016-03-04 08:31:17.987233200 +0100
-@@ -169,15 +169,15 @@
+@@ -163,15 +163,15 @@
DLLFLAGS += -OUT:$@
ifdef MOZ_DEBUG_SYMBOLS
ifdef MOZ_DEBUG_FLAGS
diff --git a/external/nss/nss.windows.patch b/external/nss/nss.windows.patch
index 901846e7bc1f..27a44045802e 100644
--- a/external/nss/nss.windows.patch
+++ b/external/nss/nss.windows.patch
@@ -1,6 +1,6 @@
--- a/a/nspr/config/rules.mk 2008-12-03 00:24:39.000000000 +0100
+++ b/b/nspr/config/rules.mk 2009-11-27 13:36:22.662753328 +0100
-@@ -415,7 +415,7 @@
+@@ -423,7 +423,7 @@
ifdef NEED_ABSOLUTE_PATH
# The quotes allow absolute paths to contain spaces.
@@ -11,7 +11,7 @@
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
--- a/a/nss/coreconf/rules.mk 2008-12-03 00:24:39.000000000 +0100
+++ b/b/nss/coreconf/rules.mk 2009-11-27 13:36:22.662753328 +0100
-@@ -386,7 +386,7 @@
+@@ -280,7 +280,7 @@
endif
# The quotes allow absolute paths to contain spaces.
@@ -22,7 +22,7 @@
ifdef USE_NT_C_SYNTAX
--- a/a/nspr/pr/include/md/_win95.h
+++ b/b/nspr/pr/include/md/_win95.h
-@@ -312,7 +312,7 @@
+@@ -317,7 +317,7 @@
#define _MD_ATOMIC_ADD(ptr,val) (InterlockedExchangeAdd((PLONG)ptr, (LONG)val) + val)
#define _MD_ATOMIC_DECREMENT(x) InterlockedDecrement((PLONG)x)
#endif /* x86 */
diff --git a/external/nss/nss_macosx.patch b/external/nss/nss_macosx.patch
index 07b60a5ed00d..6578f009d696 100644
--- a/external/nss/nss_macosx.patch
+++ b/external/nss/nss_macosx.patch
@@ -23,7 +23,7 @@ diff -ru a/nspr/configure b/nspr/configure
diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk
--- a/a/nss/coreconf/Darwin.mk 2014-09-29 16:50:22.992304799 +0100
+++ b/b/nss/coreconf/Darwin.mk 2014-09-29 16:51:59.214931953 +0100
-@@ -20,13 +24,17 @@
+@@ -20,13 +20,17 @@
ifeq (,$(filter-out i%86,$(CPU_ARCH)))
ifdef USE_64
@@ -66,7 +66,7 @@ diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk
# GCC <= 3
DARWIN_SDK_FRAMEWORKS = -F$(MACOS_SDK_DIR)/System/Library/Frameworks
ifneq (,$(shell find $(MACOS_SDK_DIR)/Library/Frameworks -maxdepth 0))
-@@ -108,7 +120,7 @@
+@@ -108,7 +113,7 @@
# May override this with different compatibility and current version numbers.
DARWIN_DYLIB_VERSIONS = -compatibility_version 1 -current_version 1
# May override this with -bundle to create a loadable module.
@@ -78,7 +78,7 @@ diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk
diff -ru a/nss/Makefile b/nss/Makefile
--- a/a/nss/Makefile 2014-09-29 16:50:22.990304789 +0100
+++ b/b/nss/Makefile 2014-09-29 16:51:59.207931908 +0100
-@@ -72,6 +72,9 @@
+@@ -82,6 +82,9 @@
ifeq ($(OS_TARGET),WIN95)
NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
endif
@@ -88,17 +88,3 @@ diff -ru a/nss/Makefile b/nss/Makefile
ifdef USE_DEBUG_RTL
NSPR_CONFIGURE_OPTS += --enable-debug-rtl
endif
---- a/a/nspr/pr/include/md/_darwin.h
-+++ b/b/nspr/pr/include/md/_darwin.h
-@@ -40,11 +40,7 @@
-
- #undef HAVE_STACK_GROWING_UP
- #define HAVE_DLL
--#if defined(__x86_64__) || TARGET_OS_IPHONE
- #define USE_DLFCN
--#else
--#define USE_MACH_DYLD
--#endif
- #define _PR_HAVE_SOCKADDR_LEN
- #define _PR_STAT_HAS_ST_ATIMESPEC
- #define _PR_HAVE_LARGE_OFF_T
diff --git a/external/nss/ubsan.patch.0 b/external/nss/ubsan.patch.0
index 059a9f3b2c0a..72be8aa6600a 100644
--- a/external/nss/ubsan.patch.0
+++ b/external/nss/ubsan.patch.0
@@ -18,7 +18,7 @@
count * sizeof(lgdbSlotData);
data->data = (unsigned char *)PORT_ZAlloc(dataLen);
-@@ -327,7 +327,7 @@
+@@ -329,7 +329,7 @@
}
if ((encoded->major == LGDB_DB_EXT1_VERSION_MAJOR) &&
(encoded->minor >= LGDB_DB_EXT1_VERSION_MINOR)) {
diff --git a/external/openldap/openldap-2.4.44.patch.1 b/external/openldap/openldap-2.4.44.patch.1
index 0d3cf5b70c3f..317ef9a62e56 100644
--- a/external/openldap/openldap-2.4.44.patch.1
+++ b/external/openldap/openldap-2.4.44.patch.1
@@ -1,3 +1,4 @@
+-*- Mode: diff -*-
--- openldap.org/configure
+++ openldap/configure
@@ -15735,7 +15735,7 @@
@@ -52,6 +53,17 @@
#undef NSS_VERSION_INT
#define NSS_VERSION_INT ((NSS_VMAJOR << 24) | (NSS_VMINOR << 16) | \
+--- openldap.org/libraries/libldap/tls2.c
++++ openldap.org/libraries/libldap/tls2.c
+@@ -80,6 +80,8 @@
+ { BER_BVNULL, BER_BVNULL }
+ };
+
++int ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in );
++
+ #ifdef HAVE_TLS
+
+ void
--- openldap.org/Makefile.in
+++ openldap/Makefile.in
@@ -13,7 +13,7 @@
diff --git a/external/openssl/ExternalPackage_openssl.mk b/external/openssl/ExternalPackage_openssl.mk
index 695c7b7119b6..d0c0dbaab975 100644
--- a/external/openssl/ExternalPackage_openssl.mk
+++ b/external/openssl/ExternalPackage_openssl.mk
@@ -13,9 +13,17 @@ $(eval $(call gb_ExternalPackage_use_external_project,openssl,openssl))
ifeq ($(COM),MSC)
$(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER),\
- out32dll/ssleay32.dll \
- out32dll/libeay32.dll \
+ libcrypto-1_1.dll \
+ libssl-1_1.dll \
))
+ifneq ($(DISABLE_PYTHON),TRUE)
+ifneq ($(SYSTEM_PYTHON),TRUE)
+$(eval $(call gb_ExternalPackage_add_files,openssl,$(LIBO_LIB_FOLDER)/python-core-$(PYTHON_VERSION)/lib, \
+ libcrypto-1_1.dll \
+ libssl-1_1.dll \
+))
+endif
+endif
endif
# vim: set noet sw=4 ts=4:
diff --git a/external/openssl/ExternalProject_openssl.mk b/external/openssl/ExternalProject_openssl.mk
index 9febccfc0316..cadbb9b01bc9 100644
--- a/external/openssl/ExternalProject_openssl.mk
+++ b/external/openssl/ExternalProject_openssl.mk
@@ -42,7 +42,9 @@ OPENSSL_PLATFORM := \
ios-armv7\
,\
$(if $(filter WNT,$(OS)),\
- $(if $(filter INTEL,$(CPUNAME)),VC-WIN32,VC-WIN64A)\
+ $(if $(filter INTEL,$(CPUNAME)),VC-WIN32)\
+ $(if $(filter X86_64,$(CPUNAME)),VC-WIN64A)\
+ $(if $(filter ARM64,$(CPUNAME)),VC-WIN64-ARM)\
,\
$(if $(filter MACOSX,$(OS)),\
$(if $(filter POWERPC,$(CPUNAME)),darwin-ppc-cc)\
@@ -60,11 +62,9 @@ $(eval $(call gb_ExternalProject_use_nmake,openssl,build))
$(call gb_ExternalProject_get_state_target,openssl,build):
$(call gb_ExternalProject_run,build,\
- export PERL="$(shell cygpath -w $(PERL))" \
- && $(PERL) Configure $(OPENSSL_PLATFORM) no-idea \
- && cmd /c "ms\do_ms.bat $(PERL) $(OPENSSL_PLATFORM)" \
- && nmake -f "ms\ntdll.mak" \
- && mv inc32/* include/ \
+ CONFIGURE_INSIST=1 $(PERL) Configure $(OPENSSL_PLATFORM) no-tests no-multilib \
+ && export PERL="$(shell cygpath -w $(PERL))" \
+ && nmake -f makefile \
)
else
@@ -76,8 +76,7 @@ $(call gb_ExternalProject_get_state_target,openssl,build):
$(if $(filter WNT,$(OS)), \
$(PERL) Configure, \
./config)) \
- $(OPENSSL_PLATFORM) no-dso no-shared \
- $(if $(filter-out WNT,$(OS)),no-idea) \
+ $(OPENSSL_PLATFORM) no-dso no-shared no-tests no-multilib threads \
$(if $(filter-out ANDROID iOS WNT,$(OS)), \
$(if $(SYSBASE),-I$(SYSBASE)/usr/include -L$(SYSBASE)/usr/lib)) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk
index a36ecde1fa1f..6f00cf7f7e44 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -12,17 +12,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,openssl))
$(eval $(call gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl))
$(eval $(call gb_UnpackedTarball_add_patches,openssl,\
- external/openssl/openssllnx.patch \
- external/openssl/opensslwnt.patch \
- $(if $(filter INTEL,$(CPUNAME)),external/openssl/opensslwnt_safeseh.patch) \
- external/openssl/openssl-1.0.1h-win64.patch.1 \
- external/openssl/opensslsol.patch \
- external/openssl/opensslios.patch \
- external/openssl/opensslosxppc.patch \
- external/openssl/openssl-3650-masm.patch.1 \
- external/openssl/openssl-fixbuild.patch.1 \
- external/openssl/openssl-macos-arm64.patch.1 \
- external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1 \
+ external/openssl/openssl-no-multilib.patch.0 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/openssl/openssl-1.0.1h-win64.patch.1 b/external/openssl/openssl-1.0.1h-win64.patch.1
deleted file mode 100644
index aea914633ebb..000000000000
--- a/external/openssl/openssl-1.0.1h-win64.patch.1
+++ /dev/null
@@ -1,47 +0,0 @@
-diff --git a/ms/do_win64a.bat b/ms/do_win64a.bat
-index 8768dc6..6772390 100755
---- a/ms/do_win64a.bat
-+++ b/ms/do_win64a.bat
-@@ -1,19 +1,19 @@
--perl util\mkfiles.pl >MINFO
-+perl util/mkfiles.pl >MINFO
-
- cmd /c "nasm -f win64 -v" >NUL 2>&1
- if %errorlevel% neq 0 goto ml64
-
--perl ms\uplink-x86_64.pl nasm > ms\uptable.asm
--nasm -f win64 -o ms\uptable.obj ms\uptable.asm
-+perl ms/uplink-x86_64.pl nasm > ms/uptable.asm
-+nasm -f win64 -o ms/uptable.obj ms/uptable.asm
- goto proceed
-
- :ml64
--perl ms\uplink-x86_64.pl masm > ms\uptable.asm
--ml64 -c -Foms\uptable.obj ms\uptable.asm
-+perl ms/uplink-x86_64.pl masm > ms/uptable.asm
-+ml64 -c -Foms/uptable.obj ms/uptable.asm
-
- :proceed
--perl util\mk1mf.pl VC-WIN64A >ms\nt.mak
--perl util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak
-+perl util/mk1mf.pl VC-WIN64A >ms/nt.mak
-+perl util/mk1mf.pl dll VC-WIN64A >ms/ntdll.mak
-
--perl util\mkdef.pl 32 libeay > ms\libeay32.def
--perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
-+perl util/mkdef.pl 32 libeay > ms/libeay32.def
-+perl util/mkdef.pl 32 ssleay > ms/ssleay32.def
-diff --git a/util/mk1mf.pl b/util/mk1mf.pl
-index 72fa089..d98def1 100755
---- a/util/mk1mf.pl
-+++ b/util/mk1mf.pl
-@@ -233,6 +233,9 @@ else
- $cflags.=' -DTERMIO';
- }
-
-+# force unix style path separator
-+${o} = "/";
-+
- $fipsdir =~ s/\//${o}/g;
-
- $out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":"");
diff --git a/external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1 b/external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1
deleted file mode 100644
index 313f9cd870d7..000000000000
--- a/external/openssl/openssl-1.0.2k-cve-2020-1971.patch.1
+++ /dev/null
@@ -1,578 +0,0 @@
-diff -up openssl-1.0.2k/crypto/asn1/asn1_err.c.null-dereference openssl-1.0.2k/crypto/asn1/asn1_err.c
---- openssl-1.0.2k/crypto/asn1/asn1_err.c.null-dereference 2020-12-04 10:08:08.506247597 +0100
-+++ openssl-1.0.2k/crypto/asn1/asn1_err.c 2020-12-04 10:12:31.901956486 +0100
-@@ -1,6 +1,6 @@
- /* crypto/asn1/asn1_err.c */
- /* ====================================================================
-- * Copyright (c) 1999-2018 The OpenSSL Project. All rights reserved.
-+ * Copyright (c) 1999-2020 The OpenSSL Project. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
-@@ -103,6 +103,7 @@ static ERR_STRING_DATA ASN1_str_functs[]
- {ERR_FUNC(ASN1_F_ASN1_ITEM_DUP), "ASN1_item_dup"},
- {ERR_FUNC(ASN1_F_ASN1_ITEM_EX_COMBINE_NEW), "ASN1_ITEM_EX_COMBINE_NEW"},
- {ERR_FUNC(ASN1_F_ASN1_ITEM_EX_D2I), "ASN1_ITEM_EX_D2I"},
-+ {ERR_PACK(ERR_LIB_ASN1, ASN1_F_ASN1_ITEM_EX_I2D, 0), "ASN1_item_ex_i2d"},
- {ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_BIO), "ASN1_item_i2d_bio"},
- {ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_FP), "ASN1_item_i2d_fp"},
- {ERR_FUNC(ASN1_F_ASN1_ITEM_PACK), "ASN1_item_pack"},
-@@ -202,6 +203,7 @@ static ERR_STRING_DATA ASN1_str_reasons[
- {ERR_REASON(ASN1_R_AUX_ERROR), "aux error"},
- {ERR_REASON(ASN1_R_BAD_CLASS), "bad class"},
- {ERR_REASON(ASN1_R_BAD_OBJECT_HEADER), "bad object header"},
-+ {ERR_PACK(ERR_LIB_ASN1, 0, ASN1_R_BAD_TEMPLATE), "bad template"},
- {ERR_REASON(ASN1_R_BAD_PASSWORD_READ), "bad password read"},
- {ERR_REASON(ASN1_R_BAD_TAG), "bad tag"},
- {ERR_REASON(ASN1_R_BMPSTRING_IS_WRONG_LENGTH),
-diff -up openssl-1.0.2k/crypto/asn1/asn1.h.null-dereference openssl-1.0.2k/crypto/asn1/asn1.h
---- openssl-1.0.2k/crypto/asn1/asn1.h.null-dereference 2020-12-04 11:00:06.896637900 +0100
-+++ openssl-1.0.2k/crypto/asn1/asn1.h 2020-12-04 11:04:47.079562987 +0100
-@@ -1202,6 +1202,7 @@ void ERR_load_ASN1_strings(void);
- # define ASN1_F_ASN1_ITEM_DUP 191
- # define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121
- # define ASN1_F_ASN1_ITEM_EX_D2I 120
-+# define ASN1_F_ASN1_ITEM_EX_I2D 231
- # define ASN1_F_ASN1_ITEM_I2D_BIO 192
- # define ASN1_F_ASN1_ITEM_I2D_FP 193
- # define ASN1_F_ASN1_ITEM_PACK 198
-@@ -1298,6 +1299,7 @@ void ERR_load_ASN1_strings(void);
- # define ASN1_R_AUX_ERROR 100
- # define ASN1_R_BAD_CLASS 101
- # define ASN1_R_BAD_OBJECT_HEADER 102
-+# define ASN1_R_BAD_TEMPLATE 230
- # define ASN1_R_BAD_PASSWORD_READ 103
- # define ASN1_R_BAD_TAG 104
- # define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214
-diff -up openssl-1.0.2k/crypto/asn1/tasn_dec.c.null-dereference openssl-1.0.2k/crypto/asn1/tasn_dec.c
---- openssl-1.0.2k/crypto/asn1/tasn_dec.c.null-dereference 2020-12-04 10:12:42.036057323 +0100
-+++ openssl-1.0.2k/crypto/asn1/tasn_dec.c 2020-12-04 10:17:45.685035333 +0100
-@@ -223,6 +223,15 @@ static int asn1_item_ex_d2i(ASN1_VALUE *
- break;
-
- case ASN1_ITYPE_MSTRING:
-+ /*
-+ * It never makes sense for multi-strings to have implicit tagging, so
-+ * if tag != -1, then this looks like an error in the template.
-+ */
-+ if (tag != -1) {
-+ ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_BAD_TEMPLATE);
-+ goto err;
-+ }
-+
- p = *in;
- /* Just read in tag and class */
- ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
-@@ -240,6 +249,7 @@ static int asn1_item_ex_d2i(ASN1_VALUE *
- ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_MSTRING_NOT_UNIVERSAL);
- goto err;
- }
-+
- /* Check tag matches bit map */
- if (!(ASN1_tag2bit(otag) & it->utype)) {
- /* If OPTIONAL, assume this is OK */
-@@ -316,6 +326,15 @@ static int asn1_item_ex_d2i(ASN1_VALUE *
- goto err;
-
- case ASN1_ITYPE_CHOICE:
-+ /*
-+ * It never makes sense for CHOICE types to have implicit tagging, so
-+ * if tag != -1, then this looks like an error in the template.
-+ */
-+ if (tag != -1) {
-+ ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_BAD_TEMPLATE);
-+ goto err;
-+ }
-+
- if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
- goto auxerr;
- if (*pval) {
-diff -up openssl-1.0.2k/crypto/asn1/tasn_enc.c.null-dereference openssl-1.0.2k/crypto/asn1/tasn_enc.c
---- openssl-1.0.2k/crypto/asn1/tasn_enc.c.null-dereference 2020-12-04 10:18:30.261472002 +0100
-+++ openssl-1.0.2k/crypto/asn1/tasn_enc.c 2020-12-04 10:21:14.310078987 +0100
-@@ -151,9 +151,25 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval,
- break;
-
- case ASN1_ITYPE_MSTRING:
-+ /*
-+ * It never makes sense for multi-strings to have implicit tagging, so
-+ * if tag != -1, then this looks like an error in the template.
-+ */
-+ if (tag != -1) {
-+ ASN1err(ASN1_F_ASN1_ITEM_EX_I2D, ASN1_R_BAD_TEMPLATE);
-+ return -1;
-+ }
- return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
-
- case ASN1_ITYPE_CHOICE:
-+ /*
-+ * It never makes sense for CHOICE types to have implicit tagging, so
-+ * if tag != -1, then this looks like an error in the template.
-+ */
-+ if (tag != -1) {
-+ ASN1err(ASN1_F_ASN1_ITEM_EX_I2D, ASN1_R_BAD_TEMPLATE);
-+ return -1;
-+ }
- if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
- return 0;
- i = asn1_get_choice_selector(pval, it);
-diff -up openssl-1.0.2k/crypto/x509v3/v3_genn.c.null-dereference openssl-1.0.2k/crypto/x509v3/v3_genn.c
---- openssl-1.0.2k/crypto/x509v3/v3_genn.c.null-dereference 2020-12-04 10:28:02.374237945 +0100
-+++ openssl-1.0.2k/crypto/x509v3/v3_genn.c 2020-12-04 10:36:51.156138263 +0100
-@@ -72,8 +72,9 @@ ASN1_SEQUENCE(OTHERNAME) = {
- IMPLEMENT_ASN1_FUNCTIONS(OTHERNAME)
-
- ASN1_SEQUENCE(EDIPARTYNAME) = {
-- ASN1_IMP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0),
-- ASN1_IMP_OPT(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1)
-+ /* DirectoryString is a CHOICE type so use explicit tagging */
-+ ASN1_EXP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0),
-+ ASN1_EXP(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1)
- } ASN1_SEQUENCE_END(EDIPARTYNAME)
-
- IMPLEMENT_ASN1_FUNCTIONS(EDIPARTYNAME)
-@@ -107,6 +108,37 @@ GENERAL_NAME *GENERAL_NAME_dup(GENERAL_N
- (char *)a);
- }
-
-+static int edipartyname_cmp(const EDIPARTYNAME *a, const EDIPARTYNAME *b)
-+{
-+ int res;
-+
-+ if (a == NULL || b == NULL) {
-+ /*
-+ * Shouldn't be possible in a valid GENERAL_NAME, but we handle it
-+ * anyway. OTHERNAME_cmp treats NULL != NULL so we do the same here
-+ */
-+ return -1;
-+ }
-+ if (a->nameAssigner == NULL && b->nameAssigner != NULL)
-+ return -1;
-+ if (a->nameAssigner != NULL && b->nameAssigner == NULL)
-+ return 1;
-+ /* If we get here then both have nameAssigner set, or both unset */
-+ if (a->nameAssigner != NULL) {
-+ res = ASN1_STRING_cmp(a->nameAssigner, b->nameAssigner);
-+ if (res != 0)
-+ return res;
-+ }
-+ /*
-+ * partyName is required, so these should never be NULL. We treat it in
-+ * the same way as the a == NULL || b == NULL case above
-+ */
-+ if (a->partyName == NULL || b->partyName == NULL)
-+ return -1;
-+
-+ return ASN1_STRING_cmp(a->partyName, b->partyName);
-+}
-+
- /* Returns 0 if they are equal, != 0 otherwise. */
- int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b)
- {
-@@ -116,8 +148,11 @@ int GENERAL_NAME_cmp(GENERAL_NAME *a, GE
- return -1;
- switch (a->type) {
- case GEN_X400:
-+ result = ASN1_TYPE_cmp(a->d.x400Address, b->d.x400Address);
-+ break;
-+
- case GEN_EDIPARTY:
-- result = ASN1_TYPE_cmp(a->d.other, b->d.other);
-+ result = edipartyname_cmp(a->d.ediPartyName, b->d.ediPartyName);
- break;
-
- case GEN_OTHERNAME:
-@@ -164,8 +199,11 @@ void GENERAL_NAME_set0_value(GENERAL_NAM
- {
- switch (type) {
- case GEN_X400:
-+ a->d.x400Address = value;
-+ break;
-+
- case GEN_EDIPARTY:
-- a->d.other = value;
-+ a->d.ediPartyName = value;
- break;
-
- case GEN_OTHERNAME:
-@@ -199,8 +237,10 @@ void *GENERAL_NAME_get0_value(GENERAL_NA
- *ptype = a->type;
- switch (a->type) {
- case GEN_X400:
-+ return a->d.x400Address;
-+
- case GEN_EDIPARTY:
-- return a->d.other;
-+ return a->d.ediPartyName;
-
- case GEN_OTHERNAME:
- return a->d.otherName;
-diff -up openssl-1.0.2k/crypto/x509v3/v3nametest.c.null-dereference openssl-1.0.2k/crypto/x509v3/v3nametest.c
---- openssl-1.0.2k/crypto/x509v3/v3nametest.c.null-dereference 2020-12-04 10:28:02.374237945 +0100
-+++ openssl-1.0.2k/crypto/x509v3/v3nametest.c 2020-12-04 10:36:51.156138263 +0100
-@@ -321,6 +321,356 @@ static void run_cert(X509 *crt, const ch
- }
- }
-
-+struct gennamedata {
-+ const unsigned char der[22];
-+ size_t derlen;
-+} gennames[] = {
-+ {
-+ /*
-+ * [0] {
-+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 }
-+ * [0] {
-+ * SEQUENCE {}
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa0, 0x13, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04,
-+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x02, 0x30, 0x00
-+ },
-+ 21
-+ }, {
-+ /*
-+ * [0] {
-+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 }
-+ * [0] {
-+ * [APPLICATION 0] {}
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa0, 0x13, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04,
-+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x02, 0x60, 0x00
-+ },
-+ 21
-+ }, {
-+ /*
-+ * [0] {
-+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 }
-+ * [0] {
-+ * UTF8String { "a" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04,
-+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x0c, 0x01, 0x61
-+ },
-+ 22
-+ }, {
-+ /*
-+ * [0] {
-+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.2 }
-+ * [0] {
-+ * UTF8String { "a" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04,
-+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x02, 0xa0, 0x03, 0x0c, 0x01, 0x61
-+ },
-+ 22
-+ }, {
-+ /*
-+ * [0] {
-+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 }
-+ * [0] {
-+ * UTF8String { "b" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04,
-+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x0c, 0x01, 0x62
-+ },
-+ 22
-+ }, {
-+ /*
-+ * [0] {
-+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 }
-+ * [0] {
-+ * BOOLEAN { TRUE }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04,
-+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x01, 0x01, 0xff
-+ },
-+ 22
-+ }, {
-+ /*
-+ * [0] {
-+ * OBJECT_IDENTIFIER { 1.2.840.113554.4.1.72585.2.1 }
-+ * [0] {
-+ * BOOLEAN { FALSE }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa0, 0x14, 0x06, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04,
-+ 0x01, 0x84, 0xb7, 0x09, 0x02, 0x01, 0xa0, 0x03, 0x01, 0x01, 0x00
-+ },
-+ 22
-+ }, {
-+ /* [1 PRIMITIVE] { "a" } */
-+ {
-+ 0x81, 0x01, 0x61
-+ },
-+ 3
-+ }, {
-+ /* [1 PRIMITIVE] { "b" } */
-+ {
-+ 0x81, 0x01, 0x62
-+ },
-+ 3
-+ }, {
-+ /* [2 PRIMITIVE] { "a" } */
-+ {
-+ 0x82, 0x01, 0x61
-+ },
-+ 3
-+ }, {
-+ /* [2 PRIMITIVE] { "b" } */
-+ {
-+ 0x82, 0x01, 0x62
-+ },
-+ 3
-+ }, {
-+ /*
-+ * [4] {
-+ * SEQUENCE {
-+ * SET {
-+ * SEQUENCE {
-+ * # commonName
-+ * OBJECT_IDENTIFIER { 2.5.4.3 }
-+ * UTF8String { "a" }
-+ * }
-+ * }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa4, 0x0e, 0x30, 0x0c, 0x31, 0x0a, 0x30, 0x08, 0x06, 0x03, 0x55,
-+ 0x04, 0x03, 0x0c, 0x01, 0x61
-+ },
-+ 16
-+ }, {
-+ /*
-+ * [4] {
-+ * SEQUENCE {
-+ * SET {
-+ * SEQUENCE {
-+ * # commonName
-+ * OBJECT_IDENTIFIER { 2.5.4.3 }
-+ * UTF8String { "b" }
-+ * }
-+ * }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa4, 0x0e, 0x30, 0x0c, 0x31, 0x0a, 0x30, 0x08, 0x06, 0x03, 0x55,
-+ 0x04, 0x03, 0x0c, 0x01, 0x62
-+ },
-+ 16
-+ }, {
-+ /*
-+ * [5] {
-+ * [1] {
-+ * UTF8String { "a" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa5, 0x05, 0xa1, 0x03, 0x0c, 0x01, 0x61
-+ },
-+ 7
-+ }, {
-+ /*
-+ * [5] {
-+ * [1] {
-+ * UTF8String { "b" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa5, 0x05, 0xa1, 0x03, 0x0c, 0x01, 0x62
-+ },
-+ 7
-+ }, {
-+ /*
-+ * [5] {
-+ * [0] {
-+ * UTF8String {}
-+ * }
-+ * [1] {
-+ * UTF8String { "a" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa5, 0x09, 0xa0, 0x02, 0x0c, 0x00, 0xa1, 0x03, 0x0c, 0x01, 0x61
-+ },
-+ 11
-+ }, {
-+ /*
-+ * [5] {
-+ * [0] {
-+ * UTF8String { "a" }
-+ * }
-+ * [1] {
-+ * UTF8String { "a" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa5, 0x0a, 0xa0, 0x03, 0x0c, 0x01, 0x61, 0xa1, 0x03, 0x0c, 0x01,
-+ 0x61
-+ },
-+ 12
-+ }, {
-+ /*
-+ * [5] {
-+ * [0] {
-+ * UTF8String { "b" }
-+ * }
-+ * [1] {
-+ * UTF8String { "a" }
-+ * }
-+ * }
-+ */
-+ {
-+ 0xa5, 0x0a, 0xa0, 0x03, 0x0c, 0x01, 0x62, 0xa1, 0x03, 0x0c, 0x01,
-+ 0x61
-+ },
-+ 12
-+ }, {
-+ /* [6 PRIMITIVE] { "a" } */
-+ {
-+ 0x86, 0x01, 0x61
-+ },
-+ 3
-+ }, {
-+ /* [6 PRIMITIVE] { "b" } */
-+ {
-+ 0x86, 0x01, 0x62
-+ },
-+ 3
-+ }, {
-+ /* [7 PRIMITIVE] { `11111111` } */
-+ {
-+ 0x87, 0x04, 0x11, 0x11, 0x11, 0x11
-+ },
-+ 6
-+ }, {
-+ /* [7 PRIMITIVE] { `22222222`} */
-+ {
-+ 0x87, 0x04, 0x22, 0x22, 0x22, 0x22
-+ },
-+ 6
-+ }, {
-+ /* [7 PRIMITIVE] { `11111111111111111111111111111111` } */
-+ {
-+ 0x87, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
-+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
-+ },
-+ 18
-+ }, {
-+ /* [7 PRIMITIVE] { `22222222222222222222222222222222` } */
-+ {
-+ 0x87, 0x10, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
-+ 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
-+ },
-+ 18
-+ }, {
-+ /* [8 PRIMITIVE] { 1.2.840.113554.4.1.72585.2.1 } */
-+ {
-+ 0x88, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, 0x01, 0x84,
-+ 0xb7, 0x09, 0x02, 0x01
-+ },
-+ 15
-+ }, {
-+ /* [8 PRIMITIVE] { 1.2.840.113554.4.1.72585.2.2 } */
-+ {
-+ 0x88, 0x0d, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x12, 0x04, 0x01, 0x84,
-+ 0xb7, 0x09, 0x02, 0x02
-+ },
-+ 15
-+ }
-+};
-+
-+#define OSSL_NELEM(x) (sizeof(x)/sizeof((x)[0]))
-+
-+static int test_GENERAL_NAME_cmp(void)
-+{
-+ size_t i, j;
-+ GENERAL_NAME **namesa = OPENSSL_malloc(sizeof(*namesa)
-+ * OSSL_NELEM(gennames));
-+ GENERAL_NAME **namesb = OPENSSL_malloc(sizeof(*namesb)
-+ * OSSL_NELEM(gennames));
-+ int testresult = 0;
-+
-+ if (namesa == NULL || namesb == NULL)
-+ goto end;
-+
-+ for (i = 0; i < OSSL_NELEM(gennames); i++) {
-+ const unsigned char *derp = gennames[i].der;
-+
-+ /*
-+ * We create two versions of each GENERAL_NAME so that we ensure when
-+ * we compare them they are always different pointers.
-+ */
-+ namesa[i] = d2i_GENERAL_NAME(NULL, &derp, gennames[i].derlen);
-+ derp = gennames[i].der;
-+ namesb[i] = d2i_GENERAL_NAME(NULL, &derp, gennames[i].derlen);
-+ if (namesa[i] == NULL || namesb[i] == NULL)
-+ goto end;
-+ }
-+
-+ /* Every name should be equal to itself and not equal to any others. */
-+ for (i = 0; i < OSSL_NELEM(gennames); i++) {
-+ for (j = 0; j < OSSL_NELEM(gennames); j++) {
-+ if (i == j) {
-+ if (GENERAL_NAME_cmp(namesa[i], namesb[j]) != 0)
-+ goto end;
-+ } else {
-+ if (GENERAL_NAME_cmp(namesa[i], namesb[j]) == 0)
-+ goto end;
-+ }
-+ }
-+ }
-+ testresult = 1;
-+
-+ end:
-+ for (i = 0; i < OSSL_NELEM(gennames); i++) {
-+ if (namesa != NULL)
-+ GENERAL_NAME_free(namesa[i]);
-+ if (namesb != NULL)
-+ GENERAL_NAME_free(namesb[i]);
-+ }
-+ OPENSSL_free(namesa);
-+ OPENSSL_free(namesb);
-+
-+ if (!testresult)
-+ fprintf(stderr, "test of GENERAL_NAME_cmp failed\n");
-+
-+ return testresult;
-+}
-+
-+
-+
- int main(void)
- {
- const struct set_name_fn *pfn = name_fns;
-@@ -342,5 +692,8 @@ int main(void)
- }
- ++pfn;
- }
-+
-+ errors += !test_GENERAL_NAME_cmp();
-+
- return errors > 0 ? 1 : 0;
- }
diff --git a/external/openssl/openssl-3650-masm.patch.1 b/external/openssl/openssl-3650-masm.patch.1
deleted file mode 100644
index 97f1eb6446c3..000000000000
--- a/external/openssl/openssl-3650-masm.patch.1
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl
-index 1741342..917d0f8 100644
---- a/crypto/perlasm/x86masm.pl
-+++ b/crypto/perlasm/x86masm.pl
-@@ -18,10 +18,10 @@ sub ::generic
-
- if ($opcode =~ /lea/ && @arg[1] =~ s/.*PTR\s+(\(.*\))$/OFFSET $1/) # no []
- { $opcode="mov"; }
-- elsif ($opcode !~ /movq/)
-+ elsif ($opcode !~ /mov[dq]$/)
- { # fix xmm references
-- $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i);
-- $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
-+ $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[-1]=~/\bxmm[0-7]\b/i);
-+ $arg[-1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
- }
-
- &::emit($opcode,@arg);
-@@ -160,13 +160,13 @@ sub ::public_label
- { push(@out,"PUBLIC\t".&::LABEL($_[0],$nmdecor.$_[0])."\n"); }
-
- sub ::data_byte
--{ push(@out,("DB\t").join(',',@_)."\n"); }
-+{ push(@out,("DB\t").join(',',splice(@_,0,16))."\n") while(@_); }
-
- sub ::data_short
--{ push(@out,("DW\t").join(',',@_)."\n"); }
-+{ push(@out,("DW\t").join(',',splice(@_,0,8))."\n") while(@_); }
-
- sub ::data_word
--{ push(@out,("DD\t").join(',',@_)."\n"); }
-+{ push(@out,("DD\t").join(',',splice(@_,0,4))."\n") while(@_); }
-
- sub ::align
- { push(@out,"ALIGN\t$_[0]\n"); }
diff --git a/external/openssl/openssl-fixbuild.patch.1 b/external/openssl/openssl-fixbuild.patch.1
deleted file mode 100644
index 5a986e87214b..000000000000
--- a/external/openssl/openssl-fixbuild.patch.1
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/crypto/evp/Makefile
-+++ b/crypto/evp/Makefile
-@@ -289,7 +289,7 @@
- e_idea.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
- e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
- e_idea.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
--e_idea.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
-+e_idea.o: ../../include/openssl/evp.h ../idea/idea.h
- e_idea.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
- e_idea.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
- e_idea.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
---- a/util/mklink.pl
-+++ b/util/mklink.pl
-@@ -50,8 +50,7 @@
- my $to = join('/', @to_path);
-
- my $file;
--$symlink_exists=eval {symlink("",""); 1};
--if ($^O eq "msys") { $symlink_exists=0 };
-+$symlink_exists=0;
- foreach $file (@files) {
- my $err = "";
- if ($symlink_exists) {
diff --git a/external/openssl/openssl-no-multilib.patch.0 b/external/openssl/openssl-no-multilib.patch.0
new file mode 100644
index 000000000000..07c45318ac25
--- /dev/null
+++ b/external/openssl/openssl-no-multilib.patch.0
@@ -0,0 +1,38 @@
+--- Configure.orig 2020-04-21 14:22:39.000000000 +0200
++++ Configure 2020-07-07 17:25:19.256297500 +0200
+@@ -24,7 +24,7 @@
+ my $orig_death_handler = $SIG{__DIE__};
+ $SIG{__DIE__} = \&death_handler;
+
+-my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n";
++my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [no-multilib] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n";
+
+ # Options:
+ #
+@@ -59,6 +59,7 @@
+ # If disabled, it also disables shared and dynamic-engine.
+ # no-asm do not use assembler
+ # no-egd do not compile support for the entropy-gathering daemon APIs
++# no-multilib exclude multilib identifier from library name
+ # [no-]zlib [don't] compile support for zlib compression.
+ # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
+ # library and will be loaded in run-time by the OpenSSL library.
+@@ -383,6 +384,7 @@
+ "mdc2",
+ "msan",
+ "multiblock",
++ "multilib",
+ "nextprotoneg",
+ "pinshared",
+ "ocb",
+@@ -1754,6 +1756,10 @@
+ if (-f catfile($srcdir, "test", $_, "build.info"));
+ }
+
++ if ($disabled{"multilib"}) {
++ $target{"multilib"} = "";
++ }
++
+ $config{build_infos} = [ ];
+
+ my %ordinals = ();
diff --git a/external/openssl/openssllnx.patch b/external/openssl/openssllnx.patch
deleted file mode 100644
index 224df8f87b2e..000000000000
--- a/external/openssl/openssllnx.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- build/openssl-0.9.8v/Configure-old 2010-04-17 13:51:42.000000000 +0200
-+++ build/openssl-0.9.8v/Configure 2010-04-17 13:52:03.000000000 +0200
-@@ -388,6 +388,9 @@
-
- "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-
-+"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
-+
- "nextstep", "cc:-O -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
- "nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::",
-
---- build/openssl-0.9.8v/Makefile.org 2010-01-27 17:06:36.000000000 +0100
-+++ build/openssl-0.9.8v/Makefile.org 2010-09-20 09:24:00.000000000 +0100
-@@ -206,7 +206,7 @@
- # same language for uniform treatment.
- BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
- CC='$(CC)' CFLAG='$(CFLAG)' \
-- AS='$(CC)' ASFLAG='$(CFLAG) -c' \
-+ AS='$(CC)' ASFLAG='$(CFLAG) -c -Wa,--noexecstack' \
- AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
- RC='$(RC)' \
- CROSS_COMPILE='$(CROSS_COMPILE)' \
diff --git a/external/openssl/opensslsol.patch b/external/openssl/opensslsol.patch
deleted file mode 100644
index 6122b67c930e..000000000000
--- a/external/openssl/opensslsol.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- misc/openssl-0.9.8v/Makefile.shared Wed Sep 17 17:56:40 2008
-+++ build/openssl-0.9.8v/Makefile.shared Fri Mar 26 16:04:41 2010
-@@ -95,7 +95,7 @@
- LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
- LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
- LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
-- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
-+ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \
- $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
-
- LINK_SO= \
-@@ -105,7 +105,7 @@
- SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
- LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
- LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
-- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
-+ LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \
- $${SHAREDCMD} $${SHAREDFLAGS} \
- -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
- $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
diff --git a/external/openssl/opensslwnt.patch b/external/openssl/opensslwnt.patch
deleted file mode 100644
index e22bea6f077b..000000000000
--- a/external/openssl/opensslwnt.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-diff -ru openssl.orig/crypto/x509v3/v3_pci.c openssl/crypto/x509v3/v3_pci.c
---- a/openssl.orig/crypto/x509v3/v3_pci.c 2016-03-01 14:35:05.000000000 +0100
-+++ b/openssl/crypto/x509v3/v3_pci.c 2016-03-03 20:27:42.195914432 +0100
-@@ -3,7 +3,7 @@
- * Contributed to the OpenSSL Project 2004 by Richard Levitte
- * (richard@levitte.org)
- */
--/* Copyright (c) 2004 Kungliga Tekniska Högskolan
-+/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
-diff -ru openssl.orig/crypto/x509v3/v3_pcia.c openssl/crypto/x509v3/v3_pcia.c
---- a/openssl.orig/crypto/x509v3/v3_pcia.c 2016-03-01 14:35:05.000000000 +0100
-+++ b/openssl/crypto/x509v3/v3_pcia.c 2016-03-03 20:27:56.495913984 +0100
-@@ -3,7 +3,7 @@
- * Contributed to the OpenSSL Project 2004 by Richard Levitte
- * (richard@levitte.org)
- */
--/* Copyright (c) 2004 Kungliga Tekniska Högskolan
-+/* Copyright (c) 2004 Kungliga Tekniska Hoegskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
-diff -ru openssl.orig/ms/do_ms.bat openssl/ms/do_ms.bat
---- a/openssl.orig/ms/do_ms.bat 2015-01-15 15:43:14.000000000 +0100
-+++ b/openssl/ms/do_ms.bat 2016-03-03 20:31:09.355907935 +0100
-@@ -1,11 +1,11 @@
-
--perl util\mkfiles.pl >MINFO
--perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak
--perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak
--if x%OSVERSION% == x goto skipce
--perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak
--perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak
--:skipce
-+%1 util\mkfiles.pl >MINFO
-+if %2 == VC-WIN32 goto not64a
-+perl ms\uplink.pl win64a > ms\uptable.asm
-+ml64 -c -Foms\uptable.obj ms\uptable.asm
-+:not64a
-+%1 util\mk1mf.pl no-asm %2 >ms\nt.mak
-+%1 util\mk1mf.pl dll no-asm %2 >ms\ntdll.mak
-
--perl util\mkdef.pl 32 libeay > ms\libeay32.def
--perl util\mkdef.pl 32 ssleay > ms\ssleay32.def
-+%1 util\mkdef.pl 32 libeay > ms\libeay32.def
-+%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def
-diff -ru openssl.orig/util/mk1mf.pl openssl/util/mk1mf.pl
---- a/openssl.orig/util/mk1mf.pl 2016-03-03 20:22:21.043924505 +0100
-+++ b/openssl/util/mk1mf.pl 2016-03-03 20:34:45.015901171 +0100
-@@ -163,7 +163,7 @@
- $inc_def="outinc";
- $tmp_def="tmp";
-
--$perl="perl" unless defined $perl;
-+$perl="$ENV{PERL}" unless defined $perl;
- $mkdir="-mkdir" unless defined $mkdir;
-
- ($ssl,$crypto)=("ssl","crypto");
-@@ -347,6 +347,11 @@
- s/\s*$//; # was chop, didn't work in mixture of perls for Windows...
-
- ($key,$val)=/^([^=]+)=(.*)/;
-+
-+ # On some Windows machines, $val has linefeeds at the end, which confuses
-+ # subsequent code in this file. So we strip all whitespace at the end.
-+ $val =~ s/\s+$//;
-+
- if ($key eq "RELATIVE_DIRECTORY")
- {
- if ($lib ne "")
-@@ -473,7 +478,7 @@
- # Set your compiler options
- PLATFORM=$platform
- CC=$bin_dir${cc}
--CFLAG=$cflags
-+CFLAG=$cflags \$(SOLARINC)
- APP_CFLAG=$app_cflag
- LIB_CFLAG=$lib_cflag
- SHLIB_CFLAG=$shl_cflag
-@@ -488,7 +493,7 @@
-
- LINK_CMD=$link
- LFLAGS=$lflags
--RSC=$rsc
-+RSC=$rsc \$(SOLARINC)
-
- # The output directory for everything interesting
- OUT_D=$out_dir
-@@ -669,7 +674,7 @@
- printf OUT <<EOF;
- #ifdef $platform_cpp_symbol
- /* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */
-- #define CFLAGS "compiler: $cc $cflags"
-+ #define CFLAGS "compiler: $cflags"
- #define PLATFORM "$platform"
- EOF
- printf OUT " #define DATE \"%s\"\n", scalar gmtime();
-diff -ru openssl.orig/util/pl/VC-32.pl openssl/util/pl/VC-32.pl
---- a/openssl.orig/util/pl/VC-32.pl 2016-03-01 14:35:53.000000000 +0100
-+++ b/openssl/util/pl/VC-32.pl 2016-03-03 21:15:14.083824986 +0100
-@@ -30,7 +30,7 @@
- my $ff = "";
-
- # C compiler stuff
--$cc='cl';
-+$cc=$ENV{'CC'};
- if ($FLAVOR =~ /WIN64/)
- {
- # Note that we currently don't have /WX on Win64! There is a lot of
-@@ -114,7 +114,7 @@
- }
-
- $cc=($ENV{CC} or "cl");
-- $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
-+ $base_cflags=' -W3 -GF -Gy -nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
- $base_cflags.=" $wcecdefs";
- $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
- $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
-@@ -123,20 +123,21 @@
- } else {
- $base_cflags.=' /MC';
- }
-- $opt_cflags=' /O1i'; # optimize for space, but with intrinsics...
-- $dbg_cflags=' /Od -DDEBUG -D_DEBUG';
-+ $opt_cflags=' -O1i'; # optimize for space, but with intrinsics...
-+ $dbg_cflags=' -Od -DDEBUG -D_DEBUG';
-+
- $lflags="/nologo /opt:ref $wcelflag";
- }
- else # Win32
- {
- $base_cflags= " $mf_cflag";
-- my $f = $shlib || $fips ?' /MD':' /MT';
-+ my $f = $shlib || $fips ? (($ENV{MSVC_USE_DEBUG_RUNTIME} eq "TRUE") ? ' -MDd' : ' -MD' ):' -MT';
- $ff = "/fixed";
-- $opt_cflags=$f.' /Ox /O2 /Ob2';
-- $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
-+ $opt_cflags=$f.' -Ox -O2 -Ob2';
-+ $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG';
- $lflags="/nologo /subsystem:console /opt:ref";
- }
--$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
-+$lib_cflag='-Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
- $mlflags='';
-
- $out_def ="out32"; $out_def.="dll" if ($shlib);
-@@ -161,7 +162,7 @@
-
- $obj='.obj';
- $asm_suffix='.asm';
--$ofile="/Fo";
-+$ofile="-Fo.\\";
-
- # EXE linking stuff
- $link="link";
-diff -ru openssl.orig/ms/uplink.c openssl/ms/uplink.c
---- a/openssl.orig/ms/uplink.c 2015-03-19 15:02:02.000000000 +0100
-+++ b/openssl/ms/uplink.c 2016-03-03 20:39:19.403892565 +0100
-@@ -1,5 +1,6 @@
- #if (defined(_WIN64) || defined(_WIN32_WCE)) && !defined(UNICODE)
- # define UNICODE
-+# define _CRT_NON_CONFORMING_SWPRINTFS
- #endif
- #if defined(UNICODE) && !defined(_UNICODE)
- # define _UNICODE
diff --git a/external/openssl/opensslwnt_safeseh.patch b/external/openssl/opensslwnt_safeseh.patch
deleted file mode 100644
index f2eafab5b9ed..000000000000
--- a/external/openssl/opensslwnt_safeseh.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-use /safeseh in 32-bit MSVC builds; this is not required for 64-bit
-
-diff -ru openssl.orig/util/mk1mf.pl openssl/util/mk1mf.pl
---- a/openssl.orig/util/mk1mf.pl 2016-03-03 20:22:21.043924505 +0100
-+++ b/openssl/util/mk1mf.pl 2016-03-03 20:34:45.015901171 +0100
-@@ -488,7 +493,7 @@
- SRC_D=$src_dir
-
- LINK_CMD=$link
--LFLAGS=$lflags
-+LFLAGS=$lflags /SAFESEH
- RSC=$rsc \$(SOLARINC)
-
- # The output directory for everything interesting
-@@ -511,7 +516,7 @@
- MKDIR=$mkdir
- MKLIB=$bin_dir$mklib
- MLFLAGS=$mlflags
--ASM=$bin_dir$asm
-+ASM=$bin_dir$asm /safeseh
-
- # FIPS validated module and support file locations
-
diff --git a/external/pdfium/AndroidNDK19.patch.1 b/external/pdfium/AndroidNDK19.patch.1
new file mode 100644
index 000000000000..b0d1f0deae80
--- /dev/null
+++ b/external/pdfium/AndroidNDK19.patch.1
@@ -0,0 +1,16 @@
+diff -Naur pdfium.org/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h
+--- pdfium.org/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h 2021-05-05 23:01:25.705057178 +0200
++++ pdfium/third_party/base/allocator/partition_allocator/page_allocator_internals_posix.h 2021-05-05 23:06:52.194081762 +0200
+@@ -15,6 +15,12 @@
+ #endif
+ #if defined(OS_ANDROID)
+ #include <sys/prctl.h>
++#ifndef PR_SET_VMA
++#define PR_SET_VMA 0x53564d41
++#endif
++#ifndef PR_SET_VMA_ANON_NAME
++#define PR_SET_VMA_ANON_NAME 0
++#endif
+ #endif
+ #if defined(OS_LINUX) || defined(OS_CHROMEOS)
+ #include <sys/resource.h>
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index f08ff51a31a3..900c21b349b5 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -670,6 +670,20 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,pdfium,\
))
endif
+ifeq ($(OS),iOS)
+# fxge
+$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
+ UnpackedTarball/pdfium/core/fxge/apple/fx_apple_platform \
+ UnpackedTarball/pdfium/core/fxge/apple/fx_mac_impl \
+ UnpackedTarball/pdfium/core/fxge/apple/fx_quartz_device \
+))
+
+$(eval $(call gb_Library_use_system_darwin_frameworks,pdfium,\
+ CoreGraphics \
+ CoreFoundation \
+))
+endif
+
ifeq ($(OS),ANDROID)
# fxge
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index f4643376cee0..cb9b571a25fe 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -14,6 +14,10 @@ pdfium_patches += build.patch.1
# Avoids Windows 8 build dependency.
pdfium_patches += windows7.patch.1
pdfium_patches += c++20-comparison.patch
+# Use CoreGraphics.h instead of Carbon.h
+pdfium_patches += cg-instead-of-carbon.patch.1
+# Android NDK 19 - that is known to work well - does not have 2 defines
+pdfium_patches += AndroidNDK19.patch.1
$(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
diff --git a/external/pdfium/cg-instead-of-carbon.patch.1 b/external/pdfium/cg-instead-of-carbon.patch.1
new file mode 100644
index 000000000000..bd29af1b95c2
--- /dev/null
+++ b/external/pdfium/cg-instead-of-carbon.patch.1
@@ -0,0 +1,13 @@
+-*- Mode: Diff -*-
+--- a/core/fxge/apple/fx_quartz_device.h
++++ b/core/fxge/apple/fx_quartz_device.h
+@@ -7,7 +7,7 @@
+ #ifndef CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
+ #define CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
+
+-#include <Carbon/Carbon.h>
++#include <CoreGraphics/CoreGraphics.h>
+
+ #include "core/fxcrt/fx_system.h"
+ #include "core/fxge/cfx_gemodule.h"
+
diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk
index 3cc0a95e3617..1f1adba6ee34 100644
--- a/external/poppler/StaticLibrary_poppler.mk
+++ b/external/poppler/StaticLibrary_poppler.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
UnpackedTarball/poppler/fofi/FoFiType1C \
UnpackedTarball/poppler/fofi/FoFiIdentifier \
UnpackedTarball/poppler/poppler/Annot \
+ UnpackedTarball/poppler/poppler/AnnotStampImageHelper \
UnpackedTarball/poppler/poppler/Array \
UnpackedTarball/poppler/poppler/BBoxOutputDev \
UnpackedTarball/poppler/poppler/CachedFile \
@@ -83,6 +84,8 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
UnpackedTarball/poppler/poppler/Decrypt \
UnpackedTarball/poppler/poppler/Dict \
UnpackedTarball/poppler/poppler/Error \
+ UnpackedTarball/poppler/poppler/FDPDFDocBuilder \
+ UnpackedTarball/poppler/poppler/FILECacheLoader \
UnpackedTarball/poppler/poppler/FileSpec \
UnpackedTarball/poppler/poppler/FontEncodingTables \
UnpackedTarball/poppler/poppler/Form \
@@ -93,6 +96,7 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
UnpackedTarball/poppler/poppler/GfxState \
UnpackedTarball/poppler/poppler/GlobalParams \
UnpackedTarball/poppler/poppler/Hints \
+ UnpackedTarball/poppler/poppler/ImageEmbeddingUtils \
UnpackedTarball/poppler/poppler/JArithmeticDecoder \
UnpackedTarball/poppler/poppler/JBIG2Stream \
UnpackedTarball/poppler/poppler/JSInfo \
@@ -129,13 +133,12 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
UnpackedTarball/poppler/poppler/TextOutputDev \
UnpackedTarball/poppler/poppler/PageLabelInfo \
UnpackedTarball/poppler/poppler/SecurityHandler \
- UnpackedTarball/poppler/poppler/StdinCachedFile \
- UnpackedTarball/poppler/poppler/StdinPDFDocBuilder \
UnpackedTarball/poppler/poppler/Sound \
UnpackedTarball/poppler/poppler/ViewerPreferences \
UnpackedTarball/poppler/poppler/Movie \
UnpackedTarball/poppler/poppler/Rendition \
UnpackedTarball/poppler/poppler/DCTStream \
+ UnpackedTarball/poppler/splash/SplashBitmap \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk
index 68fd06d9403b..0ac3c8aa69c4 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler
$(eval $(call gb_UnpackedTarball_add_patches,poppler,\
external/poppler/poppler-config.patch.1 \
+ external/poppler/disable-freetype.patch.1 \
+ external/poppler/gcc7-EntityInfo.patch.1 \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/poppler/disable-freetype.patch.1 b/external/poppler/disable-freetype.patch.1
new file mode 100644
index 000000000000..d59006eba979
--- /dev/null
+++ b/external/poppler/disable-freetype.patch.1
@@ -0,0 +1,41 @@
+disable freetype dependent code
+
+--- poppler/poppler/Form.cc.orig 2022-09-14 15:46:48.588316681 +0200
++++ poppler/poppler/Form.cc 2022-09-14 15:48:01.468274551 +0200
+@@ -46,7 +46,7 @@
+ #include <cstdlib>
+ #include <cstring>
+ #include <cctype>
+-#include "goo/ft_utils.h"
++//#include "goo/ft_utils.h"
+ #include "goo/gmem.h"
+ #include "goo/gfile.h"
+ #include "goo/GooString.h"
+@@ -77,8 +77,8 @@
+ #include "fofi/FoFiTrueType.h"
+ #include "fofi/FoFiIdentifier.h"
+
+-#include <ft2build.h>
+-#include FT_FREETYPE_H
++//#include <ft2build.h>
++//#include FT_FREETYPE_H
+
+ // return a newly allocated char* containing an UTF16BE string of size length
+ char *pdfDocEncodingToUTF16(const std::string &orig, int *length)
+@@ -2730,6 +2730,8 @@
+
+ Form::AddFontResult Form::addFontToDefaultResources(const std::string &filepath, int faceIndex, const std::string &fontFamily, const std::string &fontStyle)
+ {
++ return {};
++#if 0
+ if (!GooString::endsWith(filepath, ".ttf") && !GooString::endsWith(filepath, ".ttc") && !GooString::endsWith(filepath, ".otf")) {
+ error(errIO, -1, "We only support embedding ttf/ttc/otf fonts for now. The font file for {0:s} {1:s} was {2:s}", fontFamily.c_str(), fontStyle.c_str(), filepath.c_str());
+ return {};
+@@ -2939,6 +2941,7 @@
+ }
+
+ return { dictFontName, fontDictRef };
++#endif
+ }
+
+ std::string Form::getFallbackFontForChar(Unicode uChar, const GfxFont &fontToEmulate) const
diff --git a/external/poppler/gcc7-EntityInfo.patch.1 b/external/poppler/gcc7-EntityInfo.patch.1
new file mode 100644
index 000000000000..b450bff93af9
--- /dev/null
+++ b/external/poppler/gcc7-EntityInfo.patch.1
@@ -0,0 +1,48 @@
+gcc 7.3.1 says:
+
+workdir/UnpackedTarball/poppler/poppler/CertificateInfo.cc:42:34: error: function ‘X509CertificateInfo::EntityInfo& X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo&&)’ defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ‘’
+
+--- poppler/poppler/CertificateInfo.h.orig 2022-09-14 19:32:12.426351385 +0200
++++ poppler/poppler/CertificateInfo.h 2022-09-14 19:32:18.947347812 +0200
+@@ -70,7 +70,7 @@
+ ~EntityInfo();
+
+ EntityInfo(EntityInfo &&) noexcept;
+- EntityInfo &operator=(EntityInfo &&) noexcept;
++ EntityInfo &operator=(EntityInfo &&) /*noexcept*/;
+
+ EntityInfo(const EntityInfo &) = delete;
+ EntityInfo &operator=(const EntityInfo &) = delete;
+--- poppler/poppler/CertificateInfo.cc.orig 2022-09-14 19:31:10.225385467 +0200
++++ poppler/poppler/CertificateInfo.cc 2022-09-14 19:31:12.572384182 +0200
+@@ -39,7 +39,7 @@
+
+ X509CertificateInfo::EntityInfo::EntityInfo(X509CertificateInfo::EntityInfo &&other) noexcept = default;
+
+-X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) noexcept = default;
++X509CertificateInfo::EntityInfo &X509CertificateInfo::EntityInfo::operator=(X509CertificateInfo::EntityInfo &&other) /*noexcept*/ = default;
+
+ X509CertificateInfo::X509CertificateInfo() : ku_extensions(KU_NONE), cert_version(-1), is_self_signed(false) { }
+
+--- poppler/poppler/GfxFont.cc.orig 2022-09-14 20:24:32.569607333 +0200
++++ poppler/poppler/GfxFont.cc 2022-09-14 20:24:52.323596186 +0200
+@@ -180,7 +180,7 @@
+
+ GfxFontLoc::GfxFontLoc(GfxFontLoc &&other) noexcept = default;
+
+-GfxFontLoc &GfxFontLoc::operator=(GfxFontLoc &&other) noexcept = default;
++GfxFontLoc &GfxFontLoc::operator=(GfxFontLoc &&other) /*noexcept*/ = default;
+
+ void GfxFontLoc::setPath(GooString *pathA)
+ {
+--- poppler/poppler/GfxFont.h.orig 2022-09-14 20:24:30.784608340 +0200
++++ poppler/poppler/GfxFont.h 2022-09-14 20:25:08.850586861 +0200
+@@ -124,7 +124,7 @@
+ GfxFontLoc(const GfxFontLoc &) = delete;
+ GfxFontLoc(GfxFontLoc &&) noexcept;
+ GfxFontLoc &operator=(const GfxFontLoc &) = delete;
+- GfxFontLoc &operator=(GfxFontLoc &&other) noexcept;
++ GfxFontLoc &operator=(GfxFontLoc &&other) /*noexcept*/;
+
+ // Set the 'path' string from a GooString on the heap.
+ // Ownership of the object is taken.
diff --git a/external/poppler/poppler-config.patch.1 b/external/poppler/poppler-config.patch.1
index b902402ea4e7..455a88e2afc4 100644
--- a/external/poppler/poppler-config.patch.1
+++ b/external/poppler/poppler-config.patch.1
@@ -16,7 +16,7 @@ new file mode 100644
index 0fbd336a..451213f8 100644
--- /dev/null
+++ b/config.h
-@@ -0,0 +1,221 @@
+@@ -0,0 +1,220 @@
+/* config.h. Generated from config.h.cmake by cmake. */
+
+/* Build against libcurl. */
@@ -105,9 +105,6 @@ index 0fbd336a..451213f8 100644
+#define HAVE_TIMEGM 1
+#endif
+
-+/* Define if you have the iconv() function and it works. */
-+/* #undef HAVE_ICONV */
-+
+/* Define to 1 if you have the `z' library (-lz). */
+/* #undef HAVE_LIBZ */
+
@@ -176,7 +173,7 @@ index 0fbd336a..451213f8 100644
+#define PACKAGE_NAME "poppler"
+
+/* Define to the full name and version of this package. */
-+#define PACKAGE_STRING "poppler 21.01.0"
++#define PACKAGE_STRING "poppler 22.09.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "poppler"
@@ -185,7 +182,7 @@ index 0fbd336a..451213f8 100644
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
-+#define PACKAGE_VERSION "21.01.0"
++#define PACKAGE_VERSION "22.09.0"
+
+/* Poppler data dir */
+#define POPPLER_DATADIR "/usr/local/share/poppler"
@@ -203,7 +200,7 @@ index 0fbd336a..451213f8 100644
+/* #undef USE_FLOAT */
+
+/* Version number of package */
-+#define VERSION "21.01.0"
++#define VERSION "22.09.0"
+
+#if defined(__APPLE__)
+#elif defined (_WIN32)
@@ -228,6 +225,8 @@ index 0fbd336a..451213f8 100644
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#define popen _popen
+#define pclose _pclose
++#define strncasecmp _strnicmp
++#define strcasecmp _stricmp
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
@@ -243,12 +242,12 @@ new file mode 100644
index 0fbd336a..451213f8 100644
--- /dev/null
+++ b/poppler/poppler-config.h
-@@ -0,0 +1,166 @@
+@@ -0,0 +1,161 @@
+//================================================= -*- mode: c++ -*- ====
+//
+// poppler-config.h
+//
-+// Copyright 1996-2011 Glyph & Cog, LLC
++// Copyright 1996-2011, 2022 Glyph & Cog, LLC
+//
+//========================================================================
+
@@ -282,7 +281,7 @@ index 0fbd336a..451213f8 100644
+
+/* Defines the poppler version. */
+#ifndef POPPLER_VERSION
-+#define POPPLER_VERSION "21.01.0"
++#define POPPLER_VERSION "22.09.0"
+#endif
+
+/* Use single precision arithmetic in the Splash backend */
@@ -369,18 +368,13 @@ index 0fbd336a..451213f8 100644
+/* #undef USE_BOOST_HEADERS */
+#endif
+
-+/* Is splash backend available */
-+#ifndef HAVE_SPLASH
-+/* #undef HAVE_SPLASH */
-+#endif
-+
+//------------------------------------------------------------------------
+// version
+//------------------------------------------------------------------------
+
+// copyright notice
-+#define popplerCopyright "Copyright 2005-2021 The Poppler Developers - http://poppler.freedesktop.org"
-+#define xpdfCopyright "Copyright 1996-2011 Glyph & Cog, LLC"
++#define popplerCopyright "Copyright 2005-2022 The Poppler Developers - http://poppler.freedesktop.org"
++#define xpdfCopyright "Copyright 1996-2011, 2022 Glyph & Cog, LLC"
+
+//------------------------------------------------------------------------
+// Win32 stuff
@@ -439,9 +433,9 @@ index 0fbd336a..451213f8 100644
+
+#include "poppler-global.h"
+
-+#define POPPLER_VERSION "21.01.0"
-+#define POPPLER_VERSION_MAJOR 21
-+#define POPPLER_VERSION_MINOR 1
++#define POPPLER_VERSION "22.09.0"
++#define POPPLER_VERSION_MAJOR 22
++#define POPPLER_VERSION_MINOR 9
+#define POPPLER_VERSION_MICRO 0
+
+namespace poppler
@@ -455,3 +449,38 @@ index 0fbd336a..451213f8 100644
+}
+
+#endif
+diff --git a/poppler_private_export.h b/poppler_private_export.h
+new file mode 100644
+index 0fbd336a..451213f8 100644
+--- /dev/null
++++ b/poppler_private_export.h
+@@ -0,0 +1,11 @@
++
++#ifndef POPPLER_PRIVATE_EXPORT_H
++#define POPPLER_PRIVATE_EXPORT_H
++
++# define POPPLER_PRIVATE_EXPORT
++# define POPPLER_PRIVATE_NO_EXPORT
++# define POPPLER_PRIVATE_DEPRECATED
++# define POPPLER_PRIVATE_DEPRECATED_EXPORT
++# define POPPLER_PRIVATE_DEPRECATED_NO_EXPORT
++
++#endif /* POPPLER_PRIVATE_EXPORT_H */
+
+diff --git a/cpp/poppler_cpp_export.h b/cpp/poppler_cpp_export.h
+new file mode 100644
+index 0fbd336a..451213f8 100644
+--- /dev/null
++++ b/cpp/poppler_cpp_export.h
+@@ -0,0 +1,11 @@
++
++#ifndef POPPLER_CPP_EXPORT_H
++#define POPPLER_CPP_EXPORT_H
++
++# define POPPLER_CPP_EXPORT
++# define POPPLER_CPP_NO_EXPORT
++# define POPPLER_CPP_DEPRECATED
++# define POPPLER_CPP_DEPRECATED_EXPORT
++# define POPPLER_CPP_DEPRECATED_NO_EXPORT
++
++#endif /* POPPLER_CPP_EXPORT_H */
diff --git a/external/postgresql/ExternalPackage_postgresql.mk b/external/postgresql/ExternalPackage_postgresql.mk
new file mode 100644
index 000000000000..f6c9a9bb6deb
--- /dev/null
+++ b/external/postgresql/ExternalPackage_postgresql.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalPackage_ExternalPackage,postgresql,postgresql))
+
+$(eval $(call gb_ExternalPackage_use_external_project,postgresql,postgresql))
+
+$(eval $(call gb_ExternalPackage_add_file,postgresql,$(LIBO_LIB_FOLDER)/libpq.dll,$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)/libpq/libpq.dll))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/postgresql/ExternalProject_postgresql.mk b/external/postgresql/ExternalProject_postgresql.mk
index ba462a34a1a1..377f02c0174c 100644
--- a/external/postgresql/ExternalProject_postgresql.mk
+++ b/external/postgresql/ExternalProject_postgresql.mk
@@ -12,7 +12,6 @@ $(eval $(call gb_ExternalProject_ExternalProject,postgresql))
$(eval $(call gb_ExternalProject_use_externals,postgresql,\
$(if $(ENABLE_LDAP),openldap) \
openssl \
- zlib \
))
$(eval $(call gb_ExternalProject_register_targets,postgresql,\
@@ -25,8 +24,12 @@ $(eval $(call gb_ExternalProject_use_nmake,postgresql,build))
$(call gb_ExternalProject_get_state_target,postgresql,build) :
$(call gb_ExternalProject_run,build,\
- nmake -f win32.mak USE_SSL=1 USE_LDAP=1 \
- ,src)
+ MSBFLAGS="/p:Platform=$(if $(filter X86_64,$(CPUNAME)),x64,Win32) \
+ $(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
+ $(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
+ $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION))" \
+ $(PERL) build.pl $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) libpq \
+ ,src/tools/msvc)
else
@@ -40,7 +43,7 @@ endif
ifeq ($(DISABLE_OPENSSL),)
ifeq ($(SYSTEM_OPENSSL),)
postgresql_CPPFLAGS += -I$(call gb_UnpackedTarball_get_dir,openssl)/include
-postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/
+postgresql_LDFLAGS += -L$(call gb_UnpackedTarball_get_dir,openssl)/ $(if $(filter $(OS),LINUX),-pthread)
endif
endif
@@ -55,21 +58,25 @@ postgresql_LDFLAGS += \
endif
+# note: as of 13.1, zlib is not needed by libpq
+# passing MAKELEVEL=0 is required to find internal headers
$(call gb_ExternalProject_get_state_target,postgresql,build) :
$(call gb_ExternalProject_run,build,\
./configure \
- --without-readline --disable-shared --with-ldap \
+ --without-readline \
+ --without-zlib \
+ --with-ldap \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
$(if $(DISABLE_OPENSSL),,--with-openssl \
- $(if $(WITH_KRB5), --with-krb5) \
$(if $(WITH_GSSAPI),--with-gssapi)) \
$(if $(ENABLE_LDAP),,--with-ldap=no) \
+ CFLAGS="-fPIC" \
CPPFLAGS="$(postgresql_CPPFLAGS)" \
LDFLAGS="$(postgresql_LDFLAGS)" \
$(if $(ENABLE_LDAP),EXTRA_LDAP_LIBS="-llber -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4") \
&& cd src/interfaces/libpq \
- && MAKEFLAGS= && $(MAKE) all-static-lib)
+ && MAKEFLAGS= && $(MAKE) MAKELEVEL=0 all-static-lib)
endif
diff --git a/external/postgresql/Module_postgresql.mk b/external/postgresql/Module_postgresql.mk
index 1f655c6e5034..7ea89dad3b39 100644
--- a/external/postgresql/Module_postgresql.mk
+++ b/external/postgresql/Module_postgresql.mk
@@ -14,4 +14,10 @@ $(eval $(call gb_Module_add_targets,postgresql,\
UnpackedTarball_postgresql \
))
+ifeq ($(OS),WNT)
+$(eval $(call gb_Module_add_targets,postgresql,\
+ ExternalPackage_postgresql \
+))
+endif # WNT
+
# vim: set noet sw=4 ts=4:
diff --git a/external/postgresql/UnpackedTarball_postgresql.mk b/external/postgresql/UnpackedTarball_postgresql.mk
index 90b363c2dccf..594b6dd0a5e7 100644
--- a/external/postgresql/UnpackedTarball_postgresql.mk
+++ b/external/postgresql/UnpackedTarball_postgresql.mk
@@ -11,21 +11,16 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,postgresql))
$(eval $(call gb_UnpackedTarball_set_tarball,postgresql,$(POSTGRESQL_TARBALL),,postgresql))
-$(eval $(call gb_UnpackedTarball_update_autoconf_configs,postgresql,config))
-
-$(eval $(call gb_UnpackedTarball_set_patchlevel,postgresql,3))
-
$(eval $(call gb_UnpackedTarball_add_patches,postgresql, \
- external/postgresql/postgresql-libs-leak.patch \
- external/postgresql/postgresql-9.2.1-libreoffice.patch \
external/postgresql/windows.patch.0 \
- external/postgresql/postgresql.exit.patch.0 \
+ external/postgresql/postgres-msvc-build.patch.1 \
+ $(if $(filter WNT_ARM64,$(OS)_$(CPUNAME)), external/postgresql/arm64.patch.1) \
))
-ifeq ($(SYSTEM_ZLIB),)
-$(eval $(call gb_UnpackedTarball_add_patches,postgresql, \
- external/postgresql/internal-zlib.patch.1 \
-))
+ifeq ($(CROSS_COMPILING),)
+$(eval $(call gb_UnpackedTarball_add_file,postgresql,src/tools/msvc/config.pl,external/postgresql/config.pl))
endif
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,postgresql))
+
# vim: set noet sw=4 ts=4:
diff --git a/external/postgresql/arm64.patch.1 b/external/postgresql/arm64.patch.1
new file mode 100644
index 000000000000..7f8f2d6e4137
--- /dev/null
+++ b/external/postgresql/arm64.patch.1
@@ -0,0 +1,53 @@
+diff -ur postgresql.org/src/tools/msvc/Mkvcbuild.pm postgresql/src/tools/msvc/Mkvcbuild.pm
+--- postgresql.org/src/tools/msvc/Mkvcbuild.pm 2021-03-14 02:09:15.288060770 +0100
++++ postgresql/src/tools/msvc/Mkvcbuild.pm 2021-03-14 02:12:22.351726582 +0100
+@@ -107,13 +107,6 @@
+
+ push(@pgportfiles, 'strtof.c') if ($vsVersion < '14.00');
+
+- if ($vsVersion >= '9.00')
+- {
+- push(@pgportfiles, 'pg_crc32c_sse42_choose.c');
+- push(@pgportfiles, 'pg_crc32c_sse42.c');
+- push(@pgportfiles, 'pg_crc32c_sb8.c');
+- }
+- else
+ {
+ push(@pgportfiles, 'pg_crc32c_sb8.c');
+ }
+diff -ur postgresql.org/src/tools/msvc/MSBuildProject.pm postgresql/src/tools/msvc/MSBuildProject.pm
+--- postgresql.org/src/tools/msvc/MSBuildProject.pm 2021-03-14 02:09:15.288060770 +0100
++++ postgresql/src/tools/msvc/MSBuildProject.pm 2021-03-14 02:12:22.351726582 +0100
+@@ -307,8 +307,7 @@
+ : ($self->{type} eq "dll" ? 'DynamicLibrary' : 'StaticLibrary');
+ my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ';');
+
+- my $targetmachine =
+- $self->{platform} eq 'Win32' ? 'MachineX86' : 'MachineX64';
++ my $targetmachine = "MachineARM64";
+
+ my $includes = $self->{includes};
+ unless ($includes eq '' or $includes =~ /;$/)
+@@ -347,7 +347,6 @@
+ <ProgramDatabaseFile>.\\$cfgname\\$self->{name}\\$self->{name}.pdb</ProgramDatabaseFile>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>.\\$cfgname\\$self->{name}\\$self->{name}.map</MapFileName>
+- <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <!-- Permit links to MinGW-built, 32-bit DLLs (default before VS2012). -->
+ <ImageHasSafeExceptionHandlers/>
+ <SubSystem>Console</SubSystem>
+diff -ur postgresql.org/src/tools/msvc/Solution.pm postgresql/src/tools/msvc/Solution.pm
+--- postgresql.org/src/tools/msvc/Solution.pm 2021-03-14 02:09:15.288060770 +0100
++++ postgresql/src/tools/msvc/Solution.pm 2021-03-14 02:12:22.351726582 +0100
+@@ -62,10 +62,7 @@
+ if (1) #($^O eq "MSWin32")
+ {
+ # Examine CL help output to determine if we are in 32 or 64-bit mode.
+- my $output = `cl /? 2>&1`;
+- $? >> 8 == 0 or die "cl command not found";
+- $self->{platform} =
+- ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32';
++ $self->{platform} = 'ARM64';
+ }
+ else
+ {
diff --git a/external/postgresql/config.pl b/external/postgresql/config.pl
new file mode 100644
index 000000000000..ae163ebbd166
--- /dev/null
+++ b/external/postgresql/config.pl
@@ -0,0 +1 @@
+$config->{openssl} = "$ENV{WORKDIR}/UnpackedTarball/openssl";
diff --git a/external/postgresql/internal-zlib.patch.1 b/external/postgresql/internal-zlib.patch.1
deleted file mode 100644
index ac2b728e1314..000000000000
--- a/external/postgresql/internal-zlib.patch.1
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -up postgresql/configure.dt postgresql/configure
---- postgresql/configure.dt 2016-11-03 17:34:17.282388226 +0100
-+++ postgresql/configure 2016-11-03 17:34:35.004202484 +0100
-@@ -8566,13 +8566,13 @@ fi
-
- if test "$with_zlib" = yes; then
-
--{ $as_echo "$as_me:$LINENO: checking for inflate in -lz" >&5
--$as_echo_n "checking for inflate in -lz... " >&6; }
-+{ $as_echo "$as_me:$LINENO: checking for inflate in -lzlib" >&5
-+$as_echo_n "checking for inflate in -lzlib... " >&6; }
- if test "${ac_cv_lib_z_inflate+set}" = set; then
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lz $LIBS"
-+LIBS="-lzlib $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -8636,7 +8636,7 @@ if test "x$ac_cv_lib_z_inflate" = x""yes
- #define HAVE_LIBZ 1
- _ACEOF
-
-- LIBS="-lz $LIBS"
-+ LIBS="-lzlib $LIBS"
-
- else
- { { $as_echo "$as_me:$LINENO: error: zlib library not found
diff --git a/external/postgresql/postgres-msvc-build.patch.1 b/external/postgresql/postgres-msvc-build.patch.1
new file mode 100644
index 000000000000..c217a755918b
--- /dev/null
+++ b/external/postgresql/postgres-msvc-build.patch.1
@@ -0,0 +1,110 @@
+Cygwin perl calls /bin/sh which can't resolve to .exe
+
+Also Cygwin perl has $Config{osname} different from MSWin32, and why even check that?
+
+--- postgresql/src/tools/msvc/build.pl.orig 2021-01-19 17:36:09.801463500 +0100
++++ postgresql/src/tools/msvc/build.pl 2021-01-19 17:36:20.426821300 +0100
+@@ -55,13 +55,13 @@
+ if ($buildwhat)
+ {
+ system(
+- "msbuild $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf"
++ "msbuild.exe $buildwhat.vcxproj /verbosity:normal $msbflags /p:Configuration=$bconf"
+ );
+ }
+ else
+ {
+ system(
+- "msbuild pgsql.sln /verbosity:normal $msbflags /p:Configuration=$bconf"
++ "msbuild.exe pgsql.sln /verbosity:normal $msbflags /p:Configuration=$bconf"
+ );
+ }
+
+--- postgresql/src/tools/msvc/Project.pm.orig 2021-01-19 17:59:18.799237700 +0100
++++ postgresql/src/tools/msvc/Project.pm 2021-01-19 17:59:48.487711700 +0100
+@@ -22,7 +22,7 @@
+ my $self = {
+ name => $name,
+ type => $type,
+- guid => $^O eq "MSWin32" ? Win32::GuidGen() : 'FAKE',
++ guid => Win32::GuidGen(),
+ files => {},
+ references => [],
+ libraries => [],
+--- postgresql/src/tools/msvc/Solution.pm.orig 2021-01-19 18:03:04.594229100 +0100
++++ postgresql/src/tools/msvc/Solution.pm 2021-01-19 18:04:13.677610100 +0100
+@@ -59,7 +59,7 @@
+ {
+ my $self = shift;
+
+- if ($^O eq "MSWin32")
++ if (1) #($^O eq "MSWin32")
+ {
+ # Examine CL help output to determine if we are in 32 or 64-bit mode.
+ my $output = `cl /? 2>&1`;
+@@ -1081,7 +1081,7 @@
+ }
+ if ($fld ne "")
+ {
+- $flduid{$fld} = $^O eq "MSWin32" ? Win32::GuidGen() : 'FAKE';
++ $flduid{$fld} = Win32::GuidGen();
+ print $sln <<EOF;
+ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "$fld", "$fld", "$flduid{$fld}"
+ EndProject
+--- postgresql/src/tools/msvc/VSObjectFactory.pm.orig 2021-01-19 18:06:42.633421700 +0100
++++ postgresql/src/tools/msvc/VSObjectFactory.pm 2021-01-19 18:06:28.663523200 +0100
+@@ -111,7 +111,7 @@
+
+ sub DetermineVisualStudioVersion
+ {
+- if ($^O eq "MSWin32")
++ if (1) # ($^O eq "MSWin32")
+ {
+ # To determine version of Visual Studio we use nmake as it has
+ # existed for a long time and still exists in current Visual
+--- postgresql/src/tools/msvc/Mkvcbuild.pm.orig 2021-01-19 18:23:59.830153900 +0100
++++ postgresql/src/tools/msvc/Mkvcbuild.pm 2021-01-19 18:24:04.095411300 +0100
+@@ -9,7 +9,7 @@
+ use warnings;
+
+ use Carp;
+-use if ($^O eq "MSWin32"), 'Win32';
++use Win32;
+ use Project;
+ use Solution;
+ use Cwd;
+--- postgresql/src/tools/msvc/Solution.pm.orig 2021-01-19 20:27:21.366237600 +0100
++++ postgresql/src/tools/msvc/Solution.pm 2021-01-19 20:28:17.773662900 +0100
+@@ -126,7 +126,8 @@
+ # openssl.exe is in the specified directory.
+ # Quote the .exe name in case it has spaces
+ my $opensslcmd =
+- qq("$self->{options}->{openssl}\\bin\\openssl.exe" version 2>&1);
++ qq("$self->{options}->{openssl}\\apps\\openssl.exe" version 2>&1);
++ print "$opensslcmd";
+ my $sslout = `$opensslcmd`;
+
+ $? >> 8 == 0
+@@ -964,8 +964,8 @@
+ # On both Win32 and Win64 the same library
+ # names are used without a debugging context.
+ $dbgsuffix = 0;
+- $libsslpath = '\lib\libssl.lib';
+- $libcryptopath = '\lib\libcrypto.lib';
++ $libsslpath = '\libssl.lib';
++ $libcryptopath = '\libcrypto.lib';
+ }
+
+ $proj->AddLibrary($self->{options}->{openssl} . $libsslpath,
+@@ -990,9 +990,9 @@
+ # to be here, so don't ask for it in last
+ # parameter.
+ $proj->AddLibrary(
+- $self->{options}->{openssl} . '\lib\ssleay32.lib', 0);
++ $self->{options}->{openssl} . '\ssleay32.lib', 0);
+ $proj->AddLibrary(
+- $self->{options}->{openssl} . '\lib\libeay32.lib', 0);
++ $self->{options}->{openssl} . '\libeay32.lib', 0);
+ }
+ }
+ }
diff --git a/external/postgresql/postgresql-9.2.1-libreoffice.patch b/external/postgresql/postgresql-9.2.1-libreoffice.patch
deleted file mode 100644
index 174ee8551a78..000000000000
--- a/external/postgresql/postgresql-9.2.1-libreoffice.patch
+++ /dev/null
@@ -1,74 +0,0 @@
---- misc/build/postgresql-9.1.1/src/interfaces/libpq/Makefile 2011-09-22 23:57:57.000000000 +0200
-+++ misc/build/postgresql-9.1.1.patched/src/interfaces/libpq/Makefile 2011-12-15 09:02:18.000000000 +0100
-@@ -148,3 +148,6 @@
- maintainer-clean: distclean maintainer-clean-lib
- $(MAKE) -C test $@
- rm -f libpq-dist.rc
-+
-+libpq-flags.mk:
-+ @printf '%s\n' 'LIBPQ_DEP_LIBS+=$(SHLIB_LINK)' > '$@'
---- misc/build/postgresql-9.1.1/src/interfaces/libpq/win32.mak 2011-12-14 14:28:59.000000000 +0100
-+++ misc/build/postgresql-9.1.1.patched/src/interfaces/libpq/win32.mak 2011-12-15 09:11:37.000000000 +0100
-@@ -11,14 +11,12 @@
- !ENDIF
-
- !IFDEF DEBUG
--OPT=/Od /Zi /MDd
-+OPT=/Od /Zi
- LOPT=/DEBUG
--DEBUGDEF=/D _DEBUG
--OUTFILENAME=libpqd
-+OUTFILENAME=libpq
- !ELSE
- OPT=/O2 /MD
- LOPT=
--DEBUGDEF=/D NDEBUG
- OUTFILENAME=libpq
- !ENDIF
-
-@@ -67,18 +66,11 @@
- CPP=cl.exe
- RSC=rc.exe
-
--!IFDEF DEBUG
--OUTDIR=.\Debug
--INTDIR=.\Debug
--CPP_OBJS=.\Debug/
--!ELSE
--OUTDIR=.\Release
--INTDIR=.\Release
--CPP_OBJS=.\Release/
--!ENDIF
--
-+OUTDIR=.
-+INTDIR=.
-+CPP_OBJS=./
-
--ALL : config "$(OUTDIR)\$(OUTFILENAME).lib" "$(OUTDIR)\$(OUTFILENAME).dll"
-+ALL : config "$(OUTDIR)\$(OUTFILENAME).lib"
-
- CLEAN :
- -@erase "$(INTDIR)\getaddrinfo.obj"
-@@ -178,10 +170,11 @@
- "$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
--CPP_PROJ=/nologo /W3 /EHsc $(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. /I "$(SSL_INC)" \
-+CPP_PROJ=/nologo /W3 /EHsc $(OPT) /I "..\..\include" /I "..\..\include\port\win32" /I "..\..\include\port\win32_msvc" /I "..\..\port" /I. $(SOLARINC) /I $(WORKDIR)/UnpackedTarball/openssl/include \
- /D "FRONTEND" $(DEBUGDEF) \
- /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch" \
- /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \
-+ /D "_CRT_NONSTDC_NO_DEPRECATE" \
- /D "_CRT_SECURE_NO_DEPRECATE" $(ADD_DEFINES)
-
- !IFDEF USE_SSL
-@@ -222,7 +215,7 @@
- <<
-
- "$(INTDIR)\libpq.res" : "$(INTDIR)" libpq-dist.rc
-- $(RSC) $(RSC_PROJ) libpq-dist.rc
-+ $(RSC) $(SOLARINC) $(RSC_PROJ) libpq-dist.rc
-
-
- "$(OUTDIR)\$(OUTFILENAME).dll" : "$(OUTDIR)" "$(INTDIR)\libpq.res"
-
diff --git a/external/postgresql/postgresql-libs-leak.patch b/external/postgresql/postgresql-libs-leak.patch
deleted file mode 100644
index 8224137f1f97..000000000000
--- a/external/postgresql/postgresql-libs-leak.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff --recursive -u misc/build/postgresql-9.1.1/configure.in misc/build/postgresql-9.1.1.patched/configure.in
---- misc/build/postgresql-9.1.1/configure.in 2011-09-22 23:57:57.000000000 +0200
-+++ misc/build/postgresql-9.1.1.patched/configure.in 2012-02-03 11:42:45.000000000 +0100
-@@ -903,18 +903,9 @@
- *** Not using spinlocks will cause poor performance.])
- fi
-
--if test "$with_gssapi" = yes ; then
-- if test "$PORTNAME" != "win32"; then
-- AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
-- [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
-- else
-- LIBS="$LIBS -lgssapi32"
-- fi
--fi
--
- if test "$with_krb5" = yes ; then
- if test "$PORTNAME" != "win32"; then
-- AC_SEARCH_LIBS(com_err, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' com_err 'com_err -lssl -lcrypto'], [],
-+ AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
- [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
- AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
- [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
-@@ -924,6 +915,15 @@
- fi
- fi
-
-+if test "$with_gssapi" = yes ; then
-+ if test "$PORTNAME" != "win32"; then
-+ AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
-+ [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
-+ else
-+ LIBS="$LIBS -lgssapi32"
-+ fi
-+fi
-+
- if test "$with_openssl" = yes ; then
- dnl Order matters!
- if test "$PORTNAME" != "win32"; then
-
diff --git a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1 b/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
deleted file mode 100644
index 489e5d0e89ee..000000000000
--- a/external/python3/0001-3.6-bpo-17239-Disable-external-entities-in-SAX-parse.patch.1
+++ /dev/null
@@ -1,59 +0,0 @@
-From 582d188e6e3487180891f1fc457a80dec8be26a8 Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Mon, 24 Sep 2018 14:38:31 +0200
-Subject: [PATCH] [3.6] bpo-17239: Disable external entities in SAX parser
- (GH-9217) (GH-9512)
-
-The SAX parser no longer processes general external entities by default
-to increase security. Before, the parser created network connections
-to fetch remote files or loaded local files from the file system for DTD
-and entities.
-
-Signed-off-by: Christian Heimes <christian@python.org>
-
-https://bugs.python.org/issue17239.
-(cherry picked from commit 17b1d5d4e36aa57a9b25a0e694affbd1ee637e45)
-
-Co-authored-by: Christian Heimes <christian@python.org>
-
-
-
-https://bugs.python.org/issue17239
----
- Doc/library/xml.dom.pulldom.rst | 14 +++++
- Doc/library/xml.rst | 6 +-
- Doc/library/xml.sax.rst | 8 +++
- Doc/whatsnew/3.6.rst | 18 +++++-
- Lib/test/test_pulldom.py | 7 +++
- Lib/test/test_sax.py | 60 ++++++++++++++++++-
- Lib/test/test_xml_etree.py | 13 ++++
- Lib/xml/sax/expatreader.py | 2 +-
- .../2018-09-11-18-30-55.bpo-17239.kOpwK2.rst | 3 +
- 9 files changed, 125 insertions(+), 6 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst
-
-diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py
-index 421358fa5b..5066ffc2fa 100644
---- a/Lib/xml/sax/expatreader.py
-+++ b/Lib/xml/sax/expatreader.py
-@@ -95,7 +95,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
- self._lex_handler_prop = None
- self._parsing = 0
- self._entity_stack = []
-- self._external_ges = 1
-+ self._external_ges = 0
- self._interning = None
-
- # XMLReader methods
-diff --git a/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst
-new file mode 100644
-index 0000000000..8dd0fe8c1b
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2018-09-11-18-30-55.bpo-17239.kOpwK2.rst
-@@ -0,0 +1,3 @@
-+The xml.sax and xml.dom.minidom parsers no longer processes external
-+entities by default. External DTD and ENTITY declarations no longer
-+load files or create network connections.
---
-2.20.1
-
diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk
index 4dfc3b196f82..f7b8d67f25b2 100644
--- a/external/python3/ExternalPackage_python3.mk
+++ b/external/python3/ExternalPackage_python3.mk
@@ -25,17 +25,14 @@ endif
$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
PCbuild/$(python_arch_subdir)_asyncio$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_ctypes$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
- PCbuild/$(python_arch_subdir)_ctypes_test$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_decimal$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_elementtree$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_msi$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_multiprocessing$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
+ PCbuild/$(python_arch_subdir)_overlapped$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_queue$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_socket$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)_ssl$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
- PCbuild/$(python_arch_subdir)_testbuffer$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
- PCbuild/$(python_arch_subdir)_testcapi$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
- PCbuild/$(python_arch_subdir)_testconsole$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)pyexpat$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)select$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
PCbuild/$(python_arch_subdir)unicodedata$(if $(MSVC_USE_DEBUG_RUNTIME),_d).pyd \
@@ -44,8 +41,8 @@ $(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-cor
else
$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python.bin,python))
$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).so,libpython$(PYTHON_VERSION_MAJOR).so))
-$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so))
-$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so.1.0-gdb.py,Tools/gdb/libpython.py))
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so.1.0,libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so))
+$(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/python-gdb.py,Tools/gdb/libpython.py))
# Unfortunately the python build system does not allow to explicitly enable or
# disable these, it just tries to build them and then prints which did not
@@ -56,70 +53,68 @@ $(eval $(call gb_ExternalPackage_add_file,python3,$(LIBO_BIN_FOLDER)/libpython$(
ifneq ($(OS),AIX)
$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/lib-dynload,\
- LO_lib/array.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_asyncio.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/audioop.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/binascii.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_bisect.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_blake2.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/cmath.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_codecs_cn.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_codecs_hk.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_codecs_iso2022.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_codecs_jp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_codecs_kr.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_codecs_tw.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_contextvars.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_crypt.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_csv.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_ctypes.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_ctypes_test.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_datetime.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_decimal.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_elementtree.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/fcntl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/grp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/array.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_asyncio.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/audioop.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/binascii.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_bisect.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_blake2.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/cmath.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_codecs_cn.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_codecs_hk.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_codecs_iso2022.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_codecs_jp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_codecs_kr.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_codecs_tw.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_contextvars.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_crypt.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_csv.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_ctypes.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_datetime.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_decimal.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_elementtree.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/fcntl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/grp.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
$(if $(DISABLE_OPENSSL),, \
- LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_hashlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
) \
- LO_lib/_heapq.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_json.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_lsprof.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/math.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_md5.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/mmap.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_multibytecodec.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_multiprocessing.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_opcode.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/ossaudiodev.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/parser.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_pickle.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_posixsubprocess.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/pyexpat.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_queue.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_random.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/resource.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/select.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_sha1.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_sha256.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_sha3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_sha512.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_socket.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/spwd.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_heapq.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_json.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_lsprof.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/math.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_md5.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/mmap.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_multibytecodec.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_multiprocessing.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_opcode.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/ossaudiodev.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/parser.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_pickle.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_posixshmem.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_posixsubprocess.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/pyexpat.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_queue.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_random.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/resource.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/select.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_sha1.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_sha256.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_sha3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_sha512.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_socket.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/spwd.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
$(if $(DISABLE_OPENSSL),, \
- LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_ssl.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
) \
- LO_lib/_struct.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/syslog.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/termios.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_testbuffer.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_testcapi.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_testimportmultiple.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_testmultiphase.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/unicodedata.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/xxlimited.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/_xxtestfuzz.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
- LO_lib/zlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so \
+ LO_lib/_statistics.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_struct.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/syslog.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/termios.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/unicodedata.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/xxlimited.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_xxsubinterpreters.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/_xxtestfuzz.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
+ LO_lib/zlib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR).so \
))
endif
endif
@@ -140,7 +135,7 @@ endif
# put -pc in its linux platform triplets, so filter that...
ifneq ($(OS),WNT)
$(eval $(call gb_ExternalPackage_add_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
- LO_lib/_sysconfigdata_m_$(python3_MACHDEP)_$(subst i686,i386,$(subst -pc,,$(HOST_PLATFORM))).py \
+ LO_lib/_sysconfigdata__$(python3_MACHDEP)_$(subst i686,i386,$(subst -pc,,$(HOST_PLATFORM))).py \
))
endif
@@ -150,6 +145,10 @@ endif
# idlelib, tkinter, turtledemo - need Tk to build the C module
# test - probably unnecessary? was explicitly removed #i116738#
# venv - why would we need virtual environments
+#
+# These lists are now sorted with "LC_COLLATE=C sort", by using
+# find Lib/ -name "*.py" | sort | sed -e 's/^/\t/' -e 's/$/ \\/'
+#
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib,\
LICENSE \
@@ -162,6 +161,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/_dummy_thread.py \
Lib/_markupbase.py \
Lib/_osx_support.py \
+ Lib/_py_abc.py \
Lib/_pydecimal.py \
Lib/_pyio.py \
Lib/_sitebuiltins.py \
@@ -180,6 +180,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/binhex.py \
Lib/bisect.py \
Lib/bz2.py \
+ Lib/cProfile.py \
Lib/calendar.py \
Lib/cgi.py \
Lib/cgitb.py \
@@ -195,7 +196,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/contextvars.py \
Lib/copy.py \
Lib/copyreg.py \
- Lib/cProfile.py \
Lib/crypt.py \
Lib/csv.py \
Lib/dataclasses.py \
@@ -232,7 +232,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/linecache.py \
Lib/locale.py \
Lib/lzma.py \
- Lib/macpath.py \
Lib/mailbox.py \
Lib/mailcap.py \
Lib/mimetypes.py \
@@ -260,21 +259,20 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/profile.py \
Lib/pstats.py \
Lib/pty.py \
- Lib/pyclbr.py \
- Lib/_py_abc.py \
Lib/py_compile.py \
+ Lib/pyclbr.py \
Lib/pydoc.py \
Lib/queue.py \
Lib/quopri.py \
Lib/random.py \
- Lib/reprlib.py \
Lib/re.py \
+ Lib/reprlib.py \
Lib/rlcompleter.py \
Lib/runpy.py \
Lib/sched.py \
Lib/secrets.py \
- Lib/shelve.py \
Lib/selectors.py \
+ Lib/shelve.py \
Lib/shlex.py \
Lib/shutil.py \
Lib/signal.py \
@@ -288,10 +286,10 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/sre_constants.py \
Lib/sre_parse.py \
Lib/ssl.py \
- Lib/statistics.py \
Lib/stat.py \
- Lib/stringprep.py \
+ Lib/statistics.py \
Lib/string.py \
+ Lib/stringprep.py \
Lib/struct.py \
Lib/subprocess.py \
Lib/sunau.py \
@@ -306,10 +304,11 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/this.py \
Lib/threading.py \
Lib/timeit.py \
- Lib/tokenize.py \
Lib/token.py \
- Lib/traceback.py \
+ Lib/tokenize.py \
Lib/trace.py \
+ Lib/traceback.py \
+ Lib/tracemalloc.py \
Lib/tty.py \
Lib/turtle.py \
Lib/types.py \
@@ -321,14 +320,41 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/weakref.py \
Lib/webbrowser.py \
Lib/xdrlib.py \
+ Lib/zipapp.py \
Lib/zipfile.py \
+ Lib/zipimport.py \
))
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/asyncio,\
+ Lib/asyncio/__init__.py \
+ Lib/asyncio/__main__.py \
+ Lib/asyncio/base_events.py \
Lib/asyncio/base_futures.py \
+ Lib/asyncio/base_subprocess.py \
Lib/asyncio/base_tasks.py \
+ Lib/asyncio/constants.py \
+ Lib/asyncio/coroutines.py \
+ Lib/asyncio/events.py \
+ Lib/asyncio/exceptions.py \
Lib/asyncio/format_helpers.py \
+ Lib/asyncio/futures.py \
+ Lib/asyncio/locks.py \
+ Lib/asyncio/log.py \
+ Lib/asyncio/proactor_events.py \
+ Lib/asyncio/protocols.py \
+ Lib/asyncio/queues.py \
Lib/asyncio/runners.py \
+ Lib/asyncio/selector_events.py \
+ Lib/asyncio/sslproto.py \
+ Lib/asyncio/staggered.py \
+ Lib/asyncio/streams.py \
+ Lib/asyncio/subprocess.py \
+ Lib/asyncio/tasks.py \
+ Lib/asyncio/transports.py \
+ Lib/asyncio/trsock.py \
+ Lib/asyncio/unix_events.py \
+ Lib/asyncio/windows_events.py \
+ Lib/asyncio/windows_utils.py \
))
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/collections,\
@@ -383,8 +409,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/distutils/errors.py \
Lib/distutils/extension.py \
Lib/distutils/fancy_getopt.py \
- Lib/distutils/filelist.py \
Lib/distutils/file_util.py \
+ Lib/distutils/filelist.py \
Lib/distutils/log.py \
Lib/distutils/msvc9compiler.py \
Lib/distutils/msvccompiler.py \
@@ -393,44 +419,44 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/distutils/text_file.py \
Lib/distutils/unixccompiler.py \
Lib/distutils/util.py \
- Lib/distutils/versionpredicate.py \
Lib/distutils/version.py \
+ Lib/distutils/versionpredicate.py \
))
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/distutils/command,\
Lib/distutils/command/__init__.py \
+ Lib/distutils/command/bdist.py \
Lib/distutils/command/bdist_dumb.py \
Lib/distutils/command/bdist_msi.py \
- Lib/distutils/command/bdist.py \
Lib/distutils/command/bdist_rpm.py \
Lib/distutils/command/bdist_wininst.py \
+ Lib/distutils/command/build.py \
Lib/distutils/command/build_clib.py \
Lib/distutils/command/build_ext.py \
- Lib/distutils/command/build.py \
Lib/distutils/command/build_py.py \
Lib/distutils/command/build_scripts.py \
Lib/distutils/command/check.py \
Lib/distutils/command/clean.py \
Lib/distutils/command/command_template \
Lib/distutils/command/config.py \
+ Lib/distutils/command/install.py \
Lib/distutils/command/install_data.py \
Lib/distutils/command/install_egg_info.py \
Lib/distutils/command/install_headers.py \
Lib/distutils/command/install_lib.py \
- Lib/distutils/command/install.py \
Lib/distutils/command/install_scripts.py \
Lib/distutils/command/register.py \
Lib/distutils/command/sdist.py \
Lib/distutils/command/upload.py \
- Lib/distutils/command/wininst-10.0-amd64.exe \
Lib/distutils/command/wininst-10.0.exe \
- Lib/distutils/command/wininst-14.0-amd64.exe \
+ Lib/distutils/command/wininst-10.0-amd64.exe \
Lib/distutils/command/wininst-14.0.exe \
+ Lib/distutils/command/wininst-14.0-amd64.exe \
Lib/distutils/command/wininst-6.0.exe \
Lib/distutils/command/wininst-7.1.exe \
Lib/distutils/command/wininst-8.0.exe \
- Lib/distutils/command/wininst-9.0-amd64.exe \
Lib/distutils/command/wininst-9.0.exe \
+ Lib/distutils/command/wininst-9.0-amd64.exe \
))
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/email,\
@@ -474,8 +500,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/encodings/aliases.py \
Lib/encodings/ascii.py \
Lib/encodings/base64_codec.py \
- Lib/encodings/big5hkscs.py \
Lib/encodings/big5.py \
+ Lib/encodings/big5hkscs.py \
Lib/encodings/bz2_codec.py \
Lib/encodings/charmap.py \
Lib/encodings/cp037.py \
@@ -492,10 +518,10 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/encodings/cp1256.py \
Lib/encodings/cp1257.py \
Lib/encodings/cp1258.py \
+ Lib/encodings/cp273.py \
Lib/encodings/cp424.py \
Lib/encodings/cp437.py \
Lib/encodings/cp500.py \
- Lib/encodings/cp65001.py \
Lib/encodings/cp720.py \
Lib/encodings/cp737.py \
Lib/encodings/cp775.py \
@@ -529,20 +555,20 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/encodings/hp_roman8.py \
Lib/encodings/hz.py \
Lib/encodings/idna.py \
+ Lib/encodings/iso2022_jp.py \
Lib/encodings/iso2022_jp_1.py \
- Lib/encodings/iso2022_jp_2004.py \
Lib/encodings/iso2022_jp_2.py \
+ Lib/encodings/iso2022_jp_2004.py \
Lib/encodings/iso2022_jp_3.py \
Lib/encodings/iso2022_jp_ext.py \
- Lib/encodings/iso2022_jp.py \
Lib/encodings/iso2022_kr.py \
+ Lib/encodings/iso8859_1.py \
Lib/encodings/iso8859_10.py \
Lib/encodings/iso8859_11.py \
Lib/encodings/iso8859_13.py \
Lib/encodings/iso8859_14.py \
Lib/encodings/iso8859_15.py \
Lib/encodings/iso8859_16.py \
- Lib/encodings/iso8859_1.py \
Lib/encodings/iso8859_2.py \
Lib/encodings/iso8859_3.py \
Lib/encodings/iso8859_4.py \
@@ -565,8 +591,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/encodings/mac_greek.py \
Lib/encodings/mac_iceland.py \
Lib/encodings/mac_latin2.py \
- Lib/encodings/mac_romanian.py \
Lib/encodings/mac_roman.py \
+ Lib/encodings/mac_romanian.py \
Lib/encodings/mac_turkish.py \
Lib/encodings/mbcs.py \
Lib/encodings/oem.py \
@@ -576,19 +602,18 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/encodings/quopri_codec.py \
Lib/encodings/raw_unicode_escape.py \
Lib/encodings/rot_13.py \
- Lib/encodings/shift_jis_2004.py \
Lib/encodings/shift_jis.py \
+ Lib/encodings/shift_jis_2004.py \
Lib/encodings/shift_jisx0213.py \
Lib/encodings/tis_620.py \
Lib/encodings/undefined.py \
Lib/encodings/unicode_escape.py \
- Lib/encodings/unicode_internal.py \
+ Lib/encodings/utf_16.py \
Lib/encodings/utf_16_be.py \
Lib/encodings/utf_16_le.py \
- Lib/encodings/utf_16.py \
+ Lib/encodings/utf_32.py \
Lib/encodings/utf_32_be.py \
Lib/encodings/utf_32_le.py \
- Lib/encodings/utf_32.py \
Lib/encodings/utf_7.py \
Lib/encodings/utf_8.py \
Lib/encodings/utf_8_sig.py \
@@ -616,6 +641,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/importlib/_bootstrap_external.py \
Lib/importlib/abc.py \
Lib/importlib/machinery.py \
+ Lib/importlib/metadata.py \
Lib/importlib/resources.py \
Lib/importlib/util.py \
))
@@ -652,8 +678,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/lib2to3/fixes/fix_buffer.py \
Lib/lib2to3/fixes/fix_dict.py \
Lib/lib2to3/fixes/fix_except.py \
- Lib/lib2to3/fixes/fix_execfile.py \
Lib/lib2to3/fixes/fix_exec.py \
+ Lib/lib2to3/fixes/fix_execfile.py \
Lib/lib2to3/fixes/fix_exitfunc.py \
Lib/lib2to3/fixes/fix_filter.py \
Lib/lib2to3/fixes/fix_funcattrs.py \
@@ -662,13 +688,13 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/lib2to3/fixes/fix_has_key.py \
Lib/lib2to3/fixes/fix_idioms.py \
Lib/lib2to3/fixes/fix_import.py \
- Lib/lib2to3/fixes/fix_imports2.py \
Lib/lib2to3/fixes/fix_imports.py \
+ Lib/lib2to3/fixes/fix_imports2.py \
Lib/lib2to3/fixes/fix_input.py \
Lib/lib2to3/fixes/fix_intern.py \
Lib/lib2to3/fixes/fix_isinstance.py \
- Lib/lib2to3/fixes/fix_itertools_imports.py \
Lib/lib2to3/fixes/fix_itertools.py \
+ Lib/lib2to3/fixes/fix_itertools_imports.py \
Lib/lib2to3/fixes/fix_long.py \
Lib/lib2to3/fixes/fix_map.py \
Lib/lib2to3/fixes/fix_metaclass.py \
@@ -708,8 +734,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/lib2to3/pgen2/literals.py \
Lib/lib2to3/pgen2/parse.py \
Lib/lib2to3/pgen2/pgen.py \
- Lib/lib2to3/pgen2/tokenize.py \
Lib/lib2to3/pgen2/token.py \
+ Lib/lib2to3/pgen2/tokenize.py \
))
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/logging,\
@@ -718,13 +744,25 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/logging/handlers.py \
))
+ifeq (WNT,$(OS))
+$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/msilib,\
+ Lib/msilib/__init__.py \
+ Lib/msilib/schema.py \
+ Lib/msilib/sequence.py \
+ Lib/msilib/text.py \
+))
+endif
+
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/multiprocessing,\
Lib/multiprocessing/__init__.py \
Lib/multiprocessing/connection.py \
Lib/multiprocessing/context.py \
+ Lib/multiprocessing/dummy/__init__.py \
+ Lib/multiprocessing/dummy/connection.py \
Lib/multiprocessing/forkserver.py \
Lib/multiprocessing/heap.py \
Lib/multiprocessing/managers.py \
+ Lib/multiprocessing/pool.py \
Lib/multiprocessing/popen_fork.py \
Lib/multiprocessing/popen_forkserver.py \
Lib/multiprocessing/popen_spawn_posix.py \
@@ -733,7 +771,8 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/multiprocessing/queues.py \
Lib/multiprocessing/reduction.py \
Lib/multiprocessing/resource_sharer.py \
- Lib/multiprocessing/semaphore_tracker.py \
+ Lib/multiprocessing/resource_tracker.py \
+ Lib/multiprocessing/shared_memory.py \
Lib/multiprocessing/sharedctypes.py \
Lib/multiprocessing/spawn.py \
Lib/multiprocessing/synchronize.py \
@@ -754,6 +793,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest,\
Lib/unittest/__init__.py \
Lib/unittest/__main__.py \
+ Lib/unittest/async_case.py \
Lib/unittest/case.py \
Lib/unittest/loader.py \
Lib/unittest/main.py \
@@ -765,40 +805,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
Lib/unittest/util.py \
))
-$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest/test,\
- Lib/unittest/test/__init__.py \
- Lib/unittest/test/__main__.py \
- Lib/unittest/test/_test_warnings.py \
- Lib/unittest/test/dummy.py \
- Lib/unittest/test/support.py \
- Lib/unittest/test/test_assertions.py \
- Lib/unittest/test/test_break.py \
- Lib/unittest/test/test_case.py \
- Lib/unittest/test/test_discovery.py \
- Lib/unittest/test/test_functiontestcase.py \
- Lib/unittest/test/test_loader.py \
- Lib/unittest/test/test_program.py \
- Lib/unittest/test/test_result.py \
- Lib/unittest/test/test_runner.py \
- Lib/unittest/test/test_setups.py \
- Lib/unittest/test/test_skipping.py \
- Lib/unittest/test/test_suite.py \
-))
-
-$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/unittest/test/testmock,\
- Lib/unittest/test/testmock/__init__.py \
- Lib/unittest/test/testmock/__main__.py \
- Lib/unittest/test/testmock/support.py \
- Lib/unittest/test/testmock/testcallable.py \
- Lib/unittest/test/testmock/testhelpers.py \
- Lib/unittest/test/testmock/testmagicmethods.py \
- Lib/unittest/test/testmock/testmock.py \
- Lib/unittest/test/testmock/testpatch.py \
- Lib/unittest/test/testmock/testsealable.py \
- Lib/unittest/test/testmock/testsentinel.py \
- Lib/unittest/test/testmock/testwith.py \
-))
-
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/urllib,\
Lib/urllib/__init__.py \
Lib/urllib/error.py \
@@ -823,21 +829,21 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/dom,\
Lib/xml/dom/__init__.py \
- Lib/xml/dom/NodeFilter.py \
Lib/xml/dom/domreg.py \
Lib/xml/dom/expatbuilder.py \
Lib/xml/dom/minicompat.py \
Lib/xml/dom/minidom.py \
+ Lib/xml/dom/NodeFilter.py \
Lib/xml/dom/pulldom.py \
Lib/xml/dom/xmlbuilder.py \
))
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/etree,\
Lib/xml/etree/__init__.py \
+ Lib/xml/etree/cElementTree.py \
Lib/xml/etree/ElementInclude.py \
Lib/xml/etree/ElementPath.py \
Lib/xml/etree/ElementTree.py \
- Lib/xml/etree/cElementTree.py \
))
$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/xml/parsers,\
diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk
index 92772684ec87..1ff06a2382ed 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -1,4 +1,4 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*-
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
@@ -11,7 +11,7 @@ $(eval $(call gb_ExternalProject_ExternalProject,python3))
$(eval $(call gb_ExternalProject_use_externals,python3,\
expat \
- $(if $(filter LINUX,$(OS)),libffi) \
+ $(if $(filter WNT LINUX,$(OS)),libffi) \
openssl \
zlib \
))
@@ -30,16 +30,24 @@ ifeq ($(OS),WNT)
# TODO: using Debug configuration and related mangling of pyconfig.h
+python3_WIN_PLATFORM_MSBUILD := $(strip \
+ $(if $(filter INTEL,$(CPUNAME)),Win32) \
+ $(if $(filter X86_64,$(CPUNAME)),x64) \
+ $(if $(filter ARM64,$(CPUNAME)),arm64) \
+ )
+
# at least for MSVC 2008 it is necessary to clear MAKEFLAGS because
# nmake is invoked
$(call gb_ExternalProject_get_state_target,python3,build) :
$(call gb_ExternalProject_run,build,\
MAKEFLAGS= MSBuild.exe pcbuild.sln /t:Build \
/p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
- /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) \
+ /p:Platform=$(python3_WIN_PLATFORM_MSBUILD) \
/p:opensslIncludeDir=$(call gb_UnpackedTarball_get_dir,openssl)/include \
- /p:opensslOutDir=$(call gb_UnpackedTarball_get_dir,openssl)/out32dll \
+ /p:opensslOutDir=$(call gb_UnpackedTarball_get_dir,openssl) \
/p:zlibDir=$(call gb_UnpackedTarball_get_dir,zlib) \
+ /p:libffiOutDir=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/.libs \
+ /p:libffiIncludeDir=$(call gb_UnpackedTarball_get_dir,libffi)/$(HOST_PLATFORM)/include \
/maxcpucount \
$(if $(filter 150,$(VCVER)),/p:PlatformToolset=v141 /p:VisualStudioVersion=15.0 /ToolsVersion:15.0) \
$(if $(filter 160,$(VCVER)),/p:PlatformToolset=v142 /p:VisualStudioVersion=16.0 /ToolsVersion:Current) \
@@ -128,14 +136,14 @@ python3_fw_prefix=$(call gb_UnpackedTarball_get_dir,python3)/python-inst/@______
$(call gb_ExternalProject_get_state_target,python3,fixscripts) : $(call gb_ExternalProject_get_state_target,python3,build)
$(call gb_Output_announce,python3 - remove reference to installroot from scripts,build,CUS,5)
$(COMMAND_ECHO)for file in \
- $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3 \
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/2to3-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/easy_install-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/idle$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pip$(PYTHON_VERSION_MAJOR) \
+ $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pip$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pydoc$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-config \
- $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m-config \
- $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin/pyvenv-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) ; do \
- { rm "$$file" && $(gb_AWK) '\
+ ; do { rm "$$file" && $(gb_AWK) '\
BEGIN {print "#!/bin/bash\n\
origpath=$$(pwd)\n\
bindir=$$(cd $$(dirname \"$$0\") ; pwd)\n\
@@ -157,37 +165,18 @@ $(call gb_ExternalProject_get_state_target,python3,fixinstallnames) : $(call gb_
@loader_path/../../../LibreOfficePython $$file ; done
touch $@
-# also delete binaries that are symlinked in scp2
$(call gb_ExternalProject_get_state_target,python3,executables) : $(call gb_ExternalProject_get_state_target,python3,build)
cd $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/bin ; \
- for file in python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR) \
- python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m ; do \
$(INSTALL_NAME_TOOL) -change \
$(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/LibreOfficePython \
- @executable_path/../LibreOfficePython $$file ; done
+ @executable_path/../LibreOfficePython python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)
touch $@
-# Remove modules (both Python and binary bits) of questionable usefulness that we don't ship on
-# other platforms either. See the "packages not shipped" comment in ExternalPackage_python3.mk.
-
+# also delete binaries that are symlinked in scp2
$(call gb_ExternalProject_get_state_target,python3,removeunnecessarystuff) : $(call gb_ExternalProject_get_state_target,python3,build)
$(call gb_Output_announce,python3 - remove the stuff we don't need to ship,build,CUS,5)
- rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/dbm
- rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/sqlite3
- rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/curses
- rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/idlelib
- rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/tkinter
- rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/turtledemo
rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/test
- rm -rf $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/venv
- # Then the binary libraries
- rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_dbm.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
- rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_sqlite3.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
- rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
- rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_curses_panel.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
- rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_idlelib.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
- rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_tkinter.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
- rm -f $(python3_fw_prefix)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib-dynload/_test*.cpython-$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)m.so
+
endif
# vim: set noet sw=4 ts=4:
diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk
index fb693e70de7e..94950537386c 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -20,11 +20,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
external/python3/python-3.3.0-darwin.patch.1 \
external/python3/python-3.7.6-msvc-ssl.patch.1 \
external/python3/python-3.5.4-msvc-disable.patch.1 \
- external/python3/python-3.3.0-clang.patch.1 \
external/python3/ubsan.patch.0 \
external/python3/python-3.5.tweak.strip.soabi.patch \
external/python3/darwin.patch.0 \
- external/python3/macos-11.patch.0 \
))
ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
diff --git a/external/python3/i100492-freebsd.patch.1 b/external/python3/i100492-freebsd.patch.1
index 074e5fc489f8..b2ca1ee7117f 100644
--- a/external/python3/i100492-freebsd.patch.1
+++ b/external/python3/i100492-freebsd.patch.1
@@ -2,7 +2,7 @@ FreeBSD porting fixes, patch by maho@openoffice.org
--- Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:00:41.097955124 +0000
+++ Python-3.3.0/Python/thread_pthread.h 2012-11-28 09:01:13.018329351 +0000
-@@ -186,6 +189,9 @@
+@@ -238,6 +238,9 @@
{
pthread_t th;
int status;
@@ -12,7 +12,7 @@ FreeBSD porting fixes, patch by maho@openoffice.org
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_t attrs;
#endif
-@@ -214,6 +220,10 @@
+@@ -277,6 +280,10 @@
callback->func = func;
callback->arg = arg;
@@ -23,7 +23,7 @@ FreeBSD porting fixes, patch by maho@openoffice.org
status = pthread_create(&th,
#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
&attrs,
-@@ -225,6 +234,9 @@
+@@ -285,6 +292,9 @@
#endif
pythread_wrapper, callback);
diff --git a/external/python3/internal-zlib.patch.0 b/external/python3/internal-zlib.patch.0
index abe2630bd2e7..27bb737db0c7 100644
--- a/external/python3/internal-zlib.patch.0
+++ b/external/python3/internal-zlib.patch.0
@@ -19,32 +19,32 @@
--- setup.py
+++ setup.py
-@@ -1362,7 +1362,7 @@
+@@ -1483,7 +1483,7 @@
#
# You can upgrade zlib to version 1.1.4 yourself by going to
# http://www.gzip.org/zlib/
-- zlib_inc = find_file('zlib.h', [], inc_dirs)
+- zlib_inc = find_file('zlib.h', [], self.inc_dirs)
+ zlib_inc = [os.environ.get('ZLIB_INCDIR')]
have_zlib = False
if zlib_inc is not None:
zlib_h = zlib_inc[0] + '/zlib.h'
-@@ -1379,13 +1379,13 @@
+@@ -1500,13 +1500,13 @@
version = line.split()[2]
break
if version >= version_req:
-- if (self.compiler.find_library_file(lib_dirs, 'z')):
-+ if (self.compiler.find_library_file(lib_dirs, 'zlib')):
- if host_platform == "darwin":
+- if (self.compiler.find_library_file(self.lib_dirs, 'z')):
++ if (self.compiler.find_library_file(self.lib_dirs, 'zlib')):
+ if MACOS:
zlib_extra_link_args = ('-Wl,-search_paths_first',)
else:
zlib_extra_link_args = ()
- exts.append( Extension('zlib', ['zlibmodule.c'],
-- libraries = ['z'],
-+ libraries = ['zlib'],
- extra_link_args = zlib_extra_link_args))
+ self.add(Extension('zlib', ['zlibmodule.c'],
+- libraries=['z'],
++ libraries=['zlib'],
+ extra_link_args=zlib_extra_link_args))
have_zlib = True
else:
-@@ -1399,7 +1399,7 @@
+@@ -1520,7 +1520,7 @@
# crc32 if we have it. Otherwise binascii uses its own.
if have_zlib:
extra_compile_args = ['-DUSE_ZLIB_CRC32']
diff --git a/external/python3/macos-11.patch.0 b/external/python3/macos-11.patch.0
deleted file mode 100644
index 3a3da0e99bac..000000000000
--- a/external/python3/macos-11.patch.0
+++ /dev/null
@@ -1,79 +0,0 @@
--*- Mode: diff -*-
---- configure
-+++ configure
-@@ -3374,7 +3374,7 @@
- # has no effect, don't bother defining them
- Darwin/[6789].*)
- define_xopen_source=no;;
-- Darwin/1[0-9].*)
-+ Darwin/[12][0-9].*)
- define_xopen_source=no;;
- # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
- # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
-@@ -9372,6 +9275,9 @@
- esac
- else
- case `/usr/bin/arch` in
-+ arm64)
-+ MACOSX_DEFAULT_ARCH="arm64"
-+ ;;
- i386)
- MACOSX_DEFAULT_ARCH="x86_64"
- ;;
---- Mac/Tools/pythonw.c
-+++ Mac/Tools/pythonw.c
-@@ -121,6 +121,8 @@
- cpu_types[0] = CPU_TYPE_POWERPC;
- #elif defined(__i386__)
- cpu_types[0] = CPU_TYPE_X86;
-+#elif defined(__arm64__)
-+ cpu_types[0] = CPU_TYPE_ARM64;
- #else
- # error "Unknown CPU"
- #endif
---- setup.py
-+++ setup.py
-@@ -670,7 +670,10 @@
- add_dir_to_list(self.compiler.include_dirs,
- sysconfig.get_config_var("INCLUDEDIR"))
-
-- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
-+ if host_platform == 'darwin':
-+ system_lib_dirs = ['/usr/lib', macosx_sdk_root()+'/usr/lib']
-+ else:
-+ system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
- system_include_dirs = ['/usr/include']
- # lib_dirs and inc_dirs are used to search for files;
- # if a file is found in one of those directories, it can
---- Modules/_decimal/libmpdec/mpdecimal.h
-+++ Modules/_decimal/libmpdec/mpdecimal.h
-@@ -135,6 +135,9 @@
- #elif defined(__x86_64__)
- #define CONFIG_64
- #define ASM
-+ #elif defined(__arm64__)
-+ #define CONFIG_64
-+ #define ANSI
- #else
- #error "unknown architecture for universal build."
- #endif
---- Modules/_posixsubprocess.c
-+++ Modules/_posixsubprocess.c
-@@ -31,6 +31,8 @@
- # define SYS_getdents64 __NR_getdents64
- #endif
-
-+#include <limits.h>
-+
- #if defined(__sun) && defined(__SVR4)
- /* readdir64 is used to work around Solaris 9 bug 6395699. */
- # define readdir readdir64
-@@ -202,7 +202,7 @@
- #endif
- #ifdef _SC_OPEN_MAX
- local_max_fd = sysconf(_SC_OPEN_MAX);
-- if (local_max_fd == -1)
-+ if (local_max_fd == -1 || local_max_fd == LONG_MAX)
- #endif
- local_max_fd = 256; /* Matches legacy Lib/subprocess.py behavior. */
- return local_max_fd;
diff --git a/external/python3/python-3.3.0-clang.patch.1 b/external/python3/python-3.3.0-clang.patch.1
deleted file mode 100644
index 9001110fbed4..000000000000
--- a/external/python3/python-3.3.0-clang.patch.1
+++ /dev/null
@@ -1,13 +0,0 @@
--*- Mode: diff -*-
-
---- python3/setup.py
-+++ python3/setup.py
-@@ -436,7 +436,7 @@
- if ret >> 8 == 0:
- with open(tmpfile) as fp:
- for line in fp.readlines():
-- if line.startswith("gcc version"):
-+ if line.startswith("gcc version") or line.startswith("clang -cc1 version"):
- is_gcc = True
- elif line.startswith("#include <...>"):
- in_incdirs = True
diff --git a/external/python3/python-3.3.0-darwin.patch.1 b/external/python3/python-3.3.0-darwin.patch.1
index d5cb17e339a2..39d3c9180a19 100644
--- a/external/python3/python-3.3.0-darwin.patch.1
+++ b/external/python3/python-3.3.0-darwin.patch.1
@@ -5,7 +5,7 @@ LO needs to build both against MacOSX SDK and not produce universal binaries.
diff -ru python3.orig/configure python3/configure
--- python3.orig/configure 2015-07-26 17:36:11.808497783 +0200
+++ python3/configure 2015-07-26 17:38:49.016508337 +0200
-@@ -6794,7 +6794,20 @@
+@@ -7385,7 +7385,20 @@
then
case "$UNIVERSAL_ARCHS" in
32-bit)
@@ -30,7 +30,7 @@ diff -ru python3.orig/configure python3/configure
diff -ru python3.orig/Mac/Makefile.in python3/Mac/Makefile.in
--- python3.orig/Mac/Makefile.in 2015-07-05 18:50:07.000000000 +0200
+++ python3/Mac/Makefile.in 2015-07-26 17:40:14.860514100 +0200
-@@ -43,7 +43,7 @@
+@@ -44,7 +44,7 @@
INSTALL_SCRIPT= @INSTALL_SCRIPT@
INSTALL_DATA=@INSTALL_DATA@
LN=@LN@
@@ -49,7 +49,7 @@ diff -ru python3.orig/Mac/Resources/app/Info.plist.in python3/Mac/Resources/app/
- <string>Python</string>
+ <string>LibreOfficePython</string>
<key>CFBundleGetInfoString</key>
- <string>%version%, (c) 2001-2016 Python Software Foundation.</string>
+ <string>%version%, (c) 2001-2020 Python Software Foundation.</string>
<key>CFBundleHelpBookFolder</key>
diff -ru python3.orig/Mac/Resources/framework/Info.plist.in python3/Mac/Resources/framework/Info.plist.in
--- python3.orig/Mac/Resources/framework/Info.plist.in 2015-07-05 18:50:07.000000000 +0200
@@ -63,19 +63,3 @@ diff -ru python3.orig/Mac/Resources/framework/Info.plist.in python3/Mac/Resource
<key>CFBundleGetInfoString</key>
<string>Python Runtime and Library</string>
<key>CFBundleIdentifier</key>
-diff -ru python3.orig/setup.py python3/setup.py
---- python3.orig/setup.py 2015-07-26 17:36:11.804497783 +0200
-+++ python3/setup.py 2015-07-26 17:39:48.599512337 +0200
-@@ -468,11 +468,11 @@
- # Ensure that /usr/local is always used, but the local build
- # directories (i.e. '.' and 'Include') must be first. See issue
- # 10520.
-- if not cross_compiling:
-+ if not cross_compiling and host_platform != 'darwin':
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- # only change this for cross builds for 3.3, issues on Mageia
-- if cross_compiling:
-+ if cross_compiling or host_platform == 'darwin':
- self.add_gcc_paths()
- self.add_multiarch_paths()
diff --git a/external/python3/python-3.3.3-disable-obmalloc.patch.0 b/external/python3/python-3.3.3-disable-obmalloc.patch.0
index 0963a5f1bb1d..c4a1dea61ecf 100644
--- a/external/python3/python-3.3.3-disable-obmalloc.patch.0
+++ b/external/python3/python-3.3.3-disable-obmalloc.patch.0
@@ -1,6 +1,6 @@
--- Objects/obmalloc.c
+++ Objects/obmalloc.c
-@@ -413,8 +413,8 @@
+@@ -712,8 +712,8 @@
#ifdef WITH_PYMALLOC
@@ -10,7 +10,7 @@
/* If we're using GCC, use __builtin_expect() to reduce overhead of
the valgrind checks */
-@@ -1181,7 +1181,7 @@
+@@ -1430,7 +1430,7 @@
#ifdef WITH_VALGRIND
if (UNLIKELY(running_on_valgrind == -1)) {
diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 b/external/python3/python-3.3.3-elf-rpath.patch.1
index 0dfa16c8c247..a408858f5917 100644
--- a/external/python3/python-3.3.3-elf-rpath.patch.1
+++ b/external/python3/python-3.3.3-elf-rpath.patch.1
@@ -5,18 +5,16 @@ set RPATH (only to be used on ELF platforms)
diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
--- python3.orig/Makefile.pre.in 2015-07-26 20:29:07.126194320 +0200
+++ python3/Makefile.pre.in 2015-07-26 20:37:21.814227530 +0200
-@@ -550,7 +550,7 @@
+@@ -566,7 +566,7 @@
# Build the interpreter
$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
-- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-+ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -Wl,-rpath,\$$ORIGIN
+- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
++ $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) -Wl,-rpath,\$$ORIGIN
platform: $(BUILDPYTHON) pybuilddir.txt
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
---- python3.orig/Makefile.pre.in 2015-07-05 18:50:07.000000000 +0200
-+++ python3/Makefile.pre.in 2015-07-26 17:34:00.386488960 +0200
-@@ -607,7 +607,7 @@
+@@ -628,7 +628,7 @@
fi
libpython3.so: libpython$(LDVERSION).so
@@ -24,4 +22,4 @@ diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in
+ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ -Wl,-rpath,\$$ORIGIN
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
- $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 b/external/python3/python-3.5.4-msvc-disable.patch.1
index 416ab2c7b15b..d5b4e3f6264b 100644
--- a/external/python3/python-3.5.4-msvc-disable.patch.1
+++ b/external/python3/python-3.5.4-msvc-disable.patch.1
@@ -3,7 +3,7 @@ Disable some stuff LO does not need, especially stuff with external dependencies
diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln
--- python3.orig/PCbuild/pcbuild.sln 2017-08-10 00:04:44.359879894 +0200
+++ python3/PCbuild/pcbuild.sln 2017-08-10 00:13:51.179873748 +0200
-@@ -12,8 +12,6 @@
+@@ -15,8 +15,6 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcxproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}"
EndProject
@@ -12,7 +12,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcxproj", "{28B5D777-DDF2-4B6B-B34F-31D938813856}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_decimal", "_decimal.vcxproj", "{0E9791DB-593A-465F-98BC-681011311617}"
-@@ -28,32 +26,18 @@
+@@ -31,34 +29,20 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcxproj", "{86937F53-C189-40EF-8CE8-8759D8E7D480}"
EndProject
@@ -22,6 +22,8 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"
EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testinternalcapi", "_testinternalcapi.vcxproj", "{900342D7-516A-4469-B1AD-59A66E49A25F}"
+ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"
@@ -45,7 +47,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}"
-@@ -75,8 +75,6 @@
+@@ -93,8 +77,6 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj", "{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}"
EndProject
diff --git a/external/python3/python-3.5.tweak.strip.soabi.patch b/external/python3/python-3.5.tweak.strip.soabi.patch
index 48ac7f82f8be..4c2bb2bb9a29 100644
--- a/external/python3/python-3.5.tweak.strip.soabi.patch
+++ b/external/python3/python-3.5.tweak.strip.soabi.patch
@@ -1,7 +1,7 @@
diff -ru python3.orig/configure python3/configure
--- misc/python3.orig/configure 2015-07-26 21:14:31.127377193 +0200
+++ misc/python3/configure 2015-07-26 21:21:34.975405648 +0200
-@@ -14388,7 +14388,7 @@
+@@ -15229,7 +15229,7 @@
$as_echo "$ABIFLAGS" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
$as_echo_n "checking SOABI... " >&6; }
diff --git a/external/python3/python-3.7.6-msvc-ssl.patch.1 b/external/python3/python-3.7.6-msvc-ssl.patch.1
index e8e94f674c1f..17cc440f2204 100644
--- a/external/python3/python-3.7.6-msvc-ssl.patch.1
+++ b/external/python3/python-3.7.6-msvc-ssl.patch.1
@@ -2,7 +2,7 @@ No use for applink.c OPENSSL_Applink, everything is compiled with the same MSVC
--- python3/PCbuild/_ssl.vcxproj.orig2 2019-12-23 15:54:19.254298900 +0100
+++ python3/PCbuild/_ssl.vcxproj 2019-12-23 15:54:24.693251200 +0100
-@@ -67,9 +67,6 @@
+@@ -99,9 +99,6 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Modules\_ssl.c" />
@@ -14,27 +14,12 @@ No use for applink.c OPENSSL_Applink, everything is compiled with the same MSVC
<ResourceCompile Include="..\PC\python_nt.rc" />
--- python3/PCbuild/openssl.props.orig 2019-12-23 16:20:34.588135900 +0100
+++ python3/PCbuild/openssl.props 2019-12-23 16:20:51.074001300 +0100
-@@ -6,7 +6,7 @@
- </ClCompile>
- <Link>
- <AdditionalLibraryDirectories>$(opensslOutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-- <AdditionalDependencies>ws2_32.lib;libcrypto.lib;libssl.lib;%(AdditionalDependencies)</AdditionalDependencies>
-+ <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
+@@ -6,8 +6,6 @@
</ItemDefinitionGroup>
<PropertyGroup>
-@@ -15,10 +15,10 @@
- <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
+ <_DLLSuffix>-1_1</_DLLSuffix>
+- <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
+- <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
</PropertyGroup>
<ItemGroup>
-- <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
-- <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).pdb" />
-- <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).dll" />
-- <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).pdb" />
-+ <_SSLDLL Include="$(opensslOutDir)\libeay32.dll" />
-+ <_SSLDLL Include="$(opensslOutDir)\libeay32.pdb" />
-+ <_SSLDLL Include="$(opensslOutDir)\ssleay32.dll" />
-+ <_SSLDLL Include="$(opensslOutDir)\ssleay32.pdb" />
- </ItemGroup>
- <Target Name="_CopySSLDLL" Inputs="@(_SSLDLL)" Outputs="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build">
- <Copy SourceFiles="@(_SSLDLL)" DestinationFolder="$(OutDir)" />
+ <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0
index 938acc1f1725..d44fbe055c86 100644
--- a/external/python3/ubsan.patch.0
+++ b/external/python3/ubsan.patch.0
@@ -18,3 +18,26 @@
/* Set the carry bit if the function uses any sse registers.
This is clc or stc, together with the first byte of the jmp. */
+--- Modules/posixmodule.c
++++ Modules/posixmodule.c
+@@ -13998,6 +13998,9 @@
+ };
+
+ static int
++#if defined __clang__
++__attribute__((no_sanitize("shift-base"))) // MFD_HUGE_16GB in /usr/include/linux/memfd.h
++#endif
+ all_ins(PyObject *m)
+ {
+ #ifdef F_OK
+--- Objects/listobject.c
++++ Objects/listobject.c
+@@ -554,7 +554,7 @@
+ dest[i] = v;
+ }
+ src = b->ob_item;
+- dest = np->ob_item + Py_SIZE(a);
++ dest = Py_SIZE(a) == 0 ? np->ob_item : np->ob_item + Py_SIZE(a);
+ for (i = 0; i < Py_SIZE(b); i++) {
+ PyObject *v = src[i];
+ Py_INCREF(v);
diff --git a/external/serf/ExternalProject_serf.mk b/external/serf/ExternalProject_serf.mk
deleted file mode 100644
index afa2018a73fa..000000000000
--- a/external/serf/ExternalProject_serf.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_ExternalProject_ExternalProject,serf))
-
-$(eval $(call gb_ExternalProject_use_externals,serf,\
- apr \
-))
-
-$(eval $(call gb_ExternalProject_register_targets,serf,\
- build \
-))
-
-$(eval $(call gb_ExternalProject_use_nmake,serf,build))
-
-ifeq ($(COM),MSC)
-$(call gb_ExternalProject_get_state_target,serf,build):
- $(call gb_ExternalProject_run,build,\
- APR_SRC="..\apr" \
- APRUTIL_SRC="..\apr_util" \
- OPENSSL_SRC="..\openssl" \
- ZLIB_SRC="..\zlib" \
- nmake -nologo -f serf.mak \
- $(if $(MSVC_USE_DEBUG_RUNTIME),DEBUG_BUILD=T Debug,Release)/serf-1.lib \
- )
-
-else
-# serf is using SERF_LIBS variable, so pass it empty
-$(call gb_ExternalProject_get_state_target,serf,build):
- +$(call gb_ExternalProject_run,build,\
- ./configure SERF_LIBS= \
- --enable-option-checking=fatal \
- $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
- $(if $(SYSTEM_APR),,--with-apr=$(call gb_UnpackedTarball_get_dir,apr)/apr-1-config) \
- $(if $(SYSTEM_APR),,--with-apr-util=$(call gb_UnpackedTarball_get_dir,apr_util)/apu-1-config) \
- $(if $(SYSTEM_OPENSSL),,--with-openssl=$(call gb_UnpackedTarball_get_dir,openssl)) \
- && $(MAKE) libserf-1.la \
- )
-
-endif
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/serf/Module_serf.mk b/external/serf/Module_serf.mk
index 10ec039359a2..263ff05223c5 100644
--- a/external/serf/Module_serf.mk
+++ b/external/serf/Module_serf.mk
@@ -10,8 +10,8 @@
$(eval $(call gb_Module_Module,serf))
$(eval $(call gb_Module_add_targets,serf,\
+ StaticLibrary_serf \
UnpackedTarball_serf \
- ExternalProject_serf \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/serf/StaticLibrary_serf.mk b/external/serf/StaticLibrary_serf.mk
new file mode 100644
index 000000000000..b6bef228a009
--- /dev/null
+++ b/external/serf/StaticLibrary_serf.mk
@@ -0,0 +1,60 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,serf))
+
+$(eval $(call gb_StaticLibrary_set_warnings_disabled,serf))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,serf,serf))
+
+$(eval $(call gb_StaticLibrary_use_externals,serf,\
+ apr \
+ openssl \
+ openssl_headers \
+ zlib \
+))
+
+$(eval $(call gb_StaticLibrary_set_include,serf,\
+ -I$(call gb_UnpackedTarball_get_dir,serf) \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,serf,\
+ UnpackedTarball/serf/context \
+ UnpackedTarball/serf/incoming \
+ UnpackedTarball/serf/outgoing \
+ UnpackedTarball/serf/ssltunnel \
+ UnpackedTarball/serf/auth/auth_basic \
+ UnpackedTarball/serf/auth/auth \
+ UnpackedTarball/serf/auth/auth_digest \
+ UnpackedTarball/serf/auth/auth_spnego \
+ UnpackedTarball/serf/auth/auth_spnego_gss \
+ UnpackedTarball/serf/auth/auth_spnego_sspi \
+ UnpackedTarball/serf/buckets/aggregate_buckets \
+ UnpackedTarball/serf/buckets/allocator \
+ UnpackedTarball/serf/buckets/barrier_buckets \
+ UnpackedTarball/serf/buckets/buckets \
+ UnpackedTarball/serf/buckets/bwtp_buckets \
+ UnpackedTarball/serf/buckets/deflate_buckets \
+ UnpackedTarball/serf/buckets/dechunk_buckets \
+ UnpackedTarball/serf/buckets/file_buckets \
+ UnpackedTarball/serf/buckets/headers_buckets \
+ UnpackedTarball/serf/buckets/chunk_buckets \
+ UnpackedTarball/serf/buckets/iovec_buckets \
+ UnpackedTarball/serf/buckets/limit_buckets \
+ UnpackedTarball/serf/buckets/mmap_buckets \
+ UnpackedTarball/serf/buckets/request_buckets \
+ UnpackedTarball/serf/buckets/response_body_buckets \
+ UnpackedTarball/serf/buckets/response_buckets \
+ UnpackedTarball/serf/buckets/simple_buckets \
+ UnpackedTarball/serf/buckets/socket_buckets \
+ UnpackedTarball/serf/buckets/ssl_buckets \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/serf/UnpackedTarball_serf.mk b/external/serf/UnpackedTarball_serf.mk
index 3cea304dbcc4..8c7f2704693a 100644
--- a/external/serf/UnpackedTarball_serf.mk
+++ b/external/serf/UnpackedTarball_serf.mk
@@ -11,12 +11,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,serf))
$(eval $(call gb_UnpackedTarball_set_tarball,serf,$(SERF_TARBALL)))
-$(eval $(call gb_UnpackedTarball_fix_end_of_line,serf,\
- serf.mak \
-))
-
$(eval $(call gb_UnpackedTarball_add_patches,serf,\
- external/serf/windows.build.patch.1 \
external/serf/ssl.verify.none.patch.1 \
))
diff --git a/external/serf/windows.build.patch.1 b/external/serf/windows.build.patch.1
deleted file mode 100644
index c659d41cdf43..000000000000
--- a/external/serf/windows.build.patch.1
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -ur serf.org/serf.mak serf/serf.mak
---- serf.org/serf.mak 2014-03-05 16:31:26.681695709 +0100
-+++ serf/serf.mak 2014-03-05 16:32:20.969696348 +0100
-@@ -93,7 +93,7 @@
- WIN32_DEFS = /D WIN32 /D WIN32_LEAN_AND_MEAN /D NOUSER /D NOGDI /D NONLS /D NOCRYPT /D SERF_HAVE_SSPI
-
- CPP=cl.exe
--CPP_PROJ = /c /nologo $(CFLAGS) $(WIN32_DEFS) $(APR_FLAGS) $(APRUTIL_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"
-+CPP_PROJ = /c /nologo /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC $(CFLAGS) $(WIN32_DEFS) $(APR_FLAGS) $(APRUTIL_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\"
- LIB32=link.exe
- LIB32_FLAGS=/nologo
-
-@@ -127,16 +127,6 @@
- "$(INTDIR)\socket_buckets.obj" \
- "$(INTDIR)\ssl_buckets.obj" \
-
--!IFDEF OPENSSL_STATIC
--LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32\libeay32.lib" \
-- "$(OPENSSL_SRC)\out32\ssleay32.lib"
--!ELSE
--LIB32_OBJS = $(LIB32_OBJS) "$(OPENSSL_SRC)\out32dll\libeay32.lib" \
-- "$(OPENSSL_SRC)\out32dll\ssleay32.lib"
--!ENDIF
--
--LIB32_OBJS = $(LIB32_OBJS) $(APR_LIBS) $(APRUTIL_LIBS) $(ZLIB_LIBS)
--
- SYS_LIBS = secur32.lib
-
- TEST_OBJS = \
diff --git a/external/xmlsec/0001-xmlSecX509DataGetNodeContent-don-t-return-0-for-non-.patch.1 b/external/xmlsec/0001-xmlSecX509DataGetNodeContent-don-t-return-0-for-non-.patch.1
new file mode 100644
index 000000000000..51607ca6ee73
--- /dev/null
+++ b/external/xmlsec/0001-xmlSecX509DataGetNodeContent-don-t-return-0-for-non-.patch.1
@@ -0,0 +1,68 @@
+From a39b110cb2c25680259a38b2f397b350151bc6e7 Mon Sep 17 00:00:00 2001
+From: Michael Stahl <michael.stahl@allotropia.de>
+Date: Wed, 7 Apr 2021 16:43:48 +0200
+Subject: [PATCH] xmlSecX509DataGetNodeContent(): don't return 0 for non-empty
+ elements
+
+LibreOffice wants to write the content of KeyInfo itself and thus writes
+X509Certificate element with content.
+
+But then xmlSecMSCngKeyDataX509XmlWrite() writes a duplicate
+X509Certificate element, which then makes a new additional consistency
+check in LO unhappy.
+
+The duplicate is written because xmlSecX509DataGetNodeContent() returns
+0 because it only checks for empty nodes; if there are only non-empty
+nodes a fallback to XMLSEC_X509DATA_DEFAULT occurs in all backends.
+
+Change the return value to be non-0 without changing the signature of
+the function, as it is apparently public.
+
+This doesn't happen in LO in the NSS backend due to another accident,
+where the private key flag isn't set when the X509Certificate is read,
+but otherwise the code is the same.
+---
+ src/x509.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/src/x509.c b/src/x509.c
+index ed8788ae..dac8bd2b 100644
+--- a/src/x509.c
++++ b/src/x509.c
+@@ -60,22 +60,33 @@ xmlSecX509DataGetNodeContent (xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) {
+ if(xmlSecCheckNodeName(cur, xmlSecNodeX509Certificate, xmlSecDSigNs)) {
+ if(xmlSecIsEmptyNode(cur) == 1) {
+ content |= XMLSEC_X509DATA_CERTIFICATE_NODE;
++ } else {
++ /* ensure return value isn't 0 if there are non-empty elements */
++ content |= (XMLSEC_X509DATA_CERTIFICATE_NODE << 16);
+ }
+ } else if(xmlSecCheckNodeName(cur, xmlSecNodeX509SubjectName, xmlSecDSigNs)) {
+ if(xmlSecIsEmptyNode(cur) == 1) {
+ content |= XMLSEC_X509DATA_SUBJECTNAME_NODE;
++ } else {
++ content |= (XMLSEC_X509DATA_SUBJECTNAME_NODE << 16);
+ }
+ } else if(xmlSecCheckNodeName(cur, xmlSecNodeX509IssuerSerial, xmlSecDSigNs)) {
+ if(xmlSecIsEmptyNode(cur) == 1) {
+ content |= XMLSEC_X509DATA_ISSUERSERIAL_NODE;
++ } else {
++ content |= (XMLSEC_X509DATA_ISSUERSERIAL_NODE << 16);
+ }
+ } else if(xmlSecCheckNodeName(cur, xmlSecNodeX509SKI, xmlSecDSigNs)) {
+ if(xmlSecIsEmptyNode(cur) == 1) {
+ content |= XMLSEC_X509DATA_SKI_NODE;
++ } else {
++ content |= (XMLSEC_X509DATA_SKI_NODE << 16);
+ }
+ } else if(xmlSecCheckNodeName(cur, xmlSecNodeX509CRL, xmlSecDSigNs)) {
+ if(xmlSecIsEmptyNode(cur) == 1) {
+ content |= XMLSEC_X509DATA_CRL_NODE;
++ } else {
++ content |= (XMLSEC_X509DATA_CRL_NODE << 16);
+ }
+ } else {
+ /* todo: fail on unknown child node? */
+--
+2.30.2
+
diff --git a/external/xmlsec/UnpackedTarball_xmlsec.mk b/external/xmlsec/UnpackedTarball_xmlsec.mk
index 3ad978cdb829..c0591ddcea0d 100644
--- a/external/xmlsec/UnpackedTarball_xmlsec.mk
+++ b/external/xmlsec/UnpackedTarball_xmlsec.mk
@@ -8,6 +8,7 @@
#
xmlsec_patches :=
+xmlsec_patches += 0001-xmlSecX509DataGetNodeContent-don-t-return-0-for-non-.patch.1
$(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec))
diff --git a/external/zlib/UnpackedTarball_zlib.mk b/external/zlib/UnpackedTarball_zlib.mk
index e74039d25089..dd9fc1c31445 100644
--- a/external/zlib/UnpackedTarball_zlib.mk
+++ b/external/zlib/UnpackedTarball_zlib.mk
@@ -18,8 +18,4 @@ $(eval $(call gb_UnpackedTarball_set_post_action,zlib,\
$(eval $(call gb_UnpackedTarball_set_patchlevel,zlib,0))
-$(eval $(call gb_UnpackedTarball_add_patches,zlib, \
- external/zlib/ubsan.patch \
-))
-
# vim: set noet sw=4 ts=4:
diff --git a/external/zlib/ubsan.patch b/external/zlib/ubsan.patch
deleted file mode 100644
index 2d7ff8d67967..000000000000
--- a/external/zlib/ubsan.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- trees.c
-+++ trees.c
-@@ -870,7 +870,7 @@
- bi_windup(s); /* align on byte boundary */
- put_short(s, (ush)stored_len);
- put_short(s, (ush)~stored_len);
-- zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
-+ if (stored_len != 0) zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
- s->pending += stored_len;
- #ifdef ZLIB_DEBUG
- s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
diff --git a/filter/qa/unit/data/attributeRedefinedTest.odp b/filter/qa/unit/data/attributeRedefinedTest.odp
new file mode 100644
index 000000000000..dfb814bfb9ec
--- /dev/null
+++ b/filter/qa/unit/data/attributeRedefinedTest.odp
Binary files differ
diff --git a/filter/qa/unit/data/empty.doc b/filter/qa/unit/data/empty.doc
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/filter/qa/unit/data/empty.doc
diff --git a/filter/qa/unit/svg.cxx b/filter/qa/unit/svg.cxx
index c59d3cf63dca..95f894ed42cd 100644
--- a/filter/qa/unit/svg.cxx
+++ b/filter/qa/unit/svg.cxx
@@ -138,6 +138,48 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testShapeNographic)
xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
}
+CPPUNIT_TEST_FIXTURE(SvgFilterTest, attributeRedefinedTest)
+{
+ // Load document containing empty paragraphs with ids.
+ load("attributeRedefinedTest.odp");
+
+ // Export to SVG.
+ uno::Reference<frame::XStorable> xStorable(getComponent(), uno::UNO_QUERY_THROW);
+ SvMemoryStream aStream;
+ uno::Reference<io::XOutputStream> xOut = new utl::OOutputStreamWrapper(aStream);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("impress_svg_Export");
+ aMediaDescriptor["OutputStream"] <<= xOut;
+ xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList());
+ aStream.Seek(STREAM_SEEK_TO_BEGIN);
+
+ xmlDocPtr pXmlDoc = parseXmlStream(&aStream);
+
+ // We expect four paragraph
+ // 2 empty paragraphs with ids
+ // 2 paragraphs with text
+ // Without the accompanying fix the test would have failed with
+ // Expected : 4
+ // Actual : 2
+ // i.e. 2 of the empty paragraph do not get generated even if there
+ // is id imported for the paragraphs
+ // If we don't create the empty paragraphs the id attribute attribute gets redefined like this:
+ // <tspan id="id14" id="id15" id="id17" class="TextParagraph" font-family="Bahnschrift Light" font-size="1129px" font-weight="400">
+
+ OString xPath = "//svg:g[@class='TextShape']//svg:text[@class='SVGTextShape']//"
+ "svg:tspan[@class='TextParagraph']";
+ assertXPath(pXmlDoc, xPath, 4);
+
+ //assert that each tspan element with TextParagraph class has id and the tspan element of
+ //each empty paragraph doesnot contain tspan element with class TextPosition
+ assertXPath(pXmlDoc, xPath + "[1]", "id", "id4");
+ assertXPath(pXmlDoc, xPath + "[2]", "id", "id5");
+ assertXPath(pXmlDoc, xPath + "[2]//svg:tspan[@class='TextPosition']", 0);
+ assertXPath(pXmlDoc, xPath + "[3]", "id", "id6");
+ assertXPath(pXmlDoc, xPath + "[3]//svg:tspan[@class='TextPosition']", 0);
+ assertXPath(pXmlDoc, xPath + "[4]", "id", "id7");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/qa/unit/textfilterdetect.cxx b/filter/qa/unit/textfilterdetect.cxx
index 74d967490ffe..4083610b0736 100644
--- a/filter/qa/unit/textfilterdetect.cxx
+++ b/filter/qa/unit/textfilterdetect.cxx
@@ -116,6 +116,26 @@ CPPUNIT_TEST_FIXTURE(TextFilterDetectTest, testEmptyFile)
// Without the accompanying fix in place, this test would have failed, as it was opened in
// Writer instead.
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.presentation.PresentationDocument"));
+ getComponent()->dispose();
+
+ // ... and DOC
+ aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.doc";
+ // Without the accompanying fix in place, this test would have failed, the import filter aborted
+ // loading.
+ getComponent() = loadFromDesktop(aURL);
+ xServiceInfo.set(getComponent(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xServiceInfo.is());
+ CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.TextDocument"));
+ uno::Reference<frame::XModel> xModel(getComponent(), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aArgs = xModel->getArgs();
+ comphelper::SequenceAsHashMap aMap(aArgs);
+ OUString aFilterName;
+ aMap["FilterName"] >>= aFilterName;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: MS Word 97
+ // - Actual : MS WinWord 6.0
+ // i.e. opening worked, but saving back failed instead of producing a WW8 binary file.
+ CPPUNIT_ASSERT_EQUAL(OUString("MS Word 97"), aFilterName);
}
}
diff --git a/filter/source/config/fragments/types/writer_T602_Document.xcu b/filter/source/config/fragments/types/writer_T602_Document.xcu
index c34f823da4ca..e9b3df39cf33 100644
--- a/filter/source/config/fragments/types/writer_T602_Document.xcu
+++ b/filter/source/config/fragments/types/writer_T602_Document.xcu
@@ -18,7 +18,7 @@
<node oor:name="writer_T602_Document" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.Writer.T602ImportFilter</value></prop>
<prop oor:name="URLPattern"/>
- <prop oor:name="Extensions"><value>602 txt</value></prop>
+ <prop oor:name="Extensions"><value>602</value></prop>
<prop oor:name="MediaType"><value>application/x-t602</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>T602Document</value></prop>
diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx
index 825c90243e0a..025ab1fc588a 100644
--- a/filter/source/graphicfilter/icgm/bitmap.cxx
+++ b/filter/source/graphicfilter/icgm/bitmap.cxx
@@ -316,7 +316,15 @@ bool CGMBitmap::ImplGetDimensions( CGMBitmapDescriptor& rDesc )
rDesc.mbStatus = false;
sal_uInt32 nHeaderSize = 2 + 3 * nPrecision + 3 * mpCGM->ImplGetPointSize();
- rDesc.mnScanSize = ( ( rDesc.mnX * rDesc.mnDstBitsPerPixel + 7 ) >> 3 );
+
+ sal_uInt32 nWidthBits;
+ if (o3tl::checked_multiply(rDesc.mnX, rDesc.mnDstBitsPerPixel, nWidthBits))
+ {
+ rDesc.mbStatus = false;
+ return false;
+ }
+
+ rDesc.mnScanSize = (nWidthBits + 7) >> 3;
sal_uInt32 nScanSize;
nScanSize = rDesc.mnScanSize;
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 70212ea7c662..5939e975ced4 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -416,8 +416,8 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
{
const Reference< XPropertySet > xPropSet = rObj.mXPropSet;
const Reference<XPropertySetInfo> xPropInfo = xPropSet.is() ? xPropSet->getPropertySetInfo() : Reference<XPropertySetInfo>();
- // This code is expected to be called only for DOCX format.
- if (xPropInfo.is())
+ // This code is expected to be called only for DOCX/XLSX formats.
+ if (xPropInfo.is() && bOOxmlExport)
{
bool bInline = false;
if (xPropInfo->hasPropertyByName("AnchorType"))
@@ -829,7 +829,7 @@ void ImplEESdrWriter::ImplInitPageValues()
}
void ImplEESdrWriter::ImplWritePage(
- EscherSolverContainer& rSolverContainer )
+ EscherSolverContainer& rSolverContainer, bool ooxmlExport )
{
ImplInitPageValues();
@@ -840,7 +840,7 @@ void ImplEESdrWriter::ImplWritePage(
mXShapes->getByIndex( n )) );
if( aObj.IsValid() )
{
- ImplWriteShape( aObj, rSolverContainer, true );
+ ImplWriteShape( aObj, rSolverContainer, ooxmlExport );
}
}
}
@@ -919,10 +919,10 @@ void ImplEESdrWriter::ImplFlushSolverContainer()
}
}
-void ImplEESdrWriter::ImplWriteCurrentPage()
+void ImplEESdrWriter::ImplWriteCurrentPage(bool ooxmlExport)
{
assert(mpSolverContainer && "ImplEESdrWriter::ImplWriteCurrentPage: no SolverContainer");
- ImplWritePage( *mpSolverContainer );
+ ImplWritePage( *mpSolverContainer, ooxmlExport );
ImplExitPage();
}
@@ -932,16 +932,16 @@ sal_uInt32 ImplEESdrWriter::ImplWriteTheShape( ImplEESdrObject& rObj , bool ooxm
return ImplWriteShape( rObj, *mpSolverContainer, ooxmlExport );
}
-void EscherEx::AddSdrPage( const SdrPage& rPage )
+void EscherEx::AddSdrPage( const SdrPage& rPage, bool ooxmlExport )
{
if ( mpImplEESdrWriter->ImplInitPage( rPage ) )
- mpImplEESdrWriter->ImplWriteCurrentPage();
+ mpImplEESdrWriter->ImplWriteCurrentPage(ooxmlExport);
}
-void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
+void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes, bool ooxmlExport )
{
if ( mpImplEESdrWriter->ImplInitUnoShapes( rxShapes ) )
- mpImplEESdrWriter->ImplWriteCurrentPage();
+ mpImplEESdrWriter->ImplWriteCurrentPage(ooxmlExport);
}
sal_uInt32 EscherEx::AddSdrObject( const SdrObject& rObj, bool ooxmlExport )
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index 4602a320b557..c68895522200 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -116,7 +116,7 @@ class ImplEESdrWriter
std::unique_ptr<EscherSolverContainer> mpSolverContainer;
void ImplInitPageValues();
- void ImplWritePage( EscherSolverContainer& rSolver );
+ void ImplWritePage( EscherSolverContainer& rSolver, bool ooxmlExport );
sal_uInt32 ImplWriteShape( ImplEESdrObject& rObj,
EscherSolverContainer& rSolver,
const bool bOOxmlExport = false ); // returns ShapeID
@@ -136,7 +136,7 @@ public:
EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
bool ImplInitPage( const SdrPage& rPage );
bool ImplInitUnoShapes( const css::uno::Reference< css::drawing::XShapes >& rxShapes );
- void ImplWriteCurrentPage();
+ void ImplWriteCurrentPage( bool ooxmlExport );
sal_uInt32 ImplWriteTheShape( ImplEESdrObject& rObj, bool ooxmlExport );
void ImplExitPage();
};
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index fbb718b732c7..6f660566dac8 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -23,6 +23,8 @@
#include <math.h>
#include <limits.h>
#include <vector>
+
+#include <o3tl/any.hxx>
#include <osl/endian.h>
#include <osl/file.hxx>
#include <tools/solar.h>
@@ -4630,11 +4632,14 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
pAny = aGeometryItem.GetPropertyValueByName( sPath, sCoordinates );
if (pAny && (*pAny >>= seqCoordinates) && (seqCoordinates.getLength() >= 2))
{
- sal_Int32 nL, nT, nR, nB;
- seqCoordinates[0].First.Value >>= nL;
- seqCoordinates[0].Second.Value >>= nT;
- seqCoordinates[1].First.Value >>= nR;
- seqCoordinates[1].Second.Value >>= nB;
+ auto const nL
+ = *o3tl::doAccess<sal_Int32>(seqCoordinates[0].First.Value);
+ auto const nT
+ = *o3tl::doAccess<sal_Int32>(seqCoordinates[0].Second.Value);
+ auto const nR
+ = *o3tl::doAccess<sal_Int32>(seqCoordinates[1].First.Value);
+ auto const nB
+ = *o3tl::doAccess<sal_Int32>(seqCoordinates[1].Second.Value);
aEllipseRect_MS = basegfx::B2DRectangle(nL, nT, nR, nB);
}
diff --git a/filter/source/storagefilterdetect/filterdetect.cxx b/filter/source/storagefilterdetect/filterdetect.cxx
index 02ed875c6699..694251c389b3 100644
--- a/filter/source/storagefilterdetect/filterdetect.cxx
+++ b/filter/source/storagefilterdetect/filterdetect.cxx
@@ -33,6 +33,8 @@
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <comphelper/lok.hxx>
+
using namespace ::com::sun::star;
using utl::MediaDescriptor;
@@ -103,6 +105,11 @@ OUString SAL_CALL StorageFilterDetect::detect(uno::Sequence<beans::PropertyValue
OUString aMediaType;
xStorageProperties->getPropertyValue( "MediaType" ) >>= aMediaType;
aTypeName = getInternalFromMediaType( aMediaType );
+ if (comphelper::LibreOfficeKit::isActive() && aTypeName == "draw8_template")
+ {
+ // save it as draw8 instead of template format
+ aTypeName = "draw8";
+ }
}
catch( const lang::WrappedTargetException& aWrap )
diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
index 7f3cb48bcfbf..8906825126fe 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -32,6 +32,15 @@ var abs = Math.abs;
var now = Date.now;
/**
+ * polyfill for IE11
+ */
+if (!Math.trunc) {
+ Math.trunc = function (v) {
+ return v < 0 ? Math.ceil(v) : Math.floor(v);
+ };
+}
+
+/**
* set a timeout with a given scope
* @param {Function} fn
* @param {Number} timeout
@@ -5393,9 +5402,9 @@ function getTextFieldType ( elem )
function isTextFieldByClassName ( sClassName )
{
return sClassName === aDateTimeClassName || sClassName === aFooterClassName
- || sClassName === aHeaderClassName || sClassName.startsWith( aSlideNumberClassName )
- || sClassName.startsWith( aDateClassName ) || sClassName.startsWith( aTimeClassName )
- || sClassName.startsWith( aSlideNameClassName );
+ || sClassName === aHeaderClassName || sClassName.indexOf( aSlideNumberClassName ) == 0
+ || sClassName.indexOf( aDateClassName ) == 0 || sClassName.indexOf( aTimeClassName ) == 0
+ || sClassName.indexOf( aSlideNameClassName ) == 0;
}
/** Class MasterPage
@@ -5819,7 +5828,7 @@ MasterPageView.prototype.createElement = function()
for( ; i < aBackgroundObjectSubGroupIdList.length; ++i )
{
sId = aBackgroundObjectSubGroupIdList[i];
- if( sId.startsWith( aSlideNumberClassName ) )
+ if( sId.indexOf( aSlideNumberClassName ) == 0 )
{
// Slide Number Field
// The cloned element is appended directly to the field group element
@@ -5873,9 +5882,9 @@ MasterPageView.prototype.createElement = function()
aTextFieldHandlerSet, sMasterSlideId );
}
}
- else if( sId.startsWith( aDateClassName )
- || sId.startsWith( aTimeClassName )
- || sId.startsWith( aSlideNameClassName ) )
+ else if( sId.indexOf( aDateClassName ) == 0
+ || sId.indexOf( aTimeClassName ) == 0
+ || sId.indexOf( aSlideNameClassName ) == 0 )
{
this.initTextFieldHandler( sId, aPlaceholderShapeSet,
aTextFieldContentProviderSet, aDefsElement,
@@ -7024,6 +7033,8 @@ function matrixToString( aSVGMatrix )
// eslint-disable-next-line no-unused-vars
function numberParser( sValue )
{
+ if( typeof sValue !== 'string' )
+ return undefined;
if( sValue === '.' )
return undefined;
var reFloatNumber = /^[+-]?[0-9]*[.]?[0-9]*$/;
@@ -7036,6 +7047,9 @@ function numberParser( sValue )
function booleanParser( sValue )
{
+ if( typeof sValue !== 'string' )
+ return undefined;
+
sValue = sValue.toLowerCase();
if( sValue === 'true' )
return true;
@@ -7047,6 +7061,9 @@ function booleanParser( sValue )
function colorParser( sValue )
{
+ if( typeof sValue !== 'string' )
+ return undefined;
+
// The following 3 color functions are used in evaluating sValue string
// so don't remove them.
@@ -7980,6 +7997,7 @@ var ENUM_PROPERTY = 2;
var COLOR_PROPERTY = 3;
var STRING_PROPERTY = 4;
var BOOL_PROPERTY = 5;
+var TUPLE_NUMBER_PROPERTY = 6;
var aValueTypeOutMap = [ 'unknown', 'number', 'enum', 'color', 'string', 'boolean' ];
@@ -7997,6 +8015,14 @@ var aAttributeMap =
'get': 'getOpacity',
'set': 'setOpacity' },
+ 'scale': { 'type': TUPLE_NUMBER_PROPERTY,
+ 'get': 'getSize',
+ 'set': 'setSize' },
+
+ 'translate': { 'type': TUPLE_NUMBER_PROPERTY,
+ 'get': 'getPos',
+ 'set': 'setPos' },
+
'rotate': { 'type': NUMBER_PROPERTY,
'get': 'getRotationAngle',
'set': 'setRotationAngle' },
@@ -11565,6 +11591,70 @@ PropertyAnimationNode.prototype.createActivity = function()
+function isValidTransformation( sType )
+{
+ return ( sType === 'translate' || sType === 'scale' || sType === 'rotate'
+ || sType === 'skewX' || sType === 'skewY' );
+}
+
+function AnimationTransformNode( aAnimElem, aParentNode, aNodeContext )
+{
+ AnimationTransformNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
+
+ this.sClassName = 'AnimationTransformNode';
+}
+extend( AnimationTransformNode, AnimationBaseNode3 );
+
+
+AnimationTransformNode.prototype.parseElement = function()
+{
+ var bRet = AnimationTransformNode.superclass.parseElement.call(this);
+
+ var aAnimElem = this.aElement;
+
+ // transformation type
+ var sTransformType = aAnimElem.getAttribute( 'svg:type' );
+ if( !isValidTransformation( sTransformType ) )
+ {
+ this.eCurrentState = INVALID_NODE;
+ log( 'AnimationTransformNode.parseElement: transformation type not found: ' + sTransformType );
+ }
+ else
+ {
+ this.sAttributeName = sTransformType;
+ }
+
+ return bRet;
+}
+
+AnimationTransformNode.prototype.createActivity = function()
+{
+ var aActivityParamSet = this.fillActivityParams();
+ var aAnimation;
+
+ if( this.getAttributeName() === 'scale' || this.getAttributeName() === 'translate' )
+ {
+ aAnimation = createPairPropertyAnimation( this.getAttributeName(),
+ this.getAnimatedElement(),
+ this.aNodeContext.aSlideWidth,
+ this.aNodeContext.aSlideHeight );
+
+ }
+ else
+ {
+ aAnimation = createPropertyAnimation( this.getAttributeName(),
+ this.getAnimatedElement(),
+ this.aNodeContext.aSlideWidth,
+ this.aNodeContext.aSlideHeight );
+ }
+
+ var aInterpolator = null; // createActivity will compute it;
+ return createActivity( aActivityParamSet, this, aAnimation, aInterpolator );
+};
+
+
+
+
function AnimationSetNode( aAnimElem, aParentNode, aNodeContext )
{
AnimationSetNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
@@ -11863,10 +11953,8 @@ function createAnimationNode( aElement, aParentNode, aNodeContext )
aCreatedNode = new AnimationColorNode( aElement, aParentNode, aNodeContext );
break;
case ANIMATION_NODE_ANIMATETRANSFORM:
- //aCreatedNode = new AnimationTransformNode( aElement, aParentNode, aNodeContext );
- //break;
- log( 'createAnimationNode: ANIMATETRANSFORM not implemented' );
- return null;
+ aCreatedNode = new AnimationTransformNode( aElement, aParentNode, aNodeContext );
+ break;
case ANIMATION_NODE_TRANSITIONFILTER:
aCreatedNode = new AnimationTransitionFilterNode( aElement, aParentNode, aNodeContext );
break;
@@ -11989,6 +12077,41 @@ function createPropertyAnimation( sAttrName, aAnimatedElement, nWidth, nHeight )
+function createPairPropertyAnimation( sTransformType, aAnimatedElement, nWidth, nHeight )
+{
+ var aFunctorSet = aAttributeMap[ sTransformType ];
+ var sGetValueMethod = aFunctorSet.get;
+ var sSetValueMethod = aFunctorSet.set;
+
+ var aDefaultValue = [];
+ var aSizeReference = [];
+ if( sTransformType === 'scale' )
+ {
+ aDefaultValue[0] = aSizeReference[0] = aAnimatedElement.getBaseBBox().width;
+ aDefaultValue[1] = aSizeReference[1] = aAnimatedElement.getBaseBBox().height;
+ }
+ else if( sTransformType === 'translate' )
+ {
+ aDefaultValue[0] = aAnimatedElement.getBaseCenterX();
+ aDefaultValue[1] = aAnimatedElement.getBaseCenterY();
+ aSizeReference[0] = nWidth;
+ aSizeReference[1] = nHeight;
+ }
+ else
+ {
+ log( 'createPairPropertyAnimation: transform type is not handled' );
+ return null;
+ }
+
+ return new TupleAnimation( bind( aAnimatedElement, aAnimatedElement[ sGetValueMethod ] ),
+ bind( aAnimatedElement, aAnimatedElement[ sSetValueMethod ] ),
+ aDefaultValue,
+ aSizeReference );
+}
+
+
+
+
/** createShapeTransition
*
* @param aActivityParamSet
@@ -12188,6 +12311,45 @@ GenericAnimation.prototype.getUnderlyingValue = function()
+function TupleAnimation( aGetValueFunc, aSetValueFunc, aDefaultValue, aReferenceSize )
+{
+ TupleAnimation.superclass.constructor.call( this, aGetValueFunc, aSetValueFunc );
+ assert( aDefaultValue && aReferenceSize,
+ 'TupleAnimation constructor: default value functor and/or reference size are not valid' );
+
+ this.aDefaultValue = aDefaultValue;
+ this.aReferenceSize = aReferenceSize;
+}
+extend( TupleAnimation, GenericAnimation );
+
+TupleAnimation.prototype.perform = function( aNormValue )
+{
+ assert(aNormValue.length === this.aReferenceSize.length);
+
+ var aValue = [];
+ for( var i = 0; i < aNormValue.length; ++i )
+ {
+ aValue.push( aNormValue[i] * this.aReferenceSize[i] );
+ }
+
+ this.aSetValueFunc( aValue );
+};
+
+TupleAnimation.prototype.getUnderlyingValue = function()
+{
+ var aValue = this.aGetValueFunc();
+ assert(aValue.length === this.aReferenceSize.length);
+
+ var aNormValue = [];
+ for( var i = 0; i < aValue.length; ++i )
+ {
+ aNormValue.push( aValue[i] / this.aReferenceSize[i] );
+ }
+
+ return aNormValue;
+};
+
+
function HSLAnimationWrapper( aColorAnimation )
{
@@ -14505,6 +14667,11 @@ AnimatedElement.prototype.getY = function()
return this.nCenterY;
};
+AnimatedElement.prototype.getPos = function()
+{
+ return [this.getX(), this.getY()];
+};
+
AnimatedElement.prototype.getWidth = function()
{
return this.nScaleFactorX * this.getBaseBBox().width;
@@ -14515,6 +14682,11 @@ AnimatedElement.prototype.getHeight = function()
return this.nScaleFactorY * this.getBaseBBox().height;
};
+AnimatedElement.prototype.getSize = function()
+{
+ return [this.getWidth(), this.getHeight()];
+};
+
AnimatedElement.prototype.updateTransformAttribute = function()
{
this.aTransformAttrList = this.aActiveElement.transform.baseVal;
@@ -14544,12 +14716,27 @@ AnimatedElement.prototype.setY = function( nNewCenterY )
this.nCenterY = nNewCenterY;
};
+AnimatedElement.prototype.setPos = function( aNewPos )
+{
+ var nNewCenterX = aNewPos[0];
+ var nNewCenterY = aNewPos[1];
+
+ if( nNewCenterX === this.nCenterX && nNewCenterY === this.nCenterY ) return;
+
+ this.aTransformAttrList = this.aActiveElement.transform.baseVal;
+ this.aTransformAttr = this.aTransformAttrList.getItem( 0 );
+ this.aTMatrix = this.aTransformAttr.matrix.translate( nNewCenterX - this.nCenterX, nNewCenterY - this.nCenterY );
+ this.aTransformAttr.setMatrix( this.aTMatrix );
+ this.nCenterX = nNewCenterX;
+ this.nCenterY = nNewCenterY;
+};
+
AnimatedElement.prototype.setWidth = function( nNewWidth )
{
ANIMDBG.print( 'AnimatedElement.setWidth: nNewWidth = ' + nNewWidth );
if( nNewWidth < 0 )
{
- log('AnimatedElement(' + this.getId() + ').setWidth: negative height!');
+ log('AnimatedElement(' + this.getId() + ').setWidth: negative width!');
nNewWidth = 0;
}
@@ -14594,6 +14781,43 @@ AnimatedElement.prototype.setHeight = function( nNewHeight )
this.nScaleFactorY = nScaleFactorY;
};
+AnimatedElement.prototype.setSize= function( aNewSize )
+{
+ var nNewWidth = aNewSize[0];
+ var nNewHeight = aNewSize[1];
+ ANIMDBG.print( 'AnimatedElement.setSize: = [' + nNewWidth + ',' + nNewHeight + ']');
+ if( nNewWidth < 0 )
+ {
+ log('AnimatedElement(' + this.getId() + ').setSize: negative width!');
+ nNewWidth = 0;
+ }
+ if( nNewHeight < 0 )
+ {
+ log('AnimatedElement(' + this.getId() + ').setSize: negative height!');
+ nNewHeight = 0;
+ }
+
+ var nBaseWidth = this.getBaseBBox().width;
+ var nScaleFactorX = nNewWidth / nBaseWidth;
+ if( nScaleFactorX < 1e-5 ) nScaleFactorX = 1e-5;
+
+ var nBaseHeight = this.getBaseBBox().height;
+ var nScaleFactorY = nNewHeight / nBaseHeight;
+ if( nScaleFactorY < 1e-5 ) nScaleFactorY = 1e-5;
+
+ if( nScaleFactorX == this.nScaleFactorX && nScaleFactorY == this.nScaleFactorY ) return;
+
+ this.aTMatrix = document.documentElement.createSVGMatrix()
+ .translate( this.nCenterX, this.nCenterY )
+ .rotate(this.nRotationAngle)
+ .scaleNonUniform( nScaleFactorX, nScaleFactorY )
+ .translate( -this.nBaseCenterX, -this.nBaseCenterY );
+ this.updateTransformAttribute();
+
+ this.nScaleFactorX = nScaleFactorX;
+ this.nScaleFactorY = nScaleFactorY;
+};
+
AnimatedElement.prototype.getOpacity = function()
{
return this.aActiveElement.getAttribute( 'opacity' );
@@ -16327,6 +16551,17 @@ aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ COLOR_PROPERTY ][ COLO
};
};
+aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ TUPLE_NUMBER_PROPERTY ] =
+ function ( aFrom, aTo, nT )
+ {
+ var aRes = [];
+ for( var i = 0; i < aFrom.length; ++i )
+ {
+ aRes.push( ( 1.0 - nT )* aFrom[i] + nT * aTo[i] );
+ }
+ return aRes;
+ };
+
@@ -16494,6 +16729,36 @@ aOperatorSetMap[ STRING_PROPERTY ] = aOperatorSetMap[ ENUM_PROPERTY ];
// bool operators
aOperatorSetMap[ BOOL_PROPERTY ] = aOperatorSetMap[ ENUM_PROPERTY ];
+// tuple number operators
+aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ] = {};
+
+aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ].equal = function( a, b )
+{
+ assert( a.length === b.length, 'Tuples length mismatch.' );
+ return ( a.toString() === b.toString() );
+};
+
+aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ].add = function( a, b )
+{
+ assert( a.length === b.length, 'Tuples length mismatch.' );
+ var r = [];
+ for( var i = 0; i < a.length; ++i )
+ {
+ r.push(a[i] + b[i]);
+ }
+ return r;
+};
+
+aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ].scale = function( k, v )
+{
+ var r = [];
+ for( var i = 0; i < v.length; ++i )
+ {
+ r.push(k * v[i]);
+ }
+ return r;
+};
+
@@ -17903,6 +18168,22 @@ function extractAttributeValues( eValueType, aValueList, aValueSet, aBBox, nSlid
aValueList.push( aValue );
}
break;
+ case TUPLE_NUMBER_PROPERTY :
+ for( i = 0; i < aValueSet.length; ++i )
+ {
+ if( typeof aValueSet[i] === 'string' )
+ {
+ var aTuple = aValueSet[i].split(',');
+ aValue = [];
+ evalValuesAttribute(aValue, aTuple, aBBox, nSlideWidth, nSlideHeight);
+ aValueList.push(aValue);
+ }
+ else
+ {
+ aValueList.push( undefined );
+ }
+ }
+ break;
default:
log( 'createValueListActivity: unexpected value type: ' + eValueType );
}
@@ -17925,9 +18206,12 @@ function evalValuesAttribute( aValueList, aValueSet, aBBox, nSlideWidth, nSlideH
for( var i = 0; i < aValueSet.length; ++i )
{
var sValue = aValueSet[i];
- sValue = sValue.replace(reMath, 'Math.$&');
- sValue = sValue.replace(/pi(?!\w)/g, 'Math.PI');
- sValue = sValue.replace(/e(?!\w)/g, 'Math.E');
+ if(sValue)
+ {
+ sValue = sValue.replace(reMath, 'Math.$&');
+ sValue = sValue.replace(/pi(?!\w)/g, 'Math.PI');
+ sValue = sValue.replace(/e(?!\w)/g, 'Math.E');
+ }
var aValue = eval( sValue );
aValueList.push( aValue );
}
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index ce12673b795d..635bcdf1dd70 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -366,6 +366,11 @@ SVGExport::SVGExport(
// add namespaces
GetNamespaceMap_().Add(
+ GetXMLToken(XML_NP_SVG),
+ GetXMLToken(XML_N_SVG_COMPAT),
+ XML_NAMESPACE_SVG);
+
+ GetNamespaceMap_().Add(
GetXMLToken(XML_NP_PRESENTATION),
GetXMLToken(XML_N_PRESENTATION),
XML_NAMESPACE_PRESENTATION);
@@ -797,7 +802,9 @@ bool SVGFilter::implExportWriterTextGraphic( const Reference< view::XSelectionSu
const Graphic aOriginalGraphic(xOriginalGraphic);
uno::Reference<graphic::XGraphic> xTransformedGraphic;
- xPropertySet->getPropertyValue("TransformedGraphic") >>= xTransformedGraphic;
+ xPropertySet->getPropertyValue(
+ mbIsPreview ? OUString("GraphicPreview") : OUString("TransformedGraphic"))
+ >>= xTransformedGraphic;
if (!xTransformedGraphic.is())
return false;
@@ -973,6 +980,8 @@ bool SVGFilter::implExportDocument()
mpSVGWriter->SetEmbeddedBitmapRefs( &maBitmapActionMap );
implExportTiledBackground();
}
+ if( mbIsPreview )
+ mpSVGWriter->SetPreviewMode();
// #i124608# export a given object selection, so no MasterPage export at all
if (!mbExportShapeSelection)
@@ -1045,6 +1054,7 @@ void SVGFilter::implExportDocumentHeaderImpressOrDraw(sal_Int32 nDocX, sal_Int32
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:presentation", "http://sun.com/xmlns/staroffice/presentation" );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:smil", "http://www.w3.org/2001/SMIL20/" );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:anim", "urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "xml:space", "preserve" );
mpSVGDoc = new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "svg", true, true );
@@ -1228,6 +1238,8 @@ void SVGFilter::implGenerateMetaData()
{
const Reference< css::drawing::XDrawPage > & xDrawPage = mSelectedPages[i];
Reference< css::drawing::XMasterPageTarget > xMasterPageTarget( xDrawPage, UNO_QUERY );
+ if (!xMasterPageTarget.is())
+ continue;
Reference< css::drawing::XDrawPage > xMasterPage = xMasterPageTarget->getMasterPage();
OUString aSlideId(aId + "_" + OUString::number( i ));
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 5677d63fcc6c..25c96c3d1848 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -90,6 +90,7 @@ SVGFilter::SVGFilter( const Reference< XComponentContext >& rxCtx ) :
mbExportShapeSelection(false),
maFilterData(),
mxDefaultPage(),
+ mbIsPreview(false),
mbWriterFilter(false),
mbCalcFilter(false),
mbImpressFilter(false),
@@ -121,6 +122,15 @@ sal_Bool SAL_CALL SVGFilter::filter( const Sequence< PropertyValue >& rDescripto
{
for (sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++)
{
+ if (rDescriptor[nInd].Name == "IsPreview")
+ {
+ rDescriptor[nInd].Value >>= mbIsPreview;
+ break;
+ }
+ }
+
+ for (sal_Int32 nInd = 0; nInd < rDescriptor.getLength(); nInd++)
+ {
if (rDescriptor[nInd].Name == "FilterName")
{
OUString sFilterName;
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index ae9418ea49c5..d95710ca3e40 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -218,6 +218,7 @@ private:
Sequence< PropertyValue > maFilterData;
Reference< css::drawing::XDrawPage > mxDefaultPage;
std::vector< Reference< css::drawing::XDrawPage > > mSelectedPages;
+ bool mbIsPreview;
bool mbWriterFilter;
bool mbCalcFilter;
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 95980ce9b932..2f9b3a7d0e4d 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1077,7 +1077,19 @@ bool SVGTextWriter::nextParagraph()
const OUString& rParagraphId = implGetValidIDFromInterface( Reference<XInterface>(xTextContent, UNO_QUERY) );
if( !rParagraphId.isEmpty() )
{
- mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", rParagraphId );
+ // if there is id for empty paragraph we need to create a empty text paragraph
+ Reference < XTextRange > xRange( xTextContent, UNO_QUERY_THROW );
+ if ( xRange.is() && xRange->getString().isEmpty() )
+ {
+ endTextParagraph();
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "TextParagraph" );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", rParagraphId );
+ mpTextParagraphElem.reset(new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS ));
+ }
+ else
+ {
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", rParagraphId );
+ }
}
return true;
}
@@ -1737,6 +1749,9 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos,
}
else
{
+ // Without the following attribute Google Chrome does not render leading spaces
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "style", "white-space: pre" );
+
SvXMLElementExport aSVGTspanElem( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS );
mrExport.GetDocHandler()->characters( rText );
}
@@ -2855,7 +2870,27 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& rBmpEx,
}
}
- if( bCached || GraphicConverter::Export( aOStm, rBmpEx, ConvertDataFormat::PNG ) == ERRCODE_NONE )
+ const BitmapEx* pBitmap = &rBmpEx;
+ std::unique_ptr<BitmapEx> pNewBitmap;
+
+ // for preview we generate downscaled images (1280x720 max)
+ if (mbIsPreview)
+ {
+ Size aSize = rBmpEx.GetSizePixel();
+ double fX = static_cast<double>(aSize.getWidth()) / 1280;
+ double fY = static_cast<double>(aSize.getHeight()) / 720;
+ double fFactor = fX > fY ? fX : fY;
+ if (fFactor > 1.0)
+ {
+ aSize.setWidth(aSize.getWidth() / fFactor);
+ aSize.setHeight(aSize.getHeight() / fFactor);
+ pNewBitmap = std::make_unique<BitmapEx>(rBmpEx);
+ pNewBitmap->Scale(aSize);
+ pBitmap = pNewBitmap.get();
+ }
+ }
+
+ if( bCached || GraphicConverter::Export( aOStm, *pBitmap, ConvertDataFormat::PNG ) == ERRCODE_NONE )
{
Point aPt;
Size aSz;
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index d7458d053120..0be1e5ba1bdb 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -337,6 +337,7 @@ private:
bool mbClipAttrChanged;
bool mbIsPlaceholderShape;
const MetaBitmapActionMap* mpEmbeddedBitmapsMap;
+ bool mbIsPreview;
long ImplMap( sal_Int32 nVal ) const;
@@ -394,6 +395,7 @@ public:
const GDIMetaFile* pTextEmbeddedBitmapMtf = nullptr );
void SetEmbeddedBitmapRefs( const MetaBitmapActionMap* pEmbeddedBitmapsMap );
+ void SetPreviewMode(bool bState = true) { mbIsPreview = bState; }
};
diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx
index 1f5080ad0951..08944fad0e5f 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -149,10 +149,19 @@ bool HandleEmptyFileUrlByExtension(MediaDescriptor& rMediaDesc, const OUString&
return false;
}
- std::shared_ptr<const SfxFilter> pFilter(SfxFilterMatcher().GetFilter4Extension(rExt));
+ // Requiring the export+preferred flags helps to find the relevant filter, e.g. .doc -> WW8 (and
+ // not WW6 or Mac_Word).
+ SfxFilterFlags nMust
+ = SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::PREFERED;
+ std::shared_ptr<const SfxFilter> pFilter(SfxFilterMatcher().GetFilter4Extension(rExt, nMust));
if (!pFilter)
{
- return false;
+ // retry without PREFFERED so we can find at least something for 0-byte *.ods
+ nMust = SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT;
+ pFilter = SfxFilterMatcher().GetFilter4Extension(rExt, nMust);
+
+ if (!pFilter)
+ return false;
}
rMediaDesc[MediaDescriptor::PROP_FILTERNAME()] <<= pFilter->GetFilterName();
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index 42980eeeaff7..eb715230ce43 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -270,7 +270,7 @@ namespace XSLT
OSL_ASSERT(m_transformer != nullptr);
OSL_ASSERT(m_transformer->getInputStream().is());
OSL_ASSERT(m_transformer->getOutputStream().is());
- OSL_ASSERT(!m_transformer->getStyleSheetURL().isEmpty());
+ OSL_ASSERT(!m_transformer->getStyleSheetURL().isEmpty() || !m_transformer->getStyleSheetText().isEmpty());
::std::map<const char*, OString> pmap = m_transformer->getParameters();
::std::vector< const char* > params( pmap.size() * 2 + 1 ); // build parameters
int paramIndex = 0;
@@ -283,8 +283,25 @@ namespace XSLT
xmlDocPtr doc = xmlReadIO(&ParserInputBufferCallback::on_read,
&ParserInputBufferCallback::on_close,
static_cast<void*> (this), nullptr, nullptr, 0);
- xsltStylesheetPtr styleSheet = xsltParseStylesheetFile(
+ xsltStylesheetPtr styleSheet = nullptr;
+ if (m_transformer->getStyleSheetURL().getLength())
+ styleSheet = xsltParseStylesheetFile(
reinterpret_cast<const xmlChar *>(m_transformer->getStyleSheetURL().getStr()));
+ else if (m_transformer->getStyleSheetText().getLength())
+ {
+ xmlDocPtr styleSheetDoc = xmlReadMemory(
+ m_transformer->getStyleSheetText().getStr(),
+ m_transformer->getStyleSheetText().getLength(),
+ "noname.xml", nullptr, 0);
+
+ styleSheet = xsltParseStylesheetDoc(styleSheetDoc);
+ }
+
+ if (!styleSheet)
+ {
+ m_transformer->error("No stylesheet was created");
+ }
+
xmlDocPtr result = nullptr;
exsltRegisterAll();
registerExtensionModule();
@@ -329,7 +346,6 @@ namespace XSLT
m_transformer->error(msg);
}
- closeOutput();
oh.reset();
xsltFreeStylesheet(styleSheet);
xsltTransformContextPtr tcontext = nullptr;
@@ -501,6 +517,10 @@ namespace XSLT
{
m_styleSheetURL = valueUTF8;
}
+ if (nameUTF8 == "StylesheetText")
+ {
+ m_styleSheetText = valueUTF8;
+ }
else if (nameUTF8 == "SourceURL")
{
m_parameters.insert(pair<const char*, OString> (
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.hxx b/filter/source/xsltfilter/LibXSLTTransformer.hxx
index d646d5dbfc43..e527e2f84113 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.hxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.hxx
@@ -114,6 +114,7 @@ namespace XSLT
ListenerList m_listeners;
OString m_styleSheetURL;
+ OString m_styleSheetText;
::std::map<const char *, OString> m_parameters;
@@ -164,6 +165,8 @@ namespace XSLT
const OString&
getStyleSheetURL() const { return m_styleSheetURL; }
+ const OString& getStyleSheetText() const { return m_styleSheetText; }
+
const ::std::map<const char*, OString>&
getParameters() const { return m_parameters; }
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 17594207234f..0db0c3464610 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -95,17 +95,14 @@ sal_uInt8 FormulaToken::GetParamCount() const
return 0; // parameters and specials
// ocIf... jump commands not for FAP, have cByte then
//2do: bool parameter whether FAP or not?
- else if ( GetByte() )
+ else if (GetByte())
return GetByte(); // all functions, also ocExternal and ocMacro
- else if (SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_BIN_OP)
- return 2; // binary
- else if ((SC_OPCODE_START_UN_OP <= eOp && eOp < SC_OPCODE_STOP_UN_OP)
- || eOp == ocPercentSign)
- return 1; // unary
+ else if (SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_BIN_OP && eOp != ocAnd && eOp != ocOr)
+ return 2; // binary operators, compiler checked; OR and AND legacy but are functions
+ else if ((SC_OPCODE_START_UN_OP <= eOp && eOp < SC_OPCODE_STOP_UN_OP) || eOp == ocPercentSign)
+ return 1; // unary operators, compiler checked
else if (SC_OPCODE_START_NO_PAR <= eOp && eOp < SC_OPCODE_STOP_NO_PAR)
return 0; // no parameter
- else if (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR)
- return 1; // one parameter
else if (FormulaCompiler::IsOpCodeJumpCommand( eOp ))
return 1; // only the condition counts as parameter
else
diff --git a/fpicker/source/office/fileview.cxx b/fpicker/source/office/fileview.cxx
index 5b65eb1295cf..64dee0ee6239 100644
--- a/fpicker/source/office/fileview.cxx
+++ b/fpicker/source/office/fileview.cxx
@@ -636,16 +636,20 @@ void ViewTabListBox_Impl::DeleteEntries()
eResult = aDlg.run();
}
- if ( ( eResult == svtools::QUERYDELETE_ALL ) ||
- ( eResult == svtools::QUERYDELETE_YES ) )
+ bool bDeleted = false;
+
+ if (eResult == svtools::QUERYDELETE_ALL || eResult == svtools::QUERYDELETE_YES)
{
if ( Kill( aURL ) )
{
- delete reinterpret_cast<SvtContentEntry*>(mxTreeView->get_id(rCurEntry).toInt64());
mpParent->EntryRemoved( aURL );
+ bDeleted = true;
}
}
+ if (!bDeleted)
+ mxTreeView->unselect(rCurEntry);
+
return false;
});
diff --git a/fpicker/source/win32/asyncrequests.cxx b/fpicker/source/win32/asyncrequests.cxx
index 86b71cf51540..bfecc42125a3 100644
--- a/fpicker/source/win32/asyncrequests.cxx
+++ b/fpicker/source/win32/asyncrequests.cxx
@@ -50,7 +50,7 @@ void Request::wait( ::sal_Int32 nMilliSeconds )
void Request::waitProcessMessages()
{
SolarMutexGuard aGuard;
- while ( !m_aJoiner.check() )
+ while ( !m_aJoiner.check() && !Application::IsQuit())
Application::Yield();
}
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index a50cc4b401af..2055d45919e6 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -245,6 +245,10 @@ void SAL_CALL TitleHelper::disposing(const css::lang::EventObject& aEvent)
if ( ! xOwner.is ())
return;
+ css::uno::Reference< css::frame::XFrame > xFrame(xOwner, css::uno::UNO_QUERY);
+ if (xFrame.is())
+ xFrame->removeFrameActionListener(this);
+
if (xOwner != aEvent.Source)
return;
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index aad137074d98..08e33ac527ef 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -136,6 +136,10 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
void SAL_CALL PersistentWindowState::disposing(const css::lang::EventObject&)
{
+ css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
+ if (xFrame.is())
+ xFrame->removeFrameActionListener(this);
+
// nothing todo here - because we hold the frame as weak reference only
}
diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx
index 25d67694c5df..12ea12b79476 100644
--- a/framework/source/helper/statusindicator.cxx
+++ b/framework/source/helper/statusindicator.cxx
@@ -41,7 +41,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText ,
m_nRange = nRange;
m_nLastCallbackPercent = -1;
- comphelper::LibreOfficeKit::statusIndicatorStart();
+ comphelper::LibreOfficeKit::statusIndicatorStart(sText);
}
#if !defined(IOS) && !defined(ANDROID)
css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx
index 3c40842dd6fa..7a72929763c5 100644
--- a/framework/source/helper/tagwindowasmodified.cxx
+++ b/framework/source/helper/tagwindowasmodified.cxx
@@ -128,6 +128,9 @@ void SAL_CALL TagWindowAsModified::disposing(const css::lang::EventObject& aEven
SolarMutexGuard g;
css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
+ if (xFrame.is())
+ xFrame->addFrameActionListener(this);
+
if (
(xFrame.is () ) &&
(aEvent.Source == xFrame)
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index ff2d99c1e24a..601e0db44e0a 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -111,6 +111,10 @@ void SAL_CALL TitleBarUpdate::titleChanged(const css::frame::TitleChangedEvent&
void SAL_CALL TitleBarUpdate::disposing(const css::lang::EventObject&)
{
+ css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY);
+ if (xFrame.is())
+ xFrame->removeFrameActionListener(this);
+
// nothing todo here - because we hold the frame as weak reference only
}
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 3d04e17a23c2..dea965f01409 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -413,7 +413,7 @@ bool LoadEnv::waitWhileLoading(sal_uInt32 nTimeout)
// in an intelligent manner :-)
sal_Int32 nTime = nTimeout;
- while(true)
+ while(!Application::IsQuit())
{
// SAFE -> ------------------------------
{
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx
index a657efd3cc88..aa35a1511b48 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/frame/ControlCommand.hpp>
#include <svtools/toolboxcontroller.hxx>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/svapp.hxx>
#include <vcl/mnemonic.hxx>
#include <vcl/toolbox.hxx>
@@ -151,7 +152,12 @@ void SAL_CALL GenericToolbarController::execute( sal_Int16 KeyModifier )
aArgs[0].Name = "KeyModifier";
aArgs[0].Value <<= KeyModifier;
- aTargetURL.Complete = aCommandURL;
+ // handle also command aliases
+ auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(m_aCommandURL,
+ vcl::CommandInfoProvider::GetModuleIdentifier(m_xFrame));
+ OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties);
+
+ aTargetURL.Complete = sRealCommand.isEmpty() ? aCommandURL : sRealCommand;
if ( m_xUrlTransformer.is() )
m_xUrlTransformer->parseStrict( aTargetURL );
diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx
index 0594bfea8ddf..896c4d10cdc3 100644
--- a/framework/source/uielement/resourcemenucontroller.cxx
+++ b/framework/source/uielement/resourcemenucontroller.cxx
@@ -298,6 +298,9 @@ void ResourceMenuController::disposing( const css::lang::EventObject& rEvent )
{
if ( m_xMenuBarManager.is() )
{
+ if (m_xFrame.is())
+ m_xFrame->removeFrameActionListener( m_xMenuBarManager.get() );
+
m_xMenuBarManager->dispose();
m_xMenuBarManager.clear();
}
@@ -320,6 +323,9 @@ void ResourceMenuController::disposing()
m_xMenuContainer.clear();
if ( m_xMenuBarManager.is() )
{
+ if (m_xFrame.is())
+ m_xFrame->removeFrameActionListener( m_xMenuBarManager.get() );
+
m_xMenuBarManager->dispose();
m_xMenuBarManager.clear();
}
diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h
index 60bd74f80f80..8d046b0e4a2d 100644
--- a/hwpfilter/source/drawing.h
+++ b/hwpfilter/source/drawing.h
@@ -316,7 +316,7 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info)
return hmem->skipBlock(size - common_size ) != 0;
}
-static std::unique_ptr<HWPDrawingObject> LoadDrawingObject(void)
+static std::unique_ptr<HWPDrawingObject> LoadDrawingObject(HWPFile& hwpf)
{
HWPDrawingObject *prev = nullptr;
std::unique_ptr<HWPDrawingObject> hdo, head;
@@ -355,7 +355,7 @@ static std::unique_ptr<HWPDrawingObject> LoadDrawingObject(void)
}
if (link_info & HDOFILE_HAS_CHILD)
{
- hdo->child = LoadDrawingObject();
+ hdo->child = LoadDrawingObject(hwpf);
if (hdo->child == nullptr)
{
goto error;
@@ -384,6 +384,11 @@ error:
{
hdo->type = HWPDO_RECT;
}
+ if (hdo->property.pPara)
+ {
+ hwpf.move_to_failed(std::unique_ptr<HWPPara>(hdo->property.pPara));
+ hdo->property.pPara = nullptr;
+ }
HWPDOFunc(hdo.get(), OBJFUNC_FREE, nullptr, 0);
hdo.reset();
@@ -397,7 +402,7 @@ error:
}
-static bool LoadDrawingObjectBlock(Picture * pic)
+static bool LoadDrawingObjectBlock(Picture * pic, HWPFile& hwpf)
{
int size;
if (!hmem->read4b(size))
@@ -423,7 +428,7 @@ static bool LoadDrawingObjectBlock(Picture * pic)
!hmem->skipBlock(size - HDOFILE_HEADER_SIZE))
return false;
- pic->picinfo.picdraw.hdo = LoadDrawingObject().release();
+ pic->picinfo.picdraw.hdo = LoadDrawingObject(hwpf).release();
if (pic->picinfo.picdraw.hdo == nullptr)
return false;
return true;
diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx
index fda36e0953ca..28bc97212fba 100644
--- a/hwpfilter/source/hcode.cxx
+++ b/hwpfilter/source/hcode.cxx
@@ -1217,6 +1217,8 @@ hchar_string kstr2hstr(uchar const* src)
{
ret.push_back(src[i] << 8 | src[i+1]);
i++;
+ if (src[i] == '\0')
+ break;
}
}
return ret;
diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx
index 0c011731c1d4..359c15ae78bc 100644
--- a/hwpfilter/source/htags.cxx
+++ b/hwpfilter/source/htags.cxx
@@ -19,6 +19,9 @@
#include "precompile.h"
+#include <o3tl/char16_t2wchar_t.hxx>
+#include <unotools/tempfile.hxx>
+
#include <string.h>
#include "hwplib.h"
@@ -108,27 +111,20 @@ void OlePicture::Read(HWPFile & hwpf)
delete [] data;
return;
}
- FILE *fp;
- char tname[200];
- wchar_t wtname[200];
- tmpnam(tname);
- if (nullptr == (fp = fopen(tname, "wb")))
- {
- delete [] data;
- return;
- }
- fwrite(data, size, 1, fp);
+
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+
+ SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE);
+ aOutputStream.WriteBytes(data, size);
delete [] data;
- fclose(fp);
- MultiByteToWideChar(CP_ACP, 0, tname, -1, wtname, 200);
- if( StgOpenStorage(wtname, nullptr,
+ aOutputStream.Close();
+ if( StgOpenStorage(o3tl::toW(aTempFile.GetFileName().getStr()), nullptr,
STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STGM_TRANSACTED,
nullptr, 0, &pis) != S_OK ) {
pis = nullptr;
- unlink(tname);
return;
}
- unlink(tname);
#else
hwpf.SkipBlock(size);
#endif
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index a97c39cc8eb6..a1303a8ee256 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -241,6 +241,7 @@ void HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
aplist.push_back(spNode.release());
spNode.reset( new HWPPara );
}
+ move_to_failed(std::move(spNode));
}
void HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsigned char flag)
@@ -274,6 +275,12 @@ void HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsi
aplist.push_back(std::move(spNode));
spNode.reset( new HWPPara );
}
+ move_to_failed(std::move(spNode));
+}
+
+void HWPFile::move_to_failed(std::unique_ptr<HWPPara> xPara)
+{
+ pfailedlist.push_back(std::move(xPara));
}
void HWPFile::TagsRead()
diff --git a/hwpfilter/source/hwpfile.h b/hwpfilter/source/hwpfile.h
index 768086193523..e20d6b9c48ca 100644
--- a/hwpfilter/source/hwpfile.h
+++ b/hwpfilter/source/hwpfile.h
@@ -257,6 +257,8 @@ class DLLEXPORT HWPFile
}
void pop_hpara_type() { element_import_stack.pop_back(); }
+ void move_to_failed(std::unique_ptr<HWPPara> rPara);
+
private:
int compareCharShape(CharShape const *shape);
int compareParaShape(ParaShape const *shape);
@@ -284,6 +286,10 @@ class DLLEXPORT HWPFile
std::vector<std::unique_ptr<ColumnInfo>> columnlist;
// paragraph list
std::vector<std::unique_ptr<HWPPara>> plist;
+ // keep paragraph's that failed to load until
+ // import is complete to avoid dangling references
+ // elsewhere
+ std::vector<std::unique_ptr<HWPPara>> pfailedlist;
// floating box list
std::vector<FBox*> blist;
// embedded picture list(tag data)
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 12f29a38925e..f450a98a6e87 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -234,7 +234,6 @@ bool TxtBox::Read(HWPFile & hwpf)
hwpf.Read2b(&option, 1);
hwpf.Read2b(&ctrl_ch, 1);
hwpf.Read2b(style.margin, 12);
- hwpf.AddFBoxStyle(&style);
hwpf.Read2b(&box_xs, 1);
hwpf.Read2b(&box_ys, 1);
hwpf.Read2b(&cap_xs, 1);
@@ -362,7 +361,10 @@ bool TxtBox::Read(HWPFile & hwpf)
else
m_pTable = nullptr;
- return !hwpf.State();
+ bSuccess = !hwpf.State();
+ if (bSuccess)
+ hwpf.AddFBoxStyle(&style);
+ return bSuccess;
}
namespace
@@ -451,6 +453,7 @@ bool Picture::Read(HWPFile & hwpf)
scale[1] = tmp16;
hwpf.ReadBlock(picinfo.picun.path, 256); /* Picture File Name: when type is not a Drawing. */
+ picinfo.picun.path[255] = 0; // ensure null terminated
hwpf.ReadBlock(reserved3, 9); /* Brightness / Contrast / Picture Effect, etc. */
UpdateBBox(this);
@@ -490,7 +493,7 @@ bool Picture::Read(HWPFile & hwpf)
if (pictype == PICTYPE_DRAW)
{
auto xGuard(std::make_unique<ChangeMemGuard>(follow.data(), follow_block_size));
- LoadDrawingObjectBlock(this);
+ LoadDrawingObjectBlock(this, hwpf);
style.cell = picinfo.picdraw.hdo;
xGuard.reset();
}
@@ -509,12 +512,14 @@ bool Picture::Read(HWPFile & hwpf)
style.boxtype = 'G';
else
style.boxtype = 'D';
- hwpf.AddFBoxStyle(&style);
// caption
hwpf.ReadParaList(caption);
- return !hwpf.State();
+ bool bSuccess = !hwpf.State();
+ if (bSuccess)
+ hwpf.AddFBoxStyle(&style);
+ return bSuccess;
}
// line(15)
@@ -552,7 +557,6 @@ bool Line::Read(HWPFile & hwpf)
hwpf.Read2b(&option, 1);
hwpf.Read2b(&ctrl_ch, 1);
hwpf.Read2b(style.margin, 12);
- hwpf.AddFBoxStyle(&style);
hwpf.Read2b(&box_xs, 1);
hwpf.Read2b(&box_ys, 1);
hwpf.Read2b(&cap_xs, 1);
@@ -581,7 +585,10 @@ bool Line::Read(HWPFile & hwpf)
hwpf.Read2b(&color, 1);
style.xpos = width;
- return !hwpf.State();
+ bool bSuccess = !hwpf.State();
+ if (bSuccess)
+ hwpf.AddFBoxStyle(&style);
+ return bSuccess;
}
// hidden(15)
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 4144d20e0bde..12eb4960f97f 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -24,6 +24,7 @@
#include <math.h>
#include <osl/diagnose.h>
+#include <o3tl/safeint.hxx>
#include <tools/stream.hxx>
#include "fontmap.hxx"
@@ -70,7 +71,6 @@
rendEl("text:span"); \
tstart = false
-static hchar *field = nullptr;
static char buf[1024];
namespace
@@ -96,12 +96,13 @@ struct HwpReaderPrivate
bInHeader = false;
nPnPos = 0;
pPn = nullptr;
-
+ pField = nullptr;
}
bool bFirstPara;
bool bInBody;
bool bInHeader;
ShowPageNum *pPn;
+ hchar *pField;
int nPnPos;
};
@@ -460,7 +461,9 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
if( hdo->type == HWPDO_LINE || hdo->type == HWPDO_ARC || hdo->type == HWPDO_FREEFORM ||
hdo->type == HWPDO_ADVANCED_ARC )
{
- if( prop->line_tstyle && !ArrowShape[prop->line_tstyle].bMade )
+ if( prop->line_tstyle > 0 &&
+ o3tl::make_unsigned(prop->line_tstyle) < std::size(ArrowShape) &&
+ !ArrowShape[prop->line_tstyle].bMade )
{
ArrowShape[prop->line_tstyle].bMade = true;
padd("draw:name", sXML_CDATA,
@@ -484,7 +487,9 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
mxList->clear();
rendEl("draw:marker");
}
- if( prop->line_hstyle && !ArrowShape[prop->line_hstyle].bMade)
+ if (prop->line_hstyle > 0 &&
+ o3tl::make_unsigned(prop->line_hstyle) < std::size(ArrowShape) &&
+ !ArrowShape[prop->line_hstyle].bMade)
{
ArrowShape[prop->line_hstyle].bMade = true;
padd("draw:name", sXML_CDATA,
@@ -515,62 +520,28 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
if( prop->flag >> 18 & 0x01 )
{
padd( "draw:name", sXML_CDATA, ascii(Int2Str(hdo->index, "fillimage%d", buf)));
- if( !prop->pictype )
+
+ EmPicture *emp = nullptr;
+ if (prop->pictype && strlen(prop->szPatternFile) > 3)
+ emp = hwpfile.GetEmPictureByName(prop->szPatternFile);
+ if (!emp)
{
padd( "xlink:href", sXML_CDATA,
reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(prop->szPatternFile).c_str())).c_str())));
+ padd( "xlink:type", sXML_CDATA, "simple");
+ padd( "xlink:show", sXML_CDATA, "embed");
+ padd( "xlink:actuate", sXML_CDATA, "onLoad");
}
- else
- {
- EmPicture *emp = nullptr;
- if ( strlen( prop->szPatternFile ) > 3)
- emp = hwpfile.GetEmPictureByName(prop->szPatternFile);
- if( emp )
- {
- char filename[128+17+9];
- char dirname[128];
- int fd;
-#ifdef _WIN32
- GetTempPathA(sizeof(dirname), dirname);
- sprintf(filename, "%s%s",dirname, emp->name);
- if( (fd = open( filename , _O_CREAT | _O_WRONLY | _O_BINARY , 0666)) >= 0 )
-#else
- strcpy(dirname, "/tmp/");
- sprintf(filename, "%s%s", dirname, emp->name);
- if( (fd = open( filename , O_CREAT | O_WRONLY , 0666)) >= 0 )
-#endif
- {
- size_t nWritten = write(fd, emp->data.get(), emp->size);
- OSL_VERIFY(nWritten == emp->size);
- close(fd);
- }
-#ifdef _WIN32
- int j;
- for(j = 0 ; j < static_cast<int>(strlen( dirname )) ; j++)
- {
- if( dirname[j] == '\\' ) buf[j] = '/';
- else buf[j] = dirname[j];
- }
- buf[j] = '\0';
- sprintf(filename, "file:///%s%s",buf, emp->name );
-#else
- sprintf(filename, "file://%s%s",dirname, emp->name );
-#endif
- padd( "xlink:href", sXML_CDATA, ascii(filename));
- }
- else
- {
- padd( "xlink:href", sXML_CDATA,
- reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(prop->szPatternFile).c_str())).c_str())));
- }
-
- }
- padd( "xlink:type", sXML_CDATA, "simple");
- padd( "xlink:show", sXML_CDATA, "embed");
- padd( "xlink:actuate", sXML_CDATA, "onLoad");
rstartEl( "draw:fill-image", mxList.get());
mxList->clear();
+ if (emp)
+ {
+ rstartEl("office:binary-data", mxList.get());
+ std::shared_ptr<char> pStr(base64_encode_string(emp->data.get(), emp->size), Free<char>());
+ rchars(ascii(pStr.get()));
+ rendEl("office:binary-data");
+ }
rendEl( "draw:fill-image");
}
/* If there is a gradient, when a bitmap file is present, this is the first. */
@@ -2075,7 +2046,8 @@ void HwpReader::makeDrawStyle( HWPDrawingObject * hdo, FBoxStyle * fstyle)
hdo->type == HWPDO_FREEFORM || hdo->type == HWPDO_ADVANCED_ARC )
{
- if( hdo->property.line_tstyle > 0 )
+ if( hdo->property.line_tstyle > 0 &&
+ o3tl::make_unsigned(hdo->property.line_tstyle) < std::size(ArrowShape) )
{
padd("draw:marker-start", sXML_CDATA,
ascii(ArrowShape[hdo->property.line_tstyle].name) );
@@ -2096,7 +2068,8 @@ void HwpReader::makeDrawStyle( HWPDrawingObject * hdo, FBoxStyle * fstyle)
Double2Str( WTMM(hdo->property.line_width * 7)) + "mm");
}
- if( hdo->property.line_hstyle > 0 )
+ if( hdo->property.line_hstyle > 0 &&
+ o3tl::make_unsigned(hdo->property.line_hstyle) < std::size(ArrowShape) )
{
padd("draw:marker-end", sXML_CDATA,
ascii(ArrowShape[hdo->property.line_hstyle].name) );
@@ -2959,7 +2932,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
firstspace = 1;
if( hbox->type[0] == 4 && hbox->type[1] == 0 )
{
- field = hbox->str3.get();
+ d->pField = hbox->str3.get();
}
else{
makeFieldCode(str, hbox);
@@ -2972,7 +2945,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( hbox->type[0] == 4 && hbox->type[1] == 0 )
{
makeFieldCode(str, hbox);
- field = nullptr;
+ d->pField = nullptr;
}
infield = false;
str.clear();
@@ -3140,8 +3113,8 @@ void HwpReader::makeFieldCode(hchar_string const & rStr, FieldCode const *hbox)
if( hbox->type[0] == 4 && hbox->type[1] == 0 )
{
padd("text:placeholder-type", sXML_CDATA, "text");
- if( field )
- padd("text:description", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(field)));
+ if (d->pField)
+ padd("text:description", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(d->pField)));
rstartEl( "text:placeholder", mxList.get());
mxList->clear();
rchars( reinterpret_cast<sal_Unicode const *>(rStr.c_str()) );
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 2279260d0e90..364ff5cb0669 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -115,6 +115,9 @@ struct _LibreOfficeKitClass
void (*sendDialogEvent) (LibreOfficeKit* pThis,
unsigned long long int nLOKWindowId,
const char* pArguments);
+
+ /// @see lok::Office::setOption
+ void (*setOption) (LibreOfficeKit* pThis, const char* pOption, const char* pValue);
};
#define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
@@ -455,6 +458,11 @@ struct _LibreOfficeKitDocumentClass
void (*sendFormFieldEvent) (LibreOfficeKitDocument* pThis,
const char* pArguments);
+ /// @see lok::Document::setBlockedCommandList
+ void (*setBlockedCommandList) (LibreOfficeKitDocument* pThis,
+ int nViewId,
+ const char* bolckedCommandList);
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index ad2d887aa99a..6ead8a8d80d8 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -790,6 +790,11 @@ public:
mpDoc->pClass->sendFormFieldEvent(mpDoc, pArguments);
}
+ void setBlockedCommandList(int nViewId, const char* bolckedCommandList)
+ {
+ mpDoc->pClass->setBlockedCommandList(mpDoc, nViewId, bolckedCommandList);
+ }
+
#endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
};
@@ -993,6 +998,39 @@ public:
{
mpThis->pClass->sendDialogEvent(mpThis, nWindowId, pArguments);
}
+
+ /**
+ * Generic function to toggle and tweak various things in the core LO
+ *
+ * The currently available option names and their allowed values are:
+ *
+ * "profilezonerecording": "start" or "stop"
+ * Start or stop recording profile zone trace data in the process.
+ *
+ * "sallogoverride": "<string>"
+ * Override the SAL_LOG environment variable
+ *
+ * For the syntax of the string see the documentation for "Basic
+ * logging functionality" in LibreOffice internal API
+ * documentation (include/sal/log.hxx). If the logging selector
+ * has been set by this function to a non-empty value, that is used
+ * instead of the environment variable SAL_LOG.
+ *
+ * The parameter is not copied so you should pass a value that
+ * points to memory that will stay valid until you call setOption
+ * with this option name the next time.
+ *
+ * If you pass nullptr or an empty string as value, the
+ * environment variable SAL_LOG is again used as by default. You
+ * can switch back and forth as you like.
+ *
+ * @param pOption the option name
+ * @param pValue its value
+ */
+ void setOption(const char* pOption, const char* pValue)
+ {
+ mpThis->pClass->setOption(mpThis, pOption, pValue);
+ }
};
/// Factory method to create a lok::Office instance.
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 94e4b95c0631..2140c833624d 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -772,6 +772,17 @@ typedef enum
* The payload format is JSON: { "title": "title text", "content": "content text" }
*/
LOK_CALLBACK_VALIDITY_INPUT_HELP = 51,
+
+ /**
+ * This is currently Calc only. Indicates the document background
+ * color in the payload as a RGB hex string (RRGGBB).
+ */
+ LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR = 52,
+
+ /**
+ * When a user tries to use command which is restricted for that user
+ */
+ LOK_COMMAND_BLOCKED = 53,
}
LibreOfficeKitCallbackType;
@@ -904,6 +915,10 @@ static inline const char* lokCallbackTypeToString(int nType)
return "LOK_CALLBACK_FORM_FIELD_BUTTON";
case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
return "LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY";
+ case LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR:
+ return "LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR";
+ case LOK_COMMAND_BLOCKED:
+ return "LOK_COMMAND_BLOCKED";
}
assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index e9fb004511e5..257b59f38165 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -31,8 +31,9 @@ COMPHELPER_DLLPUBLIC void setActive(bool bActive = true);
enum class statusIndicatorCallbackType { Start, SetValue, Finish };
-COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data);
-
+COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(
+ void (*callback)(void* data, statusIndicatorCallbackType type, int percent, const char* pText),
+ void* data);
// Functions that can be called from arbitrary places in LibreOffice.
@@ -104,10 +105,11 @@ COMPHELPER_DLLPUBLIC bool isWhitelistedLanguage(const OUString& lang);
// Status indicator handling. Even if in theory there could be several status indicators active at
// the same time, in practice there is only one at a time, so we don't handle any identification of
// status indicator in this API.
-COMPHELPER_DLLPUBLIC void statusIndicatorStart();
+COMPHELPER_DLLPUBLIC void statusIndicatorStart(const OUString& sText);
COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent);
COMPHELPER_DLLPUBLIC void statusIndicatorFinish();
+COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char* bolckedCommandList);
}
}
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx
index 8cbc078f6621..ec2a5a41d34a 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -12,49 +12,75 @@
#include <sal/config.h>
-#include <atomic>
+#include <sal/log.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <comphelper/comphelperdllapi.h>
-#include <rtl/ustring.hxx>
+#include <comphelper/traceevent.hxx>
// implementation of XToolkitExperimental profiling API
namespace comphelper
{
-namespace ProfileRecording
+class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
{
+ long long m_nCreateTime;
+ int m_nNesting;
-COMPHELPER_DLLPUBLIC void startRecording(bool bRecording);
+ void addRecording();
-COMPHELPER_DLLPUBLIC long long addRecording(const char * aProfileId, long long aCreateTime);
+ static void setNestingLevel(int nNestingLevel);
+ static int getNestingLevel();
-COMPHELPER_DLLPUBLIC css::uno::Sequence<OUString> getRecordingAndClear();
+ ProfileZone(const char* sName, const OUString &sArgs)
+ : NamedEvent(sName, sArgs)
+ , m_nNesting(-1)
+ {
+ if (s_bRecording)
+ {
+ m_nCreateTime = getNow();
+
+ m_nNesting = getNestingLevel();
+ setNestingLevel(getNestingLevel() + 1);
+ }
+ else
+ m_nCreateTime = 0;
+ }
-} // namespace ProfileRecording
-
-class COMPHELPER_DLLPUBLIC ProfileZone
-{
-private:
- const char * m_sProfileId;
- long long const m_aCreateTime;
-public:
- static std::atomic<bool> g_bRecording; // true during recording
+ public:
// Note that the char pointer is stored as such in the ProfileZone object and used in the
// destructor, so be sure to pass a pointer that stays valid for the duration of the object's
// lifetime.
- ProfileZone(const char *sProfileId)
- : m_sProfileId(sProfileId),
- m_aCreateTime(g_bRecording ? ProfileRecording::addRecording(sProfileId, 0) : 0)
+ ProfileZone(const char* sName, const std::map<OUString, OUString> &aArgs)
+ : ProfileZone(sName, createArgsString(aArgs))
{
}
+
+ ProfileZone(const char* sName)
+ : ProfileZone(sName, OUString())
+ {
+ }
+
~ProfileZone()
{
- if (g_bRecording)
- ProfileRecording::addRecording(m_sProfileId, m_aCreateTime);
+ if (m_nCreateTime > 0)
+ {
+ setNestingLevel(getNestingLevel() - 1);
+
+ if (m_nNesting != getNestingLevel())
+ {
+ SAL_WARN("comphelper.traceevent", "Incorrect ProfileZone nesting for " << m_sName);
+ }
+ else
+ {
+ if (s_bRecording)
+ addRecording();
+ }
+ }
}
+
+ ProfileZone(const ProfileZone&) = delete;
+ void operator=(const ProfileZone&) = delete;
};
} // namespace comphelper
diff --git a/include/comphelper/traceevent.hxx b/include/comphelper/traceevent.hxx
new file mode 100644
index 000000000000..ec95f46bd62c
--- /dev/null
+++ b/include/comphelper/traceevent.hxx
@@ -0,0 +1,222 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#ifndef INCLUDED_COMPHELPER_TRACEEVENT_HXX
+#define INCLUDED_COMPHELPER_TRACEEVENT_HXX
+
+#include <sal/config.h>
+
+#include <algorithm>
+#include <atomic>
+#include <map>
+#include <memory>
+#include <vector>
+
+#include <osl/process.h>
+#include <osl/thread.h>
+#include <osl/time.h>
+#include <com/sun/star/uno/Sequence.h>
+#include <comphelper/comphelperdllapi.h>
+#include <rtl/ustrbuf.hxx>
+#include <rtl/ustring.hxx>
+
+// implementation of XToolkitExperimental profiling API
+
+namespace comphelper
+{
+class COMPHELPER_DLLPUBLIC TraceEvent
+{
+private:
+ static int getPid()
+ {
+ oslProcessInfo aProcessInfo;
+ aProcessInfo.Size = sizeof(oslProcessInfo);
+ if (osl_getProcessInfo(nullptr, osl_Process_IDENTIFIER, &aProcessInfo)
+ == osl_Process_E_None)
+ return aProcessInfo.Ident;
+ return -1;
+ }
+
+ static std::size_t s_nBufferSize;
+ static void (*s_pBufferFullCallback)();
+
+protected:
+ static std::atomic<bool> s_bRecording; // true during recording
+
+ static void addRecording(const OUString& sObject);
+
+ static long long getNow()
+ {
+ TimeValue systemTime;
+ osl_getSystemTime(&systemTime);
+ return static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec / 1000;
+ }
+
+ static OUString createArgsString(const std::map<OUString, OUString>& args)
+ {
+ if (args.size() == 0)
+ return "";
+
+ OUStringBuffer sResult;
+ sResult.append(",\"args\":{");
+ bool first = true;
+ for (auto i : args)
+ {
+ if (!first)
+ sResult.append(',');
+ sResult.append('"');
+ sResult.append(i.first);
+ sResult.append("\":\"");
+ sResult.append(i.second);
+ sResult.append('"');
+ first = false;
+ }
+ sResult.append('}');
+
+ return sResult.makeStringAndClear();
+ }
+
+ const int m_nPid;
+ const OUString m_sArgs;
+
+ TraceEvent(const OUString& sArgs)
+ : m_nPid(getPid())
+ , m_sArgs(sArgs)
+ {
+ }
+
+ TraceEvent(std::map<OUString, OUString> args)
+ : TraceEvent(createArgsString(args))
+ {
+ }
+
+public:
+ static void addInstantEvent(const char* sName, const std::map<OUString, OUString>& args
+ = std::map<OUString, OUString>());
+
+ static void startRecording();
+ static void stopRecording();
+ static void setBufferSizeAndCallback(std::size_t bufferSize, void (*bufferFullCallback)());
+
+ static std::vector<OUString> getEventVectorAndClear();
+
+ static css::uno::Sequence<OUString> getRecordingAndClear();
+};
+
+class COMPHELPER_DLLPUBLIC NamedEvent : public TraceEvent
+{
+protected:
+ const char* m_sName;
+
+ NamedEvent(const char* sName, const OUString& sArgs)
+ : TraceEvent(sArgs)
+ , m_sName(sName ? sName : "(null)")
+ {
+ }
+
+ NamedEvent(const char* sName, const std::map<OUString, OUString>& aArgs)
+ : TraceEvent(aArgs)
+ , m_sName(sName ? sName : "(null)")
+ {
+ }
+};
+
+// An AsyncEvent generates an 'S' (start) event when constructed and a 'F' (finish) event when it
+// is destructed.
+
+// The Trace Event specification claims that these event types are deprecated and replaces by
+// nestable 'b' (begin) and 'e' (end) events, but Chrome does not seem to support those.
+
+// To generate a pair of 'S' and 'F' events, create an AsyncEvent object using the AsyncEvent(const
+// char* sName) constructor when you want the 'S' event to be generated, and destroy it when you
+// want the corresponding 'F' event to be generated.
+
+class COMPHELPER_DLLPUBLIC AsyncEvent : public NamedEvent,
+ public std::enable_shared_from_this<AsyncEvent>
+{
+ static int s_nIdCounter;
+ int m_nId;
+ bool m_bBeginRecorded;
+
+ AsyncEvent(const char* sName, int nId, const std::map<OUString, OUString>& args)
+ : NamedEvent(sName, args)
+ , m_nId(nId)
+ , m_bBeginRecorded(false)
+ {
+ if (s_bRecording)
+ {
+ long long nNow = getNow();
+
+ // Generate a "Start" (type S) event
+ TraceEvent::addRecording("{"
+ "\"name\":\""
+ + OUString(m_sName, strlen(m_sName), RTL_TEXTENCODING_UTF8)
+ + "\","
+ "\"ph\":\"S\""
+ ","
+ "\"id\":"
+ + OUString::number(m_nId) + m_sArgs
+ + ","
+ "\"ts\":"
+ + OUString::number(nNow)
+ + ","
+ "\"pid\":"
+ + OUString::number(m_nPid)
+ + ","
+ "\"tid\":"
+ + OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
+ m_bBeginRecorded = true;
+ }
+ }
+
+ void generateEnd()
+ {
+ if (m_bBeginRecorded)
+ {
+ m_bBeginRecorded = false;
+
+ long long nNow = getNow();
+ // Generate a "Finish" (type F) event
+ TraceEvent::addRecording("{"
+ "\"name\":\""
+ + OUString(m_sName, strlen(m_sName), RTL_TEXTENCODING_UTF8)
+ + "\","
+ "\"ph\":\"F\""
+ ","
+ "\"id\":"
+ + OUString::number(m_nId) + m_sArgs
+ + ","
+ "\"ts\":"
+ + OUString::number(nNow)
+ + ","
+ "\"pid\":"
+ + OUString::number(m_nPid)
+ + ","
+ "\"tid\":"
+ + OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
+ }
+ }
+
+public:
+ AsyncEvent(const char* sName,
+ const std::map<OUString, OUString>& args = std::map<OUString, OUString>())
+ : AsyncEvent(sName, s_nIdCounter++, args)
+ {
+ }
+
+ ~AsyncEvent() { generateEnd(); }
+
+ void finish() { generateEnd(); }
+};
+
+} // namespace comphelper
+
+#endif // INCLUDED_COMPHELPER_TRACEEVENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index e1bf9e0c0a5d..b9fcd4c228bd 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -61,17 +61,37 @@ public:
};
// XXX: to be moved in a separate header.
-class EDITENG_DLLPUBLIC SvxBackgroundColorItem final : public SvxColorItem
+class EDITENG_DLLPUBLIC SvxBackgroundColorItem final : public SfxPoolItem
{
- public:
- static SfxPoolItem* CreateDefault();
+private:
+ Color mColor;
+
+public:
+ static SfxPoolItem* CreateDefault();
+
+ SvxBackgroundColorItem(const sal_uInt16 nId);
+ SvxBackgroundColorItem(const Color& rCol, const sal_uInt16 nId);
+ virtual ~SvxBackgroundColorItem() override;
+
+ virtual bool operator==(const SfxPoolItem& rPoolItem) const override;
+ virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
+ virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
+
+ virtual bool GetPresentation(SfxItemPresentation ePres,
+ MapUnit eCoreMetric, MapUnit ePresMetric,
+ OUString &rText, const IntlWrapper& rIntlWrapper) const override;
- SvxBackgroundColorItem(const sal_uInt16 nId);
- SvxBackgroundColorItem(const Color& rCol, const sal_uInt16 nId);
+ virtual SvxBackgroundColorItem* Clone(SfxItemPool* pPool = nullptr) const override;
+ SvxBackgroundColorItem(SvxBackgroundColorItem const &) = default; // SfxPoolItem copy function dichotomy
- virtual SfxPoolItem* Clone(SfxItemPool* pPool = nullptr) const override;
- virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
- virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
+ const Color& GetValue() const
+ {
+ return mColor;
+ }
+
+ void SetValue(const Color& rNewColor);
+
+ void dumpAsXml(xmlTextWriterPtr pWriter) const override;
};
#endif
diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx
index 5a1bf293152c..1b111a252748 100644
--- a/include/filter/msfilter/escherex.hxx
+++ b/include/filter/msfilter/escherex.hxx
@@ -1159,8 +1159,8 @@ public:
// ...Sdr... implemented in eschesdo.cxx
- void AddSdrPage( const SdrPage& rPage );
- void AddUnoShapes( const css::uno::Reference< css::drawing::XShapes >& rxShapes );
+ void AddSdrPage( const SdrPage& rPage, bool ooxmlExport = false );
+ void AddUnoShapes( const css::uno::Reference< css::drawing::XShapes >& rxShapes, bool ooxmlExport = false );
/// returns the ShapeID
sal_uInt32 AddSdrObject( const SdrObject& rObj, bool ooxmlExport = false );
diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index e822fde0294c..19d037dbdc38 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -14,6 +14,7 @@
#include <cassert>
#include <list>
#include <unordered_map>
+#include <cstddef>
namespace o3tl
{
@@ -48,7 +49,7 @@ private:
list_t mLruList;
map_t mLruMap;
- const size_t mMaxSize;
+ size_t mMaxSize;
void checkLRU()
{
@@ -78,6 +79,13 @@ public:
aLruListTemp.swap(mLruList);
}
+ void setMaxSize(size_t nMaxSize)
+ {
+ mMaxSize = nMaxSize ? nMaxSize : std::min(mLruMap.max_size(), mLruList.max_size());
+ while (mLruMap.size() > mMaxSize)
+ checkLRU();
+ }
+
void insert(key_value_pair_t& rPair)
{
map_iterator_t i = mLruMap.find(rPair.first);
diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx
index ae28ca4b6570..6d8d1304fdf3 100644
--- a/include/o3tl/safeint.hxx
+++ b/include/o3tl/safeint.hxx
@@ -12,6 +12,7 @@
#include <sal/config.h>
+#include <cassert>
#include <limits>
#include <type_traits>
@@ -226,6 +227,13 @@ template<typename T> inline typename std::enable_if<std::is_unsigned<T>::value,
#endif
+template<typename T> constexpr std::enable_if_t<std::is_signed_v<T>, std::make_unsigned_t<T>>
+make_unsigned(T value)
+{
+ assert(value >= 0);
+ return value;
+}
+
}
#endif
diff --git a/include/oox/core/contexthandler2.hxx b/include/oox/core/contexthandler2.hxx
index 678aed1380c2..279459075980 100644
--- a/include/oox/core/contexthandler2.hxx
+++ b/include/oox/core/contexthandler2.hxx
@@ -73,7 +73,7 @@ struct ElementInfo;
class OOX_DLLPUBLIC ContextHandler2Helper
{
public:
- explicit ContextHandler2Helper( bool bEnableTrimSpace );
+ explicit ContextHandler2Helper( bool bEnableTrimSpace, XmlFilterBase& rFilter );
explicit ContextHandler2Helper( const ContextHandler2Helper& rParent );
virtual ~ContextHandler2Helper();
@@ -202,6 +202,21 @@ protected:
/** Must be called from endRecord() in derived classes. */
void implEndRecord( sal_Int32 nRecId );
+ bool prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ XmlFilterBase& getDocFilter() const { return mrFilter; }
+
+ enum class MCE_STATE
+ {
+ Started,
+ FoundChoice
+ };
+
+ MCE_STATE getMCEState() const { return aMceState.back(); }
+ void setMCEState( MCE_STATE aState ) { aMceState.back() = aState; }
+ void addMCEState( MCE_STATE aState ) { aMceState.push_back( aState ); }
+ void removeMCEState() { aMceState.pop_back(); }
+ bool isMCEStateEmpty() { return aMceState.empty(); }
+
private:
ContextHandler2Helper& operator=( const ContextHandler2Helper& ) = delete;
@@ -215,9 +230,11 @@ private:
ContextStackRef mxContextStack; ///< Stack of all processed elements.
size_t const mnRootStackSize; ///< Stack size on construction time.
+ std::vector<MCE_STATE> aMceState;
protected:
bool mbEnableTrimSpace; ///< True = trim whitespace in characters().
+ XmlFilterBase& mrFilter;
};
class OOX_DLLPUBLIC ContextHandler2 : public ContextHandler, public ContextHandler2Helper
diff --git a/include/oox/core/fragmenthandler2.hxx b/include/oox/core/fragmenthandler2.hxx
index 7c64c200041d..162ec8565fdb 100644
--- a/include/oox/core/fragmenthandler2.hxx
+++ b/include/oox/core/fragmenthandler2.hxx
@@ -48,17 +48,6 @@ class XmlFilterBase;
class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public ContextHandler2Helper
{
-protected:
- enum class MCE_STATE
- {
- Started,
- FoundChoice
- };
- ::std::vector<MCE_STATE> aMceState;
-
- bool prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs );
-
-
public:
explicit FragmentHandler2(
XmlFilterBase& rFilter,
diff --git a/include/oox/drawingml/graphicshapecontext.hxx b/include/oox/drawingml/graphicshapecontext.hxx
index 14b49f23615c..c27a8e6cfa8d 100644
--- a/include/oox/drawingml/graphicshapecontext.hxx
+++ b/include/oox/drawingml/graphicshapecontext.hxx
@@ -62,6 +62,7 @@ public:
OleObjectGraphicDataContext( ::oox::core::ContextHandler2Helper const & rParent, const ShapePtr& pShapePtr );
virtual ~OleObjectGraphicDataContext() override;
virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override;
+ virtual void onEndElement() override;
private:
::oox::vml::OleObjectInfo& mrOleObjectInfo;
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 5b6fd21ce00d..37e2fe433a3f 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -178,6 +178,7 @@ public:
ShapeStyleRefMap& getShapeStyleRefs() { return maShapeStyleRefs; }
const ShapeStyleRefMap& getShapeStyleRefs() const { return maShapeStyleRefs; }
const ShapeStyleRef* getShapeStyleRef( sal_Int32 nRefType ) const;
+ bool hasShapeStyleRefs() const { return !maShapeStyleRefs.empty(); }
// addShape is creating and inserting the corresponding XShape.
void addShape(
diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx
index fb7b7877138c..f67af98f9369 100644
--- a/include/oox/export/drawingml.hxx
+++ b/include/oox/export/drawingml.hxx
@@ -45,6 +45,8 @@
class Graphic;
class SdrObjCustomShape;
+enum class SvxDateFormat;
+enum class SvxTimeFormat;
namespace com { namespace sun { namespace star {
namespace awt {
@@ -156,6 +158,22 @@ protected:
const css::uno::Reference< css::beans::XPropertyState >& rXPropState,
const OUString& aName, css::beans::PropertyState& eState );
OUString GetFieldValue( const css::uno::Reference< css::text::XTextRange >& rRun, bool& bIsURLField );
+ /** Gets OOXML datetime field type from LO Date format
+
+ @param eDate LO Date format
+ */
+ static OUString GetDatetimeTypeFromDate(SvxDateFormat eDate);
+ /** Gets OOXML datetime field type from LO Time format
+
+ @param eTime LO Time format
+ */
+ static OUString GetDatetimeTypeFromTime(SvxTimeFormat eTime);
+ /** Gets OOXML datetime field type from combination of LO Time and Date formats
+
+ @param eDate LO Date format
+ @param eTime LO Time format
+ */
+ static OUString GetDatetimeTypeFromDateTime(SvxDateFormat eDate, SvxTimeFormat eTime);
/// Output the media (including copying a video from vnd.sun.star.Package: to the output if necessary).
void WriteMediaNonVisualProperties(const css::uno::Reference<css::drawing::XShape>& xShape);
@@ -241,10 +259,19 @@ public:
void WriteTransformation(const tools::Rectangle& rRectangle,
sal_Int32 nXmlNamespace, bool bFlipH = false, bool bFlipV = false, sal_Int32 nRotation = 0, bool bIsGroupShape = false);
- void WriteText( const css::uno::Reference< css::uno::XInterface >& rXIface, const OUString& presetWarp, bool bBodyPr, bool bText = true, sal_Int32 nXmlNamespace = 0);
+ void WriteText( const css::uno::Reference< css::uno::XInterface >& rXIface, const OUString& presetWarp, bool bBodyPr, bool bText = true, sal_Int32 nXmlNamespace = 0, bool bWritePropertiesAsLstStyles = false);
+
+ /** Populates the lstStyle with the shape's text run and paragraph properties */
+ void WriteLstStyles(const css::uno::Reference<css::text::XTextContent>& rParagraph,
+ bool& rbOverridingCharHeight, sal_Int32& rnCharHeight,
+ const css::uno::Reference<css::beans::XPropertySet>& rXShapePropSet);
void WriteParagraph( const css::uno::Reference< css::text::XTextContent >& rParagraph,
bool& rbOverridingCharHeight, sal_Int32& rnCharHeight );
- void WriteParagraphProperties(const css::uno::Reference< css::text::XTextContent >& rParagraph, float fFirstCharHeight);
+ /** Writes paragraph properties
+
+ @returns true if any paragraph properties were written
+ */
+ bool WriteParagraphProperties(const css::uno::Reference< css::text::XTextContent >& rParagraph, float fFirstCharHeight, const sal_Int32 nElement = XML_pPr );
void WriteParagraphNumbering(const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, float fFirstCharHeight,
sal_Int16 nLevel );
void WriteParagraphTabStops(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet);
@@ -270,7 +297,11 @@ public:
void WriteShapeStyle( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet );
void WriteShapeEffects( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet );
void WriteShapeEffect( const OUString& sName, const css::uno::Sequence< css::beans::PropertyValue >& aEffectProps );
- void WriteShape3DEffects( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet );
+ /** Populates scene3d tag
+ @param rXPropSet Prop set
+ @param bIsText True if the 3D effects are for a text body, false if it is for a shape
+ */
+ void Write3DEffects(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet, bool bIsText);
void WriteArtisticEffect( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet );
OString WriteWdpPicture( const OUString& rFileId, const css::uno::Sequence< sal_Int8 >& rPictureData );
void WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rXShape, int nDiagramId);
diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx
index a8ea2d5c6005..aae207ff1464 100644
--- a/include/oox/export/shapes.hxx
+++ b/include/oox/export/shapes.hxx
@@ -179,7 +179,7 @@ public:
* @return <tt>*this</tt>
*/
ShapeExport& WriteShape( const css::uno::Reference< css::drawing::XShape >& xShape );
- ShapeExport& WriteTextBox( const css::uno::Reference< css::uno::XInterface >& xIface, sal_Int32 nXmlNamespace );
+ ShapeExport& WriteTextBox( const css::uno::Reference< css::uno::XInterface >& xIface, sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles = false );
virtual ShapeExport&
WriteTextShape( const css::uno::Reference< css::drawing::XShape >& xShape );
ShapeExport&
diff --git a/include/oox/ole/oleobjecthelper.hxx b/include/oox/ole/oleobjecthelper.hxx
index 604785f305b6..a133bd650443 100644
--- a/include/oox/ole/oleobjecthelper.hxx
+++ b/include/oox/ole/oleobjecthelper.hxx
@@ -48,6 +48,7 @@ struct OOX_DLLPUBLIC OleObjectInfo
bool mbLinked; ///< True = linked OLE object, false = embedded OLE object.
bool mbShowAsIcon; ///< True = show as icon, false = show contents.
bool mbAutoUpdate;
+ bool mbHasPicture; ///<Ole object requires a picture element according to spec.>
explicit OleObjectInfo();
};
diff --git a/include/oox/ppt/pptshape.hxx b/include/oox/ppt/pptshape.hxx
index c5d9e7be5548..71af3a08e291 100644
--- a/include/oox/ppt/pptshape.hxx
+++ b/include/oox/ppt/pptshape.hxx
@@ -51,6 +51,10 @@ class PPTShape final : public oox::drawingml::Shape
bool mbReferenced; // placeholdershapes on Layout are displayed only, if they are not referenced
// placeholdershapes on Slide are displayed always
oox::drawingml::ShapePtr mpPlaceholder;
+ /// Set if spPr tag is non empty for the shape
+ bool mbHasNoninheritedShapeProperties;
+
+ bool IsPlaceHolderCandidate(const SlidePersist& rSlidePersist) const;
public:
@@ -74,6 +78,11 @@ public:
void setPlaceholder( oox::drawingml::ShapePtr pPlaceholder ) { mpPlaceholder = pPlaceholder; }
void setModelId( const OUString& rId ) { msModelId = rId; }
+ /// Flags shape as having a non-empty spPr tag
+ void setHasNoninheritedShapeProperties() { mbHasNoninheritedShapeProperties = true; }
+ /// Returns whether or not the shape had a non-empty spPr tag
+ bool hasNonInheritedShapeProperties() const { return mbHasNoninheritedShapeProperties; }
+
static oox::drawingml::ShapePtr findPlaceholder( const sal_Int32 nFirstSubType,
const sal_Int32 nSecondSubType, const OptValue< sal_Int32 >& oSubTypeIndex,
std::vector< oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly = false );
diff --git a/include/oox/token/relationship.hxx b/include/oox/token/relationship.hxx
index adc25f4a73b6..40253558c799 100644
--- a/include/oox/token/relationship.hxx
+++ b/include/oox/token/relationship.hxx
@@ -22,6 +22,7 @@ enum class Relationship
CHART,
COMMENTS,
COMMENTAUTHORS,
+ COMMENTSEXTENDED,
CONTROL,
CTRLPROP,
CUSTOMXML,
diff --git a/include/oox/vml/vmlshape.hxx b/include/oox/vml/vmlshape.hxx
index 2b3677df106d..1e9f000a41e8 100644
--- a/include/oox/vml/vmlshape.hxx
+++ b/include/oox/vml/vmlshape.hxx
@@ -114,6 +114,12 @@ struct OOX_DLLPUBLIC ShapeTypeModel
OptValue<OUString> moCropTop; ///< Specifies how much to crop the image from the top down as a fraction of picture size.
OUString maLayoutFlowAlt; ///< Specifies the alternate layout flow for text in textboxes.
+ /// An adjustment for the intensity of all colors, i.e. contrast, on a 0..0x10000 scale.
+ sal_Int32 mnGain = 0x10000;
+
+ /// The image brightness, on a 0..0x10000 scale.
+ sal_Int16 mnBlacklevel = 0;
+
explicit ShapeTypeModel();
void assignUsed( const ShapeTypeModel& rSource );
diff --git a/include/rtl/xmlencode.hxx b/include/rtl/xmlencode.hxx
new file mode 100644
index 000000000000..487c4ee94749
--- /dev/null
+++ b/include/rtl/xmlencode.hxx
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_RTL_XMLENCODE_HXX
+#define INCLUDED_RTL_XMLENCODE_HXX
+
+#include "rtl/ustring.hxx"
+
+namespace rtl
+{
+inline OUString encodeForXml(std::u16string_view rStr)
+{
+ // encode conforming xml:
+ sal_Int32 len = rStr.length();
+ OUStringBuffer buf;
+ for (sal_Int32 pos = 0; pos < len; ++pos)
+ {
+ sal_Unicode c = rStr[pos];
+ switch (c)
+ {
+ case '<':
+ buf.append("&lt;");
+ break;
+ case '>':
+ buf.append("&gt;");
+ break;
+ case '&':
+ buf.append("&amp;");
+ break;
+ case '\'':
+ buf.append("&apos;");
+ break;
+ case '\"':
+ buf.append("&quot;");
+ break;
+ default:
+ buf.append(c);
+ break;
+ }
+ }
+
+ return buf.makeStringAndClear();
+}
+
+} /* Namespace */
+
+#endif // INCLUDED_RTL_XMLENCODE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 517008da6983..a6cc5ab8e9db 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -100,6 +100,7 @@ certain functionality.
@li @c comphelper.container - EmbeddedObjectContainer
@li @c comphelper.crypto
@li @c comphelper.lok
+@li @c comphelper.traceevent
@section cppu
diff --git a/include/sal/log.hxx b/include/sal/log.hxx
index 00d533ab5495..a3844ff0a129 100644
--- a/include/sal/log.hxx
+++ b/include/sal/log.hxx
@@ -30,6 +30,8 @@ extern "C" SAL_DLLPUBLIC void SAL_CALL sal_detail_log(
sal_detail_LogLevel level, char const * area, char const * where,
char const * message, sal_uInt32 backtraceDepth);
+extern "C" SAL_DLLPUBLIC void SAL_CALL sal_detail_set_log_selector(char const *logSelector);
+
extern "C" SAL_DLLPUBLIC sal_Bool SAL_CALL sal_detail_log_report(
sal_detail_LogLevel level, char const * area);
@@ -161,7 +163,10 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) {
@since LibreOffice 3.5
*/
-#if defined _LIBCPP_VERSION || (defined _MSC_VER && _MSC_VER >= 1915)
+#if defined _LIBCPP_VERSION \
+ || (defined _GLIBCXX_RELEASE \
+ && (_GLIBCXX_RELEASE >= 12 || (_GLIBCXX_RELEASE == 11 && __GLIBCXX__ > 20210428))) \
+ || (defined _MSC_VER && _MSC_VER >= 1915)
#define SAL_STREAM(stream) \
(::std::ostringstream() << stream).str()
#else
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx
index b15288e51062..6cbeffd2f770 100644
--- a/include/sax/tools/converter.hxx
+++ b/include/sax/tools/converter.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_SAX_TOOLS_CONVERTER_HXX
#define INCLUDED_SAX_TOOLS_CONVERTER_HXX
+#include <sal/config.h>
+
+#include <type_traits>
+
#include <sax/saxdllapi.h>
#include <sal/types.h>
@@ -213,6 +217,16 @@ public:
OUStringBuffer& rsType ,
const css::uno::Any& rValue);
+ /** convert specified byte sequence to xsd:hexBinary string **/
+ static void convertBytesToHexBinary(OUStringBuffer& rBuffer, const void* pBytes,
+ sal_Int32 nBytes);
+
+ template <typename T, std::enable_if_t<std::is_arithmetic_v<T>, int> = 0>
+ static void convertNumberToHexBinary(OUStringBuffer& rBuffer, T n)
+ {
+ convertBytesToHexBinary(rBuffer, &n, sizeof(n));
+ }
+
};
}
diff --git a/include/sfx2/LokControlHandler.hxx b/include/sfx2/LokControlHandler.hxx
new file mode 100644
index 000000000000..34547950643c
--- /dev/null
+++ b/include/sfx2/LokControlHandler.hxx
@@ -0,0 +1,179 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <sfx2/dllapi.h>
+#include <svx/svdouno.hxx>
+#include <vcl/window.hxx>
+#include <tools/UnitConversion.hxx>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XGraphics.hpp>
+#include <com/sun/star/awt/XView.hpp>
+#include <toolkit/helper/vclunohelper.hxx>
+
+class LokControlHandler
+{
+public:
+ static constexpr double convertMm100ToPixel(double fNumber) { return fNumber * 96.0 / 2540.0; }
+
+ static Point convertMm100ToPixel(const Point& rPoint)
+ {
+ return Point(convertMm100ToPixel(rPoint.getX()), convertMm100ToPixel(rPoint.getY()));
+ }
+
+ static tools::Rectangle convertMm100ToPixel(const tools::Rectangle& rRectangle)
+ {
+ return tools::Rectangle(convertMm100ToPixel(rRectangle.TopLeft()),
+ Size(convertMm100ToPixel(rRectangle.GetWidth()),
+ convertMm100ToPixel(rRectangle.GetHeight())));
+ }
+
+ static Point convertTwipToMm100(const Point& rPoint)
+ {
+ return Point(::convertTwipToMm100(sal_Int64(rPoint.getX())),
+ ::convertTwipToMm100(sal_Int64(rPoint.getY())));
+ }
+
+ static tools::Rectangle convertTwipToMm100(const tools::Rectangle& rRectangle)
+ {
+ return tools::Rectangle(convertTwipToMm100(rRectangle.TopLeft()),
+ Size(::convertTwipToMm100(rRectangle.GetWidth()),
+ ::convertTwipToMm100(rRectangle.GetHeight())));
+ }
+
+ static bool postMouseEvent(SdrPage* pPage, SdrView* pDrawView, vcl::Window const& rMainWindow,
+ int nType, Point aPointHmm, int nCount, int nButtons, int nModifier)
+ {
+ SdrObjListIter aIterator(pPage, SdrIterMode::Flat);
+ while (aIterator.IsMore())
+ {
+ SdrObject* pObject = aIterator.Next();
+ SdrUnoObj* pUnoObect = dynamic_cast<SdrUnoObj*>(pObject);
+ if (pUnoObect)
+ {
+ tools::Rectangle aControlRectHMM = pUnoObect->GetLogicRect();
+ if (aControlRectHMM.IsInside(aPointHmm))
+ {
+ css::uno::Reference<css::awt::XControl> xControl
+ = pUnoObect->GetUnoControl(*pDrawView, rMainWindow);
+ if (!xControl.is())
+ return false;
+
+ css::uno::Reference<css::awt::XWindow> xControlWindow(xControl,
+ css::uno::UNO_QUERY);
+ if (!xControlWindow.is())
+ return false;
+
+ css::uno::Reference<css::awt::XWindowPeer> xWindowPeer(xControl->getPeer());
+
+ VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindowPeer);
+ if (pWindow)
+ {
+ Point aControlRelativePositionHMM = aPointHmm - aControlRectHMM.TopLeft();
+ Point aControlRelativePosition
+ = convertMm100ToPixel(aControlRelativePositionHMM);
+
+ LokMouseEventData aMouseEventData(nType, aControlRelativePosition, nCount,
+ MouseEventModifiers::SIMPLECLICK,
+ nButtons, nModifier);
+
+ SfxLokHelper::postMouseEventAsync(pWindow, aMouseEventData);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ static void drawUnoControl(SdrView* pDrawView, SdrUnoObj* pUnoObect,
+ vcl::Window const& rMainWindow, VirtualDevice& rDevice,
+ tools::Rectangle const& rTileRectHMM, double scaleX, double scaleY)
+ {
+ css::uno::Reference<css::awt::XControl> xControl
+ = pUnoObect->GetUnoControl(*pDrawView, rMainWindow);
+ if (!xControl.is())
+ return;
+
+ css::uno::Reference<css::awt::XWindow> xControlWindow(xControl, css::uno::UNO_QUERY);
+ if (!xControlWindow.is())
+ return;
+
+ css::uno::Reference<css::awt::XGraphics> xGraphics(rDevice.CreateUnoGraphics());
+ if (!xGraphics.is())
+ return;
+
+ css::uno::Reference<css::awt::XView> xControlView(xControl, css::uno::UNO_QUERY);
+ if (!xControlView.is())
+ return;
+
+ tools::Rectangle aObjectRectHMM = pUnoObect->GetLogicRect();
+ Point aOffsetFromTile = Point(aObjectRectHMM.Left() - rTileRectHMM.Left(),
+ aObjectRectHMM.Top() - rTileRectHMM.Top());
+ tools::Rectangle aRectangleHMM(aOffsetFromTile, aObjectRectHMM.GetSize());
+ tools::Rectangle aRectanglePx = convertMm100ToPixel(aRectangleHMM);
+
+ xControlWindow->setPosSize(0, 0, aRectanglePx.GetWidth(), aRectanglePx.GetHeight(),
+ css::awt::PosSize::POSSIZE);
+
+ xControlView->setGraphics(xGraphics);
+
+ xControlView->draw(aRectanglePx.Left() * scaleX, aRectanglePx.Top() * scaleY);
+ }
+
+ static void paintControlTile(SdrPage* pPage, SdrView* pDrawView, vcl::Window const& rMainWindow,
+ VirtualDevice& rDevice, Size aOutputSize,
+ tools::Rectangle const& rTileRect)
+ {
+ tools::Rectangle aTileRectHMM = convertTwipToMm100(rTileRect);
+
+ // Resizes the virtual device so to contain the entries context
+ rDevice.SetOutputSizePixel(aOutputSize);
+
+ rDevice.Push(PushFlags::MAPMODE);
+ MapMode aDeviceMapMode(rDevice.GetMapMode());
+
+ Fraction scaleX
+ = Fraction(aOutputSize.Width(), 96) * Fraction(1440) / Fraction(rTileRect.GetWidth());
+ Fraction scaleY
+ = Fraction(aOutputSize.Height(), 96) * Fraction(1440) / Fraction(rTileRect.GetHeight());
+
+ aDeviceMapMode.SetScaleX(scaleX);
+ aDeviceMapMode.SetScaleY(scaleY);
+ rDevice.SetMapMode(aDeviceMapMode);
+
+ SdrObjListIter aIterator(pPage, SdrIterMode::Flat);
+
+ while (aIterator.IsMore())
+ {
+ SdrObject* pObject = aIterator.Next();
+ SdrUnoObj* pUnoObect = dynamic_cast<SdrUnoObj*>(pObject);
+ if (pUnoObect)
+ {
+ tools::Rectangle aObjectRectHMM = pUnoObect->GetLogicRect();
+
+ // Check if we intersect with the tile rectangle and we
+ // need to draw the control.
+ if (aObjectRectHMM.IsOver(aTileRectHMM))
+ {
+ drawUnoControl(pDrawView, pUnoObect, rMainWindow, rDevice, aTileRectHMM,
+ double(scaleX), double(scaleY));
+ }
+ }
+ }
+
+ rDevice.Pop();
+ }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 08be8bb5ea19..efdb957d3a57 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -192,10 +192,14 @@ private:
std::unique_ptr<weld::Label> m_xTemplFt;
std::unique_ptr<weld::Label> m_xTemplValFt;
+ std::unique_ptr<weld::CheckButton> m_xImagePreferredDpiCheckButton;
+ std::unique_ptr<weld::ComboBox> m_xImagePreferredDpiComboBox;
DECL_LINK(DeleteHdl, weld::Button&, void);
DECL_LINK(SignatureHdl, weld::Button&, void);
DECL_LINK(ChangePassHdl, weld::Button&, void);
+ DECL_LINK(ImagePreferredDPICheckBoxClicked, weld::ToggleButton&, void);
+
void ImplUpdateSignatures();
void ImplCheckPasswordState();
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 3e37b8b68597..8d6d8de7ef70 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -15,6 +15,7 @@
#include <vcl/event.hxx>
#include <sfx2/dllapi.h>
#include <sfx2/viewsh.hxx>
+#include <tools/gen.hxx>
#include <cstddef>
#include <rtl/string.hxx>
#include <boost/optional.hpp>
@@ -53,13 +54,16 @@ public:
static void destroyView(int nId);
/// Set a view shell as current one.
static void setView(int nId);
+ /// Get view shell with id
+ static SfxViewShell* getViewOfId(int nId);
/// Get the currently active view.
static int getView(const SfxViewShell* pViewShell = nullptr);
/// Get the number of views of the current DocId.
static std::size_t getViewsCount(int nDocId);
/// Get viewIds of views of the current DocId.
static bool getViewIds(int nDocId, int* pArray, size_t nSize);
-
+ /// Set View Blocked for some uno commands
+ static void setBlockedCommandList(int nViewId, const char* bolckedCommandList);
/// Get the document id for a view
static int getDocumentIdOfView(int nViewId);
/// Get the default language that should be used for views
@@ -104,7 +108,7 @@ public:
/// Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same document - if @bInvalidateAll - first invalidates all parts
static void notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc, bool bInvalidateAll = true);
/// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed.
- static void notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload);
+ static void notifyInvalidation(SfxViewShell const* pThisView, tools::Rectangle const *);
/// Emits a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, but tweaks it according to setOptionalFeatures() if needed.
static void notifyVisCursorInvalidation(OutlinerViewShell const* pThisView, const OString& rRectangle, bool bMispelledWord = false, const OString& rHyperlink = "");
/// Notifies all views with the given type and payload.
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 2d6a4c3cd2d3..9ac09d96a02a 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -218,6 +218,13 @@ protected:
// helper method
void AddToRecentlyUsedList();
+ // Parent class for actual guard objects that would do useful work
+ class LockAllViewsGuard
+ {
+ public:
+ virtual ~LockAllViewsGuard() {}
+ };
+
public:
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXDOCSH)
@@ -341,7 +348,7 @@ public:
/** Returns to if preparing was successful, else false. */
bool PrepareForSigning(weld::Window* pDialogParent);
- bool CheckIsReadonly(bool bSignScriptingContent);
+ bool CheckIsReadonly(bool bSignScriptingContent, weld::Window* pDialogParent = nullptr);
void RecheckSignature(bool bAlsoRecheckScriptingSignature);
void AfterSigning(bool bSignSuccess, bool bSignScriptingContent);
bool HasValidSignatures() const;
@@ -770,6 +777,13 @@ public:
/// Gets the certificate that is already picked by the user but not yet used for signing.
css::uno::Reference<css::security::XCertificate> GetSignPDFCertificate() const;
+
+ // Lock all unlocked views, and returns a guard object which unlocks those views when destructed
+ virtual std::unique_ptr<LockAllViewsGuard> LockAllViews()
+ {
+ return std::make_unique<LockAllViewsGuard>();
+ }
+
};
#define SFX_GLOBAL_CLASSID \
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 862a0a8e3d5c..ede429245298 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -431,7 +431,7 @@ class SvxSearchItem;
// Used for redaction
#define SID_SHAPE_NAME (SID_SFX_START + 808)
- // FREE: SID_SFX_START + 809
+#define SID_GRAPHIC_SIZE_CHECK (SID_SFX_START + 809)
// FREE: SID_SFX_START + 810
#define SID_ASYNCHRON (SID_SFX_START + 811)
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 7cd612a32a4b..496a44513a7c 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -298,6 +298,8 @@
#define STR_SIGNATURE_NOTVALIDATED_PARTIAL_OK NC_("STR_SIGNATURE_NOTVALIDATED_PARTIAL_OK", "The certificate could not be validated and the document is only partially signed.")
#define STR_SIGNATURE_OK NC_("STR_SIGNATURE_OK", "This document is digitally signed and the signature is valid.")
#define STR_SIGNATURE_SHOW NC_("STR_SIGNATURE_SHOW", "Show Signatures")
+#define STR_REFRESH_MASTER_PASSWORD NC_("STR_REFRESH_MASTER_PASSWORD", "The master password is stored in an outdated format, you should refresh it")
+#define STR_REFRESH_PASSWORD NC_("STR_REFRESH_PASSWORD", "Refresh Password")
#define STR_CLOSE_PANE NC_("STR_CLOSE_PANE", "Close Pane")
#define STR_SFX_DOCK NC_("STR_SFX_DOCK", "Dock")
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 325bfb8b4b4b..13ac3ab90173 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SFX2_TABDLG_HXX
#include <memory>
+#include <unordered_map>
#include <sal/config.h>
#include <sfx2/dllapi.h>
#include <sfx2/basedlgs.hxx>
@@ -177,6 +178,8 @@ private:
const SfxItemSet* pSet;
OUString aUserString;
bool bHasExchangeSupport;
+ std::unordered_map<OString, css::uno::Any> maAdditionalProperties;
+
std::unique_ptr< TabPageImpl > pImpl;
protected:
@@ -205,6 +208,8 @@ public:
virtual bool FillItemSet( SfxItemSet* );
virtual void Reset( const SfxItemSet* );
+ // Allows to postpone some initialization to the first activation
+ virtual bool DeferResetToFirstActivation();
bool HasExchangeSupport() const
{ return bHasExchangeSupport; }
@@ -236,6 +241,11 @@ public:
bool IsVisible() const { return m_xContainer->get_visible(); }
weld::Window* GetFrameWeld() const;
+
+ std::unordered_map<OString, css::uno::Any>& getAdditionalProperties()
+ {
+ return maAdditionalProperties;
+ }
};
#endif
diff --git a/include/sfx2/tplpitem.hxx b/include/sfx2/tplpitem.hxx
index 9276ab5524ad..ff4a1c99e21f 100644
--- a/include/sfx2/tplpitem.hxx
+++ b/include/sfx2/tplpitem.hxx
@@ -28,13 +28,16 @@
class SFX2_DLLPUBLIC SfxTemplateItem final : public SfxFlagItem
{
OUString aStyle;
+ OUString aStyleIdentifier;
public:
static SfxPoolItem* CreateDefault();
SfxTemplateItem();
SfxTemplateItem( sal_uInt16 nWhich,
- const OUString &rStyle );
+ const OUString &rStyle,
+ const OUString &rStyleIdentifier = "" );
const OUString& GetStyleName() const { return aStyle; }
+ const OUString& GetStyleIdentifier() const { return aStyleIdentifier; }
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override;
virtual bool operator==( const SfxPoolItem& ) const override;
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 250515eea0de..2ef4181dd5d5 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -64,6 +64,7 @@ protected:
DECL_LINK(WhatsNewHandler, Button*, void);
DECL_LINK(SwitchReadOnlyHandler, Button*, void);
DECL_LINK(SignDocumentHandler, Button*, void);
+ DECL_DLLPRIVATE_LINK(RefreshMasterPasswordHdl, Button*, void);
SAL_DLLPRIVATE void KillDispatcher_Impl();
virtual ~SfxViewFrame() override;
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index dedef69a65b9..d5066759e142 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -34,6 +34,7 @@
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
#include <editeng/outliner.hxx>
#include <functional>
+#include <unordered_set>
class SfxTabPage;
class SfxBaseController;
@@ -160,6 +161,7 @@ friend class SfxPrinterController;
LanguageTag maLOKLanguageTag;
LanguageTag maLOKLocale;
LOKDeviceFormFactor maLOKDeviceFormFactor;
+ std::unordered_set<OUString> mvLOKBlockedCommandList;
/// Used to set the DocId at construction time. See SetCurrentDocId.
static ViewShellDocId mnCurrentDocId;
@@ -385,6 +387,10 @@ public:
bool isLOKMobilePhone() const { return maLOKDeviceFormFactor == LOKDeviceFormFactor::MOBILE; }
virtual tools::Rectangle getLOKVisibleArea() const { return tools::Rectangle(); }
+
+ // Blocked Command view settings
+ void setBlockedCommandList(const char* bolckedCommandList);
+ bool isBlockedCommand(OUString command);
};
diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx
index f6ee242c84d1..f00cbce6e4b8 100644
--- a/include/svl/sigstruct.hxx
+++ b/include/svl/sigstruct.hxx
@@ -89,9 +89,30 @@ struct SignatureInformation
sal_Int32 nSecurityId;
css::xml::crypto::SecurityOperationStatus nStatus;
SignatureReferenceInformations vSignatureReferenceInfors;
- OUString ouX509IssuerName;
- OUString ouX509SerialNumber;
- OUString ouX509Certificate;
+ struct X509CertInfo
+ {
+ OUString X509IssuerName;
+ OUString X509SerialNumber;
+ OUString X509Certificate;
+ /// OOXML certificate SHA-256 digest, empty for ODF except when doing XAdES signature.
+ OUString CertDigest;
+ /// The certificate owner (aka subject).
+ OUString X509Subject;
+ };
+ typedef std::vector<X509CertInfo> X509Data;
+ // note: at parse time, it's unkown which one is the signing certificate;
+ // ImplVerifySignatures() figures it out and puts it at the back
+ std::vector<X509Data> X509Datas;
+
+ X509CertInfo const* GetSigningCertificate() const
+ {
+ if (X509Datas.empty())
+ {
+ return nullptr;
+ }
+ assert(!X509Datas.back().empty());
+ return & X509Datas.back().back();
+ }
OUString ouGpgKeyID;
OUString ouGpgCertificate;
@@ -103,6 +124,9 @@ struct SignatureInformation
// XAdES EncapsulatedX509Certificate values
std::set<OUString> maEncapsulatedX509Certificates;
+ OUString ouSignatureId;
+ // signature may contain multiple time stamps - check they're consistent
+ bool hasInconsistentSigningTime = false;
//We also keep the date and time as string. This is done when this
//structure is created as a result of a XML signature being read.
//When then a signature is added or another removed, then the original
@@ -115,14 +139,12 @@ struct SignatureInformation
//and the converted time is written back, then the string looks different
//and the signature is broken.
OUString ouDateTime;
- OUString ouSignatureId;
- OUString ouPropertyId;
+ /// The Id attribute of the <SignatureProperty> element that contains the <dc:date>.
+ OUString ouDateTimePropertyId;
/// Characters of the <dc:description> element inside the signature.
OUString ouDescription;
/// The Id attribute of the <SignatureProperty> element that contains the <dc:description>.
OUString ouDescriptionPropertyId;
- /// OOXML certificate SHA-256 digest, empty for ODF except when doing XAdES signature.
- OUString ouCertDigest;
/// Valid and invalid signature line images
css::uno::Reference<css::graphic::XGraphic> aValidSignatureImage;
css::uno::Reference<css::graphic::XGraphic> aInvalidSignatureImage;
@@ -137,9 +159,6 @@ struct SignatureInformation
/// For PDF: the byte range doesn't cover the whole document.
bool bPartialDocumentSignature;
- /// The certificate owner (aka subject).
- OUString ouSubject;
-
svl::crypto::SignatureMethodAlgorithm eAlgorithmID;
SignatureInformation( sal_Int32 nId )
diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index 24656eb2318a..5427680b462a 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -214,7 +214,7 @@ private:
SVL_DLLPRIVATE bool IsTrivialSearch() const;
SfxStyleSheetBase* pCurrentStyle;
- sal_uInt16 nCurrentPosition;
+ sal_Int32 mnCurrentPosition;
bool bSearchUsed;
friend class SfxStyleSheetBasePool;
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 8091c2faea71..b412a237aada 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -618,6 +618,8 @@ public:
sal_uInt16& nPrecision, sal_uInt16& nLeadingCnt,
LanguageType eLnge = LANGUAGE_DONTKNOW );
+ bool IsUserDefinedAndNotOverloaded(sal_uInt32 F_Index) const;
+
/// Check if format code string may be deleted by user
bool IsUserDefined( const OUString& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW );
diff --git a/include/svx/GenericCheckDialog.hxx b/include/svx/GenericCheckDialog.hxx
new file mode 100644
index 000000000000..ef2a41159737
--- /dev/null
+++ b/include/svx/GenericCheckDialog.hxx
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <svx/svxdllapi.h>
+#include <tools/link.hxx>
+#include <vcl/weld.hxx>
+
+namespace svx
+{
+class CheckData
+{
+public:
+ virtual ~CheckData() {}
+
+ virtual OUString getText() = 0;
+
+ virtual bool canMarkObject() = 0;
+ virtual void markObject() = 0;
+
+ virtual bool hasProperties() = 0;
+ virtual void runProperties() = 0;
+};
+
+class CheckDataCollection
+{
+protected:
+ std::vector<std::unique_ptr<CheckData>> m_aCollection;
+
+public:
+ virtual ~CheckDataCollection() {}
+
+ std::vector<std::unique_ptr<CheckData>>& getCollection() { return m_aCollection; }
+
+ virtual OUString getTitle() = 0;
+};
+
+class GenericCheckEntry final
+{
+private:
+ std::unique_ptr<weld::Builder> m_xBuilder;
+ std::unique_ptr<weld::Container> m_xContainer;
+ std::unique_ptr<weld::Label> m_xLabel;
+ std::unique_ptr<weld::Button> m_xMarkButton;
+ std::unique_ptr<weld::Button> m_xPropertiesButton;
+
+ std::unique_ptr<CheckData>& m_pCheckData;
+
+public:
+ GenericCheckEntry(weld::Container* pParent, std::unique_ptr<CheckData>& rCheckData);
+
+ weld::Widget* get_widget() const { return m_xContainer.get(); }
+
+ DECL_LINK(MarkButtonClicked, weld::Button&, void);
+ DECL_LINK(PropertiesButtonClicked, weld::Button&, void);
+};
+
+class SVX_DLLPUBLIC GenericCheckDialog final : public weld::GenericDialogController
+{
+private:
+ std::vector<std::unique_ptr<GenericCheckEntry>> m_aCheckEntries;
+ CheckDataCollection& m_rCheckDataCollection;
+
+ // Controls
+ std::unique_ptr<weld::Box> m_xCheckBox;
+
+public:
+ GenericCheckDialog(weld::Window* pParent, CheckDataCollection& rCheckDataCollection);
+ virtual ~GenericCheckDialog() override;
+ virtual short run() override;
+};
+
+} // end svx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 7e438015e907..5edb3666dcbf 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -57,6 +57,7 @@ public:
SVX_DLLPRIVATE virtual bool DeleteMarked() override;
SVX_DLLPRIVATE virtual void onSelectionHasChanged() override;
+ SVX_DLLPRIVATE virtual void onSelectAll() override;
SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ) override;
SVX_DLLPRIVATE virtual void Execute( SfxRequest& rReq ) override;
diff --git a/include/svx/selectioncontroller.hxx b/include/svx/selectioncontroller.hxx
index 79c19f60dc61..bc4fbbf5098c 100644
--- a/include/svx/selectioncontroller.hxx
+++ b/include/svx/selectioncontroller.hxx
@@ -50,6 +50,8 @@ public:
virtual void onSelectionHasChanged();
+ virtual void onSelectAll();
+
virtual void GetState( SfxItemSet& rSet );
virtual void Execute( SfxRequest& rReq );
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 3ae4e219ef76..c9c0c5249def 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1708,6 +1708,13 @@
#define RID_SVXSTR_SIGNATURELINE_DSIGNED_BY NC_("RID_SVXSTR_SIGNATURELINE_DSIGNED_BY", "Digitally signed by:")
#define RID_SVXSTR_SIGNATURELINE_DATE NC_("RID_SVXSTR_SIGNATURELINE_DATE", "Date: %1")
+/*--------------------------------------------------------------------
+ Description: GraphicSizeCheck strings
+ --------------------------------------------------------------------*/
+#define STR_GRAPHIC_SIZE_CHECK_DIALOG_TITLE NC_("STR_GRAPHIC_SIZE_CHECK_DIALOG_TITLE", "Graphic Size Check")
+#define STR_WARNING_GRAPHIC_PIXEL_COUNT_LOW NC_("STR_WARNING_GRAPHIC_PIXEL_COUNT_LOW", "Image '%NAME%' has too few pixels for the current size (%DPIX% x %DPIY% DPI)")
+#define STR_WARNING_GRAPHIC_PIXEL_COUNT_HIGH NC_("STR_WARNING_GRAPHIC_PIXEL_COUNT_HIGH", "Image '%NAME%' has too many pixels for the current size (%DPIX% x %DPIY% DPI)")
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx
index d1fde32edda0..c1956d56af9f 100644
--- a/include/svx/svddrag.hxx
+++ b/include/svx/svddrag.hxx
@@ -79,6 +79,16 @@ class SVX_DLLPUBLIC SdrDragStat final
sal_Int32 GetPrevPos() const { return mvPnts.size()-(mvPnts.size()>1 ? 2 : 1); }
+ // This is passed all the way through to ApplySpecialDrag of the Edge Object
+ // For LOK, we cannot really specify which glue point to select by default
+ // It selects the nearest glue points after DragEnd event.
+ // When multiple objects are on top of each other or somehow their glue points
+ // collide, the glue point is selected from the lowest order numbered object
+ // We can pass the ord number information inside the draginfo and choose the correct shape
+ struct {
+ sal_Int32 objectOrdNum = -1;
+ } mGlueOptions;
+
public:
SdrDragStat() { Reset(); }
~SdrDragStat();
@@ -158,6 +168,8 @@ public:
// Also considering 1stPointAsCenter
void TakeCreateRect(tools::Rectangle& rRect) const;
+
+ auto& GetGlueOptions() { return mGlueOptions; }
};
#endif // INCLUDED_SVX_SVDDRAG_HXX
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 973a28cd1b9e..71e014970888 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -186,9 +186,16 @@ public:
bool IsUndoEnabled() const;
/**
+ * Checks if this or other views have an active text edit, in which case object undos are not
+ * created.
+ */
+ bool CanDoSdrUndo() const;
+
+ /**
* Checks if this or other views have an active text edit, if true, end them.
*/
void EndTextEditAllViews() const;
+ void EndTextEditCurrentView();
std::vector< std::unique_ptr<SdrUndoAction> > CreateConnectorUndo( SdrObject& rO );
void AddUndoActions( std::vector< std::unique_ptr<SdrUndoAction> > );
@@ -305,7 +312,11 @@ public:
// geometrical attribute (position, size, rotation angle)
// A PageOrigin set at a position is taken into account.
SfxItemSet GetGeoAttrFromMarked() const;
- void SetGeoAttrToMarked(const SfxItemSet& rAttr);
+ // In LOK, interactive shape movement uses this function
+ // in that case, margin is not taken into account
+ // and the final position of the shape becomes incorrect
+ // However, "Position and Size" dialog and other cases already add the margins.
+ void SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin = false);
// Returns NULL if:
// - nothing is marked,
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index aab4e216feb9..737da8ca4896 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -71,16 +71,16 @@ class SVX_DLLPUBLIC SdrObjEditView : public SdrGlueEditView, public EditViewCall
// The OverlayObjects used for visualizing active TextEdit (currently
// using TextEditOverlayObject, but not limited to it
- sdr::overlay::OverlayObjectList maTEOverlayGroup;
+ sdr::overlay::OverlayObjectList maTEOverlayGroup;
protected:
// TextEdit
- tools::WeakReference<SdrTextObj>
- mxTextEditObj; // current object in TextEdit
- SdrPageView* pTextEditPV;
- std::unique_ptr<SdrOutliner> pTextEditOutliner; // outliner for the TextEdit
- OutlinerView* pTextEditOutlinerView; // current view of the outliners
- VclPtr<vcl::Window> pTextEditWin; // matching window to pTextEditOutlinerView
+ tools::WeakReference<SdrTextObj> mxTextEditObj; // current object in TextEdit
+ SdrPageView* mpTextEditPV;
+ std::unique_ptr<SdrOutliner> mpTextEditOutliner; // outliner for the TextEdit
+ OutlinerView* mpTextEditOutlinerView; // current view of the outliners
+ VclPtr<vcl::Window> mpTextEditWin; // matching window to pTextEditOutlinerView
+
vcl::Cursor* pTextEditCursorBuffer; // to restore the cursor in each window
SdrObject* pMacroObj;
SdrPageView* pMacroPV;
@@ -93,31 +93,28 @@ protected:
sal_uInt16 nMacroTol;
- bool bTextEditDontDelete : 1; // do not delete outliner and view of SdrEndTextEdit (f. spellchecking)
- bool bTextEditOnlyOneView : 1; // a single OutlinerView (f. spellchecking)
- bool bTextEditNewObj : 1; // current edited object was just recreated
- bool bQuickTextEditMode : 1; // persistent(->CrtV). Default=TRUE
- bool bMacroDown : 1;
+ bool mbTextEditDontDelete : 1; // do not delete outliner and view of SdrEndTextEdit (f. spellchecking)
+ bool mbTextEditOnlyOneView : 1; // a single OutlinerView (f. spellchecking)
+ bool mbTextEditNewObj : 1; // current edited object was just recreated
+ bool mbQuickTextEditMode : 1; // persistent(->CrtV). Default=TRUE
+ bool mbMacroDown : 1;
rtl::Reference< sdr::SelectionController > mxSelectionController;
rtl::Reference< sdr::SelectionController > mxLastSelectionController;
private:
SfxUndoManager* mpOldTextEditUndoManager;
+ std::unique_ptr<SdrUndoManager> mpLocalTextEditUndoManager;
SVX_DLLPRIVATE void ImpClearVars();
protected:
- // central method to get an SdrUndoManager for enhanced TextEdit. Default will
- // try to return a dynamic_casted GetModel()->GetSdrUndoManager(). Applications
- // which want to use this feature will need to override this virtual method,
- // provide their document UndoManager and derive it from SdrUndoManager.
- virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const;
+ // Create a local UndoManager that is used for text editing.
+ virtual std::unique_ptr<SdrUndoManager> createLocalTextUndoManager();
void ImpMoveCursorAfterChainingEvent(TextChainCursorManager *pCursorManager);
TextChainCursorManager *ImpHandleMotionThroughBoxesKeyInput(const KeyEvent& rKEvt, bool *bOutHandled);
-
OutlinerView* ImpFindOutlinerView(vcl::Window const * pWin) const;
// Create a new OutlinerView at the heap and initialize all required parameters.
@@ -177,12 +174,22 @@ public:
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
virtual void ModelHasChanged() override;
+ const std::unique_ptr<SdrUndoManager>& getViewLocalUndoManager() const
+ {
+ return mpLocalTextEditUndoManager;
+ }
// TextEdit over an outliner
// QuickTextEditMode = edit the text straight after selection. Default=TRUE. Persistent.
- void SetQuickTextEditMode(bool bOn) { bQuickTextEditMode=bOn; }
- bool IsQuickTextEditMode() const { return bQuickTextEditMode; }
+ void SetQuickTextEditMode(bool bOn)
+ {
+ mbQuickTextEditMode = bOn;
+ }
+ bool IsQuickTextEditMode() const
+ {
+ return mbQuickTextEditMode;
+ }
// Start the TextEditMode. If pWin==NULL, use the first window, which is logged at the View.
// The cursor of the currently edited window is stored with SdrBeginTextEdit()
@@ -230,10 +237,22 @@ public:
// Now at this outliner, events can be send, attributes can be set,
// call Cut/Copy/Paste, call Undo/Redo, and so on...
- const SdrOutliner* GetTextEditOutliner() const { return pTextEditOutliner.get(); }
- SdrOutliner* GetTextEditOutliner() { return pTextEditOutliner.get(); }
- const OutlinerView* GetTextEditOutlinerView() const { return pTextEditOutlinerView; }
- OutlinerView* GetTextEditOutlinerView() { return pTextEditOutlinerView; }
+ const SdrOutliner* GetTextEditOutliner() const
+ {
+ return mpTextEditOutliner.get();
+ }
+ SdrOutliner* GetTextEditOutliner()
+ {
+ return mpTextEditOutliner.get();
+ }
+ const OutlinerView* GetTextEditOutlinerView() const
+ {
+ return mpTextEditOutlinerView;
+ }
+ OutlinerView* GetTextEditOutlinerView()
+ {
+ return mpTextEditOutlinerView;
+ }
virtual bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override;
virtual bool MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin) override;
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 62980f1f000a..2d7d6a12248f 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -604,6 +604,8 @@ public:
bool DoesMakePageObjectsNamesUnique() const { return mbMakePageObjectsNamesUnique; }
void DoMakePageObjectsNamesUnique(bool bDo) { mbMakePageObjectsNamesUnique = bDo; }
+ virtual sal_Int32 getImagePreferredDPI() const { return 0; }
+
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index f080a57d1bbb..160f55fd8ad7 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -149,6 +149,7 @@ private:
void UndirtyMrkPnt() const;
void SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxViewShell* pOtherShell);
+ bool dumpGluePointsToJSON(boost::property_tree::ptree& rTree);
protected:
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index e6399da73bda..56c2f21c66da 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -177,7 +177,7 @@ protected:
XPolygon ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const tools::Rectangle& rBoundRect1, const tools::Rectangle& rBewareRect1,
const Point& rPt2, long nAngle2, const tools::Rectangle& rBoundRect2, const tools::Rectangle& rBewareRect2,
sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const;
- static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr);
+ static bool ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut=nullptr, SdrDragStat* pDragStat = nullptr);
static SdrEscapeDirection ImpCalcEscAngle(SdrObject const * pObj, const Point& aPt2);
void ImpSetTailPoint(bool bTail1, const Point& rPt);
void ImpUndirtyEdgeTrack(); // potential recalculation of the connection track
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index b192a438bc19..da5f094ab155 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -42,6 +42,7 @@ namespace frame { class XModel; }
namespace svt { class EmbeddedObjectRef; }
class SdrOle2ObjImpl;
+class SvxOle2Shape;
class SVX_DLLPUBLIC SdrOle2Obj : public SdrRectObj
{
@@ -49,7 +50,7 @@ private:
std::unique_ptr<SdrOle2ObjImpl> mpImpl;
private:
- SVX_DLLPRIVATE void Connect_Impl();
+ SVX_DLLPRIVATE void Connect_Impl(SvxOle2Shape* pCreator = nullptr);
SVX_DLLPRIVATE void Disconnect_Impl();
SVX_DLLPRIVATE void AddListeners_Impl();
SVX_DLLPRIVATE void RemoveListeners_Impl();
@@ -105,7 +106,7 @@ public:
// OLE object has got a separate PersistName member now;
// !!! use ::SetPersistName( ... ) only, if you know what you do !!!
const OUString& GetPersistName() const;
- void SetPersistName( const OUString& rPersistName );
+ void SetPersistName( const OUString& rPersistName, SvxOle2Shape* pCreator = nullptr );
// One can add an application name to a SdrOle2Obj, which can be queried for
// later on (SD needs this for presentation objects).
@@ -153,7 +154,7 @@ public:
sal_Int64 nAspect );
static bool Unload( const css::uno::Reference< css::embed::XEmbeddedObject >& xObj, sal_Int64 nAspect );
bool Unload();
- void Connect();
+ void Connect(SvxOle2Shape* pCreator = nullptr);
void Disconnect();
void ObjectLoaded();
@@ -200,6 +201,16 @@ public:
void Connect() { GetRealObject(); }
};
+class SVXCORE_DLLPUBLIC SdrIFrameLink final : public sfx2::SvBaseLink
+{
+ SdrOle2Obj* m_pObject;
+
+public:
+ explicit SdrIFrameLink(SdrOle2Obj* pObject);
+ virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const OUString& rMimeType, const css::uno::Any & rValue ) override;
+};
+
#endif // INCLUDED_SVX_SVDOOLE2_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index e4a6168ef425..5fda8cd58c13 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -243,7 +243,7 @@ public:
const sal_Char* pDebugName) const;
// Interactive Move Action programmaticaly
- bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint);
+ bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, const sal_Int32 aObjectOrdNum = -1);
};
// First of all the app creates a SdrModel.
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 0e445c0e84f4..5f16f431924f 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -597,6 +597,8 @@ public:
bool createObject( const SvGlobalName &aClassName );
void createLink( const OUString& aLinkURL );
+
+ virtual OUString GetAndClearInitialFrameURL();
};
diff --git a/include/unotest/macros_test.hxx b/include/unotest/macros_test.hxx
index aa098d6a2178..b62526faf9f5 100644
--- a/include/unotest/macros_test.hxx
+++ b/include/unotest/macros_test.hxx
@@ -36,6 +36,11 @@ public:
css::uno::Reference< css::lang::XComponent > loadFromDesktop(const OUString& rURL, const OUString& rDocService = OUString(),
const css::uno::Sequence<css::beans::PropertyValue>& rExtra_args = css::uno::Sequence<css::beans::PropertyValue>() );
+ static void
+ dispatchCommand(const css::uno::Reference<css::lang::XComponent>& xComponent,
+ const OUString& rCommand,
+ const css::uno::Sequence<css::beans::PropertyValue>& rPropertyValues);
+
protected:
css::uno::Reference< css::frame::XDesktop2> mxDesktop;
void setUpNssGpg(const test::Directories& rDirectories, const OUString& rTestName);
diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index 1cf13d4c7de8..7c076a451a69 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -20,6 +20,7 @@
#include <basegfx/range/b2drectangle.hxx>
#include <o3tl/safeint.hxx>
#include <array>
+#include <limits>
class SvStream;
namespace basegfx { class B2DHomMatrix; }
@@ -51,9 +52,14 @@ public:
mnBitCount(nBitCount)
{
assert(nBitCount == 24 || nBitCount == 32);
+ if (rSize.getWidth() > std::numeric_limits<sal_Int32>::max() || rSize.getWidth() < 0)
+ throw std::bad_alloc();
+ if (rSize.getHeight() > std::numeric_limits<sal_Int32>::max() || rSize.getHeight() < 0)
+ throw std::bad_alloc();
sal_Int32 nRowSize, nDataSize;
if (o3tl::checked_multiply<sal_Int32>(rSize.getWidth(), nBitCount/8, nRowSize) ||
- o3tl::checked_multiply<sal_Int32>(nRowSize, rSize.getHeight(), nDataSize))
+ o3tl::checked_multiply<sal_Int32>(nRowSize, rSize.getHeight(), nDataSize) ||
+ nDataSize < 0)
{
throw std::bad_alloc();
}
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index e089592e41fa..b9dd458edd71 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -72,8 +72,10 @@ public:
/**
* Set the document "part", i.e. slide for a slideshow, and
* tab for a spreadsheet.
+ * bool bAllowChangeFocus - used to not disturb other users while editing when
+ * setPart is used for tile rendering only
*/
- virtual void setPart( int ) {}
+ virtual void setPart( int /*nPart*/, bool /*bAllowChangeFocus*/ = true ) {}
/**
* Get the number of parts -- see setPart for further details.
diff --git a/include/vcl/WeldedTabbedNotebookbar.hxx b/include/vcl/WeldedTabbedNotebookbar.hxx
index 82996868cd2b..1a4f9eede4ec 100644
--- a/include/vcl/WeldedTabbedNotebookbar.hxx
+++ b/include/vcl/WeldedTabbedNotebookbar.hxx
@@ -15,14 +15,14 @@
#include <vcl/weld.hxx>
#include <com/sun/star/frame/XFrame.hpp>
-/** Tabbed implementation of NotebookBar for Writer
+/**
+ * Welded wrapper for NotebookBar used for online
*/
class VCL_DLLPUBLIC WeldedTabbedNotebookbar
{
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Container> m_xContainer;
- std::unique_ptr<weld::Notebook> m_xNotebook;
public:
WeldedTabbedNotebookbar(VclPtr<vcl::Window>& pContainerWindow, const OUString& rUIFilePath,
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index d3c5962741e0..cc5e82dd3f88 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -181,6 +181,10 @@ public:
vcl::Font GetUnzoomedControlPointFont() const;
void SetShowAccelerator (bool val);
+
+ void LogicMouseButtonDown(const MouseEvent& rMouseEvent) override;
+ void LogicMouseButtonUp(const MouseEvent& rMouseEvent) override;
+ void LogicMouseMove(const MouseEvent& rMouseEvent) override;
};
#endif // INCLUDED_VCL_CTRL_HXX
diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index fbfd025af5a5..1b23a09473c5 100644
--- a/include/vcl/customweld.hxx
+++ b/include/vcl/customweld.hxx
@@ -52,6 +52,7 @@ public:
}
virtual void Show() { m_pDrawingArea->show(); }
virtual void Hide() { m_pDrawingArea->hide(); }
+ void SetCursor(void * pData) { m_pDrawingArea->set_cursor_data(pData); }
void GrabFocus() { m_pDrawingArea->grab_focus(); }
bool HasFocus() const { return m_pDrawingArea->has_focus(); }
bool IsVisible() const { return m_pDrawingArea->get_visible(); }
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index 00ae91c7624a..2a83c2488c89 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -177,6 +177,8 @@ public:
virtual bool set_property(const OString &rKey, const OUString &rValue) override;
static Image loadThemeImage(const OUString &rFileName);
+
+ boost::property_tree::ptree DumpAsPropertyTree() override;
};
#endif // INCLUDED_VCL_FIXED_HXX
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 63d789d28a7e..b2f340942a20 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -723,12 +723,7 @@ private:
Help::ShowQuickHelp(this, aHelpArea, sHelpTip, eHelpWinStyle);
}
}
- virtual FactoryFunction GetUITestFactory() const override
- {
- if (m_pFactoryFunction)
- return m_pFactoryFunction;
- return Control::GetUITestFactory();
- }
+ virtual FactoryFunction GetUITestFactory() const override;
public:
VclDrawingArea(vcl::Window *pParent, WinBits nStyle)
diff --git a/include/vcl/lok.hxx b/include/vcl/lok.hxx
index 7fc5479a25cd..dcf582991806 100644
--- a/include/vcl/lok.hxx
+++ b/include/vcl/lok.hxx
@@ -22,6 +22,10 @@ bool VCL_DLLPUBLIC isUnipoll();
void VCL_DLLPUBLIC registerPollCallbacks(LibreOfficeKitPollCallback pPollCallback,
LibreOfficeKitWakeCallback pWakeCallback, void* pData);
void VCL_DLLPUBLIC unregisterPollCallbacks();
+
+// Called to tell VCL that the number of document views has changed, so that VCL
+// can adjust e.g. sizes of bitmap caches to scale well with larger number of users.
+void VCL_DLLPUBLIC numberOfViewsChanged(int count);
}
}
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index d9b6651e0c9e..137eda8f533f 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -854,6 +854,8 @@ private:
SAL_DLLPRIVATE void ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly);
///@}
+ SAL_DLLPRIVATE void ImplDrawWaveLineBezier(long nStartX, long nStartY, long nEndX, long nEndY, long nWaveHeight, double fOrientation, long nLineWidth);
+
/** @name Curved shape functions
*/
diff --git a/include/vcl/salvtables.hxx b/include/vcl/salvtables.hxx
index be939b4176f6..38a8299ae14c 100644
--- a/include/vcl/salvtables.hxx
+++ b/include/vcl/salvtables.hxx
@@ -289,6 +289,8 @@ public:
virtual OUString get_tooltip_text() const override;
+ virtual void set_cursor_data(void * pData) override;
+
virtual void connect_focus_in(const Link<Widget&, void>& rLink) override;
virtual void connect_mnemonic_activate(const Link<Widget&, bool>& rLink) override;
@@ -1540,4 +1542,19 @@ public:
virtual ~SalInstanceRadioButton() override;
};
+class SalInstanceImage : public SalInstanceWidget, public virtual weld::Image
+{
+private:
+ VclPtr<FixedImage> m_xImage;
+
+public:
+ SalInstanceImage(FixedImage* pImage, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+
+ virtual void set_from_icon_name(const OUString& rIconName) override;
+
+ virtual void set_image(VirtualDevice* pDevice) override;
+
+ virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override;
+};
+
#endif
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index a0a5b53144c2..e81cff4e4096 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -462,6 +462,10 @@ public:
*/
static void Quit();
+ /** Has Quit() been called?
+ */
+ static bool IsQuit();
+
/** Attempt to process current pending event(s)
It doesn't sleep if no events are available for processing.
diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx
index a0b773984d3b..f21460eec5de 100644
--- a/include/vcl/transfer.hxx
+++ b/include/vcl/transfer.hxx
@@ -176,7 +176,7 @@ protected:
const css::uno::Reference< css::datatransfer::clipboard::XClipboard >&
getOwnClipboard() const { return mxClipboard; }
-private:
+public:
// XTransferable
virtual css::uno::Any SAL_CALL getTransferData( const css::datatransfer::DataFlavor& rFlavor ) override;
@@ -188,6 +188,8 @@ private:
const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
virtual sal_Bool SAL_CALL isComplex() override;
+private:
+
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx
index 60d84dedbe24..b5713587ccf3 100644
--- a/include/vcl/uitest/uiobject.hxx
+++ b/include/vcl/uitest/uiobject.hxx
@@ -29,6 +29,7 @@
class Edit;
class SpinButton;
class SpinField;
+class VclDrawingArea;
class MetricField;
typedef std::map<const OUString, OUString> StringMap;
@@ -495,6 +496,17 @@ private:
SvTreeListEntry* const mpEntry;
};
+class UITEST_DLLPUBLIC DrawingAreaUIObject : public WindowUIObject
+{
+private:
+ VclPtr<VclDrawingArea> mxDrawingArea;
+public:
+ DrawingAreaUIObject(const VclPtr<VclDrawingArea>& rDrawingArea);
+ virtual ~DrawingAreaUIObject() override;
+ virtual void execute(const OUString& rAction, const StringMap& rParameters) override;
+ static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index ef208a1bc662..9ded43bcf6cc 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -162,6 +162,8 @@ public:
virtual void set_tooltip_text(const OUString& rTip) = 0;
virtual OUString get_tooltip_text() const = 0;
+ virtual void set_cursor_data(void * pData) = 0;
+
virtual void connect_focus_in(const Link<Widget&, void>& rLink)
{
assert(!m_aFocusInHdl.IsSet() || !rLink.IsSet());
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 68a5a8a4aa8a..fca4187af66e 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -229,8 +229,12 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper<
static void initializeNamespaceMaps();
void registerNamespaces();
- std::unique_ptr<SvXMLNamespaceMap> processNSAttributes(
+public:
+ static std::unique_ptr<SvXMLNamespaceMap> processNSAttributes(
+ std::unique_ptr<SvXMLNamespaceMap> & rpNamespaceMap,
+ SvXMLImport *const pImport,
const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList);
+private:
void Characters(const OUString& aChars);
css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator;
diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index d45832f02d81..6760162f5269 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -127,6 +127,16 @@ constexpr sal_uInt16 XML_NAMESPACE_PRESENTATION_SO52 = XML_OLD_NAMESPACE_BASE +
constexpr sal_uInt16 XML_NAMESPACE_CHART_SO52 = XML_OLD_NAMESPACE_BASE + 10;
constexpr sal_uInt16 XML_NAMESPACE_SMIL_SO52 = XML_OLD_NAMESPACE_BASE + 11;
+// OOo extension digital signatures, used in ODF 1.1
+constexpr sal_uInt16 XML_NAMESPACE_DSIG_OOO = 200;
+// ODF 1.2 digital signature namespaces
+constexpr sal_uInt16 XML_NAMESPACE_DSIG = 201;
+constexpr sal_uInt16 XML_NAMESPACE_DS = 202;
+constexpr sal_uInt16 XML_NAMESPACE_XADES132 = 203;
+constexpr sal_uInt16 XML_NAMESPACE_XADES141 = 204;
+// OOXML digital signature extension namespaces, also based on xmldsig-core
+constexpr sal_uInt16 XML_NAMESPACE_MDSSI = 205;
+constexpr sal_uInt16 XML_NAMESPACE_MSODIGSIG = 206;
#endif // INCLUDED_XMLOFF_XMLNMSPE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 74e51fb7c41e..f5593c628c84 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -133,6 +133,19 @@ namespace xmloff { namespace token {
XML_NP_GRDDL,
XML_N_GRDDL,
+ // OOo extension digital signatures, used in ODF 1.1
+ XML_NP_DSIG_OOO,
+ XML_N_DSIG_OOO,
+ // ODF 1.2 digital signatures
+ XML_NP_DSIG,
+ XML_N_DSIG,
+ XML_NP_DS,
+ XML_N_DS,
+ XML_NP_XADES132,
+ XML_N_XADES132,
+ XML_NP_XADES141,
+ XML_N_XADES141,
+
// ODF Enhanced namespaces
XML_NP_OFFICE_EXT,
XML_N_OFFICE_EXT,
diff --git a/instsetoo_native/CustomTarget_install.mk b/instsetoo_native/CustomTarget_install.mk
index f014f192921c..f215fc3c974b 100644
--- a/instsetoo_native/CustomTarget_install.mk
+++ b/instsetoo_native/CustomTarget_install.mk
@@ -87,6 +87,7 @@ $(foreach pkgformat,$(5),\
-l $(subst $(WHITESPACE),$(COMMA),$(strip $(2))) \
-p $(PRODUCTNAME_no_spaces)$(3) \
-u $(instsetoo_OUT) \
+ -packer $(COMPRESSIONTOOL) \
-buildid $(if $(filter deb0 rpm0,$(pkgformat)$(LIBO_VERSION_PATCH)),1,$(LIBO_VERSION_PATCH)) \
$(if $(filter WNT,$(OS)), \
-msitemplate $(dir $@)msi_templates \
diff --git a/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh b/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
index 0fe0b1d27dde..6808b3631d73 100644
--- a/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
+++ b/instsetoo_native/inc_openoffice/unix/find-requires-x11.sh
@@ -23,5 +23,7 @@ if [[ "${OS}" == "AIX" ]]; then
echo "libfreetype.a(libfreetype.so.6${mark64})"
else
echo "libfreetype.so.6${mark64}"
- echo "libXinerama.so.1${mark64}"
+ if [[ "${XINERAMA_LINK}" == "dynamic" ]]; then
+ echo "libXinerama.so.1${mark64}"
+ fi
fi
diff --git a/instsetoo_native/util/openoffice.lst.in b/instsetoo_native/util/openoffice.lst.in
index 4b6191cba3a7..988218ff6992 100644
--- a/instsetoo_native/util/openoffice.lst.in
+++ b/instsetoo_native/util/openoffice.lst.in
@@ -27,7 +27,7 @@ Globals
REGISTRYLAYERNAME Layers
SERVICEPACK 1
UPDATE_DATABASE 1
- CREATE_MSP_INSTALLSET 1
+ CREATE_MSP_INSTALLSET 0
UPDATE_DATABASE_LISTNAME finals_instsetoo.txt
PACKAGEMAP package_names.txt,package_names_ext.txt
WINDOWSPATCHLEVEL @LIBO_VERSION_PATCH@
diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index c8a9ccccb72f..974ce01dbc64 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -72,6 +72,18 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
mkdir -p $(IOSRES)/share/fonts
cp -R $(INSTDIR)/share/fonts/truetype $(IOSRES)/share/fonts
cp -R $(INSTDIR)/share/gallery $(IOSRES)/share
+ mkdir -p $(IOSRES)/share/spell $(IOSRES)/share/thes
+ # Install the Swiss German dictionary and use it for Liechtenstein, too.
+ # Install also thesauruses.
+ if test -d $(INSTDIR)/share/extensions/dict-de; then \
+ cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff $(IOSRES)/share/spell/de_CH.aff; \
+ cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic $(IOSRES)/share/spell/de_CH.dic; \
+ cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff $(IOSRES)/share/spell/de_LI.aff; \
+ cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic $(IOSRES)/share/spell/de_LI.dic; \
+ cp $(INSTDIR)/share/extensions/*/th_*_v2.* $(IOSRES)/share/thes; \
+ cp $(INSTDIR)/share/extensions/dict-en/th_en_US_v2.dat $(IOSRES)/share/thes/th_en_GB_v2.dat; \
+ cp $(INSTDIR)/share/extensions/dict-en/th_en_US_v2.idx $(IOSRES)/share/thes/th_en_GB_v2.idx; \
+ fi
cp -R $(INSTDIR)/share/palette $(IOSRES)/share
cp -R $(INSTDIR)/share/fingerprint $(IOSRES)/share
cp $(SRCDIR)/ios/welcome.odt $(IOSRES)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 4760ab629313..ea133ea6c78c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -687,17 +687,22 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
// all versions below 1.5.1
options.emplace_back("abort", reinterpret_cast<void*>(abort_handler));
bool hasStackSize = false;
+#ifdef UNX
+ // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
+ // in the class path in order to have applet support:
+ OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion);
+#endif
for (int i = 0; i < cOptions; i++)
{
OString opt(arOptions[i].optionString);
#ifdef UNX
- // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
- // in the class path in order to have applet support:
if (opt.startsWith("-Djava.class.path="))
{
- OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion);
if (!sAddPath.isEmpty())
+ {
opt += OStringChar(SAL_PATHSEPARATOR) + sAddPath;
+ sAddPath.clear();
+ }
}
#endif
if (opt == "-Xint") {
@@ -742,6 +747,11 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
}
#endif
}
+#ifdef UNX
+ if (!sAddPath.isEmpty()) {
+ options.emplace_back("-Djava.class.path=" + sAddPath, nullptr);
+ }
+#endif
std::unique_ptr<JavaVMOption[]> sarOptions(new JavaVMOption[options.size()]);
for (std::vector<Option>::size_type i = 0; i != options.size(); ++i) {
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 32120308f932..f532ebd53fd3 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -210,8 +210,12 @@ javaFrameworkError jfw_startVM(
//In direct mode the options are specified by bootstrap variables
//of the form UNO_JAVA_JFW_PARAMETER_1 .. UNO_JAVA_JFW_PARAMETER_n
vmParams = jfw::BootParams::getVMParameters();
- sUserClassPath =
- "-Djava.class.path=" + jfw::BootParams::getClasspath();
+ auto const cp = jfw::BootParams::getClasspath();
+ if (!cp.isEmpty())
+ {
+ sUserClassPath =
+ "-Djava.class.path=" + cp;
+ }
}
else
OSL_ASSERT(false);
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index ece4dd2bd717..1a70000425e2 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -458,8 +458,10 @@ OString makeClassPathOption(OUString const & sUserClassPath)
sBufCP.append(sAppCP);
}
- sPaths = OUStringToOString(
- sBufCP.makeStringAndClear(), osl_getThreadTextEncoding());
+ sPaths = OUStringToOString(sBufCP.makeStringAndClear(), osl_getThreadTextEncoding());
+ if (sPaths.isEmpty()) {
+ return "";
+ }
OString sOptionClassPath = "-Djava.class.path=" + sPaths;
return sOptionClassPath;
diff --git a/librelogo/source/LibreLogo/LibreLogo.py b/librelogo/source/LibreLogo/LibreLogo.py
index 2fa16ed81822..57ce696d288e 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -401,7 +401,7 @@ def __translate__(arg = None):
text = selection.getString()
# remove comments and strings
text = re.sub(r"[ ]*;[^\n]*", "", re.sub(r"['„“‘«»「][^\n'”“‘’«»」]*['”“‘’«»」]", "", re.sub(r"^[ \t]*[;#][^\n]*", "", text)))
- text = " ".join(set(re.findall("(?u)\w+", text)) - set(re.findall("(?u)\w*\d+\w*", text))).lower() # only words
+ text = " ".join(set(re.findall(r"(?u)\w+", text)) - set(re.findall(r"(?u)\w*\d+\w*", text))).lower() # only words
ctx = uno.getComponentContext()
guess = ctx.ServiceManager.createInstanceWithContext("com.sun.star.linguistic2.LanguageGuessing", ctx)
guess.disableLanguages(guess.getEnabledLanguages())
@@ -424,7 +424,7 @@ def __translate__(arg = None):
text = re.sub(r"^(([ \t]*[;#][^\n]*))", __encodecomment__, text)
text = re.sub("(?u)([%s])((?:[^\n%s]|\\\\[%s])*)(?<!\\\\)[%s]" % (lq, rq, rq, rq), __encodestring__, selection.getString())
- text = re.sub('(?u)(?<![0-9])(")(~?\w*)', __encodestring__, text)
+ text = re.sub(r'(?u)(?<![0-9])(")(~?\w*)', __encodestring__, text)
text = re.sub(r";(([^\n]*))", __encodecomment__, text)
# translate the program to the language of the document FIXME space/tab
@@ -433,12 +433,12 @@ def __translate__(arg = None):
in2 = __l12n__(_.lng)['IN'].split("|")[0].upper()
if in1[0] == '-' and in2[0] != '-': # "for x y-in" -> "for x in y"
exception += ['IN']
- text = re.sub(r"(?ui)\b((?:%s) +:?\w+) +([^\n]+)(?:%s) +(?=[[] |[[]\n)" % (lang['FOR'], in1), "\\1 %s \\2 " % in2, text)
- text = re.sub(r"(?ui)(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % in1, "%s \\1" % in2, text)
+ text = re.sub(r"(?ui)\b((?:%s) +:?\w+) +([^\n]+)(?:%s) +(?=[\[] |[\[]\n)" % (lang['FOR'], in1), "\\1 %s \\2 " % in2, text)
+ text = re.sub(r"(?ui)(:?\b\w+|[\[][^[\n]*])\b(?:%s)\b" % in1, "%s \\1" % in2, text)
elif in1[0] != '-' and in2[0] == '-': # "for x in y" -> "for x y-in"
exception += ['IN']
- text = re.sub(r"(?ui)(?<=\n)((?:%s)\b +:?\w+) +(?:%s) +([^\n]+?) +(?=[[] |[[]\n)" % (lang['FOR'], in1), "\\1 \\2%s " % in2, text)
- text = re.sub(r"(?ui)(?<!:)\b(?:%s) +(:?\b\w+|[[][^[\n]*])\b" % in1, "\\1%s" % in2, text)
+ text = re.sub(r"(?ui)(?<=\n)((?:%s)\b +:?\w+) +(?:%s) +([^\n]+?) +(?=[\[] |[\[]\n)" % (lang['FOR'], in1), "\\1 \\2%s " % in2, text)
+ text = re.sub(r"(?ui)(?<!:)\b(?:%s) +(:?\b\w+|[\[][^[\n]*])\b" % in1, "\\1%s" % in2, text)
for i in set(lang) - set(exception):
text = re.sub(r'(?ui)(?<!:)\b(%s)\b' % lang[i], __l12n__(_.lng)[i].split("|")[0].upper(), text)
text = re.sub(r"(?<=\d)[%s](?=\d)" % lang['DECIMAL'], __l12n__(_.lng)['DECIMAL'], text)
@@ -554,9 +554,9 @@ class LogoProgram(threading.Thread):
MessageBox(parent, __l12n__(_.lng)['ERR_ARGUMENTS'] % (__locname__('REPEAT'), 1, 0), caption, "errorbox")
else:
MessageBox(parent, __l12n__(_.lng)['ERR_NAME'] % \
- to_unicode(re.search("(?<=name ')[\w_]*(?=')", message).group(0)), caption, "errorbox")
+ to_unicode(re.search(r"(?<=name ')[\w_]*(?=')", message).group(0)), caption, "errorbox")
elif "TypeError" in message and "argument" in message and "given" in message:
- r = re.search("([\w_]*)[(][)][^\n]* (\w+) arguments? [(](\d+)", message) # XXX later: handle 'no arguments' + plural
+ r = re.search(r"([\w_]*)[(][)][^\n]* (\w+) arguments? [(](\d+)", message) # XXX later: handle 'no arguments' + plural
MessageBox(parent, __l12n__(_.lng)['ERR_ARGUMENTS'] % (__locname__(r.group(1)), r.group(2), r.group(3)), caption, "errorbox")
else:
origline = __compiled__.split("\n")[line-1]
@@ -1541,7 +1541,7 @@ def create_svg_animation(m):
def create_valid_svg_file(filename):
with open(filename, "r") as f:
s = f.read()
- s = re.sub('(?s)(<g\\sid="[^"]*)\(([^"]*)\)', '\\1\\2', s) # bad "(", ")" in xml:id
+ s = re.sub(r'(?s)(<g\sid="[^"]*)\(([^"]*)\)', '\\1\\2', s) # bad "(", ")" in xml:id
s = re.sub('(?s)<g\\sooo:[^>]*>', '', s) # remove non standard attributes
s = re.sub('(?s)<defs class="EmbeddedBulletChars">.*(?=<defs class="TextEmbeddedBitmaps")', '', s) # remove unused parts
s = re.sub('(?s)(<path stroke-width="[^"]*"[^<]*)stroke-width="[^"]*"', '\\1', s) # double stroke-width
@@ -1676,7 +1676,7 @@ def __loadlang__(lang, a):
[r"(?<!:)\b(?:%s)\b" % a['OUTPUT'], "\nreturn"],
[r"\n(if|while|return) [^\n]*", lambda r: re.sub("(?<![=!<>])=(?!=)", "==", r.group(0))], # = -> ==, XXX x = y = 1?
[r"(?<=\n)(for\b :?\w+) ([^\n]+)(?<=\w|]|}|\))(?=-|:)(?:%s)\b" % a['IN'], "\\1 in \\2"], # "for x y-in" -> "for x in y"
- [r"(:?\b\w+|[[][^[\n]*])\b(?:%s)\b" % a['IN'], "in \\1"], # "x y-in" -> "x in y"
+ [r"(:?\b\w+|[\[][^[\n]*])\b(?:%s)\b" % a['IN'], "in \\1"], # "x y-in" -> "x in y"
[r"(?<!:)\b(?:%s)\b" % a['IN'], "in"],
[r"(?<!:)\b(?:%s)\b[ \t]+(:?\w+)\b(?! in\b)" % a['FOR'], "\nfor \\1 in"],
[r"(?<=\n)__repeat__ :\n", "while True:\n"], # infinite loop
@@ -1755,7 +1755,7 @@ def __loadlang__(lang, a):
[r"(?<!:)\b(?:%s)\b ?\(" % a['RESUB'], "re.sub('(?u)'+"],
[r"(?<!:)\b(?:%s)\b ?\(" % a['REFINDALL'], "re.findall('(?u)'+"],
[r"(?<!:)\b(?:%s)\b" % a['ANY'], "u'any'"],
- [r"(?<!:)\b(?:%s) (\w+|[[][^\]]*])\b" % a['INPUT'], " Input(\\1)"],
+ [r"(?<!:)\b(?:%s) (\w+|[\[][^\]]*])\b" % a['INPUT'], " Input(\\1)"],
[r"(?<!:)\b(?:%s)\b" % a['PRINT'], "\nPrint"],
[r"(?<!:)\b(?:%s)\b" % a['TURNLEFT'], "\n)turnleft("],
[r"\b([0-9]+([,.][0-9]+)?)(%s)\b" % a['PT'], "\\1"],
@@ -1904,7 +1904,7 @@ def __compil__(s):
rq = '\'' + __l12n__(_.lng)['RIGHTSTRING'].replace("|", "")
__strings__ = []
s = re.sub("(?u)([%s])((?:[^\n%s]|\\\\[%s])*)(?<!\\\\)[%s]" % (lq, rq, rq, rq), __encodestring__, s)
- s = re.sub('(?u)(?<![0-9])(")(~?\w*)', __encodestring__, s)
+ s = re.sub(r'(?u)(?<![0-9])(")(~?\w*)', __encodestring__, s)
# remove extra spaces
s = chsp.sub(" ", s)
@@ -1918,7 +1918,7 @@ def __compil__(s):
# replace procedure names
s = re.sub(r"(?i)^[ ]*(%s)[ ]+" % __l12n__(_.lng)['TO'], "__def__ ", s)
s = re.sub(r"(?i)\n[ ]*(%s)[ ]+" % __l12n__(_.lng)['TO'], "\n__def__ ", s)
- subnames = re.findall(u"(?iu)(?<=__def__ )\w+", s)
+ subnames = re.findall(r"(?iu)(?<=__def__ )\w+", s)
globs = ""
functions = ["range", "__int__", "__float__", "Random", "Input", "__string__", "len", "round", "abs", "sin", "cos", "sqrt", "log10", "set", "list", "tuple", "re.sub", "re.search", "re.findall", "sorted", "min", "max"]
defaultfunc = ["Print"] # TODO handle all default procedures
@@ -1930,7 +1930,7 @@ def __compil__(s):
firstend = ends.split("|")[0]
s = re.sub(r"(?<!:)\b(?:%s)\b" % ends, firstend, s)
__l12n__(_.lng)["END"] = firstend
- functions += [ re.findall("(?u)\w+",i[0])[0] for i in re.findall(r"""(?iu)(?<=__def__ )([^\n]*)\n # beginning of a procedure
+ functions += [ re.findall(r"(?u)\w+",i[0])[0] for i in re.findall(r"""(?iu)(?<=__def__ )([^\n]*)\n # beginning of a procedure
(?:[^\n]*(?<!\b(%(END)s))\n)* # 0 or more lines (not END)
[^\n]*\b(?:%(OUTPUT)s)\b[^\n]*\n # line with OUTPUT (functions = procedures with OUTPUT)
(?:[^\n]*(?<!\b(?:%(END)s))\n)* # 0 or more lines (not END)
@@ -1939,7 +1939,7 @@ def __compil__(s):
# add line breaks before procedure calls
procedures = set(subnames) - set(functions)
if len(procedures) > 0:
- s = re.sub(r"(?<!__def__)(?<![-+=*/])(?<!%s)(?:^|[ \t]+)(" % ")(?<!".join(functions) + "|".join(procedures) + ")(?!\w)", r"\n\1", s)
+ s = re.sub(r"(?<!__def__)(?<![-+=*/])(?<!%s)(?:^|[ \t]+)(" % ")(?<!".join(functions) + "|".join(procedures) + r")(?!\w)", r"\n\1", s)
# substitute LibreLogo functions and specifiers with their Python equivalents
for i in __comp__[_.lng]:
@@ -1947,12 +1947,12 @@ def __compil__(s):
indent = 0 # Python indentation level
result = ""
- func = re.compile("(?iu)(def (\w+))(\(.*\):)")
+ func = re.compile(r"(?iu)(def (\w+))(\(.*\):)")
# compile to Python
subroutines = re.compile(r"(?iu)(?<!def )(?<![_\w])\b(%s)\b(?![\w(])" % "|".join(subnames + functions + defaultfunc))
operators = re.compile(r"(?iu)(%s)" % "(?:[ ]*([+*/<>]|//|==|<=|>=|<>|!=)[ ]*|[ ]*-[ ]+|(?<! )-[ ]*|[ ]*[*][*][ ]*)") # operators, eg. " - ", "-", "- "
- atoms = re.compile(r"(?iu)(%s)" % "[0-9]+([.,][0-9]+)?|:?\w+([.]\w)?")
+ atoms = re.compile(r"(?iu)(%s)" % r"[0-9]+([.,][0-9]+)?|:?\w+([.]\w)?")
# store argument numbers of all subroutines in dictionary "names"
names = {key: 1 for key in functions + defaultfunc}
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
index 68c3e881caa4..9117cee8f501 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
@@ -9,6 +9,7 @@
#include <gtk/gtk.h>
+#include <cassert>
#include <cmath>
#include <iostream>
@@ -143,6 +144,10 @@ static bool gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo)
cairo_rectangle(pCairo, aRectangle.x, aRectangle.height, aRectangle.width, 1);
cairo_fill(pCairo);
}
+ else
+ {
+ assert(false); // should never happen
+ }
gtv_calc_header_bar_draw_text(pCairo, aRectangle, rHeader.m_aText);
nPrevious = rHeader.m_nSize;
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 3eb5a5753085..91a26dbb79b3 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1386,6 +1386,8 @@ callback (gpointer pData)
case LOK_CALLBACK_TAB_STOP_LIST:
case LOK_CALLBACK_FORM_FIELD_BUTTON:
case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
+ case LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR:
+ case LOK_COMMAND_BLOCKED:
{
// TODO: Implement me
break;
diff --git a/lingucomponent/Module_lingucomponent.mk b/lingucomponent/Module_lingucomponent.mk
index 9dabeb155673..2bde5d5391e5 100644
--- a/lingucomponent/Module_lingucomponent.mk
+++ b/lingucomponent/Module_lingucomponent.mk
@@ -13,9 +13,9 @@ $(eval $(call gb_Module_Module,lingucomponent))
$(eval $(call gb_Module_add_targets,lingucomponent,\
Library_guesslang \
Library_hyphen \
- $(if $(filter-out iOS,$(OS)),Library_lnth) \
+ Library_lnth \
$(if $(filter iOS MACOSX,$(OS)),Library_MacOSXSpell) \
- $(if $(filter-out iOS,$(OS)),Library_spell) \
+ Library_spell \
StaticLibrary_ulingu \
Library_numbertext \
))
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx
index 76c79aba698a..c6d914614716 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -34,6 +34,7 @@
#include <unotools/bootstrap.hxx>
#include <unotools/lingucfg.hxx>
#include <unotools/pathoptions.hxx>
+#include <rtl/bootstrap.hxx>
#include <rtl/ustring.hxx>
#include <rtl/string.hxx>
#include <rtl/tencinfo.h>
@@ -58,7 +59,7 @@ OString Win_AddLongPathPrefix( const OString &rPathName )
}
#endif //defined(WNT)
-#ifdef SYSTEM_DICTS
+#if defined SYSTEM_DICTS || defined IOS
// find old style dictionaries in system directories
static void GetOldStyleDicsInDir(
OUString const & aSystemDir, OUString const & aFormatName,
@@ -143,7 +144,7 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy
OUString aFormatName;
OUString aDicExtension;
-#ifdef SYSTEM_DICTS
+#if defined SYSTEM_DICTS || defined IOS
OUString aSystemDir;
OUString aSystemPrefix;
OUString aSystemSuffix;
@@ -155,6 +156,10 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy
#ifdef SYSTEM_DICTS
aSystemDir = DICT_SYSTEM_DIR;
aSystemSuffix = aDicExtension;
+#elif defined IOS
+ aSystemDir = "$BRAND_BASE_DIR/share/spell";
+ rtl::Bootstrap::expandMacros(aSystemDir);
+ aSystemSuffix = ".dic";
#endif
}
else if (strcmp( pDicType, "HYPH" ) == 0)
@@ -175,17 +180,23 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy
aSystemDir = THES_SYSTEM_DIR;
aSystemPrefix = "th_";
aSystemSuffix = "_v2.dat";
+#elif defined IOS
+ aSystemDir = "$BRAND_BASE_DIR/share/thes";
+ rtl::Bootstrap::expandMacros(aSystemDir);
+ aSystemPrefix = "th_";
+ aSystemSuffix = "_v2.dat";
#endif
}
if (aFormatName.isEmpty() || aDicExtension.isEmpty())
return aRes;
-#ifdef SYSTEM_DICTS
+#if defined SYSTEM_DICTS || defined IOS
// set of languages to remember the language where it is already
// decided to make use of the dictionary.
std::set< OUString > aDicLangInUse;
+#ifndef IOS
// follow the hunspell tool's example and check DICPATH for preferred dictionaries
rtl_uString * pSearchPath = nullptr;
osl_getEnvironment(OUString("DICPATH").pData, &pSearchPath);
@@ -220,6 +231,7 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy
}
while (nIndex != -1);
}
+#endif
// load system directories last so that DICPATH prevails
GetOldStyleDicsInDir(aSystemDir, aFormatName, aSystemSuffix, aSystemPrefix,
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index ef3d5decb013..822e7481daac 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -138,12 +138,13 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales()
}
}
#ifdef IOS
- // iOS says it has specifically de_DE, but let's assume it is good enough for the other
- // variants, too, for now.
+ // iOS says it has specifically de_DE. Let's assume it is good enough for German as
+ // written in Austria, Belgium, and Luxembourg, too. (Not for German in Switzerland and
+ // Liechtenstein. For those you need to bundle the myspell dictionary.)
else if ([pLangStr isEqualToString:@"de_DE"])
{
const std::vector<NSString*> aDE
- { @"AT", @"BE", @"CH", @"DE", @"LI", @"LU" };
+ { @"AT", @"BE", @"DE", @"LU" };
for (auto c: aDE)
{
pLangStr = [@"de_" stringByAppendingString: c];
@@ -194,11 +195,36 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales()
postspdict.push_back( pLangStr );
}
}
+#ifdef IOS
+ else if ([pLangStr isEqualToString:@"fr_FR"])
+ {
+ const std::vector<NSString*> aFR
+ { @"BE", @"BF", @"BJ", @"CA", @"CH", @"CI", @"FR", @"LU", @"MC", @"ML",
+ @"MU", @"NE", @"SN", @"TG" };
+ for (auto c: aFR)
+ {
+ pLangStr = [@"fr_" stringByAppendingString: c];
+ postspdict.push_back( pLangStr );
+ }
+ }
+#endif
else if ([pLangStr isEqualToString:@"it"])
{
postspdict.push_back( @"it_CH" );
postspdict.push_back( @"it_IT" );
}
+#ifdef IOS
+ else if ([pLangStr isEqualToString:@"it_IT"])
+ {
+ const std::vector<NSString*> aIT
+ { @"CH", @"IT" };
+ for (auto c: aIT)
+ {
+ pLangStr = [@"it_" stringByAppendingString: c];
+ postspdict.push_back( pLangStr );
+ }
+ }
+#endif
else if ([pLangStr isEqualToString:@"ko"])
{
postspdict.push_back( @"ko_KR" );
diff --git a/lotuswordpro/qa/cppunit/data/pass/ofz20517-1.lwp b/lotuswordpro/qa/cppunit/data/pass/ofz20517-1.lwp
new file mode 100644
index 000000000000..de6dcbf1c5d5
--- /dev/null
+++ b/lotuswordpro/qa/cppunit/data/pass/ofz20517-1.lwp
Binary files differ
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx
index 38e8c3162f08..1489cf14cfdb 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -499,7 +499,7 @@ void LwpDrawPolyLine::Read()
m_pStream->ReadUChar( m_aPolyLineRec.aPenColor.unused );
m_pStream->ReadUInt16( m_aPolyLineRec.nNumPoints );
- if (m_aPolyLineRec.nNumPoints > m_pStream->remainingSize() / 4)
+ if (!m_pStream->good() || m_aPolyLineRec.nNumPoints > m_pStream->remainingSize() / 4)
throw BadRead();
m_pVector.reset( new SdwPoint[m_aPolyLineRec.nNumPoints] );
@@ -579,7 +579,7 @@ void LwpDrawPolygon::Read()
ReadClosedObjStyle();
m_pStream->ReadUInt16( m_nNumPoints );
- if (m_nNumPoints > m_pStream->remainingSize() / 4)
+ if (!m_pStream->good() || m_nNumPoints > m_pStream->remainingSize() / 4)
throw BadRead();
m_pVector.reset( new SdwPoint[m_nNumPoints] );
@@ -1043,6 +1043,9 @@ void LwpDrawTextBox::Read()
m_pStream->ReadInt16( m_aTextRec.nTextRotation );
m_pStream->ReadInt16( m_aTextRec.nTextExtraSpacing );
+ if (!m_pStream->good())
+ throw BadRead();
+
// some draw files in version 1.2 have an extra byte following '\0'.
// can't rely on that, so read in the whole string into memory.
@@ -1089,6 +1092,9 @@ XFFrame* LwpDrawTextBox::CreateDrawObj(const OUString& rStyleName )
aEncoding = LwpCharSetMgr::GetTextCharEncoding();
}
+ if (TextLength < 2)
+ throw BadRead();
+
XFParagraph* pXFPara = new XFParagraph();
pXFPara->Add(OUString(reinterpret_cast<char*>(m_aTextRec.pTextString), (TextLength-2), aEncoding));
pXFPara->SetStyleName(rStyleName);
@@ -1194,17 +1200,17 @@ void LwpDrawTextArt::Read()
m_pStream->ReadInt16( m_aTextArtRec.nRotation );
sal_uInt16 nPointNumber;
- sal_Int16 nX, nY;
m_pStream->ReadUInt16( nPointNumber );
size_t nPoints = nPointNumber*3+1;
- if (nPoints > m_pStream->remainingSize() / 4)
+ if (!m_pStream->good() || nPoints > m_pStream->remainingSize() / 4)
throw BadRead();
m_aTextArtRec.aPath[0].n = nPointNumber;
m_aTextArtRec.aPath[0].pPts = new SdwPoint[nPoints];
for (size_t nPt = 0; nPt < nPoints; ++nPt)
{
+ sal_Int16 nX, nY;
m_pStream->ReadInt16( nX );
m_pStream->ReadInt16( nY );
m_aTextArtRec.aPath[0].pPts[nPt].x = nX;
@@ -1214,13 +1220,14 @@ void LwpDrawTextArt::Read()
m_pStream->ReadUInt16( nPointNumber );
nPoints = nPointNumber*3+1;
- if (nPoints > m_pStream->remainingSize() / 4)
+ if (!m_pStream->good() || nPoints > m_pStream->remainingSize() / 4)
throw BadRead();
m_aTextArtRec.aPath[1].n = nPointNumber;
m_aTextArtRec.aPath[1].pPts = new SdwPoint[nPoints];
for (size_t nPt = 0; nPt < nPoints; ++nPt)
{
+ sal_Int16 nX, nY;
m_pStream->ReadInt16( nX );
m_pStream->ReadInt16( nY );
m_aTextArtRec.aPath[1].pPts[nPt].x = nX;
@@ -1248,8 +1255,12 @@ void LwpDrawTextArt::Read()
- (m_aTextArtRec.aPath[1].n*3 + 1)*4;
+ if (!m_pStream->good())
+ throw BadRead();
if (m_aTextArtRec.nTextLen > m_pStream->remainingSize())
throw BadRead();
+ if (m_aTextArtRec.nTextLen < 1)
+ throw BadRead();
m_aTextArtRec.pTextString = new sal_uInt8 [m_aTextArtRec.nTextLen];
m_pStream->ReadBytes(m_aTextArtRec.pTextString, m_aTextArtRec.nTextLen);
@@ -1344,6 +1355,22 @@ LwpDrawBitmap::~LwpDrawBitmap()
{
}
+static bool IsValid(const BmpInfoHeader2& rHeader)
+{
+ if (rHeader.nPlanes != 1)
+ return false;
+
+ if (rHeader.nBitCount != 0 && rHeader.nBitCount != 1 &&
+ rHeader.nBitCount != 4 && rHeader.nBitCount != 8 &&
+ rHeader.nBitCount != 16 && rHeader.nBitCount != 24 &&
+ rHeader.nBitCount != 32)
+ {
+ return false;
+ }
+
+ return true;
+}
+
/**
* @descr reading function of class LwpDrawBitmap
*/
@@ -1353,25 +1380,38 @@ void LwpDrawBitmap::Read()
m_pStream->ReadUInt16( m_aBmpRec.nRotation );
// 20 == length of draw-specific fields.
- // 14 == length of bmp file header.
- m_aBmpRec.nFileSize = m_aObjHeader.nRecLen - 20 + 14;
- m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] );
+ if (m_aObjHeader.nRecLen < 20)
+ throw BadRead();
+
+ sal_uInt64 nBmpPos = m_pStream->Tell();
+ sal_uInt64 nBmpLen =
+ std::min<sal_uInt64>(m_aObjHeader.nRecLen - 20, m_pStream->remainingSize());
BmpInfoHeader2 aInfoHeader2;
m_pStream->ReadUInt32( aInfoHeader2.nHeaderLen );
+ if (!m_pStream->good() || nBmpLen < aInfoHeader2.nHeaderLen)
+ throw BadRead();
+
sal_uInt32 N;
sal_uInt32 rgbTableSize;
if (aInfoHeader2.nHeaderLen == sizeof(BmpInfoHeader))
{
- m_pStream->ReadUInt32( aInfoHeader2.nWidth );
- m_pStream->ReadUInt32( aInfoHeader2.nHeight );
+ sal_uInt16 nTmp;
+
+ m_pStream->ReadUInt16( nTmp );
+ aInfoHeader2.nWidth = nTmp;
+ m_pStream->ReadUInt16( nTmp );
+ aInfoHeader2.nHeight = nTmp;
m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
+ if (!m_pStream->good() || !IsValid(aInfoHeader2))
+ throw BadRead();
+
N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
- if (N == 24)
+ if (N >= 16)
{
rgbTableSize = 0;
}
@@ -1380,14 +1420,18 @@ void LwpDrawBitmap::Read()
rgbTableSize = 3 * (1 << N);
}
}
- else
+ else if (aInfoHeader2.nHeaderLen >= sizeof(BmpInfoHeader2))
{
m_pStream->ReadUInt32( aInfoHeader2.nWidth );
m_pStream->ReadUInt32( aInfoHeader2.nHeight );
m_pStream->ReadUInt16( aInfoHeader2.nPlanes );
m_pStream->ReadUInt16( aInfoHeader2.nBitCount );
+
+ if (!m_pStream->good() || !IsValid(aInfoHeader2))
+ throw BadRead();
+
N = aInfoHeader2.nPlanes * aInfoHeader2.nBitCount;
- if (N == 24)
+ if (N >= 16)
{
rgbTableSize = 0;
}
@@ -1395,8 +1439,14 @@ void LwpDrawBitmap::Read()
{
rgbTableSize = 4 * (1 << N);
}
-
}
+ else
+ {
+ throw BadRead();
+ }
+
+ m_aBmpRec.nFileSize = static_cast<sal_uInt32>(nBmpLen + 14);
+ m_pImageData.reset( new sal_uInt8 [m_aBmpRec.nFileSize] );
sal_uInt32 nOffBits = 14 + aInfoHeader2.nHeaderLen + rgbTableSize;
m_pImageData[0] = 'B';
@@ -1414,50 +1464,11 @@ void LwpDrawBitmap::Read()
m_pImageData[12] = static_cast<sal_uInt8>(nOffBits >> 16);
m_pImageData[13] = static_cast<sal_uInt8>(nOffBits >> 24);
- sal_uInt32 nDIBRemaining;
sal_uInt8* pPicData = m_pImageData.get();
- if (aInfoHeader2.nHeaderLen== sizeof(BmpInfoHeader))
- {
- m_pImageData[14] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen);
- m_pImageData[15] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen >> 8);
- m_pImageData[16] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen >> 16);
- m_pImageData[17] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen >> 24);
- m_pImageData[18] = static_cast<sal_uInt8>(aInfoHeader2.nWidth);
- m_pImageData[19] = static_cast<sal_uInt8>(aInfoHeader2.nWidth >> 8);
- m_pImageData[20] = static_cast<sal_uInt8>(aInfoHeader2.nHeight);
- m_pImageData[21] = static_cast<sal_uInt8>(aInfoHeader2.nHeight >> 8);
- m_pImageData[22] = static_cast<sal_uInt8>(aInfoHeader2.nPlanes);
- m_pImageData[23] = static_cast<sal_uInt8>(aInfoHeader2.nPlanes >> 8);
- m_pImageData[24] = static_cast<sal_uInt8>(aInfoHeader2.nBitCount);
- m_pImageData[25] = static_cast<sal_uInt8>(aInfoHeader2.nBitCount >> 8);
-
- nDIBRemaining = m_aBmpRec.nFileSize - 26;
- pPicData += 26*sizeof(sal_uInt8);
- }
- else
- {
- m_pImageData[14] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen);
- m_pImageData[15] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen >> 8);
- m_pImageData[16] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen >> 16);
- m_pImageData[17] = static_cast<sal_uInt8>(aInfoHeader2.nHeaderLen >> 24);
- m_pImageData[18] = static_cast<sal_uInt8>(aInfoHeader2.nWidth);
- m_pImageData[19] = static_cast<sal_uInt8>(aInfoHeader2.nWidth >> 8);
- m_pImageData[20] = static_cast<sal_uInt8>(aInfoHeader2.nWidth >> 16);
- m_pImageData[21] = static_cast<sal_uInt8>(aInfoHeader2.nWidth >> 24);
- m_pImageData[22] = static_cast<sal_uInt8>(aInfoHeader2.nHeight);
- m_pImageData[23] = static_cast<sal_uInt8>(aInfoHeader2.nHeight >> 8);
- m_pImageData[24] = static_cast<sal_uInt8>(aInfoHeader2.nHeight >> 16);
- m_pImageData[25] = static_cast<sal_uInt8>(aInfoHeader2.nHeight >> 24);
- m_pImageData[26] = static_cast<sal_uInt8>(aInfoHeader2.nPlanes);
- m_pImageData[27] = static_cast<sal_uInt8>(aInfoHeader2.nPlanes >> 8);
- m_pImageData[28] = static_cast<sal_uInt8>(aInfoHeader2.nBitCount);
- m_pImageData[29] = static_cast<sal_uInt8>(aInfoHeader2.nBitCount >> 8);
-
- nDIBRemaining = m_aBmpRec.nFileSize - 30;
- pPicData += 30*sizeof(sal_uInt8);
- }
- m_pStream->ReadBytes(pPicData, nDIBRemaining);
+ m_pStream->Seek(nBmpPos);
+ if (nBmpLen != m_pStream->ReadBytes(pPicData + 14, nBmpLen))
+ throw BadRead();
}
OUString LwpDrawBitmap::RegisterStyle()
diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx
index f1d9917de8bf..8eabe7099883 100644
--- a/lotuswordpro/source/filter/lwpfribptr.cxx
+++ b/lotuswordpro/source/filter/lwpfribptr.cxx
@@ -85,7 +85,8 @@
#include <lwpdropcapmgr.hxx>
LwpFribPtr::LwpFribPtr()
- : m_pFribs(nullptr),m_pXFPara(nullptr),m_pPara(nullptr)
+ : m_pFribs(nullptr)
+ , m_pPara(nullptr)
{
}
@@ -174,7 +175,7 @@ void LwpFribPtr::XFConvert()
case FRIB_TAG_TEXT:
{
LwpFribText* textFrib= static_cast<LwpFribText*>(pFrib);
- textFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
+ textFrib->XFConvert(m_pXFPara.get(),m_pPara->GetStory());
}
break;
case FRIB_TAG_TAB:
@@ -246,7 +247,7 @@ void LwpFribPtr::XFConvert()
case FRIB_TAG_UNICODE3: //fall through
{
LwpFribUnicode* unicodeFrib= static_cast<LwpFribUnicode*>(pFrib);
- unicodeFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
+ unicodeFrib->XFConvert(m_pXFPara.get(), m_pPara->GetStory());
}
break;
case FRIB_TAG_HARDSPACE:
@@ -255,15 +256,15 @@ void LwpFribPtr::XFConvert()
LwpStory *pStory = m_pPara->GetStory();
LwpHyperlinkMgr* pHyperlink = pStory ? pStory->GetHyperlinkMgr() : nullptr;
if (pHyperlink && pHyperlink->GetHyperlinkFlag())
- pFrib->ConvertHyperLink(m_pXFPara,pHyperlink,sHardSpace);
+ pFrib->ConvertHyperLink(m_pXFPara.get(), pHyperlink,sHardSpace);
else
- pFrib->ConvertChars(m_pXFPara,sHardSpace);
+ pFrib->ConvertChars(m_pXFPara.get(), sHardSpace);
}
break;
case FRIB_TAG_SOFTHYPHEN:
{
OUString sSoftHyphen(u'\x00ad');
- pFrib->ConvertChars(m_pXFPara,sSoftHyphen);
+ pFrib->ConvertChars(m_pXFPara.get(), sSoftHyphen);
}
break;
case FRIB_TAG_FRAME:
@@ -275,64 +276,64 @@ void LwpFribPtr::XFConvert()
LwpFoundry* pFoundry = m_pPara->GetFoundry();
LwpDropcapMgr* pMgr = pFoundry ? pFoundry->GetDropcapMgr() : nullptr;
if (pMgr)
- pMgr->SetXFPara(m_pXFPara);
+ pMgr->SetXFPara(m_pXFPara.get());
}
- frameFrib->XFConvert(m_pXFPara);
+ frameFrib->XFConvert(m_pXFPara.get());
break;
}
case FRIB_TAG_CHBLOCK:
{
LwpFribCHBlock* chbFrib = static_cast<LwpFribCHBlock*>(pFrib);
- chbFrib->XFConvert(m_pXFPara,m_pPara->GetStory());
+ chbFrib->XFConvert(m_pXFPara.get(),m_pPara->GetStory());
}
break;
case FRIB_TAG_TABLE:
{
LwpFribTable* tableFrib = static_cast<LwpFribTable*>(pFrib);
//tableFrib->XFConvert(m_pPara->GetXFContainer());
- tableFrib->XFConvert(m_pXFPara);
+ tableFrib->XFConvert(m_pXFPara.get());
}
break;
case FRIB_TAG_BOOKMARK:
{
LwpFribBookMark* bookmarkFrib = static_cast<LwpFribBookMark*>(pFrib);
- bookmarkFrib->XFConvert(m_pXFPara);
+ bookmarkFrib->XFConvert(m_pXFPara.get());
}
break;
case FRIB_TAG_FOOTNOTE:
{
LwpFribFootnote* pFootnoteFrib = static_cast<LwpFribFootnote*>(pFrib);
- pFootnoteFrib->XFConvert(m_pXFPara);
+ pFootnoteFrib->XFConvert(m_pXFPara.get());
break;
}
case FRIB_TAG_FIELD:
{
LwpFribField* fieldFrib = static_cast<LwpFribField*>(pFrib);
- fieldFrib->XFConvert(m_pXFPara);
+ fieldFrib->XFConvert(m_pXFPara.get());
break;
}
case FRIB_TAG_NOTE:
{
LwpFribNote* pNoteFrib = static_cast<LwpFribNote*>(pFrib);
- pNoteFrib->XFConvert(m_pXFPara);
+ pNoteFrib->XFConvert(m_pXFPara.get());
break;
}
case FRIB_TAG_PAGENUMBER:
{
LwpFribPageNumber* pagenumFrib = static_cast<LwpFribPageNumber*>(pFrib);
- pagenumFrib->XFConvert(m_pXFPara);
+ pagenumFrib->XFConvert(m_pXFPara.get());
break;
}
case FRIB_TAG_DOCVAR:
{
LwpFribDocVar* docFrib = static_cast<LwpFribDocVar*>(pFrib);
- docFrib->XFConvert(m_pXFPara);
+ docFrib->XFConvert(m_pXFPara.get());
break;
}
case FRIB_TAG_RUBYMARKER:
{
LwpFribRubyMarker* rubyFrib = static_cast<LwpFribRubyMarker*>(pFrib);
- rubyFrib->XFConvert(m_pXFPara);
+ rubyFrib->XFConvert(m_pXFPara.get());
break;
}
case FRIB_TAG_RUBYFRAME:
diff --git a/lotuswordpro/source/filter/lwpfribptr.hxx b/lotuswordpro/source/filter/lwpfribptr.hxx
index d59cb81ca0d4..847690242911 100644
--- a/lotuswordpro/source/filter/lwpfribptr.hxx
+++ b/lotuswordpro/source/filter/lwpfribptr.hxx
@@ -75,13 +75,13 @@ public:
void ReadPara(LwpObjectStream* pObjStrm);
private:
LwpFrib* m_pFribs;
- XFParagraph* m_pXFPara;//Current XFPara used for frib parsing
+ rtl::Reference<XFParagraph> m_pXFPara; //Current XFPara used for frib parsing
LwpPara* m_pPara;//for get foundry
static void ProcessDropcap(LwpStory* pStory, const LwpFrib* pFrib,sal_uInt32 nLen);
public:
void XFConvert();
void SetXFPara(XFParagraph* Para){m_pXFPara = Para;}
- XFParagraph* GetXFPara(){return m_pXFPara;}
+ XFParagraph* GetXFPara() { return m_pXFPara.get(); }
void SetPara(LwpPara* para){m_pPara=para;}
void RegisterStyle();
LwpFrib* GetFribs(){return m_pFribs;}
diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx
index 287f8de65434..98acf39085d4 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -191,7 +191,8 @@ void LwpRowLayout::Read()
void LwpRowLayout::ConvertRow(rtl::Reference<XFTable> const & pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol)
{
LwpTableLayout* pTableLayout = GetParentTableLayout();
- assert(pTableLayout);
+ if (!pTableLayout)
+ throw std::runtime_error("missing TableLayout");
LwpTable* pTable = pTableLayout->GetTable();
//calculate the connected cell position
@@ -282,14 +283,15 @@ void LwpRowLayout::RegisterCurRowStyle(XFRow* pXFRow,sal_uInt16 nRowMark)
{
pRowStyle = static_cast<XFRowStyle*>(
pXFStyleManager->FindStyle(pTableLayout->GetDefaultRowStyleName()));
- fHeight += pRowStyle->GetRowHeight();
}
else
{
pRowStyle = static_cast<XFRowStyle*>(
pXFStyleManager->FindStyle(iter->second->GetStyleName()));
- fHeight+=pRowStyle->GetRowHeight();
}
+ if (!pRowStyle)
+ throw std::runtime_error("missing RowStyle");
+ fHeight += pRowStyle->GetRowHeight();
}
if (m_nDirection & 0x0030)
@@ -377,11 +379,13 @@ void LwpRowLayout::ConvertCommonRow(rtl::Reference<XFTable> const & pXFTable, sa
LwpTableLayout* pTableLayout = GetParentTableLayout();
if (!pTableLayout)
return;
+ LwpTable* pTable = pTableLayout->GetTable();
+ if (!pTable)
+ return;
rtl::Reference<XFRow> xRow(new XFRow);
xRow->SetStyleName(m_StyleName);
- LwpTable* pTable = pTableLayout->GetTable();
sal_uInt8 nCellStartCol,nCellEndCol;
for (sal_uInt8 i = nStartCol; i < nEndCol ; i++)
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index b4805ae6d9af..6357bcc83862 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -879,7 +879,14 @@ sal_uInt16 LwpTableLayout::ConvertHeadingRow(
XFRow* pXFRow = pTmpTable->GetRow(1);
pXFTable->AddHeaderRow(pXFRow);
pTmpTable->RemoveRow(1);
- nContentRow = m_RowsMap[0]->GetCurMaxSpannedRows(0,nCol);
+ auto iter = m_RowsMap.find(0);
+ if (iter == m_RowsMap.end())
+ {
+ SAL_WARN("lwp", "row 0 is unknown");
+ nContentRow = 0;
+ }
+ else
+ nContentRow = iter->second->GetCurMaxSpannedRows(0,nCol);
}
}
return nContentRow;
diff --git a/o3tl/qa/test-lru_map.cxx b/o3tl/qa/test-lru_map.cxx
index 5ceec149571c..fe616ee3d026 100644
--- a/o3tl/qa/test-lru_map.cxx
+++ b/o3tl/qa/test-lru_map.cxx
@@ -29,6 +29,7 @@ public:
void testCustomHash();
void testRemoveIf();
void testNoAutoCleanup();
+ void testChangeMaxSize();
CPPUNIT_TEST_SUITE(lru_map_test);
CPPUNIT_TEST(testBaseUsage);
@@ -38,6 +39,7 @@ public:
CPPUNIT_TEST(testCustomHash);
CPPUNIT_TEST(testRemoveIf);
CPPUNIT_TEST(testNoAutoCleanup);
+ CPPUNIT_TEST(testChangeMaxSize);
CPPUNIT_TEST_SUITE_END();
};
@@ -309,6 +311,18 @@ void lru_map_test::testNoAutoCleanup()
}
}
+void lru_map_test::testChangeMaxSize()
+{
+ o3tl::lru_map<int, int> lru(3);
+ CPPUNIT_ASSERT_EQUAL(size_t(0), lru.size());
+ lru.insert({ 0, 0 });
+ lru.insert({ 1, 1 });
+ lru.insert({ 2, 2 });
+ CPPUNIT_ASSERT_EQUAL(size_t(3), lru.size());
+ lru.setMaxSize(1);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), lru.size());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(lru_map_test);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/document/XOOXMLDocumentPropertiesImporter.idl b/offapi/com/sun/star/document/XOOXMLDocumentPropertiesImporter.idl
index 9a2ba7fe4192..840081663edb 100644
--- a/offapi/com/sun/star/document/XOOXMLDocumentPropertiesImporter.idl
+++ b/offapi/com/sun/star/document/XOOXMLDocumentPropertiesImporter.idl
@@ -24,6 +24,7 @@
#include <com/sun/star/xml/sax/SAXException.idl>
#include <com/sun/star/lang/IllegalArgumentException.idl>
#include <com/sun/star/uno/Exception.idl>
+#include <com/sun/star/io/XInputStream.idl>
module com { module sun { module star { module document {
@@ -70,6 +71,30 @@ interface XOOXMLDocumentPropertiesImporter: com::sun::star::uno::XInterface
raises( com::sun::star::lang::IllegalArgumentException,
com::sun::star::xml::sax::SAXException,
com::sun::star::uno::Exception );
+
+ /** find and get core properties stream
+
+ (usually it is docProps\core.xml)
+ @since LibreOffice 7.3
+ */
+
+ com::sun::star::io::XInputStream getCorePropertiesStream([in] com::sun::star::embed::XStorage xSource);
+
+ /** find and get extended properties stream
+
+ (usually it is docProps/app.xml)
+ @since LibreOffice 7.3
+ */
+
+ com::sun::star::io::XInputStream getExtendedPropertiesStream([in] com::sun::star::embed::XStorage xSource);
+
+ /** find and get custom properties streams
+
+ (usually it is customXml\*.xml)
+ @since LibreOffice 7.3
+ */
+
+ sequence< com::sun::star::io::XInputStream > getCustomPropertiesStreams([in] com::sun::star::embed::XStorage xSource);
};
diff --git a/offapi/com/sun/star/frame/status/Template.idl b/offapi/com/sun/star/frame/status/Template.idl
index e9e688eb1363..9bb9402cef89 100644
--- a/offapi/com/sun/star/frame/status/Template.idl
+++ b/offapi/com/sun/star/frame/status/Template.idl
@@ -39,6 +39,13 @@ struct Template
/** specifies a value that is bound to the style name.
*/
long Value;
+
+
+ /** specifies an identifier name in English (only for standard style).
+
+ @since LO 7.2
+ */
+ string StyleNameIdentifier;
};
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 5f8c6743e7c3..38a70848fd53 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -7181,6 +7181,14 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:GraphicSizeCheck" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Graphic Size Check...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 0adfd7a24e26..7a6ab57c2bb7 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -27,6 +27,11 @@
<info>
<desc>Contains a container for passwords.</desc>
</info>
+ <prop oor:name="InitializationVector" oor:type="xs:string">
+ <info>
+ <desc>Contains an initialization vector for the password encryption.</desc>
+ </info>
+ </prop>
<prop oor:name="Password" oor:type="xs:string" oor:localized="false">
<info>
<desc>Contains a password encoded with the master password.</desc>
@@ -911,12 +916,23 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="StorageVersion" oor:type="xs:int" oor:nillable="false">
+ <info>
+ <desc>Specifies what version of encoding scheme the password container uses.</desc>
+ </info>
+ <value>0</value>
+ </prop>
<prop oor:name="HasMaster" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Specifies if there is a valid master password.</desc>
</info>
<value>false</value>
</prop>
+ <prop oor:name="MasterInitializationVector" oor:type="xs:string">
+ <info>
+ <desc>Contains an initialization vector for the master password encryption.</desc>
+ </info>
+ </prop>
<prop oor:name="Master" oor:type="xs:string" oor:nillable="false">
<info>
<desc>Contains the master password encrypted by itself.</desc>
diff --git a/oox/inc/drawingml/customshapeproperties.hxx b/oox/inc/drawingml/customshapeproperties.hxx
index 1dc0270614e0..5b1b01e97770 100644
--- a/oox/inc/drawingml/customshapeproperties.hxx
+++ b/oox/inc/drawingml/customshapeproperties.hxx
@@ -125,6 +125,12 @@ public:
sal_Int32 getArcNum() { return mnArcNum++; }
+ /**
+ Returns whether or not the current CustomShapeProperties
+ represent a default shape preset that is rectangular.
+ */
+ bool representsDefaultShape() const;
+
private:
sal_Int32 mnShapePresetType;
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx
index 8cc3a70b254a..54f40b9098b8 100644
--- a/oox/inc/drawingml/textbody.hxx
+++ b/oox/inc/drawingml/textbody.hxx
@@ -68,6 +68,23 @@ public:
bool isEmpty() const;
OUString toString() const;
+ /** Returns whether the textbody had a rPr tag in it that alters it visually
+ *
+ * For instance _lang_ doesn't have a visual effect.
+ */
+ bool hasVisualRunProperties() const;
+
+ /// Returns whether the textbody had a pPr tag in it
+ bool hasParagraphProperties() const;
+
+ /// Returns whether the textbody had a non-empty bodyPr tag in it
+ bool hasNoninheritedBodyProperties() const { return mbHasNoninheritedBodyProperties; }
+ /// Flags textbody as having a non-empty bodyPr tag
+ void setHasNoninheritedBodyProperties() { mbHasNoninheritedBodyProperties = true; }
+
+ /// Returns whether the textbody had a non-empty lstStyle tag in it
+ bool hasListStyleOnImport() const { return maTextListStyle.hasListStyleOnImport(); }
+
void ApplyStyleEmpty(
const ::oox::core::XmlFilterBase& rFilterBase,
const css::uno::Reference < css::text::XText > & xText,
@@ -76,6 +93,8 @@ public:
protected:
TextParagraphVector maParagraphs;
TextBodyProperties maTextProperties;
+ /// Set if bodyPr tag in this textbody is non-empty during import
+ bool mbHasNoninheritedBodyProperties;
TextListStyle maTextListStyle;
Text3DProperties ma3DProperties;
};
diff --git a/oox/inc/drawingml/textcharacterproperties.hxx b/oox/inc/drawingml/textcharacterproperties.hxx
index a034121e47d0..147a9847781d 100644
--- a/oox/inc/drawingml/textcharacterproperties.hxx
+++ b/oox/inc/drawingml/textcharacterproperties.hxx
@@ -59,6 +59,8 @@ struct TextCharacterProperties
OptValue< bool > moUnderlineLineFollowText;
OptValue< bool > moUnderlineFillFollowText;
FillProperties maFillProperties;
+ /// Set if there was a property set that alters run visually during import
+ bool mbHasVisualRunProperties;
std::vector<css::beans::PropertyValue> maTextEffectsProperties;
@@ -79,6 +81,8 @@ struct TextCharacterProperties
void pushToPropSet(
PropertySet& rPropSet,
const ::oox::core::XmlFilterBase& rFilter ) const;
+
+ TextCharacterProperties() : mbHasVisualRunProperties(false) {}
};
diff --git a/oox/inc/drawingml/textfield.hxx b/oox/inc/drawingml/textfield.hxx
index 7cc15a04fce4..f70f0989ac7b 100644
--- a/oox/inc/drawingml/textfield.hxx
+++ b/oox/inc/drawingml/textfield.hxx
@@ -24,6 +24,9 @@
#include <drawingml/textparagraphproperties.hxx>
#include <memory>
+enum class SvxTimeFormat;
+enum class SvxDateFormat;
+
namespace oox { namespace drawingml {
struct TextCharacterProperties;
@@ -49,6 +52,16 @@ public:
const TextCharacterProperties& rTextCharacterStyle,
float nDefaultCharHeight) const override;
+ /** Gets the corresponding LO Date format for given OOXML datetime field type
+ *
+ * @param rDateTimeType PPTX datetime field type e.g. datetime3
+ */
+ static SvxDateFormat getLODateFormat( std::u16string_view rDateTimeType );
+ /** Gets the corresponding LO Time format for given OOXML datetime field type
+ *
+ * @param rDateTimeType PPTX datetime field type e.g. datetime3
+ */
+ static SvxTimeFormat getLOTimeFormat( std::u16string_view rDateTimeType );
private:
TextParagraphProperties maTextParagraphProperties;
OUString msType;
diff --git a/oox/inc/drawingml/textliststyle.hxx b/oox/inc/drawingml/textliststyle.hxx
index 94b6b10dc569..d4b5297ffb6d 100644
--- a/oox/inc/drawingml/textliststyle.hxx
+++ b/oox/inc/drawingml/textliststyle.hxx
@@ -45,6 +45,14 @@ public:
const TextParagraphPropertiesVector& getAggregationListStyle() const { return maAggregationListStyle; };
TextParagraphPropertiesVector& getAggregationListStyle() { return maAggregationListStyle; };
+ /// Flags ListStyle as having a non-empty lstStyle tag on import
+ void setHasListStyleOnImport() { mbHasListStyleOnImport = true; }
+ /** Returns whether the lstStyle tag was non-empty on import
+ *
+ * @return true if list style has it's own noninherited properties.
+ */
+ bool hasListStyleOnImport() const { return mbHasListStyleOnImport; }
+
#ifdef DBG_UTIL
void dump() const;
#endif
@@ -53,6 +61,8 @@ private:
TextParagraphPropertiesVector maListStyle;
TextParagraphPropertiesVector maAggregationListStyle;
+ /// Set if ListStyle has a non-empty lstStyle tag on import
+ bool mbHasListStyleOnImport;
};
} }
diff --git a/oox/inc/drawingml/textparagraph.hxx b/oox/inc/drawingml/textparagraph.hxx
index ec0d57686e1b..27c7cb251271 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -52,6 +52,10 @@ public:
TextParagraphProperties& getProperties() { return maProperties; }
const TextParagraphProperties& getProperties() const { return maProperties; }
+ /// Flags the textparagraph as having a pPr tag in it
+ void setHasProperties() { mbHasProperties = true; }
+ /// Returns whether the textparagraph had an pPr tag in it during import
+ bool hasProperties() const { return mbHasProperties; }
TextCharacterProperties& getEndProperties() { return maEndProperties; }
const TextCharacterProperties& getEndProperties() const { return maEndProperties; }
@@ -78,8 +82,15 @@ public:
}
formulaimport::XmlStreamBuilder & GetMathXml();
+ /** Returns whether textparagraph had a rPr tag in it that alters it visually
+ *
+ * For instance _lang_ doesn't have a visual effect.
+ */
+ bool hasVisualRunProperties() const;
+
private:
TextParagraphProperties maProperties;
+ bool mbHasProperties;
TextCharacterProperties maEndProperties;
TextRunVector maRuns;
// temporarily store this here
diff --git a/oox/inc/drawingml/textrun.hxx b/oox/inc/drawingml/textrun.hxx
index 8d3e2c499bc6..4df18764ea08 100644
--- a/oox/inc/drawingml/textrun.hxx
+++ b/oox/inc/drawingml/textrun.hxx
@@ -43,6 +43,12 @@ public:
void setLineBreak() { mbIsLineBreak = true; }
bool isLineBreak() const { return mbIsLineBreak; }
+ /** Returns whether the textrun had properties that alter it visually in its rPr tag
+ *
+ * For instance _lang_ doesn't have a visual effect.
+ */
+ bool hasVisualRunProperties() const { return maTextCharacterProperties.mbHasVisualRunProperties; }
+
virtual sal_Int32 insertAt(
const ::oox::core::XmlFilterBase& rFilterBase,
const css::uno::Reference < css::text::XText >& xText,
diff --git a/oox/qa/unit/data/camera-rotation-revolution-nonwps.pptx b/oox/qa/unit/data/camera-rotation-revolution-nonwps.pptx
new file mode 100755
index 000000000000..db26dc032caa
--- /dev/null
+++ b/oox/qa/unit/data/camera-rotation-revolution-nonwps.pptx
Binary files differ
diff --git a/oox/qa/unit/data/endParaRPr-newline-textsize.pptx b/oox/qa/unit/data/endParaRPr-newline-textsize.pptx
new file mode 100755
index 000000000000..109f818ec8a7
--- /dev/null
+++ b/oox/qa/unit/data/endParaRPr-newline-textsize.pptx
Binary files differ
diff --git a/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx b/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx
new file mode 100755
index 000000000000..4dbf3717d1fd
--- /dev/null
+++ b/oox/qa/unit/data/testTdf132557_footerCustomShapes.pptx
Binary files differ
diff --git a/oox/qa/unit/data/watermark.docx b/oox/qa/unit/data/watermark.docx
new file mode 100644
index 000000000000..c9eacff9a643
--- /dev/null
+++ b/oox/qa/unit/data/watermark.docx
Binary files differ
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index a5be52f66c9e..363b58e3d36e 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -299,6 +299,32 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testCameraRotationRevolution)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(27000), nRotateAngle1);
}
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf146534_CameraRotationRevolutionNonWpsShapes)
+{
+ OUString aURL
+ = m_directories.getURLFromSrc(DATA_DIRECTORY) + "camera-rotation-revolution-nonwps.pptx";
+ load(aURL);
+
+ uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+ uno::Reference<container::XNamed> xShape0(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<container::XNamed> xShape1(xDrawPage->getByIndex(1), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShapeProps0(xShape0, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShapeProps1(xShape1, uno::UNO_QUERY);
+ sal_Int32 nRotateAngle0;
+ sal_Int32 nRotateAngle1;
+ xShapeProps0->getPropertyValue("RotateAngle") >>= nRotateAngle0;
+ xShapeProps1->getPropertyValue("RotateAngle") >>= nRotateAngle1;
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 9000
+ // - Actual : 0
+ // so the camera rotation would not have been factored into how the shape is displayed
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(9000), nRotateAngle0);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(30500), nRotateAngle1);
+}
+
CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow)
{
auto verify = [](const uno::Reference<lang::XComponent>& xComponent) {
@@ -334,6 +360,35 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTableShadow)
verify(getComponent());
}
+CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testTdf132557_footerCustomShapes)
+{
+ // slide with date, footer, slide number with custom shapes
+ OUString aURL
+ = m_directories.getURLFromSrc(DATA_DIRECTORY) + "testTdf132557_footerCustomShapes.pptx";
+ // When importing the document:
+ load(aURL);
+
+ uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+
+ // Test if we were able to import the footer shapes with CustomShape service.
+ uno::Reference<drawing::XShape> xShapeDateTime(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"),
+ xShapeDateTime->getShapeType());
+ // Without the accompanying fix in place, this test would have failed with:
+ // An uncaught exception of type com.sun.star.lang.IndexOutOfBoundsException
+ // i.e. the shape wasn't on the slide there since it was imported as a property, not a shape.
+
+ uno::Reference<drawing::XShape> xShapeFooter(xDrawPage->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"),
+ xShapeFooter->getShapeType());
+
+ uno::Reference<drawing::XShape> xShapeSlideNum(xDrawPage->getByIndex(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.CustomShape"),
+ xShapeSlideNum->getShapeType());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/qa/unit/vml.cxx b/oox/qa/unit/vml.cxx
index 36a120dbc938..88d69492e431 100644
--- a/oox/qa/unit/vml.cxx
+++ b/oox/qa/unit/vml.cxx
@@ -18,6 +18,7 @@
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
+#include <com/sun/star/drawing/ColorMode.hpp>
#include <comphelper/embeddedobjectcontainer.hxx>
#include <comphelper/processfactory.hxx>
@@ -153,6 +154,27 @@ CPPUNIT_TEST_FIXTURE(OoxVmlTest, testGraphicStroke)
CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_SOLID, eLineStyle);
}
+CPPUNIT_TEST_FIXTURE(OoxVmlTest, testWatermark)
+{
+ // Given a document with a picture watermark, and the "washout" checkbox is ticked on the Word
+ // UI:
+ // When loading that document:
+ load(u"watermark.docx");
+
+ // Then make sure the watermark effect is not lost on import:
+ uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ drawing::ColorMode eMode{};
+ xShape->getPropertyValue("GraphicColorMode") >>= eMode;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 3
+ // - Actual : 0
+ // i.e. the color mode was STANDARD, not WATERMARK.
+ CPPUNIT_ASSERT_EQUAL(drawing::ColorMode_WATERMARK, eMode);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx
index ab9cea4a49fc..bde8d5abdb53 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -18,16 +18,20 @@
*/
#include <oox/core/contexthandler2.hxx>
+#include <oox/core/xmlfilterbase.hxx>
#include <oox/helper/attributelist.hxx>
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
namespace oox {
namespace core {
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::xml::sax;
/** Information about a processed element. */
@@ -40,10 +44,11 @@ struct ElementInfo
explicit ElementInfo() : maChars( 0), mnElement( XML_TOKEN_INVALID ), mbTrimSpaces( false ) {}
};
-ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) :
+ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace, XmlFilterBase& rFilter ) :
mxContextStack( new ContextStack ),
mnRootStackSize( 0 ),
- mbEnableTrimSpace( bEnableTrimSpace )
+ mbEnableTrimSpace( bEnableTrimSpace ),
+ mrFilter( rFilter )
{
pushElementInfo( XML_ROOT_CONTEXT );
}
@@ -51,7 +56,8 @@ ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace ) :
ContextHandler2Helper::ContextHandler2Helper( const ContextHandler2Helper& rParent ) :
mxContextStack( rParent.mxContextStack ),
mnRootStackSize( rParent.mxContextStack->size() ),
- mbEnableTrimSpace( rParent.mbEnableTrimSpace )
+ mbEnableTrimSpace( rParent.mbEnableTrimSpace ),
+ mrFilter(rParent.mrFilter)
{
}
@@ -188,6 +194,13 @@ ContextHandler2::~ContextHandler2()
Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContext(
sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
{
+ if( getNamespace( nElement ) == NMSP_mce ) // TODO for checking 'Ignorable'
+ {
+ if( prepareMceContext( nElement, AttributeList( rxAttribs ) ) )
+ return this;
+ return nullptr;
+ }
+
return implCreateChildContext( nElement, rxAttribs );
}
@@ -207,6 +220,72 @@ void SAL_CALL ContextHandler2::endFastElement( sal_Int32 nElement )
implEndElement( nElement );
}
+bool ContextHandler2Helper::prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( nElement )
+ {
+ case MCE_TOKEN( AlternateContent ):
+ addMCEState( MCE_STATE::Started );
+ break;
+
+ case MCE_TOKEN( Choice ):
+ {
+ if (isMCEStateEmpty() || getMCEState() != MCE_STATE::Started)
+ return false;
+
+ OUString aRequires = rAttribs.getString( XML_Requires, "none" );
+
+ // At this point we can't access namespaces as the correct xml filter
+ // is long gone. For now let's decide depending on a list of supported
+ // namespaces like we do in writerfilter
+
+ std::vector<OUString> aSupportedNS =
+ {
+ "a14", // Impress needs this to import math formulas.
+ "p14",
+ "p15",
+ "x12ac",
+ "v"
+ };
+
+ Reference<XServiceInfo> xModel(getDocFilter().getModel(), UNO_QUERY);
+ if (xModel.is() && xModel->supportsService("com.sun.star.sheet.SpreadsheetDocument"))
+ {
+ // No a14 for Calc documents, it would cause duplicated shapes as-is.
+ auto it = std::find(aSupportedNS.begin(), aSupportedNS.end(), "a14");
+ if (it != aSupportedNS.end())
+ {
+ aSupportedNS.erase(it);
+ }
+ }
+
+ if (std::find(aSupportedNS.begin(), aSupportedNS.end(), aRequires) != aSupportedNS.end())
+ setMCEState( MCE_STATE::FoundChoice ) ;
+ else
+ return false;
+ }
+ break;
+
+ case MCE_TOKEN( Fallback ):
+ if( !isMCEStateEmpty() && getMCEState() == MCE_STATE::Started )
+ break;
+ return false;
+ default:
+ {
+ OUString str = rAttribs.getString( MCE_TOKEN( Ignorable ), OUString() );
+ if( !str.isEmpty() )
+ {
+ // Sequence< css::xml::FastAttribute > attrs = rAttribs.getFastAttributeList()->getFastAttributes();
+ // printf("MCE: %s\n", OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() );
+ // TODO: Check & Get the namespaces in "Ignorable"
+ // printf("NS: %d : %s\n", attrs.getLength(), OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
// oox.core.RecordContext interface -------------------------------------------
ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm )
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx
index 79b58ce70f0e..cbad55571b09 100644
--- a/oox/source/core/fragmenthandler2.cxx
+++ b/oox/source/core/fragmenthandler2.cxx
@@ -34,7 +34,7 @@ using ::com::sun::star::uno::Sequence;
FragmentHandler2::FragmentHandler2( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEnableTrimSpace ) :
FragmentHandler( rFilter, rFragmentPath ),
- ContextHandler2Helper( bEnableTrimSpace )
+ ContextHandler2Helper( bEnableTrimSpace, rFilter )
{
}
@@ -54,72 +54,6 @@ void SAL_CALL FragmentHandler2::endDocument()
finalizeImport();
}
-bool FragmentHandler2::prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs )
-{
- switch( nElement )
- {
- case MCE_TOKEN( AlternateContent ):
- aMceState.push_back( MCE_STATE::Started );
- break;
-
- case MCE_TOKEN( Choice ):
- {
- if (aMceState.empty() || aMceState.back() != MCE_STATE::Started)
- return false;
-
- OUString aRequires = rAttribs.getString( XML_Requires, "none" );
-
- // At this point we can't access namespaces as the correct xml filter
- // is long gone. For now let's decide depending on a list of supported
- // namespaces like we do in writerfilter
-
- std::vector<OUString> aSupportedNS =
- {
- "a14", // Impress needs this to import math formulas.
- "p14",
- "p15",
- "x12ac",
- "v",
- };
-
- uno::Reference<lang::XServiceInfo> xModel(getFilter().getModel(), uno::UNO_QUERY);
- if (xModel.is() && xModel->supportsService("com.sun.star.sheet.SpreadsheetDocument"))
- {
- // No a14 for Calc documents, it would cause duplicated shapes as-is.
- auto it = std::find(aSupportedNS.begin(), aSupportedNS.end(), "a14");
- if (it != aSupportedNS.end())
- {
- aSupportedNS.erase(it);
- }
- }
-
- if (std::find(aSupportedNS.begin(), aSupportedNS.end(), aRequires) != aSupportedNS.end())
- aMceState.back() = MCE_STATE::FoundChoice;
- else
- return false;
- }
- break;
-
- case MCE_TOKEN( Fallback ):
- if( !aMceState.empty() && aMceState.back() == MCE_STATE::Started )
- break;
- return false;
- default:
- {
- OUString str = rAttribs.getString( MCE_TOKEN( Ignorable ), OUString() );
- if( !str.isEmpty() )
- {
- // Sequence< css::xml::FastAttribute > attrs = rAttribs.getFastAttributeList()->getFastAttributes();
- // printf("MCE: %s\n", OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() );
- // TODO: Check & Get the namespaces in "Ignorable"
- // printf("NS: %d : %s\n", attrs.getLength(), OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- return false;
- }
- return true;
-}
-
// com.sun.star.xml.sax.XFastContextHandler interface -------------------------
Reference< XFastContextHandler > SAL_CALL FragmentHandler2::createFastChildContext(
@@ -151,7 +85,7 @@ void SAL_CALL FragmentHandler2::endFastElement( sal_Int32 nElement )
switch( nElement )
{
case MCE_TOKEN( AlternateContent ):
- aMceState.pop_back();
+ removeMCEState();
break;
}
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index b6a2c5a0b812..d63020189243 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -33,6 +33,7 @@
#include "docprophandler.hxx"
#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequence.hxx>
using namespace ::com::sun::star;
@@ -86,6 +87,40 @@ Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxSto
return ContainerHelper::vectorToSequence( aResult );
}
+Sequence< InputSource > lclGetCoreStreams(const Reference< XStorage >& rxSource)
+{
+ Sequence< InputSource > aCoreStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE("metadata/core-properties"));
+ // OOXML strict
+ if (!aCoreStreams.hasElements())
+ aCoreStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT("metadata/core-properties"));
+ // MS Office seems to have a bug, so we have to do similar handling
+ if (!aCoreStreams.hasElements())
+ aCoreStreams = lclGetRelatedStreams(rxSource, "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties");
+
+ return aCoreStreams;
+}
+
+Sequence< InputSource > lclGetExtStreams(const Reference< XStorage >& rxSource)
+{
+ Sequence< InputSource > aExtStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE("extended-properties"));
+ // OOXML strict
+ if (!aExtStreams.hasElements())
+ aExtStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT("extended-properties"));
+
+ return aExtStreams;
+}
+
+Sequence< InputSource > lclGetCustomStreams(const Reference< XStorage >& rxSource)
+{
+ Sequence< InputSource > aCustomStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE("custom-properties"));
+ // OOXML strict
+ if (!aCustomStreams.hasElements())
+ aCustomStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT("custom-properties"));
+
+ return aCustomStreams;
+}
+
+
} // namespace
DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) :
@@ -120,22 +155,11 @@ void SAL_CALL DocumentPropertiesImport::importProperties(
if( !rxSource.is() || !rxDocumentProperties.is() )
throw IllegalArgumentException();
- Sequence< InputSource > aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "metadata/core-properties" ) );
- // OOXML strict
- if( !aCoreStreams.hasElements() )
- aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT( "metadata/core-properties" ) );
- // MS Office seems to have a bug, so we have to do similar handling
- if( !aCoreStreams.hasElements() )
- aCoreStreams = lclGetRelatedStreams( rxSource, "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" );
+ Sequence< InputSource > aCoreStreams = lclGetCoreStreams(rxSource);
- Sequence< InputSource > aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "extended-properties" ) );
- // OOXML strict
- if( !aExtStreams.hasElements() )
- aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT( "extended-properties" ) );
- Sequence< InputSource > aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "custom-properties" ) );
- // OOXML strict
- if( !aCustomStreams.hasElements() )
- aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT( "custom-properties" ) );
+ Sequence< InputSource > aExtStreams = lclGetExtStreams(rxSource);
+
+ Sequence< InputSource > aCustomStreams = lclGetCustomStreams(rxSource);
if( aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements() )
{
@@ -160,6 +184,41 @@ void SAL_CALL DocumentPropertiesImport::importProperties(
}
}
+Reference < com::sun::star::io::XInputStream > SAL_CALL DocumentPropertiesImport::getCorePropertiesStream(
+ const Reference< XStorage >& rxSource)
+{
+ Sequence< InputSource > aCoreStreams = lclGetCoreStreams(rxSource);
+ if (!aCoreStreams.hasElements())
+ return nullptr;
+
+ return aCoreStreams[0].aInputStream;
+}
+
+Reference < com::sun::star::io::XInputStream > SAL_CALL DocumentPropertiesImport::getExtendedPropertiesStream(
+ const Reference< XStorage >& rxSource)
+{
+ Sequence< InputSource > aExtStreams = lclGetExtStreams(rxSource);
+ if (!aExtStreams.hasElements())
+ return nullptr;
+
+ return aExtStreams[0].aInputStream;
+}
+
+css::uno::Sequence< css::uno::Reference< com::sun::star::io::XInputStream > > SAL_CALL DocumentPropertiesImport::getCustomPropertiesStreams(
+ const Reference< XStorage >& rxSource)
+{
+ Sequence <InputSource> aExtStreams = lclGetCustomStreams(rxSource);
+
+ // Repack the sequence
+ std::vector<Reference<XInputStream>> aResult(aExtStreams.getLength());
+ for (const auto& aInputSource : aExtStreams)
+ {
+ aResult.push_back(aInputSource.aInputStream);
+ }
+
+ return comphelper::containerToSequence(aResult);
+}
+
} // namespace docprop
} // namespace oox
diff --git a/oox/source/docprop/ooxmldocpropimport.hxx b/oox/source/docprop/ooxmldocpropimport.hxx
index 61a58eb9c7d9..969cd16d50a9 100644
--- a/oox/source/docprop/ooxmldocpropimport.hxx
+++ b/oox/source/docprop/ooxmldocpropimport.hxx
@@ -47,6 +47,12 @@ public:
virtual void SAL_CALL importProperties(
const css::uno::Reference< css::embed::XStorage >& rxSource,
const css::uno::Reference< css::document::XDocumentProperties >& rxDocumentProperties ) override;
+ virtual css::uno::Reference < com::sun::star::io::XInputStream > SAL_CALL getCorePropertiesStream(
+ const css::uno::Reference< css::embed::XStorage >& rxSource) override;
+ virtual css::uno::Reference < com::sun::star::io::XInputStream > SAL_CALL getExtendedPropertiesStream(
+ const css::uno::Reference< css::embed::XStorage >& rxSource) override;
+ virtual css::uno::Sequence< css::uno::Reference< com::sun::star::io::XInputStream > > SAL_CALL getCustomPropertiesStreams(
+ const css::uno::Reference< css::embed::XStorage >& rxSource) override;
private:
css::uno::Reference< css::uno::XComponentContext > mxContext;
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index b3c76915a5de..32bbfb545ef2 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -414,9 +414,13 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel )
// varying point colors only for single series in single chart type
bool bSupportsVaryColorsByPoint = mrModel.maTypeGroups.size() == 1;
+ bool bIsCombinedChart = mrModel.maTypeGroups.size() == 2 &&
+ mrModel.maTypeGroups[0]->mnTypeId != mrModel.maTypeGroups[1]->mnTypeId;
+
// convert all axes sets, and check which axis is attached to the first maTypeGroups
- sal_Int32 nStartAxesSetIdx = (rValAxisIds.size() > 1 && aAxesSets.size() > 0 && aAxesSets[0]->maAxes.count( API_Y_AXIS )
- && aAxesSets[0]->maAxes[ API_Y_AXIS ]->mnAxisId != rValAxisIds[0] ) ? 1 : 0;
+ sal_Int32 nStartAxesSetIdx = bIsCombinedChart ? ((rValAxisIds.size() > 1 && aAxesSets.size() > 0 && aAxesSets[0]->maAxes.count( API_Y_AXIS )
+ && aAxesSets[0]->maAxes[ API_Y_AXIS ]->mnAxisId != rValAxisIds[0] ) ? 1 : 0)
+ : 0;
sal_Int32 nAxesSetIdx = nStartAxesSetIdx;
for (auto const& axesSet : aAxesSets)
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index ea02d5ca548b..99bbaebe3101 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -291,11 +291,14 @@ Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence()
if( nMaxValues < 0 )
nMaxValues = 2;
SeriesModel &aModel = *mrModel.maSeries.get(0);
- DataSourceModel &aSrc = aModel.maSources.create( SeriesModel::CATEGORIES );
- DataSequenceModel &aSeq = aSrc.mxDataSeq.create();
- aSeq.mnPointCount = nMaxValues;
- for( sal_Int32 i = 0; i < nMaxValues; i++ )
- aSeq.maData[ i ] <<= OUString::number( i + 1 );
+ if (!aModel.maSources.has(SeriesModel::CATEGORIES))
+ {
+ DataSourceModel &aSrc = aModel.maSources.create( SeriesModel::CATEGORIES );
+ DataSequenceModel &aSeq = aSrc.mxDataSeq.create();
+ aSeq.mnPointCount = nMaxValues;
+ for( sal_Int32 i = 0; i < nMaxValues; i++ )
+ aSeq.maData[ i ] <<= OUString::number( i + 1 );
+ }
SeriesConverter aSeriesConv( *this, aModel );
xLabeledSeq = aSeriesConv.createCategorySequence( "categories" );
}
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 4a6e3d9eae6d..0beb6a172b5f 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -89,6 +89,13 @@ sal_Int32 CustomShapeProperties::GetCustomShapeGuideValue( const std::vector< Cu
return nIndex;
}
+bool CustomShapeProperties::representsDefaultShape() const
+{
+ return !((getShapePresetType() >= 0 || maPath2DList.size() > 0) &&
+ getShapePresetType() != XML_Rect &&
+ getShapePresetType() != XML_rect);
+}
+
CustomShapeProperties::PresetDataMap CustomShapeProperties::maPresetDataMap;
static OUString GetConnectorShapeType( sal_Int32 nType )
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index a67f9278b34e..213eaae10584 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -117,6 +117,8 @@ void lclCalculateCropPercentage(uno::Reference<graphic::XGraphic> const & xGraph
aFillRect.Y2 = -nBottomPercentage;
}
+// Crops a piece of the bitmap. Takes negative aFillRect values. Negative values means "crop",
+// positive values means "grow" bitmap with empty spaces. lclCropGraphic doesn't handle growing.
Reference< XGraphic > lclCropGraphic(uno::Reference<graphic::XGraphic> const & xGraphic, geometry::IntegerRectangle2D aFillRect)
{
::Graphic aGraphic(xGraphic);
@@ -764,11 +766,17 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
aGraphCrop.Bottom = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * aFillRect.Y2 ) / 100000 );
rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
- if(bIsCustomShape &&
- ( aGraphCrop.Left != 0 || aGraphCrop.Right != 0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0))
+ bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0;
+ // Negative GraphicCrop values means "crop" here.
+ bool bNeedCrop = aGraphCrop.Left <= 0 && aGraphCrop.Right <= 0 && aGraphCrop.Top <= 0 && aGraphCrop.Bottom <= 0;
+
+ if(bIsCustomShape && bHasCropValues && bNeedCrop)
{
xGraphic = lclCropGraphic(xGraphic, aFillRect);
- rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
+ if (rPropMap.supportsProperty(ShapeProperty::FillBitmapName))
+ rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic);
+ else
+ rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
}
}
}
@@ -873,14 +881,15 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
aGraphCrop.Bottom = rtl::math::round( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 100000 );
rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
- if(mbIsCustomShape &&
- ( aGraphCrop.Left != 0 || aGraphCrop.Right != 0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0))
+ bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0;
+ // Positive GraphicCrop values means "crop" here.
+ bool bNeedCrop = aGraphCrop.Left >= 0 && aGraphCrop.Right >= 0 && aGraphCrop.Top >= 0 && aGraphCrop.Bottom >= 0;
+
+ if(mbIsCustomShape && bHasCropValues && bNeedCrop)
{
geometry::IntegerRectangle2D aCropRect = oClipRect;
lclCalculateCropPercentage(xGraphic, aCropRect);
xGraphic = lclCropGraphic(xGraphic, aCropRect);
-
- rPropMap.setProperty(PROP_FillBitmap, xGraphic);
}
}
}
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index 1c22a33b9ca1..67f1a8bc6633 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -219,6 +219,7 @@ ContextHandlerRef OleObjectGraphicDataContext::onCreateContext( sal_Int32 nEleme
mrOleObjectInfo.maName = rAttribs.getXString( XML_name, OUString() );
mrOleObjectInfo.maProgId = rAttribs.getXString( XML_progId, OUString() );
mrOleObjectInfo.mbShowAsIcon = rAttribs.getBool( XML_showAsIcon, false );
+ mrOleObjectInfo.mbHasPicture = false; // Initialize as false
return this;
}
break;
@@ -232,6 +233,7 @@ ContextHandlerRef OleObjectGraphicDataContext::onCreateContext( sal_Int32 nEleme
mrOleObjectInfo.mbAutoUpdate = rAttribs.getBool( XML_updateAutomatic, false );
break;
case PPT_TOKEN( pic ):
+ mrOleObjectInfo.mbHasPicture = true; // Set true if ole object has picture element.
return new GraphicShapeContext( *this, mpMasterShapePtr, mpShapePtr );
break;
}
@@ -240,6 +242,15 @@ ContextHandlerRef OleObjectGraphicDataContext::onCreateContext( sal_Int32 nEleme
return nullptr;
}
+void OleObjectGraphicDataContext::onEndElement()
+{
+ if( getCurrentElement() == PPT_TOKEN( oleObj ) && !isMCEStateEmpty() )
+ {
+ if( getMCEState() == MCE_STATE::FoundChoice && !mrOleObjectInfo.mbHasPicture )
+ setMCEState( MCE_STATE::Started );
+ }
+}
+
DiagramGraphicDataContext::DiagramGraphicDataContext( ContextHandler2Helper const & rParent, const ShapePtr& pShapePtr )
: ShapeContext( rParent, ShapePtr(), pShapePtr )
{
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index ec29618dd8f9..3f45859e818f 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -726,8 +726,8 @@ Reference< XShape > const & Shape::createAndInsert(
}
// Use custom shape instead of GraphicObjectShape if the image is cropped to
// shape. Except rectangle, which does not require further cropping
- bool bIsCroppedGraphic = (aServiceName == "com.sun.star.drawing.GraphicObjectShape" && mpCustomShapePropertiesPtr->getShapePresetType() >= 0
- && mpCustomShapePropertiesPtr->getShapePresetType() != XML_Rect && mpCustomShapePropertiesPtr->getShapePresetType() != XML_rect);
+ bool bIsCroppedGraphic = (aServiceName == "com.sun.star.drawing.GraphicObjectShape" &&
+ !mpCustomShapePropertiesPtr->representsDefaultShape());
bool bIsCustomShape = ( aServiceName == "com.sun.star.drawing.CustomShape" ||
aServiceName == "com.sun.star.drawing.ConnectorShape" ||
bIsCroppedGraphic);
@@ -761,7 +761,8 @@ Reference< XShape > const & Shape::createAndInsert(
}
bool bNoTranslation = !aParentTransformation.isIdentity();
- if( mbFlipH || mbFlipV || mnRotation != 0 || bNoTranslation )
+ const sal_Int32 nCameraRotation = get3DProperties().maCameraRotation.mnRevolution.get(0);
+ if( mbFlipH || mbFlipV || mnRotation != 0 || nCameraRotation != 0 || bNoTranslation )
{
// calculate object's center
basegfx::B2DPoint aCenter(0.5, 0.5);
@@ -797,7 +798,7 @@ Reference< XShape > const & Shape::createAndInsert(
}
}
// rotate around object's center
- aTransformation.rotate(basegfx::deg2rad(static_cast<double>(mnRotation) / 60000.0));
+ aTransformation.rotate(basegfx::deg2rad(static_cast<double>(mnRotation - nCameraRotation) / 60000.0));
}
// move object back from center
@@ -848,7 +849,6 @@ Reference< XShape > const & Shape::createAndInsert(
uno::Sequence< awt::Point > aPointSequence( nNumPoints );
awt::Point* pPoints = aPointSequence.getArray();
uno::Reference<lang::XServiceInfo> xModelInfo(rFilterBase.getModel(), uno::UNO_QUERY);
- bool bIsWriter = xModelInfo->supportsService("com.sun.star.text.TextDocument");
for( i = 0; i < nNumPoints; ++i )
{
const basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) );
@@ -856,13 +856,7 @@ Reference< XShape > const & Shape::createAndInsert(
// tdf#106792 Not needed anymore due to the change in SdrPathObj::NbcResize:
// tdf#96674: Guard against zero width or height.
- if (bIsWriter && bNoTranslation)
- // Writer's draw page is in twips, and these points get passed
- // to core without any unit conversion when Writer
- // postprocesses only the group shape itself.
- pPoints[i] = awt::Point(static_cast<sal_Int32>(convertMm100ToTwip(aPoint.getX())), static_cast<sal_Int32>(convertMm100ToTwip(aPoint.getY())));
- else
- pPoints[i] = awt::Point(static_cast<sal_Int32>(aPoint.getX()), static_cast<sal_Int32>(aPoint.getY()));
+ pPoints[i] = awt::Point(static_cast<sal_Int32>(aPoint.getX()), static_cast<sal_Int32>(aPoint.getY()));
}
uno::Sequence< uno::Sequence< awt::Point > > aPolyPolySequence( 1 );
aPolyPolySequence.getArray()[ 0 ] = aPointSequence;
@@ -1463,8 +1457,6 @@ Reference< XShape > const & Shape::createAndInsert(
getTextBody()->getTextProperties().pushVertSimulation();
// tdf#133037: a bit hackish: force Shape to rotate in the opposite direction the camera would rotate
- const sal_Int32 nCameraRotation = get3DProperties().maCameraRotation.mnRevolution.get(0);
-
PropertySet aPropertySet(mxShape);
if ( !bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 0) )
{
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index 80ebb4d2287d..323d654ce971 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -32,10 +32,12 @@ using namespace ::com::sun::star::beans;
namespace oox { namespace drawingml {
TextBody::TextBody()
+ : mbHasNoninheritedBodyProperties( false )
{
}
TextBody::TextBody( const TextBodyPtr& pBody )
+ : mbHasNoninheritedBodyProperties( false )
{
if( pBody.get() ) {
maTextProperties = pBody->maTextProperties;
@@ -104,6 +106,26 @@ OUString TextBody::toString() const
return OUString();
}
+bool TextBody::hasVisualRunProperties() const
+{
+ for ( auto& pTextParagraph : getParagraphs() )
+ {
+ if ( pTextParagraph->hasVisualRunProperties() )
+ return true;
+ }
+ return false;
+}
+
+bool TextBody::hasParagraphProperties() const
+{
+ for ( auto& pTextParagraph : getParagraphs() )
+ {
+ if ( pTextParagraph->hasProperties() )
+ return true;
+ }
+ return false;
+}
+
void TextBody::ApplyStyleEmpty(
const ::oox::core::XmlFilterBase& rFilterBase,
const Reference < XText > & xText,
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index cbd1e420ee5a..3e0637c87f91 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -28,6 +28,8 @@
#include <oox/drawingml/shape.hxx>
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
+#include <oox/helper/attributelist.hxx>
+#include <sax/fastattribs.hxx>
#include <oox/mathml/import.hxx>
@@ -86,6 +88,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken
}
case A_TOKEN( pPr ):
case W_TOKEN( pPr ):
+ mrParagraph.setHasProperties();
return new TextParagraphPropertiesContext( *this, rAttribs, mrParagraph.getProperties() );
case A_TOKEN( endParaRPr ):
return new TextCharacterPropertiesContext( *this, rAttribs, mrParagraph.getEndProperties() );
@@ -175,6 +178,8 @@ ContextHandlerRef TextBodyContext::onCreateContext( sal_Int32 aElementToken, con
switch( aElementToken )
{
case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag
+ if (sax_fastparser::FastAttributeList::castToFastAttributeList(rAttribs.getFastAttributeList())->getFastAttributeTokens().size() > 0)
+ mrTextBody.setHasNoninheritedBodyProperties();
if ( mpShapePtr )
return new TextBodyPropertiesContext( *this, rAttribs, mpShapePtr );
else
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index de47058e60ca..6b55c5326455 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -178,6 +178,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
if( maHighlightColor.isUsed() )
rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( rFilter.getGraphicHelper() ));
+ else
+ rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
}
static void pushToGrabBag( PropertySet& rPropSet, const std::vector<PropertyValue>& aVectorOfProperyValues )
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 236219d844cf..2bc7be3633c1 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -29,6 +29,8 @@
#include "hyperlinkcontext.hxx"
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
+#include <sax/fastattribs.hxx>
+#include <sax/fastparser.hxx>
#include <sal/log.hxx>
@@ -47,8 +49,16 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
: ContextHandler2( rParent )
, mrTextCharacterProperties( rTextCharacterProperties )
{
- if ( rAttribs.hasAttribute( XML_lang ) )
+ int nVisualTokenAmount = sax_fastparser::FastAttributeList::castToFastAttributeList(
+ rAttribs.getFastAttributeList() )->getFastAttributeTokens().size();
+
+ if ( rAttribs.hasAttribute( XML_lang ) ){
mrTextCharacterProperties.moLang = rAttribs.getString( XML_lang );
+ --nVisualTokenAmount; // Not a visual attribute
+ }
+ if ( rAttribs.hasAttribute( XML_altLang )){
+ --nVisualTokenAmount; // Not a visual attribute
+ }
if ( rAttribs.hasAttribute( XML_sz ) )
mrTextCharacterProperties.moHeight = rAttribs.getInteger( XML_sz );
if ( rAttribs.hasAttribute( XML_spc ) )
@@ -66,6 +76,17 @@ TextCharacterPropertiesContext::TextCharacterPropertiesContext(
mrTextCharacterProperties.moItalic = rAttribs.getBool( XML_i );
if( rAttribs.hasAttribute( XML_cap ) )
mrTextCharacterProperties.moCaseMap = rAttribs.getToken( XML_cap );
+ if ( rAttribs.hasAttribute( XML_dirty ) )
+ {
+ --nVisualTokenAmount; // Not a visual attribute
+ }
+ if ( rAttribs.hasAttribute( XML_smtClean ) )
+ {
+ --nVisualTokenAmount; // Not a visual attribute
+ }
+
+ if ( nVisualTokenAmount > 0 )
+ mrTextCharacterProperties.mbHasVisualRunProperties = true;
/* TODO / unhandled so far:
A_TOKEN( kern )
@@ -87,6 +108,9 @@ TextCharacterPropertiesContext::~TextCharacterPropertiesContext()
ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
+ if( aElementToken != A_TOKEN(lang) )
+ mrTextCharacterProperties.mbHasVisualRunProperties = true;
+
switch( aElementToken )
{
// TODO unsupported yet
diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx
index 61b50e8ef549..a8e058603f7a 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -34,6 +34,7 @@
#include <drawingml/textparagraphproperties.hxx>
#include <drawingml/textcharacterproperties.hxx>
#include <tools/diagnose_ex.h>
+#include <editeng/flditem.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -73,68 +74,28 @@ void lclCreateTextFields( std::vector< Reference< XTextField > > & aFields,
aFields.emplace_back( xIface, UNO_QUERY );
return;
}
- bool bIsDate = true;
- int idx = p.toInt32();
- sal_uInt16 nNumFmt;
- xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" );
- aFields.emplace_back( xIface, UNO_QUERY );
- Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW );
-
- // here we should format the field properly. waiting after #i81091.
- switch( idx )
+
+ SvxDateFormat eDateFormat = TextField::getLODateFormat(sType);
+ if (eDateFormat != SvxDateFormat::AppDefault)
{
- case 1: // Date dd/mm/yyyy
- // this is the default format...
- nNumFmt = 5;
- xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
- break;
- case 2: // Date Day, Month dd, yyyy
- break;
- case 3: // Date dd Month yyyy
- nNumFmt = 3;
- xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
- break;
- case 4: // Date Month dd, yyyy
- break;
- case 5: // Date dd-Mon-yy
- break;
- case 6: // Date Month yy
- break;
- case 7: // Date Mon-yy
- break;
- case 8: // DateTime dd/mm/yyyy H:MM PM
- lclCreateTextFields( aFields, xModel, "datetime12" );
- break;
- case 9: // DateTime dd/mm/yy H:MM:SS PM
- lclCreateTextFields( aFields, xModel, "datetime13" );
- break;
- case 10: // Time H:MM
- bIsDate = false;
- nNumFmt = 3;
- xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
- break;
- case 11: // Time H:MM:SS
- bIsDate = false;
- // this is the default format
- nNumFmt = 2;
- xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
- break;
- case 12: // Time H:MM PM
- bIsDate = false;
- nNumFmt = 6;
- xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
- break;
- case 13: // Time H:MM:SS PM
- bIsDate = false;
- nNumFmt = 7;
- xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
- break;
- default:
- nNumFmt = 2;
- xProps->setPropertyValue("NumberFormat", makeAny(nNumFmt));
+ xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" );
+ aFields.emplace_back( xIface, UNO_QUERY );
+ Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW );
+ xProps->setPropertyValue("NumberFormat", Any(static_cast<sal_Int32>(eDateFormat)));
+ xProps->setPropertyValue("IsDate", Any(true));
+ xProps->setPropertyValue("IsFixed", Any(false));
+ }
+
+ SvxTimeFormat eTimeFormat = TextField::getLOTimeFormat(sType);
+ if (eTimeFormat != SvxTimeFormat::AppDefault)
+ {
+ xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" );
+ aFields.emplace_back( xIface, UNO_QUERY );
+ Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW );
+ xProps->setPropertyValue("NumberFormat", Any(static_cast<sal_Int32>(eTimeFormat)));
+ xProps->setPropertyValue("IsDate", Any(false));
+ xProps->setPropertyValue("IsFixed", Any(false));
}
- xProps->setPropertyValue( "IsDate", makeAny( bIsDate ) );
- xProps->setPropertyValue( "IsFixed", makeAny( false ) );
}
catch(const Exception &)
{
@@ -247,6 +208,67 @@ sal_Int32 TextField::insertAt(
return nCharHeight;
}
+SvxDateFormat TextField::getLODateFormat(std::u16string_view rDateTimeType)
+{
+ OString aDateTimeNum = OUStringToOString(rDateTimeType.substr(8), RTL_TEXTENCODING_UTF8);
+
+ if( aDateTimeNum.isEmpty() ) // "datetime"
+ return SvxDateFormat::StdSmall;
+
+ int nDateTimeNum = aDateTimeNum.toInt32();
+
+ switch( nDateTimeNum )
+ {
+ case 1: // Date dd/mm/yyyy
+ case 8: // DateTime dd/mm/yyyy H:MM PM
+ case 9: // DateTime dd/mm/yyyy H:MM:SS PM
+ return SvxDateFormat::B;
+ case 2: // Date Day, Month dd, yyyy
+ return SvxDateFormat::StdBig;
+ case 3: // Date dd Month yyyy
+ case 4: // Date Month dd, yyyy - no exact map
+ case 6: // Date Month yy - no exact map
+ return SvxDateFormat::D;
+ case 5: // Date dd-Mon-yy - no exact map
+ case 7: // Date Mon-yy - no exact map
+ return SvxDateFormat::C;
+ case 10: // Time H:MM - not a date format
+ case 11: // Time H:MM:SS - not a date format
+ case 12: // Time H:MM PM - not a date format
+ case 13: // Time H:MM:SS PM - not a date format
+ default:
+ return SvxDateFormat::AppDefault;
+ }
+}
+
+SvxTimeFormat TextField::getLOTimeFormat(std::u16string_view rDateTimeType)
+{
+ OString aDateTimeNum = OUStringToOString(rDateTimeType.substr(8), RTL_TEXTENCODING_UTF8);
+ int nDateTimeNum = aDateTimeNum.toInt32();
+
+ switch( nDateTimeNum )
+ {
+ case 8: // DateTime dd/mm/yyyy H:MM PM
+ case 12: // Time H:MM PM
+ return SvxTimeFormat::HH12_MM;
+ case 9: // DateTime dd/mm/yyyy H:MM:SS PM
+ case 13: // Time H:MM:SS PM
+ return SvxTimeFormat::HH12_MM_SS;
+ case 10: // Time H:MM
+ return SvxTimeFormat::HH24_MM;
+ case 11: // Time H:MM:SS
+ return SvxTimeFormat::Standard;
+ case 1: // Date dd/mm/yyyy
+ case 2: // Date Day, Month dd, yyyy
+ case 3: // Date dd Month yyyy
+ case 4: // Date Month dd, yyyy
+ case 5: // Date dd-Mon-yy
+ case 6: // Date Month yy
+ case 7: // Date Mon-yy
+ default:
+ return SvxTimeFormat::AppDefault;
+ }
+}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx
index 15475ddcacb0..645cd64b4792 100644
--- a/oox/source/drawingml/textliststyle.cxx
+++ b/oox/source/drawingml/textliststyle.cxx
@@ -23,6 +23,7 @@
namespace oox { namespace drawingml {
TextListStyle::TextListStyle()
+ : mbHasListStyleOnImport(false)
{
for ( int i = 0; i < 9; i++ )
{
@@ -36,6 +37,7 @@ TextListStyle::~TextListStyle()
}
TextListStyle::TextListStyle(const TextListStyle& rStyle)
+ : mbHasListStyleOnImport(false)
{
assert(rStyle.maListStyle.size() == 9);
assert(rStyle.maAggregationListStyle.size() == 9);
diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx
index 9c43e7206f1b..dee3a71e3f80 100644
--- a/oox/source/drawingml/textliststylecontext.cxx
+++ b/oox/source/drawingml/textliststylecontext.cxx
@@ -42,6 +42,7 @@ TextListStyleContext::~TextListStyleContext()
ContextHandlerRef TextListStyleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
+ mrTextListStyle.setHasListStyleOnImport();
switch( aElementToken )
{
case A_TOKEN( defPPr ): // CT_TextParagraphProperties
diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx
index b5635b58f2e9..c85878715310 100644
--- a/oox/source/drawingml/textparagraph.cxx
+++ b/oox/source/drawingml/textparagraph.cxx
@@ -38,6 +38,7 @@ using namespace ::com::sun::star::beans;
namespace oox { namespace drawingml {
TextParagraph::TextParagraph()
+ : mbHasProperties( false )
{
}
@@ -195,6 +196,16 @@ formulaimport::XmlStreamBuilder & TextParagraph::GetMathXml()
return *m_pMathXml;
}
+bool TextParagraph::hasVisualRunProperties() const
+{
+ for ( auto& pTextRun : getRuns() )
+ {
+ if ( pTextRun->hasVisualRunProperties() )
+ return true;
+ }
+ return false;
+}
+
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index fd4f67732607..5d3996430eff 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1781,7 +1781,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
else if (GetProperty(rXPropSet, "CharHeight"))
{
nSize = static_cast<sal_Int32>(100*(*o3tl::doAccess<float>(mAny)));
- if ( nElement == XML_rPr )
+ if ( nElement == XML_rPr || nElement == XML_defRPr )
{
rbOverridingCharHeight = true;
rnCharHeight = nSize;
@@ -2138,40 +2138,13 @@ OUString DrawingML::GetFieldValue( const css::uno::Reference< css::text::XTextRa
{
sal_Int32 nNumFmt = -1;
rXPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= nNumFmt;
- switch(static_cast<SvxDateFormat>(nNumFmt))
- {
- case SvxDateFormat::StdSmall:
- case SvxDateFormat::A: aFieldValue = "datetime"; // 13/02/96
- break;
- case SvxDateFormat::B: aFieldValue = "datetime1"; // 13/02/1996
- break;
- case SvxDateFormat::StdBig:
- case SvxDateFormat::D: aFieldValue = "datetime3"; // 13 February 1996
- break;
- default: break;
- }
+ aFieldValue = GetDatetimeTypeFromDate(static_cast<SvxDateFormat>(nNumFmt));
}
else if(aFieldKind == "ExtTime")
{
sal_Int32 nNumFmt = -1;
rXPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= nNumFmt;
- switch(static_cast<SvxTimeFormat>(nNumFmt))
- {
- case SvxTimeFormat::Standard:
- case SvxTimeFormat::HH24_MM_SS:
- aFieldValue = "datetime11"; // 13:49:38
- break;
- case SvxTimeFormat::HH24_MM:
- aFieldValue = "datetime10"; // 13:49
- break;
- case SvxTimeFormat::HH12_MM:
- aFieldValue = "datetime12"; // 01:49 PM
- break;
- case SvxTimeFormat::HH12_MM_SS:
- aFieldValue = "datetime13"; // 01:49:38 PM
- break;
- default: break;
- }
+ aFieldValue = GetDatetimeTypeFromTime(static_cast<SvxTimeFormat>(nNumFmt));
}
else if(aFieldKind == "ExtFile")
{
@@ -2198,6 +2171,85 @@ OUString DrawingML::GetFieldValue( const css::uno::Reference< css::text::XTextRa
return aFieldValue;
}
+OUString DrawingML::GetDatetimeTypeFromDate(SvxDateFormat eDate)
+{
+ return GetDatetimeTypeFromDateTime(eDate, SvxTimeFormat::AppDefault);
+}
+
+OUString DrawingML::GetDatetimeTypeFromTime(SvxTimeFormat eTime)
+{
+ return GetDatetimeTypeFromDateTime(SvxDateFormat::AppDefault, eTime);
+}
+
+OUString DrawingML::GetDatetimeTypeFromDateTime(SvxDateFormat eDate, SvxTimeFormat eTime)
+{
+ OUString aDateField;
+ switch (eDate)
+ {
+ case SvxDateFormat::StdSmall:
+ case SvxDateFormat::A:
+ aDateField = "datetime";
+ break;
+ case SvxDateFormat::B:
+ aDateField = "datetime1"; // 13/02/1996
+ break;
+ case SvxDateFormat::C:
+ aDateField = "datetime5";
+ break;
+ case SvxDateFormat::D:
+ aDateField = "datetime3"; // 13 February 1996
+ break;
+ case SvxDateFormat::StdBig:
+ case SvxDateFormat::E:
+ case SvxDateFormat::F:
+ aDateField = "datetime2";
+ break;
+ default:
+ break;
+ }
+
+ OUString aTimeField;
+ switch (eTime)
+ {
+ case SvxTimeFormat::Standard:
+ case SvxTimeFormat::HH24_MM_SS:
+ case SvxTimeFormat::HH24_MM_SS_00:
+ aTimeField = "datetime11"; // 13:49:38
+ break;
+ case SvxTimeFormat::HH24_MM:
+ aTimeField = "datetime10"; // 13:49
+ break;
+ case SvxTimeFormat::HH12_MM:
+ case SvxTimeFormat::HH12_MM_AMPM:
+ aTimeField = "datetime12"; // 01:49 PM
+ break;
+ case SvxTimeFormat::HH12_MM_SS:
+ case SvxTimeFormat::HH12_MM_SS_AMPM:
+ case SvxTimeFormat::HH12_MM_SS_00:
+ case SvxTimeFormat::HH12_MM_SS_00_AMPM:
+ aTimeField = "datetime13"; // 01:49:38 PM
+ break;
+ default:
+ break;
+ }
+
+ if (!aDateField.isEmpty() && aTimeField.isEmpty())
+ return aDateField;
+ else if (!aTimeField.isEmpty() && aDateField.isEmpty())
+ return aTimeField;
+ else if (!aDateField.isEmpty() && !aTimeField.isEmpty())
+ {
+ if (aTimeField == "datetime11" || aTimeField == "datetime13")
+ // only datetime format that has Date and HH:MM:SS
+ return "datetime9"; // dd/mm/yyyy H:MM:SS
+ else
+ // only datetime format that has Date and HH:MM
+ return "datetime8"; // dd/mm/yyyy H:MM
+ }
+ else
+ return "";
+}
+
void DrawingML::WriteRun( const Reference< XTextRange >& rRun,
bool& rbOverridingCharHeight, sal_Int32& rnCharHeight)
{
@@ -2623,14 +2675,14 @@ void DrawingML::WriteLinespacing( const LineSpacing& rSpacing )
}
}
-void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rParagraph, float fFirstCharHeight)
+bool DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rParagraph, float fFirstCharHeight, sal_Int32 nElement)
{
Reference< XPropertySet > rXPropSet( rParagraph, UNO_QUERY );
Reference< XPropertyState > rXPropState( rParagraph, UNO_QUERY );
PropertyState eState;
if( !rXPropSet.is() || !rXPropState.is() )
- return;
+ return false;
sal_Int16 nLevel = -1;
if (GetProperty(rXPropSet, "NumberingLevel"))
@@ -2681,14 +2733,14 @@ void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara
|| bHasLinespacing )
{
if (nParaLeftMargin) // For Paragraph
- mpFS->startElementNS( XML_a, XML_pPr,
+ mpFS->startElementNS( XML_a, nElement,
XML_lvl, nLevel > 0 ? OString::number(nLevel).getStr() : nullptr,
XML_marL, nParaLeftMargin > 0 ? OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)).getStr() : nullptr,
XML_indent, nParaFirstLineIndent ? OString::number(oox::drawingml::convertHmmToEmu(nParaFirstLineIndent)).getStr() : nullptr,
XML_algn, GetAlignment( nAlignment ),
XML_rtl, bRtl ? ToPsz10(bRtl) : nullptr );
else
- mpFS->startElementNS( XML_a, XML_pPr,
+ mpFS->startElementNS( XML_a, nElement,
XML_lvl, nLevel > 0 ? OString::number(nLevel).getStr() : nullptr,
XML_marL, nLeftMargin > 0 ? OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)).getStr() : nullptr,
XML_indent, nLineIndentation ? OString::number(oox::drawingml::convertHmmToEmu(nLineIndentation)).getStr() : nullptr,
@@ -2726,7 +2778,51 @@ void DrawingML::WriteParagraphProperties( const Reference< XTextContent >& rPara
WriteParagraphNumbering( rXPropSet, fFirstCharHeight, nLevel );
WriteParagraphTabStops( rXPropSet );
- mpFS->endElementNS( XML_a, XML_pPr );
+ // do not end element for lstStyles since, defRPr should be stacked inside it
+ if( nElement != XML_lvl1pPr )
+ mpFS->endElementNS( XML_a, nElement );
+
+ return true;
+ }
+ return false;
+}
+
+void DrawingML::WriteLstStyles(const css::uno::Reference<css::text::XTextContent>& rParagraph,
+ bool& rbOverridingCharHeight, sal_Int32& rnCharHeight,
+ const css::uno::Reference<css::beans::XPropertySet>& /*rXShapePropSet*/)
+{
+ Reference<XEnumerationAccess> access(rParagraph, UNO_QUERY);
+ if (!access.is())
+ return;
+
+ Reference<XEnumeration> enumeration(access->createEnumeration());
+ if (!enumeration.is())
+ return;
+
+
+ Reference<XTextRange> rRun;
+
+ if (enumeration->hasMoreElements())
+ {
+ Any aAny(enumeration->nextElement());
+ if (aAny >>= rRun)
+ {
+ float fFirstCharHeight = rnCharHeight / 1000.;
+ Reference<XPropertySet> xFirstRunPropSet(rRun, UNO_QUERY);
+ Reference<XPropertySetInfo> xFirstRunPropSetInfo
+ = xFirstRunPropSet->getPropertySetInfo();
+
+ if (xFirstRunPropSetInfo->hasPropertyByName("CharHeight"))
+ fFirstCharHeight = xFirstRunPropSet->getPropertyValue("CharHeight").get<float>();
+
+ mpFS->startElementNS(XML_a, XML_lstStyle);
+ if( !WriteParagraphProperties(rParagraph, fFirstCharHeight, XML_lvl1pPr) )
+ mpFS->startElementNS(XML_a, XML_lvl1pPr);
+ WriteRunProperties(xFirstRunPropSet, false, XML_defRPr, true, rbOverridingCharHeight,
+ rnCharHeight, GetScriptType(rRun->getString()));
+ mpFS->endElementNS(XML_a, XML_lvl1pPr);
+ mpFS->endElementNS(XML_a, XML_lstStyle);
+ }
}
}
@@ -2757,7 +2853,11 @@ void DrawingML::WriteParagraph( const Reference< XTextContent >& rParagraph,
Reference< XPropertySet > xFirstRunPropSet (run, UNO_QUERY);
Reference< XPropertySetInfo > xFirstRunPropSetInfo = xFirstRunPropSet->getPropertySetInfo();
if( xFirstRunPropSetInfo->hasPropertyByName("CharHeight") )
+ {
fFirstCharHeight = xFirstRunPropSet->getPropertyValue("CharHeight").get<float>();
+ rnCharHeight = 100 * fFirstCharHeight;
+ rbOverridingCharHeight = true;
+ }
WriteParagraphProperties( rParagraph, fFirstCharHeight );
bPropertiesWritten = true;
}
@@ -2770,7 +2870,7 @@ void DrawingML::WriteParagraph( const Reference< XTextContent >& rParagraph,
mpFS->endElementNS( XML_a, XML_p );
}
-void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUString& presetWarp, bool bBodyPr, bool bText, sal_Int32 nXmlNamespace )
+void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUString& presetWarp, bool bBodyPr, bool bText, sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles )
{
Reference< XText > xXText( rXIface, UNO_QUERY );
Reference< XPropertySet > rXPropSet( rXIface, UNO_QUERY );
@@ -3002,7 +3102,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
}
}
- WriteShape3DEffects( rXPropSet );
+ Write3DEffects( rXPropSet, /*bIsText=*/true );
mpFS->endElementNS((nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr);
}
@@ -3048,6 +3148,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
bool bOverridingCharHeight = false;
sal_Int32 nCharHeight = -1;
+ bool bFirstParagraph = true;
while( enumeration->hasMoreElements() )
{
@@ -3055,7 +3156,13 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
Any any ( enumeration->nextElement() );
if( any >>= paragraph)
- WriteParagraph( paragraph, bOverridingCharHeight, nCharHeight );
+ {
+ if (bFirstParagraph && bWritePropertiesAsLstStyles)
+ WriteLstStyles(paragraph, bOverridingCharHeight, nCharHeight, rXPropSet);
+
+ WriteParagraph(paragraph, bOverridingCharHeight, nCharHeight);
+ bFirstParagraph = false;
+ }
}
}
@@ -3933,7 +4040,7 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet )
}
}
-void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
+void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool bIsText )
{
// check existence of the grab bag
if( !GetProperty( xPropSet, "InteropGrabBag" ) )
@@ -3942,8 +4049,10 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
// extract the relevant properties from the grab bag
Sequence< PropertyValue > aGrabBag, aEffectProps, aLightRigProps, aShape3DProps;
mAny >>= aGrabBag;
- auto pShapeProp = std::find_if(std::cbegin(aGrabBag), std::cend(aGrabBag),
- [](const PropertyValue& rProp) { return rProp.Name == "3DEffectProperties"; });
+
+ auto pShapeProp = std::find_if( std::cbegin(aGrabBag), std::cend(aGrabBag),
+ [bIsText](const PropertyValue& rProp)
+ { return rProp.Name == (bIsText ? u"Text3DEffectProperties" : u"3DEffectProperties"); });
if (pShapeProp != std::cend(aGrabBag))
{
Sequence< PropertyValue > a3DEffectProps;
@@ -3959,24 +4068,6 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
}
}
- auto pTextProp = std::find_if(std::cbegin(aGrabBag), std::cend(aGrabBag),
- [](const PropertyValue& rProp) { return rProp.Name == "Text3DEffectProperties"; });
-
- if (pTextProp != std::cend(aGrabBag))
- {
- Sequence< PropertyValue > a3DEffectProps;
- pTextProp->Value >>= a3DEffectProps;
- for( const auto& r3DEffectProp : std::as_const(a3DEffectProps) )
- {
- if( r3DEffectProp.Name == "Camera" )
- r3DEffectProp.Value >>= aEffectProps;
- else if( r3DEffectProp.Name == "LightRig" )
- r3DEffectProp.Value >>= aLightRigProps;
- else if( r3DEffectProp.Name == "Shape3D" )
- r3DEffectProp.Value >>= aShape3DProps;
- }
- }
-
if( !aEffectProps.hasElements() && !aLightRigProps.hasElements() && !aShape3DProps.hasElements() )
return;
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 60b88181b5dc..ef9fdfd12282 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1059,7 +1059,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
bHas3DEffectinShape = true;
if( bHas3DEffectinShape)
- WriteShape3DEffects( rXPropSet );
+ Write3DEffects( rXPropSet, /*bIsText=*/false );
}
pFS->endElementNS( mnXmlNamespace, XML_spPr );
@@ -1313,7 +1313,7 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
WriteOutline( xShapeProps );
WriteShapeEffects( xShapeProps );
- WriteShape3DEffects( xShapeProps );
+ Write3DEffects( xShapeProps, /*bIsText=*/false );
pFS->endElementNS( mnXmlNamespace, XML_spPr );
@@ -1591,7 +1591,7 @@ ShapeExport& ShapeExport::WriteShape( const Reference< XShape >& xShape )
return *this;
}
-ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, sal_Int32 nXmlNamespace )
+ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles )
{
// In case this shape has an associated textbox, then export that, and we're done.
if (GetDocumentType() == DOCUMENT_DOCX && GetTextExport())
@@ -1616,7 +1616,7 @@ ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, s
pFS->startElementNS(nXmlNamespace,
(GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx));
- WriteText( xIface, m_presetWarp, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX) );
+ WriteText( xIface, m_presetWarp, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX), true, 0, bWritePropertiesAsLstStyles );
pFS->endElementNS( nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX ? XML_txBody : XML_txbx) );
if (GetDocumentType() == DOCUMENT_DOCX)
WriteText( xIface, m_presetWarp, /*bBodyPr=*/true, /*bText=*/false, /*nXmlNamespace=*/nXmlNamespace );
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 71b94c727132..6208a7107f23 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -19,9 +19,14 @@
#include <oox/ppt/pptshape.hxx>
#include <oox/core/xmlfilterbase.hxx>
+#include <drawingml/customshapeproperties.hxx>
#include <drawingml/textbody.hxx>
+#include <drawingml/textparagraph.hxx>
+#include <drawingml/textfield.hxx>
#include <drawingml/table/tableproperties.hxx>
+#include <editeng/flditem.hxx>
+#include <com/sun/star/text/XTextField.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
@@ -50,6 +55,7 @@ PPTShape::PPTShape( const oox::ppt::ShapeLocation eShapeLocation, const sal_Char
: Shape( pServiceName )
, meShapeLocation( eShapeLocation )
, mbReferenced( false )
+, mbHasNoninheritedShapeProperties( false )
{
}
@@ -85,6 +91,19 @@ static const char* lclDebugSubType( sal_Int32 nType )
return "unknown - please extend lclDebugSubType";
}
+namespace
+{
+bool ShapeHasNoVisualPropertiesOnImport(const oox::ppt::PPTShape& rPPTShape)
+{
+ return !rPPTShape.hasNonInheritedShapeProperties()
+ && !rPPTShape.hasShapeStyleRefs()
+ && !rPPTShape.getTextBody()->hasVisualRunProperties()
+ && !rPPTShape.getTextBody()->hasNoninheritedBodyProperties()
+ && !rPPTShape.getTextBody()->hasListStyleOnImport()
+ && !rPPTShape.getTextBody()->hasParagraphProperties();
+}
+}
+
oox::drawingml::TextListStylePtr PPTShape::getSubTypeTextListStyle( const SlidePersist& rSlidePersist, sal_Int32 nSubType )
{
oox::drawingml::TextListStylePtr pTextListStyle;
@@ -110,6 +129,27 @@ oox::drawingml::TextListStylePtr PPTShape::getSubTypeTextListStyle( const SlideP
return pTextListStyle;
}
+bool PPTShape::IsPlaceHolderCandidate(const SlidePersist& rSlidePersist) const
+{
+ if (meShapeLocation != Slide)
+ return false;
+ if (rSlidePersist.isNotesPage())
+ return false;
+ auto pTextBody = getTextBody();
+ if (!pTextBody)
+ return false;
+ auto rParagraphs = pTextBody->getParagraphs();
+ if (rParagraphs.size() != 1)
+ return false;
+ if (rParagraphs.front()->getRuns().size() != 1)
+ return false;
+ // If the placeholder has a shape other than rectangle,
+ // we have to place it in the slide as a CustomShape.
+ if (!mpCustomShapePropertiesPtr->representsDefaultShape())
+ return false;
+ return ShapeHasNoVisualPropertiesOnImport(*this);
+}
+
void PPTShape::addShape(
oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rSlidePersist,
@@ -178,6 +218,34 @@ void PPTShape::addShape(
}
break;
case XML_dt :
+ if (IsPlaceHolderCandidate(rSlidePersist))
+ {
+ TextRunPtr& pTextRun = getTextBody()->getParagraphs().front()->getRuns().front();
+ oox::drawingml::TextField* pTextField = dynamic_cast<oox::drawingml::TextField*>(pTextRun.get());
+ if (pTextField)
+ {
+ OUString aType = pTextField->getType();
+ if ( aType.startsWith("datetime") )
+ {
+ SvxDateFormat eDateFormat = drawingml::TextField::getLODateFormat(aType);
+ SvxTimeFormat eTimeFormat = drawingml::TextField::getLOTimeFormat(aType);
+ Reference< XPropertySet > xPropertySet( rSlidePersist.getPage(), UNO_QUERY );
+
+ if( eDateFormat != SvxDateFormat::AppDefault
+ || eTimeFormat != SvxTimeFormat::AppDefault )
+ {
+ // DateTimeFormat property looks for the date in 4 LSBs
+ // and looks for time format in the 4 bits after that
+ sal_Int32 nDateTimeFormat = static_cast<sal_Int32>(eDateFormat) |
+ static_cast<sal_Int32>(eTimeFormat) << 4;
+ xPropertySet->setPropertyValue( "IsDateTimeVisible", Any(true) );
+ xPropertySet->setPropertyValue( "IsDateTimeFixed", Any(false) );
+ xPropertySet->setPropertyValue( "DateTimeFormat", Any(nDateTimeFormat) );
+ return;
+ }
+ }
+ }
+ }
sServiceName = "com.sun.star.presentation.DateTimeShape";
bClearText = true;
break;
@@ -186,10 +254,40 @@ void PPTShape::addShape(
bClearText = true;
break;
case XML_ftr :
+ if (IsPlaceHolderCandidate(rSlidePersist))
+ {
+ const OUString& rFooterText = getTextBody()->toString();
+
+ if( !rFooterText.isEmpty() )
+ {
+ // if it is possible to get the footer as a property the LO way,
+ // get it and discard the shape
+ Reference< XPropertySet > xPropertySet( rSlidePersist.getPage(), UNO_QUERY );
+ xPropertySet->setPropertyValue( "IsFooterVisible", Any( true ) );
+ xPropertySet->setPropertyValue( "FooterText", Any(rFooterText) );
+ return;
+ }
+ }
sServiceName = "com.sun.star.presentation.FooterShape";
bClearText = true;
break;
case XML_sldNum :
+ if (IsPlaceHolderCandidate(rSlidePersist))
+ {
+ TextRunPtr& pTextRun
+ = getTextBody()->getParagraphs().front()->getRuns().front();
+ oox::drawingml::TextField* pTextField
+ = dynamic_cast<oox::drawingml::TextField*>(pTextRun.get());
+ if (pTextField && pTextField->getType() == "slidenum")
+ {
+ // if it is possible to get the slidenum placeholder as a property
+ // do that and discard the shape
+ Reference<XPropertySet> xPropertySet(rSlidePersist.getPage(),
+ UNO_QUERY);
+ xPropertySet->setPropertyValue("IsPageNumberVisible", Any(true));
+ return;
+ }
+ }
sServiceName = "com.sun.star.presentation.SlideNumberShape";
bClearText = true;
break;
@@ -227,6 +325,16 @@ void PPTShape::addShape(
}
}
+ // Since it is not possible to represent custom shaped placeholders in Impress
+ // Need to use service name css.drawing.CustomShape if they have a non default shape.
+ // This workaround has the drawback of them not really being processed as placeholders
+ // so it is only done for slide footers...
+ if ((mnSubType == XML_sldNum || mnSubType == XML_dt || mnSubType == XML_ftr)
+ && meShapeLocation == Slide && !mpCustomShapePropertiesPtr->representsDefaultShape())
+ {
+ sServiceName = "com.sun.star.drawing.CustomShape";
+ }
+
if (sServiceName != "com.sun.star.drawing.TableShape")
{
if (TextBodyPtr pTextBody = getTextBody())
@@ -408,6 +516,26 @@ void PPTShape::addShape(
}
}
+ // we will be losing whatever information there is in the footer placeholder on master/layout slides
+ // since they should have the "<footer>" textfield in them in order to make LibreOffice process them as expected
+ // likewise DateTime placeholder data on master/layout slides will be lost and replaced
+ if( (mnSubType == XML_ftr || mnSubType == XML_dt) && meShapeLocation != Slide )
+ {
+ OUString aFieldType;
+ if( mnSubType == XML_ftr )
+ aFieldType = "com.sun.star.presentation.TextField.Footer";
+ else
+ aFieldType = "com.sun.star.presentation.TextField.DateTime";
+ Reference < XTextField > xField( xServiceFact->createInstance( aFieldType ), UNO_QUERY );
+ Reference < XText > xText(mxShape, UNO_QUERY);
+ if(xText.is())
+ {
+ xText->setString("");
+ Reference < XTextCursor > xTextCursor = xText->createTextCursor();
+ xText->insertTextContent( xTextCursor, xField, false);
+ }
+ }
+
// if this is a group shape, we have to add also each child shape
Reference<XShapes> xShapes(xShape, UNO_QUERY);
if (xShapes.is())
diff --git a/oox/source/ppt/pptshapepropertiescontext.cxx b/oox/source/ppt/pptshapepropertiescontext.cxx
index b2dfcbce8980..a65a02d93e1c 100644
--- a/oox/source/ppt/pptshapepropertiescontext.cxx
+++ b/oox/source/ppt/pptshapepropertiescontext.cxx
@@ -35,6 +35,7 @@
#include <oox/token/namespaces.hxx>
#include <oox/token/properties.hxx>
#include <oox/token/tokens.hxx>
+#include <oox/ppt/pptshape.hxx>
using namespace oox::core;
using namespace ::com::sun::star;
@@ -54,6 +55,10 @@ PPTShapePropertiesContext::PPTShapePropertiesContext( ContextHandler2Helper cons
ContextHandlerRef PPTShapePropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs )
{
+ PPTShape* pPPTShape = dynamic_cast<PPTShape*>(&mrShape);
+ if (pPPTShape)
+ pPPTShape->setHasNoninheritedShapeProperties();
+
switch( aElementToken )
{
case A_TOKEN( xfrm ):
diff --git a/oox/source/token/namespaces-strict.txt b/oox/source/token/namespaces-strict.txt
index d6990e5bdf91..36841732372e 100644
--- a/oox/source/token/namespaces-strict.txt
+++ b/oox/source/token/namespaces-strict.txt
@@ -84,6 +84,7 @@ p14 http://schemas.microsoft.com/office/powerpoint/2010/main
# MSO 2012/2013 extensions ---------------------------------------------------------
+w15 http://schemas.microsoft.com/office/word/2012/wordml
p15 http://schemas.microsoft.com/office/powerpoint/2012/main
x12ac http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 604541129469..20d283415069 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -84,6 +84,7 @@ p14 http://schemas.microsoft.com/office/powerpoint/2010/main
# MSO 2012/2013 extensions ---------------------------------------------------------
+w15 http://schemas.microsoft.com/office/word/2012/wordml
p15 http://schemas.microsoft.com/office/powerpoint/2012/main
x12ac http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac
diff --git a/oox/source/token/relationship.inc b/oox/source/token/relationship.inc
index 2b973ded1653..31d46cdd7d71 100644
--- a/oox/source/token/relationship.inc
+++ b/oox/source/token/relationship.inc
@@ -2,6 +2,7 @@
{Relationship::CHART, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"},
{Relationship::COMMENTS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"},
{Relationship::COMMENTAUTHORS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors"},
+{Relationship::COMMENTSEXTENDED, "http://schemas.microsoft.com/office/2011/relationships/commentsExtended"},
{Relationship::CONTROL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/control"},
{Relationship::CTRLPROP, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp"},
{Relationship::CUSTOMXML, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"},
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index 3929d8c93808..9f7b815e53c2 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -1314,12 +1314,14 @@ comma
command
commandType
comment
+commentEx
commentList
commentPr
commentRangeEnd
commentRangeStart
commentReference
comments
+commentsEx
comp
compact
compactData
@@ -1901,6 +1903,7 @@ doNotValidateAgainstSchema
doNotVertAlignCellWithSp
doNotVertAlignInTxbx
doNotWrapTextWithPunct
+done
doc
docDefaults
docEnd
@@ -3850,6 +3853,7 @@ parTrans
parTransId
parTxLTRAlign
parTxRTLAlign
+paraId
paragraph
parallel
parallelogram
@@ -5672,6 +5676,7 @@ vt
w
w10
w14
+w15
wAfter
wArH
wBefore
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 3dd9747f0a84..038f35ec37c5 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <rtl/math.hxx>
#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/drawing/ColorMode.hpp>
#include <sal/log.hxx>
#include <svx/svdtrans.hxx>
#include <oox/drawingml/shapepropertymap.hxx>
@@ -923,6 +924,12 @@ Reference< XShape > SimpleShape::createPictureObject(const Reference< XShapes >&
aPropSet.setProperty(PROP_GraphicCrop, aGraphicCrop);
}
+
+ if (maTypeModel.mnGain == -70 && maTypeModel.mnBlacklevel == 70)
+ {
+ // Map MSO 'washout' to our watermark colormode.
+ aPropSet.setProperty(PROP_GraphicColorMode, uno::makeAny(drawing::ColorMode_WATERMARK));
+ }
}
return xShape;
}
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index d27839a79084..0679362401fc 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -386,6 +386,34 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A
mrTypeModel.moCropLeft = rAttribs.getString(XML_cropleft);
mrTypeModel.moCropRight = rAttribs.getString(XML_cropright);
mrTypeModel.moCropTop = rAttribs.getString(XML_croptop);
+
+ // Gain / contrast.
+ OptValue<OUString> oGain = rAttribs.getString(XML_gain);
+ sal_Int32 nGain = 0x10000;
+ if (oGain.has() && oGain.get().endsWith("f"))
+ {
+ nGain = oGain.get().toInt32();
+ }
+ if (nGain < 0x10000)
+ {
+ nGain *= 101; // 100 + 1 to round
+ nGain /= 0x10000;
+ nGain -= 100;
+ }
+ mrTypeModel.mnGain = nGain;
+
+ // Blacklevel / brightness.
+ OptValue<OUString> oBlacklevel = rAttribs.getString(XML_blacklevel);
+ sal_Int16 nBlacklevel = 0;
+ if (oBlacklevel.has() && oBlacklevel.get().endsWith("f"))
+ {
+ nBlacklevel = oBlacklevel.get().toInt32();
+ }
+ if (nBlacklevel != 0)
+ {
+ nBlacklevel /= 327;
+ }
+ mrTypeModel.mnBlacklevel = nBlacklevel;
}
break;
case NMSP_vmlWord | XML_wrap:
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index e28de2ef751a..aee91755c77c 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -50,10 +50,8 @@ $(eval $(call gb_Rdb_add_components,services,\
i18npool/util/i18npool \
lingucomponent/source/hyphenator/hyphen/hyphen \
lingucomponent/source/languageguessing/guesslang \
- $(if $(filter-out iOS,$(OS)), \
- lingucomponent/source/spellcheck/spell/spell \
- lingucomponent/source/thesaurus/libnth/lnth \
- ) \
+ lingucomponent/source/spellcheck/spell/spell \
+ lingucomponent/source/thesaurus/libnth/lnth \
lingucomponent/source/numbertext/numbertext \
linguistic/source/lng \
$(if $(ENABLE_LWP), \
diff --git a/pyuno/source/loader/pythonloader.py b/pyuno/source/loader/pythonloader.py
index 268cb168fe3c..0ecbf5d848a6 100644
--- a/pyuno/source/loader/pythonloader.py
+++ b/pyuno/source/loader/pythonloader.py
@@ -19,7 +19,7 @@
import uno
import unohelper
import sys
-import imp
+import types
import os
from com.sun.star.uno import Exception,RuntimeException
from com.sun.star.loader import XImplementationLoader
@@ -82,7 +82,7 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ):
# did we load the module already ?
mod = g_loadedComponents.get( url )
if not mod:
- mod = imp.new_module("uno_component")
+ mod = types.ModuleType("uno_component")
# check for pythonpath.zip beside .py files
checkForPythonPathBesideComponent( url[0:url.rfind('/')] )
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index 5a6ffdff9110..e53c1ae712f4 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -125,7 +125,9 @@ char const* setEnvFromLoggingIniFile(const char* env, const char* key)
}
#endif
-char const * getLogLevel() {
+char const* pLogSelector = nullptr;
+
+char const* getLogLevelEnvVar() {
static char const* const pLevel = [] {
char const* pResult = nullptr;
@@ -176,33 +178,36 @@ std::ofstream * getLogFile() {
return pFile;
}
-void maybeOutputTimestamp(std::ostringstream &s) {
- static const std::pair<bool, bool> aFlags = [] {
- char const* env = getLogLevel();
- bool outputTimestamp = false;
- bool outputRelativeTimer = false;
- for (char const* p = env; p && *p;)
+
+const std::pair<bool, bool> getTimestampFlags(char const *selector)
+{
+ bool outputTimestamp = false;
+ bool outputRelativeTimer = false;
+ for (char const* p = selector; p && *p;)
{
if (*p++ == '+')
- {
- char const * p1 = p;
- while (*p1 != '.' && *p1 != '+' && *p1 != '-' && *p1 != '\0') {
- ++p1;
- }
- if (equalStrings(p, p1 - p, RTL_CONSTASCII_STRINGPARAM("TIMESTAMP")))
- outputTimestamp = true;
- else if (equalStrings(p, p1 - p, RTL_CONSTASCII_STRINGPARAM("RELATIVETIMER")))
- outputRelativeTimer = true;
- char const * p2 = p1;
- while (*p2 != '+' && *p2 != '-' && *p2 != '\0') {
- ++p2;
+ {
+ char const * p1 = p;
+ while (*p1 != '.' && *p1 != '+' && *p1 != '-' && *p1 != '\0') {
+ ++p1;
+ }
+ if (equalStrings(p, p1 - p, RTL_CONSTASCII_STRINGPARAM("TIMESTAMP")))
+ outputTimestamp = true;
+ else if (equalStrings(p, p1 - p, RTL_CONSTASCII_STRINGPARAM("RELATIVETIMER")))
+ outputRelativeTimer = true;
+ char const * p2 = p1;
+ while (*p2 != '+' && *p2 != '-' && *p2 != '\0') {
+ ++p2;
+ }
+ p = p2;
}
- p = p2;
- }
}
- return std::pair(outputTimestamp, outputRelativeTimer);
- }();
- const auto& [outputTimestamp, outputRelativeTimer] = aFlags;
+ return std::pair(outputTimestamp, outputRelativeTimer);
+}
+
+void maybeOutputTimestamp(std::ostringstream &s) {
+ static const std::pair<bool, bool> aEnvFlags = getTimestampFlags(getLogLevelEnvVar());
+ const auto& [outputTimestamp, outputRelativeTimer] = (pLogSelector == nullptr ? aEnvFlags : getTimestampFlags(pLogSelector));
if (outputTimestamp)
{
@@ -340,6 +345,11 @@ void sal_detail_log(
#endif
}
+void sal_detail_set_log_selector(char const *logSelector)
+{
+ pLogSelector = logSelector;
+}
+
void sal_detail_logFormat(
sal_detail_LogLevel level, char const * area, char const * where,
char const * format, ...)
@@ -365,12 +375,13 @@ sal_Bool sal_detail_log_report(sal_detail_LogLevel level, char const * area) {
return true;
}
assert(area != nullptr);
- static char const* const env = [] {
- char const* pResult = getLogLevel();
+ static char const* const envEnv = [] {
+ char const* pResult = getLogLevelEnvVar();
if (!pResult)
pResult = "+WARN";
return pResult;
}();
+ char const* const env = (pLogSelector == nullptr ? envEnv : pLogSelector);
std::size_t areaLen = std::strlen(area);
enum Sense { POSITIVE = 0, NEGATIVE = 1 };
std::size_t senseLen[2] = { 0, 1 };
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index a3aeb3dae3f8..26005f7715af 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -212,74 +212,7 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
}
}
-#elif defined( MACOSX )
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include "backtrace.h"
-
-/* glib backtrace is only available on MacOsX 10.5 or higher
- so we do it on our own */
-
-int backtrace( void **buffer, int max_frames )
-{
- void **frame = (void **)__builtin_frame_address(0);
- void **bp = ( void **)(*frame);
- void *ip = frame[1];
- int i;
-
- for ( i = 0; bp && ip && i < max_frames; i++ )
- {
- *(buffer++) = ip;
-
- ip = bp[1];
- bp = (void**)(bp[0]);
- }
-
- return i;
-}
-
-char ** backtrace_symbols(void * const * buffer, int size)
-{
- (void)buffer; (void)size;
- return NULL; /*TODO*/
-}
-
-void backtrace_symbols_fd( void **buffer, int size, int fd )
-{
- FILE *fp = fdopen( fd, "w" );
-
- if ( fp )
- {
- void **pFramePtr;
-
- for ( pFramePtr = buffer; size > 0 && pFramePtr && *pFramePtr; pFramePtr++, size-- )
- {
- Dl_info dli;
-
- if ( 0 != dladdr( *pFramePtr, &dli ) )
- {
- ptrdiff_t offset;
-
- if ( dli.dli_fname && dli.dli_fbase )
- {
- offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
- fprintf( fp, "%s+0x%tx", dli.dli_fname, offset );
- }
- if ( dli.dli_sname && dli.dli_saddr )
- {
- offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
- fprintf( fp, "(%s+0x%tx)", dli.dli_sname, offset );
- }
- }
- fprintf( fp, "[%p]\n", *pFramePtr );
- }
-
- fclose( fp );
- }
-}
-
-#elif !defined LINUX
+#elif !defined LINUX && !defined MACOSX && !defined IOS
int backtrace( void **buffer, int max_frames )
{
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 48d76b1a3802..a43ae43e9cbe 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -747,6 +747,7 @@ PRIVATE_1.6 { # LibreOffice 6.4
global:
rtl_str_toInt64_WithLength;
rtl_ustr_toInt64_WithLength;
+ sal_detail_set_log_selector;
} PRIVATE_1.5;
PRIVATE_textenc.1 { # LibreOffice 3.6
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 8ee00c63be1f..b73aef090e13 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -2439,6 +2439,21 @@ bool Converter::convertAny(OUStringBuffer& rsValue,
return bConverted;
}
+void Converter::convertBytesToHexBinary(OUStringBuffer& rBuffer, const void* pBytes,
+ sal_Int32 nBytes)
+{
+ rBuffer.setLength(0);
+ rBuffer.ensureCapacity(nBytes * 2);
+ auto pChars = static_cast<const unsigned char*>(pBytes);
+ for (sal_Int32 i = 0; i < nBytes; ++i)
+ {
+ sal_Int32 c = *pChars++;
+ if (c < 16)
+ rBuffer.append('0');
+ rBuffer.append(c, 16);
+ }
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 7a568e1f48a8..338d4dd2ff4d 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -159,6 +159,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/notebookbar_groups \
sc/uiconfig/scalc/ui/notebookbar_groupedbar_full \
sc/uiconfig/scalc/ui/notebookbar_groupedbar_compact \
+ sc/uiconfig/scalc/ui/notebookbar_online \
sc/uiconfig/scalc/ui/numberbox \
sc/uiconfig/scalc/ui/managenamesdialog \
sc/uiconfig/scalc/ui/mergecellsdialog \
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx
index 96d7000cef67..0fd9bbf991cf 100644
--- a/sc/inc/cellsuno.hxx
+++ b/sc/inc/cellsuno.hxx
@@ -25,6 +25,7 @@
#include <formula/grammar.hxx>
#include <rtl/ref.hxx>
+#include <sal/types.h>
#include <tools/link.hxx>
#include <svl/lstner.hxx>
#include <svl/listener.hxx>
@@ -763,7 +764,7 @@ public:
virtual sal_Int16 SAL_CALL resetActionLocks() override;
};
-class ScTableSheetObj : public ScCellRangeObj,
+class SAL_DLLPUBLIC_RTTI ScTableSheetObj : public ScCellRangeObj,
public css::sheet::XSpreadsheet,
public css::container::XNamed,
public css::sheet::XSheetPageBreak,
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 64485ccd5f2c..38d47910a6b0 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -537,7 +537,7 @@ public:
sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow,
ScFilterEntries& rFilterEntries );
- bool GetDataEntries( SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit ) const;
+ bool GetDataEntries( SCROW nRow, std::set<ScTypedStrData>& rStrings) const;
void UpdateInsertTabAbs(SCTAB nNewPos);
bool TestTabRefAbs(SCTAB nTable) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 4d385e97d0c9..91e2c5b7c0b3 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -561,6 +561,8 @@ private:
bool mbEmbedFontScriptAsian : 1;
bool mbEmbedFontScriptComplex : 1;
+ sal_Int32 mnImagenPreferredDPI;
+
std::unique_ptr<sc::IconSetBitmapMap> m_pIconSetBitmapMap;
bool mbTrackFormulasPending : 1;
@@ -586,6 +588,9 @@ public:
void SetEmbedFontScriptAsian(bool bUse) { mbEmbedFontScriptAsian = bUse; }
void SetEmbedFontScriptComplex(bool bUse) { mbEmbedFontScriptComplex = bUse; }
+ void SetImagePreferredDPI(sal_Int32 nValue) { mnImagenPreferredDPI = nValue; }
+ sal_Int32 GetImagePreferredDPI() { return mnImagenPreferredDPI; }
+
SC_DLLPUBLIC sal_uLong GetCellCount() const; // all cells
SC_DLLPUBLIC sal_uLong GetFormulaGroupCount() const; // all cells
sal_uLong GetCodeCount() const; // RPN-Code in formulas
@@ -2061,7 +2066,7 @@ public:
ScFilterEntries& rFilterEntries );
void GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab,
- std::vector<ScTypedStrData>& rStrings, bool bLimit = false );
+ std::vector<ScTypedStrData>& rStrings, bool bValidation = false );
void GetFormulaEntries( ScTypedCaseStrSet& rStrings );
bool HasAutoFilter( SCCOL nCol, SCROW nRow, SCTAB nTab );
diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx
index 758469f258a6..ed77561a5153 100644
--- a/sc/inc/documentimport.hxx
+++ b/sc/inc/documentimport.hxx
@@ -125,6 +125,8 @@ public:
void setMergedCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+ void invalidateBlockPositionSet(SCTAB nTab);
+
void finalize();
/** Broadcast all formula cells that are marked with
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 6108c7a3e9a4..d65cdd1f5ba3 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -21,6 +21,8 @@
#define INCLUDED_SC_INC_DOCUNO_HXX
#include "address.hxx"
+
+#include <sal/types.h>
#include <sfx2/sfxbasemodel.hxx>
#include <svl/lstner.hxx>
#include <svx/fmdmod.hxx>
@@ -310,7 +312,7 @@ public:
virtual Size getDocumentSize() override;
/// @see vcl::ITiledRenderable::setPart().
- virtual void setPart(int nPart) override;
+ virtual void setPart(int nPart, bool bAllowChangeFocus = true) override;
/// @see vcl::ITiledRenderable::getPart().
virtual int getPart() override;
@@ -658,7 +660,7 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
};
-class ScAnnotationsObj final : public cppu::WeakImplHelper<
+class SAL_DLLPUBLIC_RTTI ScAnnotationsObj final : public cppu::WeakImplHelper<
css::sheet::XSheetAnnotations,
css::container::XEnumerationAccess,
css::lang::XServiceInfo>,
diff --git a/sc/inc/dragdata.hxx b/sc/inc/dragdata.hxx
index 77f23c89db86..edd38c17e423 100644
--- a/sc/inc/dragdata.hxx
+++ b/sc/inc/dragdata.hxx
@@ -27,6 +27,13 @@ struct ScDragData
OUString aLinkArea;
OUString aJumpTarget;
OUString aJumpText;
+
+ ScDragData() :
+ pCellTransfer(nullptr),
+ pDrawTransfer(nullptr),
+ pJumpLocalDoc(nullptr)
+ {
+ }
};
#endif
diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx
index 850fb4738ae0..efff6220f853 100644
--- a/sc/inc/fillinfo.hxx
+++ b/sc/inc/fillinfo.hxx
@@ -93,6 +93,7 @@ struct ScIconSetInfo
{
sal_Int32 nIconIndex;
ScIconSetType eIconSetType;
+ long mnHeight = 0;
bool mbShowValue;
};
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 8fa962081a05..b04a97b7c3c2 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -463,6 +463,8 @@ public:
void GetLastDataPos(SCCOL& rCol, SCROW& rRow) const;
std::unique_ptr<ScPostIt> ReleaseNote( SCCOL nCol, SCROW nRow );
+ ScPostIt* GetNote( SCCOL nCol, SCROW nRow );
+ void SetNote( SCCOL nCol, SCROW nRow, std::unique_ptr<ScPostIt> pNote );
size_t GetNoteCount( SCCOL nCol ) const;
SCROW GetNotePosition( SCCOL nCol, size_t nIndex ) const;
@@ -948,7 +950,7 @@ public:
void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries );
void GetFilteredFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, ScFilterEntries& rFilterEntries );
[[nodiscard]]
- bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit);
+ bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings);
bool HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
bool HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const;
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 6fb5051ec249..5dda3ad674d3 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -571,6 +571,7 @@
#define SC_UNO_UPDTEMPL "UpdateFromTemplate"
#define SC_UNO_FILTERED_RANGE_SELECTION "FilteredRangeSelection"
#define SC_UNO_VISAREASCREEN "VisibleAreaOnScreen"
+#define SC_UNO_IMAGE_PREFERRED_DPI "ImagePreferredDPI"
/*Stampit enable/disable print cancel */
#define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel"
diff --git a/sc/qa/unit/data/xlsx/autofilternamedrange.xlsx b/sc/qa/unit/data/xlsx/autofilternamedrange.xlsx
new file mode 100644
index 000000000000..51490d9229ea
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/autofilternamedrange.xlsx
Binary files differ
diff --git a/sc/qa/unit/data/xlsx/escape-unicode.xlsx b/sc/qa/unit/data/xlsx/escape-unicode.xlsx
new file mode 100644
index 000000000000..ec43688b74b8
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/escape-unicode.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 0d2f55dcd184..74b844e22382 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -254,6 +254,8 @@ public:
void testAutoheight2Rows();
void testXLSDefColWidth();
void testPreviewMissingObjLink();
+ void testEscapedUnicodeXLSX();
+ void testAutofilterNamedRangesXLSX();
CPPUNIT_TEST_SUITE(ScFiltersTest);
CPPUNIT_TEST(testBooleanFormatXLSX);
@@ -397,6 +399,8 @@ public:
CPPUNIT_TEST(testAutoheight2Rows);
CPPUNIT_TEST(testXLSDefColWidth);
CPPUNIT_TEST(testPreviewMissingObjLink);
+ CPPUNIT_TEST(testEscapedUnicodeXLSX);
+ CPPUNIT_TEST(testAutofilterNamedRangesXLSX);
CPPUNIT_TEST_SUITE_END();
@@ -4370,6 +4374,37 @@ void ScFiltersTest::testPreviewMissingObjLink()
xDocSh->DoClose();
}
+void ScFiltersTest::testEscapedUnicodeXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc("escape-unicode.", FORMAT_XLSX);
+ ScDocument& rDoc = xDocSh->GetDocument();
+
+ // Without the fix, there would be "_x000D_" after every new-line char.
+ CPPUNIT_ASSERT_EQUAL(OUString("Line 1\nLine 2\nLine 3\nLine 4"), rDoc.GetString(1, 1, 0));
+
+ xDocSh->DoClose();
+}
+
+void ScFiltersTest::testAutofilterNamedRangesXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc(u"autofilternamedrange.", FORMAT_XLSX);
+ CPPUNIT_ASSERT_MESSAGE("Failed to load autofilternamedrange.xlsx", xDocSh.is());
+
+ ScDocument& rDoc = xDocSh->GetDocument();
+ const ScDBData* pDBData = rDoc.GetDBCollection()->GetDBNearCursor(0, 0, 0);
+ CPPUNIT_ASSERT(pDBData);
+ ScRange aRange;
+ pDBData->GetArea(aRange);
+ CPPUNIT_ASSERT_EQUAL(ScRange(0, 0, 0, 0, 3, 0), aRange);
+ OUString aPosStr;
+ // test there is no '_xlnm._FilterDatabase' named range on the filter area
+ const ScRangeData* pRData = rDoc.GetRangeAtBlock(aRange, &aPosStr);
+ CPPUNIT_ASSERT(!pRData);
+ CPPUNIT_ASSERT_EQUAL(OUString(), aPosStr);
+
+ xDocSh->DoClose();
+}
+
ScFiltersTest::ScFiltersTest()
: ScBootstrapFixture( "sc/qa/unit/data" )
{
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 158754d51ffc..9c5a19be2d42 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -39,6 +39,7 @@
#include <sc.hrc>
#include <comphelper/string.hxx>
#include <docoptio.hxx>
+#include <postit.hxx>
#include <chrono>
#include <cstddef>
@@ -49,6 +50,7 @@
#include <document.hxx>
#include <docuno.hxx>
#include <drwlayer.hxx>
+#include <editutil.hxx>
using namespace css;
@@ -115,7 +117,12 @@ public:
void testSpellOnlineRenderParameter();
void testPasteIntoWrapTextCell();
void testSortAscendingDescending();
-
+ void testAutoInputExactMatch();
+ void testMoveShapeHandle();
+ void testEditCursorBounds();
+ void testTextSelectionBounds();
+ void testSheetViewDataCrash();
+ void testCommentCellCopyPaste();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnHeaders);
@@ -164,6 +171,12 @@ public:
CPPUNIT_TEST(testSpellOnlineRenderParameter);
CPPUNIT_TEST(testPasteIntoWrapTextCell);
CPPUNIT_TEST(testSortAscendingDescending);
+ CPPUNIT_TEST(testAutoInputExactMatch);
+ CPPUNIT_TEST(testMoveShapeHandle);
+ CPPUNIT_TEST(testEditCursorBounds);
+ CPPUNIT_TEST(testTextSelectionBounds);
+ CPPUNIT_TEST(testSheetViewDataCrash);
+ CPPUNIT_TEST(testCommentCellCopyPaste);
CPPUNIT_TEST_SUITE_END();
private:
@@ -421,6 +434,130 @@ void ScTiledRenderingTest::testEmptyColumnSelection()
CPPUNIT_ASSERT_EQUAL(OString(), apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"));
}
+struct EditCursorMessage final {
+ tools::Rectangle m_aRelRect;
+ Point m_aRefPoint;
+
+ void clear()
+ {
+ m_aRelRect.SetEmpty();
+ m_aRefPoint = Point(-1, -1);
+ }
+
+ bool empty()
+ {
+ return m_aRelRect.IsEmpty() &&
+ m_aRefPoint.X() == -1 &&
+ m_aRefPoint.Y() == -1;
+ }
+
+ void parseMessage(const char* pMessage)
+ {
+ clear();
+ if (!pMessage || !comphelper::LibreOfficeKit::isCompatFlagSet(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs) ||
+ !comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation())
+ return;
+
+ std::stringstream aStream(pMessage);
+ boost::property_tree::ptree aTree;
+ boost::property_tree::read_json(aStream, aTree);
+ std::string aVal = aTree.get_child("refpoint").get_value<std::string>();
+
+ uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(aVal.c_str()));
+ CPPUNIT_ASSERT(aSeq.getLength() == 2);
+ m_aRefPoint.setX(aSeq[0].toInt32());
+ m_aRefPoint.setY(aSeq[1].toInt32());
+
+ aVal = aTree.get_child("relrect").get_value<std::string>();
+ aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(aVal.c_str()));
+ CPPUNIT_ASSERT(aSeq.getLength() == 4);
+ m_aRelRect.setX(aSeq[0].toInt32());
+ m_aRelRect.setY(aSeq[1].toInt32());
+ m_aRelRect.setWidth(aSeq[2].toInt32());
+ m_aRelRect.setHeight(aSeq[3].toInt32());
+ }
+
+ tools::Rectangle getBounds()
+ {
+ tools::Rectangle aBounds = m_aRelRect;
+ aBounds.Move(m_aRefPoint.X(), m_aRefPoint.Y());
+ return aBounds;
+ }
+};
+
+struct TextSelectionMessage
+{
+ std::vector<tools::Rectangle> m_aRelRects;
+ Point m_aRefPoint;
+
+ void clear() {
+ m_aRefPoint.setX(0);
+ m_aRefPoint.setY(0);
+ m_aRelRects.clear();
+ }
+
+ bool empty() {
+ return m_aRelRects.empty();
+ }
+
+ void parseMessage(const char* pMessage)
+ {
+ clear();
+ if (!pMessage)
+ return;
+
+ std::string aStr(pMessage);
+ if (aStr.find(",") == std::string::npos)
+ return;
+
+ size_t nRefDelimStart = aStr.find("::");
+ std::string aRectListString = (nRefDelimStart == std::string::npos) ? aStr : aStr.substr(0, nRefDelimStart);
+ std::string aRefPointString = (nRefDelimStart == std::string::npos) ?
+ std::string("0, 0") :
+ aStr.substr(nRefDelimStart + 2, aStr.length() - 2 - nRefDelimStart);
+ uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(aRefPointString.c_str()));
+ CPPUNIT_ASSERT(aSeq.getLength() == 2);
+ m_aRefPoint.setX(aSeq[0].toInt32());
+ m_aRefPoint.setY(aSeq[1].toInt32());
+
+ size_t nStart = 0;
+ size_t nEnd = aRectListString.find(";");
+ if (nEnd == std::string::npos)
+ nEnd = aRectListString.length();
+ do
+ {
+ std::string aRectString = aRectListString.substr(nStart, nEnd - nStart);
+ {
+ aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(aRectString.c_str()));
+ CPPUNIT_ASSERT(aSeq.getLength() == 4);
+ tools::Rectangle aRect;
+ aRect.setX(aSeq[0].toInt32());
+ aRect.setY(aSeq[1].toInt32());
+ aRect.setWidth(aSeq[2].toInt32());
+ aRect.setHeight(aSeq[3].toInt32());
+
+ m_aRelRects.push_back(aRect);
+ }
+
+ nStart = nEnd + 1;
+ nEnd = aRectListString.find(";", nStart);
+ }
+ while(nEnd != std::string::npos);
+ }
+
+ tools::Rectangle getBounds(size_t nIndex)
+ {
+ if (nIndex >= m_aRelRects.size())
+ return tools::Rectangle();
+
+ tools::Rectangle aBounds = m_aRelRects[nIndex];
+ aBounds.Move(m_aRefPoint.X(), m_aRefPoint.Y());
+ return aBounds;
+ }
+
+};
+
/// A view callback tracks callbacks invoked on one specific view.
class ViewCallback final
{
@@ -435,12 +572,16 @@ public:
bool m_bFullInvalidateTiles;
bool m_bInvalidateTiles;
std::vector<tools::Rectangle> m_aInvalidations;
+ tools::Rectangle m_aCellCursorBounds;
std::vector<int> m_aInvalidationsParts;
bool m_bViewLock;
OString m_sCellFormula;
boost::property_tree::ptree m_aCommentCallbackResult;
+ EditCursorMessage m_aInvalidateCursorResult;
+ TextSelectionMessage m_aTextSelectionResult;
OString m_sInvalidateHeader;
OString m_sInvalidateSheetGeometry;
+ OString m_ShapeSelection;
ViewCallback(bool bDeleteListenerOnDestruct=true)
: m_bOwnCursorInvalidated(false),
@@ -480,6 +621,14 @@ public:
case LOK_CALLBACK_CELL_CURSOR:
{
m_bOwnCursorInvalidated = true;
+ uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
+ m_aCellCursorBounds = tools::Rectangle();
+ if (aSeq.getLength() == 6) {
+ m_aCellCursorBounds.setX(aSeq[0].toInt32());
+ m_aCellCursorBounds.setY(aSeq[1].toInt32());
+ m_aCellCursorBounds.setWidth(aSeq[2].toInt32());
+ m_aCellCursorBounds.setHeight(aSeq[3].toInt32());
+ }
}
break;
case LOK_CALLBACK_CELL_VIEW_CURSOR:
@@ -503,6 +652,7 @@ public:
case LOK_CALLBACK_GRAPHIC_SELECTION:
{
m_bGraphicSelection = true;
+ m_ShapeSelection = OString(pPayload);
}
break;
case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
@@ -555,6 +705,16 @@ public:
{
m_sInvalidateSheetGeometry = pPayload;
}
+ break;
+ case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
+ {
+ m_aInvalidateCursorResult.parseMessage(pPayload);
+ }
+ break;
+ case LOK_CALLBACK_TEXT_SELECTION:
+ {
+ m_aTextSelectionResult.parseMessage(pPayload);
+ }
}
}
};
@@ -594,20 +754,6 @@ void ScTiledRenderingTest::testSpellOnlineRenderParameter()
CPPUNIT_ASSERT_EQUAL(!bSet, pDoc->GetDocOptions().IsAutoSpell());
}
-void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rArguments)
-{
- uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
- CPPUNIT_ASSERT(xController.is());
- uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xFrame.is());
-
- uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
- uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext));
- CPPUNIT_ASSERT(xDispatchHelper.is());
-
- xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rArguments);
-}
-
void ScTiledRenderingTest::testTextViewSelection()
{
comphelper::LibreOfficeKit::setActive();
@@ -621,7 +767,7 @@ void ScTiledRenderingTest::testTextViewSelection()
// Create a selection on two cells in the second view, that's a text selection in LOK terms.
aView1.m_bTextViewSelectionInvalidated = false;
- lcl_dispatchCommand(mxComponent, ".uno:GoRightSel", {});
+ dispatchCommand(mxComponent, ".uno:GoRightSel", {});
Scheduler::ProcessEventsToIdle();
// Make sure the first view got its notification.
CPPUNIT_ASSERT(aView1.m_bTextViewSelectionInvalidated);
@@ -640,7 +786,7 @@ void ScTiledRenderingTest::testDocumentSizeChanged()
{
comphelper::makePropertyValue("ToPoint", OUString("$A$30")),
};
- lcl_dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:GoToCell", aPropertyValues);
Scheduler::ProcessEventsToIdle();
// Assert that the size in the payload is not 0.
CPPUNIT_ASSERT(m_aDocumentSize.getWidth() > 0);
@@ -677,6 +823,54 @@ void ScTiledRenderingTest::testViewLock()
CPPUNIT_ASSERT(!aView1.m_bViewLock);
}
+static void lcl_extractHandleParameters(const OString& selection, int& id, int& x, int& y)
+{
+ OString extraInfo = selection.copy(selection.indexOf("{"));
+ std::stringstream aStream(extraInfo.getStr());
+ boost::property_tree::ptree aTree;
+ boost::property_tree::read_json(aStream, aTree);
+ boost::property_tree::ptree
+ handle0 = aTree
+ .get_child("handles")
+ .get_child("kinds")
+ .get_child("rectangle")
+ .get_child("1")
+ .begin()->second;
+ id = handle0.get_child("id").get_value<int>();
+ x = handle0.get_child("point").get_child("x").get_value<int>();
+ y = handle0.get_child("point").get_child("y").get_value<int>();
+}
+
+void ScTiledRenderingTest::testMoveShapeHandle()
+{
+ comphelper::LibreOfficeKit::setActive();
+ ScModelObj* pModelObj = createDoc("shape.ods");
+ ViewCallback aView1;
+ pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, /*x=*/ 1,/*y=*/ 1,/*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0);
+ pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, /*x=*/ 1, /*y=*/ 1, /*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+ {
+ int id, x, y;
+ lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+ int oldX = x;
+ int oldY = y;
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
+ {
+ {"HandleNum", uno::makeAny(id)},
+ {"NewPosX", uno::makeAny(x+1)},
+ {"NewPosY", uno::makeAny(y+1)}
+ }));
+ comphelper::dispatchCommand(".uno:MoveShapeHandle", aPropertyValues);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+ lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+ CPPUNIT_ASSERT_EQUAL(x-1, oldX);
+ CPPUNIT_ASSERT_EQUAL(y-1, oldY);
+ }
+}
+
void ScTiledRenderingTest::testColRowResize()
{
comphelper::LibreOfficeKit::setActive();
@@ -1687,7 +1881,7 @@ void ScTiledRenderingTest::testSpellOnlineParameter()
{
comphelper::makePropertyValue("Enable", uno::makeAny(!bSet)),
};
- lcl_dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ dispatchCommand(mxComponent, ".uno:SpellOnline", params);
CPPUNIT_ASSERT_EQUAL(!bSet, pDoc->GetDocOptions().IsAutoSpell());
// set the same state as now and we don't expect any change (no-toggle)
@@ -1695,7 +1889,7 @@ void ScTiledRenderingTest::testSpellOnlineParameter()
{
comphelper::makePropertyValue("Enable", uno::makeAny(!bSet)),
};
- lcl_dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ dispatchCommand(mxComponent, ".uno:SpellOnline", params);
CPPUNIT_ASSERT_EQUAL(!bSet, pDoc->GetDocOptions().IsAutoSpell());
}
@@ -2377,8 +2571,8 @@ void ScTiledRenderingTest::testPasteIntoWrapTextCell()
pView->GetViewFrame()->GetBindings().Execute(SID_PASTE);
Scheduler::ProcessEventsToIdle();
- // SG invalidations for rows
- CPPUNIT_ASSERT_EQUAL(OString("rows"), aView.m_sInvalidateSheetGeometry);
+ // SG invalidations for all
+ CPPUNIT_ASSERT_EQUAL(OString("all"), aView.m_sInvalidateSheetGeometry);
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr);
}
@@ -2433,6 +2627,303 @@ void ScTiledRenderingTest::testSortAscendingDescending()
CPPUNIT_ASSERT_EQUAL(OString("rows"), aView.m_sInvalidateSheetGeometry);
}
+static void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, ScTabViewShell* pView, ScModelObj* pModelObj)
+{
+ pView->SetCursor(nCol, nRow);
+ for (const char& cChar : aStr)
+ {
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, cChar, 0);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, cChar, 0);
+ Scheduler::ProcessEventsToIdle();
+ }
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN);
+ Scheduler::ProcessEventsToIdle();
+}
+
+void ScTiledRenderingTest::testAutoInputExactMatch()
+{
+ comphelper::LibreOfficeKit::setActive();
+
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ CPPUNIT_ASSERT(pModelObj);
+ ScTabViewShell* pView = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+ CPPUNIT_ASSERT(pView);
+ ScDocument* pDoc = pModelObj->GetDocument();
+
+ pDoc->SetString(ScAddress(0, 1, 0), "Simple"); // A2
+ pDoc->SetString(ScAddress(0, 2, 0), "Simple"); // A3
+ pDoc->SetString(ScAddress(0, 3, 0), "Sing"); // A4
+ ScFieldEditEngine& rEE = pDoc->GetEditEngine();
+ rEE.SetText("Case");
+ pDoc->SetEditText(ScAddress(0, 4, 0), rEE.CreateTextObject()); // A5
+ pDoc->SetString(ScAddress(0, 5, 0), "Time"); // A6
+ pDoc->SetString(ScAddress(0, 6, 0), "Castle"); // A7
+
+ ScAddress aA8(0, 7, 0);
+ lcl_typeCharsInCell("S", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "S" in A8
+ // Should not autocomplete as there are multiple matches starting with "S".
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("1: A8 should have just S (should not autocomplete)", OUString("S"), pDoc->GetString(aA8));
+
+ lcl_typeCharsInCell("Si", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Si" in A8
+ // Should not autocomplete as there are multiple matches starting with "Si".
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("2: A8 should not autocomplete", OUString("Si"), pDoc->GetString(aA8));
+
+ lcl_typeCharsInCell("Sim", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Sim" in A8
+ // Should autocomplete to "Simple" which is the only match.
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("3: A8 should autocomplete", OUString("Simple"), pDoc->GetString(aA8));
+
+ lcl_typeCharsInCell("Sin", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Sin" in A8
+ // Should autocomplete to "Sing" which is the only match.
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("4: A8 should autocomplete", OUString("Sing"), pDoc->GetString(aA8));
+
+ lcl_typeCharsInCell("Cas", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Cas" in A8
+ // Should not autocomplete as there are multiple matches starting with "Cas".
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("5: A8 should not autocomplete", OUString("Cas"), pDoc->GetString(aA8));
+
+ lcl_typeCharsInCell("Cast", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "Cast" in A8
+ // Should autocomplete to "Castle" which is the only match.
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("6: A8 should autocomplete", OUString("Castle"), pDoc->GetString(aA8));
+
+ lcl_typeCharsInCell("T", aA8.Col(), aA8.Row(), pView, pModelObj); // Type "T" in A8
+ // Should autocomplete to "Time" which is the only match.
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("7: A8 should autocomplete", OUString("Time"), pDoc->GetString(aA8));
+}
+
+void ScTiledRenderingTest::testEditCursorBounds()
+{
+ comphelper::LibreOfficeKit::setActive();
+ comphelper::LibreOfficeKit::setCompatFlag(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+
+ ViewCallback aView;
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView);
+ ScTabViewShell* pView = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+ CPPUNIT_ASSERT(pView);
+ comphelper::LibreOfficeKit::setViewIdForVisCursorInvalidation(true);
+
+ // ~170% zoom.
+ pModelObj->setClientZoom(256, 256, 2222, 2222);
+ pModelObj->setClientVisibleArea(tools::Rectangle(7725, 379832, 16240, 6449));
+ Scheduler::ProcessEventsToIdle();
+
+ constexpr SCCOL nCol = 5;
+ constexpr SCROW nRow = 2048;
+ pDoc->SetValue(ScAddress(nCol, nRow, 0), 123);
+
+ aView.m_bOwnCursorInvalidated = false;
+ // Obtain the cell bounds via cursor.
+ pView->SetCursor(nCol, nRow);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(aView.m_bOwnCursorInvalidated);
+ CPPUNIT_ASSERT(!aView.m_aCellCursorBounds.IsEmpty());
+ tools::Rectangle aCellBounds(aView.m_aCellCursorBounds);
+
+ aView.m_aInvalidateCursorResult.clear();
+ // Enter edit mode in the same cell.
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::F2);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::F2);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(!aView.m_aInvalidateCursorResult.empty());
+ CPPUNIT_ASSERT_MESSAGE("Edit cursor must be in cell bounds!",
+ aCellBounds.IsInside(aView.m_aInvalidateCursorResult.getBounds()));
+
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr);
+}
+
+void ScTiledRenderingTest::testTextSelectionBounds()
+{
+ comphelper::LibreOfficeKit::setActive();
+ comphelper::LibreOfficeKit::setCompatFlag(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+
+ ViewCallback aView;
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView);
+ ScTabViewShell* pView = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+ CPPUNIT_ASSERT(pView);
+ comphelper::LibreOfficeKit::setViewIdForVisCursorInvalidation(true);
+
+ // ~170% zoom.
+ pModelObj->setClientZoom(256, 256, 2222, 2222);
+ pModelObj->setClientVisibleArea(tools::Rectangle(7725, 379832, 16240, 6449));
+ Scheduler::ProcessEventsToIdle();
+
+ constexpr SCCOL nCol = 5;
+ constexpr SCROW nRow = 2048;
+ pDoc->SetValue(ScAddress(nCol, nRow, 0), 123);
+
+ aView.m_bOwnCursorInvalidated = false;
+ // Obtain the cell bounds via cursor.
+ pView->SetCursor(nCol, nRow);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(aView.m_bOwnCursorInvalidated);
+ CPPUNIT_ASSERT(!aView.m_aCellCursorBounds.IsEmpty());
+ tools::Rectangle aCellBounds(aView.m_aCellCursorBounds);
+
+ aView.m_aTextSelectionResult.clear();
+ // Enter edit mode in the same cell and select all text.
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::F2);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::F2);
+ Scheduler::ProcessEventsToIdle();
+
+ // CTRL + A
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | awt::Key::A);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | awt::Key::A);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(!aView.m_aTextSelectionResult.empty());
+ CPPUNIT_ASSERT_MESSAGE("Text selections must be in cell bounds!",
+ !aCellBounds.Intersection(aView.m_aTextSelectionResult.getBounds(0)).IsEmpty());
+
+ SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr);
+}
+
+void ScTiledRenderingTest::testSheetViewDataCrash()
+{
+ comphelper::LibreOfficeKit::setActive();
+
+ ScModelObj* pModelObj = createDoc("empty.ods");
+
+ // view #1
+ int nView1 = SfxLokHelper::getView();
+ SfxLokHelper::setView(nView1);
+
+ // Imitate online while creating a new sheet on empty.ods.
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({
+ { "Name", uno::Any(OUString("NewSheet")) },
+ { "Index", uno::Any(sal_Int32(2)) }
+ }));
+ comphelper::dispatchCommand(".uno:Insert", aArgs);
+ Scheduler::ProcessEventsToIdle();
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | KEY_MOD1);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD1);
+ Scheduler::ProcessEventsToIdle();
+ ScTabViewShell* pView1 = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+ CPPUNIT_ASSERT(pView1);
+
+ // view #2
+ SfxLokHelper::createView();
+ ScTabViewShell* pView2 = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+ CPPUNIT_ASSERT(pView2);
+ Scheduler::ProcessEventsToIdle();
+
+ SfxLokHelper::setView(nView1);
+ // Delete a range.
+ pView1->SetCursor(1, 1);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::DOWN | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DOWN | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::DELETE);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DELETE);
+ // It will crash at this point without the fix.
+ Scheduler::ProcessEventsToIdle();
+}
+
+void ScTiledRenderingTest::testCommentCellCopyPaste()
+{
+ // Load a document
+ comphelper::LibreOfficeKit::setActive();
+ // Comments callback are emitted only if tiled annotations are off
+ comphelper::LibreOfficeKit::setTiledAnnotations(false);
+
+ // FIXME: Hack because previous tests do not destroy ScDocument(with annotations) on exit (?).
+ ScPostIt::mnLastPostItId = 1;
+
+ {
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ViewCallback aView;
+ int nView = SfxLokHelper::getView();
+
+ SfxLokHelper::setView(nView);
+
+ ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+ CPPUNIT_ASSERT(pTabViewShell);
+
+ lcl_typeCharsInCell("ABC", 0, 0, pTabViewShell, pModelObj); // Type "ABC" in A1
+
+ pTabViewShell->SetCursor(1, 1);
+
+ // Add a new comment
+ uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
+ {
+ {"Text", uno::makeAny(OUString("LOK Comment Cell B2"))},
+ {"Author", uno::makeAny(OUString("LOK Client"))},
+ }));
+ comphelper::dispatchCommand(".uno:InsertAnnotation", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
+ CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView.m_aCommentCallbackResult.get<std::string>("action"));
+ CPPUNIT_ASSERT_EQUAL(std::string("1"), aView.m_aCommentCallbackResult.get<std::string>("id"));
+ CPPUNIT_ASSERT_EQUAL(std::string("0"), aView.m_aCommentCallbackResult.get<std::string>("tab"));
+ CPPUNIT_ASSERT_EQUAL(std::string("LOK Client"), aView.m_aCommentCallbackResult.get<std::string>("author"));
+ CPPUNIT_ASSERT_EQUAL(std::string("LOK Comment Cell B2"), aView.m_aCommentCallbackResult.get<std::string>("text"));
+
+ uno::Sequence<beans::PropertyValue> aCopyPasteArgs;
+
+ // We need separate tests for single cell copy-paste and cell-range copy-paste
+ // since they hit different code paths in ScColumn methods.
+
+ // Single cell(with comment) copy paste test
+ {
+ comphelper::dispatchCommand(".uno:Copy", aCopyPasteArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ pTabViewShell->SetCursor(1, 49);
+ Scheduler::ProcessEventsToIdle();
+ comphelper::dispatchCommand(".uno:Paste", aCopyPasteArgs); // Paste to cell B50
+ Scheduler::ProcessEventsToIdle();
+
+ // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
+ CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView.m_aCommentCallbackResult.get<std::string>("action"));
+ // Without the fix the id will be "1".
+ CPPUNIT_ASSERT_EQUAL(std::string("2"), aView.m_aCommentCallbackResult.get<std::string>("id"));
+ CPPUNIT_ASSERT_EQUAL(std::string("0"), aView.m_aCommentCallbackResult.get<std::string>("tab"));
+ CPPUNIT_ASSERT_EQUAL(std::string("LOK Client"), aView.m_aCommentCallbackResult.get<std::string>("author"));
+ CPPUNIT_ASSERT_EQUAL(std::string("LOK Comment Cell B2"), aView.m_aCommentCallbackResult.get<std::string>("text"));
+ }
+
+ // Cell range (with a comment) copy paste test
+ {
+ // Select range A1:C3
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_HOME | KEY_MOD1);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_HOME | KEY_MOD1);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DOWN | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | KEY_SHIFT);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | KEY_SHIFT);
+ Scheduler::ProcessEventsToIdle();
+
+ comphelper::dispatchCommand(".uno:Copy", aCopyPasteArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ pTabViewShell->SetCursor(3, 49);
+ Scheduler::ProcessEventsToIdle();
+ comphelper::dispatchCommand(".uno:Paste", aCopyPasteArgs); // Paste to cell D50
+ Scheduler::ProcessEventsToIdle();
+
+ // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
+ CPPUNIT_ASSERT_EQUAL(std::string("Add"), aView.m_aCommentCallbackResult.get<std::string>("action"));
+ // Without the fix the id will be "1".
+ CPPUNIT_ASSERT_EQUAL(std::string("3"), aView.m_aCommentCallbackResult.get<std::string>("id"));
+ CPPUNIT_ASSERT_EQUAL(std::string("0"), aView.m_aCommentCallbackResult.get<std::string>("tab"));
+ CPPUNIT_ASSERT_EQUAL(std::string("LOK Client"), aView.m_aCommentCallbackResult.get<std::string>("author"));
+ CPPUNIT_ASSERT_EQUAL(std::string("LOK Comment Cell B2"), aView.m_aCommentCallbackResult.get<std::string>("text"));
+ }
+ }
+ comphelper::LibreOfficeKit::setTiledAnnotations(true);
+}
}
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 64c0d990c147..754c9e656734 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -16,6 +16,8 @@
#include <tokenarray.hxx>
#include <refupdatecontext.hxx>
#include <refdata.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <scitems.hxx>
#include <formula/token.hxx>
#include <vcl/bitmapex.hxx>
@@ -1056,6 +1058,10 @@ std::unique_ptr<ScIconSetInfo> ScIconSetFormat::GetIconSetInfo(const ScAddress&
std::unique_ptr<ScIconSetInfo> pInfo(new ScIconSetInfo);
+ const SfxPoolItem& rPoolItem = mpDoc->GetPattern(rAddr)->GetItem(ATTR_FONT_HEIGHT);
+ long aFontHeight = static_cast<const SvxFontHeightItem&>(rPoolItem).GetHeight();
+ pInfo->mnHeight = aFontHeight;
+
if(mpFormatData->mbReverse)
{
sal_Int32 nMaxIndex = mpFormatData->m_Entries.size() - 1;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 2918e31cd2c4..a8c704a5bef4 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1853,9 +1853,10 @@ public:
SCROW nDestRow = nRow + mnDestOffset;
ScAddress aSrcPos(mnSrcCol, nRow, mnSrcTab);
ScAddress aDestPos(mnDestCol, nDestRow, mnDestTab);
- miPos = mrDestNotes.set(miPos, nDestRow, p->Clone(aSrcPos, *mrDestCol.GetDoc(), aDestPos, mbCloneCaption).release());
+ ScPostIt* pNew = p->Clone(aSrcPos, *mrDestCol.GetDoc(), aDestPos, mbCloneCaption).release();
+ miPos = mrDestNotes.set(miPos, nDestRow, pNew);
// Notify our LOK clients also
- ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, mrDestCol.GetDoc(), aDestPos, p);
+ ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, mrDestCol.GetDoc(), aDestPos, pNew);
}
};
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 90a0dcec43aa..306781a26baf 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2644,14 +2644,8 @@ public:
}
// GetDataEntries - Strings from continuous Section around nRow
-
-// DATENT_MAX - max. number of entries in list for auto entry
-// DATENT_SEARCH - max. number of cells that get transparent - new: only count Strings
-#define DATENT_MAX 200
-#define DATENT_SEARCH 2000
-
bool ScColumn::GetDataEntries(
- SCROW nStartRow, std::set<ScTypedStrData>& rStrings, bool bLimit ) const
+ SCROW nStartRow, std::set<ScTypedStrData>& rStrings) const
{
// Start at the specified row position, and collect all string values
// going upward and downward directions in parallel. The start position
@@ -2673,44 +2667,30 @@ bool ScColumn::GetDataEntries(
bMoveDown = aItrDown.next(); // Find the next string cell position.
bool bFound = false;
- size_t nCellsSearched = 0;
- while (bMoveUp || bMoveDown)
+ while (bMoveUp)
{
- if (bMoveUp)
+ // Get the current string and move up.
+ OUString aStr = aItrUp.get();
+ if (!aStr.isEmpty())
{
- // Get the current string and move up.
- OUString aStr = aItrUp.get();
- if (!aStr.isEmpty())
- {
- bool bInserted = rStrings.insert(ScTypedStrData(aStr)).second;
- if (bInserted && bLimit && rStrings.size() >= DATENT_MAX)
- return true; // Maximum reached
+ if (rStrings.insert(ScTypedStrData(aStr)).second)
bFound = true;
- }
-
- if (bLimit && ++nCellsSearched >= DATENT_SEARCH)
- return bFound; // max search cell count reached.
-
- bMoveUp = aItrUp.prev();
}
- if (bMoveDown)
+ bMoveUp = aItrUp.prev();
+ }
+
+ while (bMoveDown)
+ {
+ // Get the current string and move down.
+ OUString aStr = aItrDown.get();
+ if (!aStr.isEmpty())
{
- // Get the current string and move down.
- OUString aStr = aItrDown.get();
- if (!aStr.isEmpty())
- {
- bool bInserted = rStrings.insert(ScTypedStrData(aStr)).second;
- if (bInserted && bLimit && rStrings.size() >= DATENT_MAX)
- return true; // Maximum reached
+ if (rStrings.insert(ScTypedStrData(aStr)).second)
bFound = true;
- }
-
- if (bLimit && ++nCellsSearched >= DATENT_SEARCH)
- return bFound; // max search cell count reached.
-
- bMoveDown = aItrDown.next();
}
+
+ bMoveDown = aItrDown.next();
}
return bFound;
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 7acd4b0a9183..57edd94a6a52 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -29,6 +29,7 @@
#include <drwlayer.hxx>
#include <compiler.hxx>
#include <recursionhelper.hxx>
+#include <docsh.hxx>
#include <svl/sharedstringpool.hxx>
#include <sal/log.hxx>
@@ -304,6 +305,14 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
pBlockPos->miCellNotePos =
maCellNotes.set(
pBlockPos->miCellNotePos, nRow1, aNotes.begin(), aNotes.end());
+
+ // Notify our LOK clients.
+ aDestPos.SetRow(nRow1);
+ for (size_t i = 0; i < nDestSize; ++i)
+ {
+ ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, pDocument, aDestPos, aNotes[i]);
+ aDestPos.IncRow();
+ }
}
}
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index eeeeb9f1cc69..407c5484a4c2 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1080,8 +1080,8 @@ void ScQueryCellIterator::InitPos()
nRow = mpParam->nRow1;
if (mpParam->bHasHeader && mpParam->bByRow)
++nRow;
- ScColumn* pCol = &(pDoc->maTabs[nTab])->aCol[nCol];
- maCurPos = pCol->maCells.position(nRow);
+ const ScColumn& rCol = pDoc->maTabs[nTab]->CreateColumnIfNotExists(nCol);
+ maCurPos = rCol.maCells.position(nRow);
}
void ScQueryCellIterator::IncPos()
@@ -1799,6 +1799,10 @@ bool ScQueryCellIterator::BinarySearch()
if (nTab >= pDoc->GetTableCount())
OSL_FAIL("try to access index out of bounds, FIX IT");
nCol = mpParam->nCol1;
+
+ if (nCol >= pDoc->maTabs[nTab]->GetAllocatedColumnsCount())
+ return false;
+
ScColumn* pCol = &(pDoc->maTabs[nTab])->aCol[nCol];
if (pCol->IsEmptyData())
return false;
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 7271fdef0d43..4846c301dca7 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -163,6 +163,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
mbEmbedFontScriptLatin(true),
mbEmbedFontScriptAsian(true),
mbEmbedFontScriptComplex(true),
+ mnImagenPreferredDPI(0),
mbTrackFormulasPending(false),
mbFinalTrackFormulas(false),
mbDocShellRecalc(false),
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 783bac66f2fd..c463a17f7a48 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1582,12 +1582,12 @@ void ScDocument::GetFilterEntriesArea(
*/
void ScDocument::GetDataEntries(
SCCOL nCol, SCROW nRow, SCTAB nTab,
- std::vector<ScTypedStrData>& rStrings, bool bLimit )
+ std::vector<ScTypedStrData>& rStrings, bool bValidation )
{
- if( !bLimit )
+ if( bValidation )
{
/* Try to generate the list from list validation. This part is skipped,
- if bLimit==true, because in that case this function is called to get
+ if bValidation==false, because in that case this function is called to get
cell values for auto completion on input. */
sal_uInt32 nValidation = GetAttr( nCol, nRow, nTab, ATTR_VALIDDATA )->GetValue();
if( nValidation )
@@ -1610,7 +1610,7 @@ void ScDocument::GetDataEntries(
return;
std::set<ScTypedStrData> aStrings;
- if (maTabs[nTab]->GetDataEntries(nCol, nRow, aStrings, bLimit))
+ if (maTabs[nTab]->GetDataEntries(nCol, nRow, aStrings))
{
rStrings.insert(rStrings.end(), aStrings.begin(), aStrings.end());
sortAndRemoveDuplicates(rStrings, true/*bCaseSens*/);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 470ac4909854..252117184a0f 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6494,9 +6494,8 @@ ScPostIt* ScDocument::GetNote(const ScAddress& rPos)
ScPostIt* ScDocument::GetNote(SCCOL nCol, SCROW nRow, SCTAB nTab)
{
- if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) &&
- nCol < maTabs[nTab]->GetAllocatedColumnsCount())
- return maTabs[nTab]->aCol[nCol].GetCellNote(nRow);
+ if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()))
+ return maTabs[nTab]->GetNote(nCol, nRow);
else
return nullptr;
@@ -6509,7 +6508,8 @@ void ScDocument::SetNote(const ScAddress& rPos, std::unique_ptr<ScPostIt> pNote)
void ScDocument::SetNote(SCCOL nCol, SCROW nRow, SCTAB nTab, std::unique_ptr<ScPostIt> pNote)
{
- return maTabs[nTab]->CreateColumnIfNotExists(nCol).SetCellNote(nRow, std::move(pNote));
+ if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()))
+ maTabs[nTab]->SetNote(nCol, nRow, std::move(pNote));
}
bool ScDocument::HasNote(const ScAddress& rPos) const
@@ -6542,6 +6542,9 @@ bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const
if (!pTab)
return false;
+ if (nCol >= pTab->GetAllocatedColumnsCount())
+ return false;
+
return pTab->aCol[nCol].HasCellNotes();
}
@@ -6585,6 +6588,7 @@ ScPostIt* ScDocument::GetOrCreateNote(const ScAddress& rPos)
else
return CreateNote(rPos);
}
+
ScPostIt* ScDocument::CreateNote(const ScAddress& rPos)
{
ScPostIt* pPostIt = new ScPostIt(*this, rPos);
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index e5c0cfbef37e..739a62d553ca 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -92,6 +92,15 @@ struct ScDocumentImportImpl
return rTab.getBlockPosition(nCol);
}
+ void invalidateBlockPositionSet(SCTAB nTab)
+ {
+ if (sal_uInt16(nTab) >= maBlockPosSet.size())
+ return;
+
+ sc::TableColumnBlockPositionSet& rTab = maBlockPosSet[nTab];
+ rTab.invalidate();
+ }
+
void initForSheets()
{
size_t n = mrDoc.GetTableCount();
@@ -179,6 +188,11 @@ void ScDocumentImport::setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uI
mpImpl->mrDoc.pDocOptions->SetDate(nDay, nMonth, nYear);
}
+void ScDocumentImport::invalidateBlockPositionSet(SCTAB nTab)
+{
+ mpImpl->invalidateBlockPositionSet(nTab);
+}
+
void ScDocumentImport::setAutoInput(const ScAddress& rPos, const OUString& rStr, const ScSetStringParam* pStringParam)
{
ScTable* pTab = mpImpl->mrDoc.FetchTable(rPos.Tab());
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 050fd823b4ee..ec9cebf3e66d 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -780,7 +780,8 @@ void ScGlobal::OpenURL(const OUString& rURL, const OUString& rTarget, bool bIgno
// OpenURL is always called in the GridWindow by mouse clicks in some way or another.
// That's why pScActiveViewShell and nScClickMouseModifier are correct.
- if (!bIgnoreSettings && !ShouldOpenURL())
+ // Fragments pointing into the current document should be always opened.
+ if (!bIgnoreSettings && !(ShouldOpenURL() || rURL.startsWith("#")))
return;
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index b92082ef7115..fc7bea8fd718 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -28,6 +28,7 @@
#include <editeng/outlobj.hxx>
#include <editeng/editobj.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <comphelper/lok.hxx>
#include <scitems.hxx>
#include <svx/xfillit0.hxx>
@@ -876,7 +877,8 @@ ScPostIt::~ScPostIt()
std::unique_ptr<ScPostIt> ScPostIt::Clone( const ScAddress& rOwnPos, ScDocument& rDestDoc, const ScAddress& rDestPos, bool bCloneCaption ) const
{
CreateCaptionFromInitData( rOwnPos );
- return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, *this, mnPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos, maNoteData, false, mnPostItId );
+ sal_uInt32 nPostItId = comphelper::LibreOfficeKit::isActive() ? 0 : mnPostItId;
+ return bCloneCaption ? std::make_unique<ScPostIt>( rDestDoc, rDestPos, *this, nPostItId ) : std::make_unique<ScPostIt>( rDestDoc, rDestPos, maNoteData, false, mnPostItId );
}
void ScPostIt::SetDate( const OUString& rDate )
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 20efb9d1dd93..35e13aca3f33 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1651,6 +1651,21 @@ std::unique_ptr<ScPostIt> ScTable::ReleaseNote( SCCOL nCol, SCROW nRow )
return aCol[nCol].ReleaseNote(nRow);
}
+ScPostIt* ScTable::GetNote( SCCOL nCol, SCROW nRow )
+{
+ if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount())
+ return nullptr;
+ return aCol[nCol].GetCellNote(nRow);
+}
+
+void ScTable::SetNote( SCCOL nCol, SCROW nRow, std::unique_ptr<ScPostIt> pNote )
+{
+ if (!ValidColRow(nCol, nRow))
+ return;
+
+ CreateColumnIfNotExists(nCol).SetCellNote(nRow, std::move(pNote));
+}
+
size_t ScTable::GetNoteCount( SCCOL nCol ) const
{
if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount())
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index c27c73fb88e1..a2357d352225 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3477,9 +3477,9 @@ void ScTable::GetFilteredFilterEntries(
}
}
-bool ScTable::GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit)
+bool ScTable::GetDataEntries(SCCOL nCol, SCROW nRow, std::set<ScTypedStrData>& rStrings)
{
- return aCol[nCol].GetDataEntries( nRow, rStrings, bLimit );
+ return aCol[nCol].GetDataEntries( nRow, rStrings);
}
sal_uLong ScTable::GetCellCount() const
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 3b902524d901..c7d4527dbf57 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -235,6 +235,7 @@ private:
inline bool MustHaveParamCount( short nAct, short nMust );
inline bool MustHaveParamCount( short nAct, short nMust, short nMax );
inline bool MustHaveParamCountMin( short nAct, short nMin );
+ inline bool MustHaveParamCountMinWithStackCheck( short nAct, short nMin );
void PushParameterExpected();
void PushIllegalParameter();
void PushIllegalArgument();
@@ -1086,6 +1087,17 @@ inline bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin )
return false;
}
+inline bool ScInterpreter::MustHaveParamCountMinWithStackCheck( short nAct, short nMin )
+{
+ assert(sp >= nAct);
+ if (sp < nAct)
+ {
+ PushParameterExpected();
+ return false;
+ }
+ return MustHaveParamCountMin( nAct, nMin);
+}
+
inline bool ScInterpreter::CheckStringPositionArgument( double & fVal )
{
if (!rtl::math::isFinite( fVal))
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 144ca95d4113..50e1276dbc21 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2621,7 +2621,14 @@ Label_MaskStateMachine:
if (eState != ssSkipReference)
{
*pSym++ = c;
- *pSym++ = *pSrc++;
+
+ if( pSym == &cSymbol[ MAXSTRLEN ] )
+ {
+ SetError( FormulaError::StringOverflow);
+ eState = ssStop;
+ }
+ else
+ *pSym++ = *pSrc++;
}
bAddToSymbol = false;
}
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index e375f1626ec5..9e5754878848 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -7524,131 +7524,144 @@ void ScInterpreter::ScVLookup()
void ScInterpreter::ScSubTotal()
{
sal_uInt8 nParamCount = GetByte();
- if ( MustHaveParamCountMin( nParamCount, 2 ) )
+ if ( !MustHaveParamCountMinWithStackCheck( nParamCount, 2 ) )
+ return;
+
+ // We must fish the 1st parameter deep from the stack! And push it on top.
+ const FormulaToken* p = pStack[ sp - nParamCount ];
+ PushWithoutError( *p );
+ sal_Int32 nFunc = GetInt32();
+ mnSubTotalFlags |= SubtotalFlags::IgnoreNestedStAg | SubtotalFlags::IgnoreFiltered;
+ if (nFunc > 100)
{
- // We must fish the 1st parameter deep from the stack! And push it on top.
- const FormulaToken* p = pStack[ sp - nParamCount ];
- PushWithoutError( *p );
- sal_Int32 nFunc = GetInt32();
- mnSubTotalFlags |= SubtotalFlags::IgnoreNestedStAg | SubtotalFlags::IgnoreFiltered;
- if (nFunc > 100)
- {
- // For opcodes 101 through 111, we need to skip hidden cells.
- // Other than that these opcodes are identical to 1 through 11.
- mnSubTotalFlags |= SubtotalFlags::IgnoreHidden;
- nFunc -= 100;
- }
+ // For opcodes 101 through 111, we need to skip hidden cells.
+ // Other than that these opcodes are identical to 1 through 11.
+ mnSubTotalFlags |= SubtotalFlags::IgnoreHidden;
+ nFunc -= 100;
+ }
- if ( nGlobalError != FormulaError::NONE || nFunc < 1 || nFunc > 11 )
- PushIllegalArgument(); // simulate return on stack, not SetError(...)
- else
+ if ( nGlobalError != FormulaError::NONE || nFunc < 1 || nFunc > 11 )
+ PushIllegalArgument(); // simulate return on stack, not SetError(...)
+ else
+ {
+ cPar = nParamCount - 1;
+ switch( nFunc )
{
- cPar = nParamCount - 1;
- switch( nFunc )
- {
- case SUBTOTAL_FUNC_AVE : ScAverage(); break;
- case SUBTOTAL_FUNC_CNT : ScCount(); break;
- case SUBTOTAL_FUNC_CNT2 : ScCount2(); break;
- case SUBTOTAL_FUNC_MAX : ScMax(); break;
- case SUBTOTAL_FUNC_MIN : ScMin(); break;
- case SUBTOTAL_FUNC_PROD : ScProduct(); break;
- case SUBTOTAL_FUNC_STD : ScStDev(); break;
- case SUBTOTAL_FUNC_STDP : ScStDevP(); break;
- case SUBTOTAL_FUNC_SUM : ScSum(); break;
- case SUBTOTAL_FUNC_VAR : ScVar(); break;
- case SUBTOTAL_FUNC_VARP : ScVarP(); break;
- default : PushIllegalArgument(); break;
- }
+ case SUBTOTAL_FUNC_AVE : ScAverage(); break;
+ case SUBTOTAL_FUNC_CNT : ScCount(); break;
+ case SUBTOTAL_FUNC_CNT2 : ScCount2(); break;
+ case SUBTOTAL_FUNC_MAX : ScMax(); break;
+ case SUBTOTAL_FUNC_MIN : ScMin(); break;
+ case SUBTOTAL_FUNC_PROD : ScProduct(); break;
+ case SUBTOTAL_FUNC_STD : ScStDev(); break;
+ case SUBTOTAL_FUNC_STDP : ScStDevP(); break;
+ case SUBTOTAL_FUNC_SUM : ScSum(); break;
+ case SUBTOTAL_FUNC_VAR : ScVar(); break;
+ case SUBTOTAL_FUNC_VARP : ScVarP(); break;
+ default : PushIllegalArgument(); break;
}
- mnSubTotalFlags = SubtotalFlags::NONE;
- // Get rid of the 1st (fished) parameter.
- FormulaConstTokenRef xRef( PopToken());
- Pop();
- PushTokenRef( xRef);
}
+ mnSubTotalFlags = SubtotalFlags::NONE;
+ // Get rid of the 1st (fished) parameter.
+ FormulaConstTokenRef xRef( PopToken());
+ Pop();
+ PushTokenRef( xRef);
}
void ScInterpreter::ScAggregate()
{
sal_uInt8 nParamCount = GetByte();
- if ( MustHaveParamCountMin( nParamCount, 3 ) )
- {
- // fish the 1st parameter from the stack and push it on top.
- const FormulaToken* p = pStack[ sp - nParamCount ];
- PushWithoutError( *p );
- sal_Int32 nFunc = GetInt32();
- // fish the 2nd parameter from the stack and push it on top.
- const FormulaToken* p2 = pStack[ sp - ( nParamCount - 1 ) ];
- PushWithoutError( *p2 );
- sal_Int32 nOption = GetInt32();
-
- if ( nGlobalError != FormulaError::NONE || nFunc < 1 || nFunc > 19 )
- PushIllegalArgument();
- else
+ if ( !MustHaveParamCountMinWithStackCheck( nParamCount, 3 ) )
+ return;
+
+ const FormulaError nErr = nGlobalError;
+ nGlobalError = FormulaError::NONE;
+
+ // fish the 1st parameter from the stack and push it on top.
+ const FormulaToken* p = pStack[ sp - nParamCount ];
+ PushWithoutError( *p );
+ sal_Int32 nFunc = GetInt32();
+ // fish the 2nd parameter from the stack and push it on top.
+ const FormulaToken* p2 = pStack[ sp - ( nParamCount - 1 ) ];
+ PushWithoutError( *p2 );
+ sal_Int32 nOption = GetInt32();
+
+ if ( nGlobalError != FormulaError::NONE || nFunc < 1 || nFunc > 19 )
+ {
+ nGlobalError = nErr;
+ PushIllegalArgument();
+ }
+ else
+ {
+ switch ( nOption)
{
- switch ( nOption)
- {
- case 0 : // ignore nested SUBTOTAL and AGGREGATE functions
- mnSubTotalFlags = SubtotalFlags::IgnoreNestedStAg;
- break;
- case 1 : // ignore hidden rows, nested SUBTOTAL and AGGREGATE functions
- mnSubTotalFlags = SubtotalFlags::IgnoreHidden | SubtotalFlags::IgnoreNestedStAg;
- break;
- case 2 : // ignore error values, nested SUBTOTAL and AGGREGATE functions
- mnSubTotalFlags = SubtotalFlags::IgnoreErrVal | SubtotalFlags::IgnoreNestedStAg;
- break;
- case 3 : // ignore hidden rows, error values, nested SUBTOTAL and AGGREGATE functions
- mnSubTotalFlags = SubtotalFlags::IgnoreHidden | SubtotalFlags::IgnoreErrVal | SubtotalFlags::IgnoreNestedStAg;
- break;
- case 4 : // ignore nothing
- mnSubTotalFlags = SubtotalFlags::NONE;
- break;
- case 5 : // ignore hidden rows
- mnSubTotalFlags = SubtotalFlags::IgnoreHidden ;
- break;
- case 6 : // ignore error values
- mnSubTotalFlags = SubtotalFlags::IgnoreErrVal ;
- break;
- case 7 : // ignore hidden rows and error values
- mnSubTotalFlags = SubtotalFlags::IgnoreHidden | SubtotalFlags::IgnoreErrVal ;
- break;
- default :
- PushIllegalArgument();
- return;
- }
+ case 0 : // ignore nested SUBTOTAL and AGGREGATE functions
+ mnSubTotalFlags = SubtotalFlags::IgnoreNestedStAg;
+ break;
+ case 1 : // ignore hidden rows, nested SUBTOTAL and AGGREGATE functions
+ mnSubTotalFlags = SubtotalFlags::IgnoreHidden | SubtotalFlags::IgnoreNestedStAg;
+ break;
+ case 2 : // ignore error values, nested SUBTOTAL and AGGREGATE functions
+ mnSubTotalFlags = SubtotalFlags::IgnoreErrVal | SubtotalFlags::IgnoreNestedStAg;
+ break;
+ case 3 : // ignore hidden rows, error values, nested SUBTOTAL and AGGREGATE functions
+ mnSubTotalFlags = SubtotalFlags::IgnoreHidden | SubtotalFlags::IgnoreErrVal | SubtotalFlags::IgnoreNestedStAg;
+ break;
+ case 4 : // ignore nothing
+ mnSubTotalFlags = SubtotalFlags::NONE;
+ break;
+ case 5 : // ignore hidden rows
+ mnSubTotalFlags = SubtotalFlags::IgnoreHidden ;
+ break;
+ case 6 : // ignore error values
+ mnSubTotalFlags = SubtotalFlags::IgnoreErrVal ;
+ break;
+ case 7 : // ignore hidden rows and error values
+ mnSubTotalFlags = SubtotalFlags::IgnoreHidden | SubtotalFlags::IgnoreErrVal ;
+ break;
+ default :
+ nGlobalError = nErr;
+ PushIllegalArgument();
+ return;
+ }
- cPar = nParamCount - 2;
- switch ( nFunc )
- {
- case AGGREGATE_FUNC_AVE : ScAverage(); break;
- case AGGREGATE_FUNC_CNT : ScCount(); break;
- case AGGREGATE_FUNC_CNT2 : ScCount2(); break;
- case AGGREGATE_FUNC_MAX : ScMax(); break;
- case AGGREGATE_FUNC_MIN : ScMin(); break;
- case AGGREGATE_FUNC_PROD : ScProduct(); break;
- case AGGREGATE_FUNC_STD : ScStDev(); break;
- case AGGREGATE_FUNC_STDP : ScStDevP(); break;
- case AGGREGATE_FUNC_SUM : ScSum(); break;
- case AGGREGATE_FUNC_VAR : ScVar(); break;
- case AGGREGATE_FUNC_VARP : ScVarP(); break;
- case AGGREGATE_FUNC_MEDIAN : ScMedian(); break;
- case AGGREGATE_FUNC_MODSNGL : ScModalValue(); break;
- case AGGREGATE_FUNC_LARGE : ScLarge(); break;
- case AGGREGATE_FUNC_SMALL : ScSmall(); break;
- case AGGREGATE_FUNC_PERCINC : ScPercentile( true ); break;
- case AGGREGATE_FUNC_QRTINC : ScQuartile( true ); break;
- case AGGREGATE_FUNC_PERCEXC : ScPercentile( false ); break;
- case AGGREGATE_FUNC_QRTEXC : ScQuartile( false ); break;
- default : PushIllegalArgument(); break;
- }
- mnSubTotalFlags = SubtotalFlags::NONE;
- }
- FormulaConstTokenRef xRef( PopToken());
- // Get rid of the 1st and 2nd (fished) parameters.
- Pop();
- Pop();
- PushTokenRef( xRef);
+ if ((mnSubTotalFlags & SubtotalFlags::IgnoreErrVal) == SubtotalFlags::NONE)
+ nGlobalError = nErr;
+
+ cPar = nParamCount - 2;
+ switch ( nFunc )
+ {
+ case AGGREGATE_FUNC_AVE : ScAverage(); break;
+ case AGGREGATE_FUNC_CNT : ScCount(); break;
+ case AGGREGATE_FUNC_CNT2 : ScCount2(); break;
+ case AGGREGATE_FUNC_MAX : ScMax(); break;
+ case AGGREGATE_FUNC_MIN : ScMin(); break;
+ case AGGREGATE_FUNC_PROD : ScProduct(); break;
+ case AGGREGATE_FUNC_STD : ScStDev(); break;
+ case AGGREGATE_FUNC_STDP : ScStDevP(); break;
+ case AGGREGATE_FUNC_SUM : ScSum(); break;
+ case AGGREGATE_FUNC_VAR : ScVar(); break;
+ case AGGREGATE_FUNC_VARP : ScVarP(); break;
+ case AGGREGATE_FUNC_MEDIAN : ScMedian(); break;
+ case AGGREGATE_FUNC_MODSNGL : ScModalValue(); break;
+ case AGGREGATE_FUNC_LARGE : ScLarge(); break;
+ case AGGREGATE_FUNC_SMALL : ScSmall(); break;
+ case AGGREGATE_FUNC_PERCINC : ScPercentile( true ); break;
+ case AGGREGATE_FUNC_QRTINC : ScQuartile( true ); break;
+ case AGGREGATE_FUNC_PERCEXC : ScPercentile( false ); break;
+ case AGGREGATE_FUNC_QRTEXC : ScQuartile( false ); break;
+ default:
+ nGlobalError = nErr;
+ PushIllegalArgument();
+ break;
+ }
+ mnSubTotalFlags = SubtotalFlags::NONE;
}
+ FormulaConstTokenRef xRef( PopToken());
+ // Get rid of the 1st and 2nd (fished) parameters.
+ Pop();
+ Pop();
+ PushTokenRef( xRef);
}
std::unique_ptr<ScDBQueryParamBase> ScInterpreter::GetDBParams( bool& rMissingField )
@@ -9505,6 +9518,8 @@ void ScInterpreter::ScMid()
OUString aStr = GetString().getString();
if ( nStart < 1 || nSubLen < 0 )
PushIllegalArgument();
+ else if (nStart > kScInterpreterMaxStrLen || nSubLen > kScInterpreterMaxStrLen)
+ PushError(FormulaError::StringOverflow);
else
{
sal_Int32 nLen = aStr.getLength();
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index f219beca9386..d442d4eee224 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -3474,7 +3474,7 @@ void ScInterpreter::ScPercentile( bool bInclusive )
GetNumberSequenceArray( 1, aArray, false );
if ( aArray.empty() || nGlobalError != FormulaError::NONE )
{
- SetError( FormulaError::NoValue );
+ PushNoValue();
return;
}
if ( bInclusive )
@@ -3497,7 +3497,7 @@ void ScInterpreter::ScQuartile( bool bInclusive )
GetNumberSequenceArray( 1, aArray, false );
if ( aArray.empty() || nGlobalError != FormulaError::NONE )
{
- SetError( FormulaError::NoValue );
+ PushNoValue();
return;
}
if ( bInclusive )
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index eb3fb987c034..170e60f6afca 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3982,9 +3982,20 @@ StackVar ScInterpreter::Interpret()
(*aTokenMatrixMapIter).second->GetType() != svJumpMatrix)
{
// Path already calculated, reuse result.
- nStackBase = sp - pCur->GetParamCount();
- if ( nStackBase > sp )
- nStackBase = sp; // underflow?!?
+ if (sp >= pCur->GetParamCount())
+ nStackBase = sp - pCur->GetParamCount();
+ else
+ {
+ SAL_WARN("sc.core", "Stack anomaly with calculated path at "
+ << aPos.Tab() << "," << aPos.Col() << "," << aPos.Row()
+ << " " << aPos.Format(
+ ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, pDok)
+ << " eOp: " << static_cast<int>(eOp)
+ << " params: " << static_cast<int>(pCur->GetParamCount())
+ << " nStackBase: " << nStackBase << " sp: " << sp);
+ nStackBase = sp;
+ assert(!"underflow");
+ }
sp = nStackBase;
PushTokenRef( (*aTokenMatrixMapIter).second);
}
@@ -4012,7 +4023,15 @@ StackVar ScInterpreter::Interpret()
else if (sp >= pCur->GetParamCount())
nStackBase = sp - pCur->GetParamCount();
else
- nStackBase = sp; // underflow?!?
+ {
+ SAL_WARN("sc.core", "Stack anomaly at " << aPos.Format(
+ ScRefFlags::VALID | ScRefFlags::FORCE_DOC | ScRefFlags::TAB_3D, pDok)
+ << " eOp: " << static_cast<int>(eOp)
+ << " params: " << static_cast<int>(pCur->GetParamCount())
+ << " nStackBase: " << nStackBase << " sp: " << sp);
+ nStackBase = sp;
+ assert(!"underflow");
+ }
}
switch( eOp )
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index 8b58519bcda2..a255d22232d2 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -222,6 +222,7 @@ void ScInterpreter::ScFilterXML()
case XPATH_STRING:
PushString(OUString::createFromAscii(reinterpret_cast<char*>(pXPathObj->stringval)));
break;
+#if LIBXML_VERSION < 21000 || defined(LIBXML_XPTR_LOCS_ENABLED)
case XPATH_POINT:
PushNoValue();
break;
@@ -231,13 +232,13 @@ void ScInterpreter::ScFilterXML()
case XPATH_LOCATIONSET:
PushNoValue();
break;
+#endif
case XPATH_USERS:
PushNoValue();
break;
case XPATH_XSLT_TREE:
PushNoValue();
break;
-
}
}
}
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index fc634e319549..86c4d1c5cde0 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1803,7 +1803,7 @@ void XclExpObjectManager::StartSheet()
std::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const SdrPage* pSdrPage )
{
if( pSdrPage )
- mxEscherEx->AddSdrPage( *pSdrPage );
+ mxEscherEx->AddSdrPage( *pSdrPage, GetOutput() != EXC_OUTPUT_BINARY );
// the first dummy object may still be open
OSL_ENSURE( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
while( mxEscherEx->GetGroupLevel() )
@@ -1815,7 +1815,7 @@ std::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const S
std::shared_ptr< XclExpRecordBase > XclExpObjectManager::ProcessDrawing( const Reference< XShapes >& rxShapes )
{
if( rxShapes.is() )
- mxEscherEx->AddUnoShapes( rxShapes );
+ mxEscherEx->AddUnoShapes( rxShapes, GetOutput() != EXC_OUTPUT_BINARY );
// the first dummy object may still be open
OSL_ENSURE( mxEscherEx->GetGroupLevel() <= 1, "XclExpObjectManager::ProcessDrawing - still groups open?" );
while( mxEscherEx->GetGroupLevel() )
diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx
index 10733994a232..2040b59c3215 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -167,7 +167,7 @@ public:
OUString& orName,
const css::uno::Sequence< css::sheet::FormulaToken>& rTokens,
sal_Int32 nIndex,
- sal_Int32 nNameFlags ) const;
+ sal_Int32 nNameFlags, bool bHidden ) const;
/** Creates and returns a defined name on-the-fly in the sheet.
The name will not be buffered in the global defined names buffer.
@@ -176,7 +176,7 @@ public:
OUString& orName,
const css::uno::Sequence< css::sheet::FormulaToken>& rTokens,
sal_Int32 nIndex,
- sal_Int32 nNameFlags, sal_Int32 nTab ) const;
+ sal_Int32 nNameFlags, sal_Int32 nTab, bool bHidden ) const;
/** Creates and returns a database range on-the-fly in the Calc document.
The range will not be buffered in the global table buffer.
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 02cd9b0e014d..d85cc4456d58 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -580,14 +580,9 @@ void OP_SheetName123(LotusContext& rContext, SvStream& rStream, sal_uInt16 nLeng
sal_uInt16 nSheetNum(0);
rStream.ReadUInt16(nSheetNum);
- ::std::vector<sal_Char> sSheetName;
- sSheetName.reserve(nLength-4);
- for (sal_uInt16 i = 4; i < nLength; ++i)
- {
- sal_Char c;
- rStream.ReadChar( c );
- sSheetName.push_back(c);
- }
+ const size_t nStrLen = nLength - 4;
+ std::vector<sal_Char> sSheetName(nStrLen + 1);
+ sSheetName[rStream.ReadBytes(sSheetName.data(), nStrLen)] = 0;
if (!ValidTab(nSheetNum))
return;
diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx
index 182be74080e1..8de4098e3016 100644
--- a/sc/source/filter/oox/defnamesbuffer.cxx
+++ b/sc/source/filter/oox/defnamesbuffer.cxx
@@ -225,16 +225,17 @@ void DefinedName::createNameObject( sal_Int32 nIndex )
using namespace ::com::sun::star::sheet::NamedRangeFlag;
if( !isGlobalName() ) switch( mcBuiltinId )
{
- case BIFF_DEFNAME_CRITERIA: nNameFlags = FILTER_CRITERIA; break;
- case BIFF_DEFNAME_PRINTAREA: nNameFlags = PRINT_AREA; break;
- case BIFF_DEFNAME_PRINTTITLES: nNameFlags = COLUMN_HEADER | ROW_HEADER; break;
+ case BIFF_DEFNAME_CRITERIA:
+ case BIFF_DEFNAME_FILTERDATABASE: nNameFlags = FILTER_CRITERIA; break;
+ case BIFF_DEFNAME_PRINTAREA: nNameFlags = PRINT_AREA; break;
+ case BIFF_DEFNAME_PRINTTITLES: nNameFlags = COLUMN_HEADER | ROW_HEADER; break;
}
// create the name and insert it into the document, maCalcName will be changed to the resulting name
if (maModel.mnSheet >= 0)
- mpScRangeData = createLocalNamedRangeObject( maCalcName, ApiTokenSequence(), nIndex, nNameFlags, maModel.mnSheet );
+ mpScRangeData = createLocalNamedRangeObject( maCalcName, ApiTokenSequence(), nIndex, nNameFlags, maModel.mnSheet, maModel.mbHidden );
else
- mpScRangeData = createNamedRangeObject( maCalcName, ApiTokenSequence(), nIndex, nNameFlags );
+ mpScRangeData = createNamedRangeObject( maCalcName, ApiTokenSequence(), nIndex, nNameFlags, maModel.mbHidden );
mnTokenIndex = nIndex;
}
diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx
index 4f2e937ffc3e..ef40b919e908 100644
--- a/sc/source/filter/oox/richstring.cxx
+++ b/sc/source/filter/oox/richstring.cxx
@@ -49,6 +49,116 @@ bool lclNeedsRichTextFormat( const oox::xls::Font* pFont )
return pFont && pFont->needsRichTextFormat();
}
+sal_Int32 lcl_getHexLetterValue(sal_Unicode nCode)
+{
+ if (nCode >= '0' && nCode <= '9')
+ return nCode - '0';
+
+ if (nCode >= 'A' && nCode <= 'F')
+ return nCode - 'A' + 10;
+
+ if (nCode >= 'a' && nCode <= 'f')
+ return nCode - 'a' + 10;
+
+ return -1;
+}
+
+bool lcl_validEscape(sal_Unicode nCode)
+{
+ // Valid XML chars that can be escaped (ignoring the restrictions) as in the OOX open spec
+ // 2.1.1742 Part 1 Section 22.9.2.19, ST_Xstring (Escaped String)
+ if (nCode == 0x000D || nCode == 0x000A || nCode == 0x0009 || nCode == 0x005F)
+ return true;
+
+ // Other valid XML chars in basic multilingual plane that cannot be escaped.
+ if ((nCode >= 0x0020 && nCode <= 0xD7FF) || (nCode >= 0xE000 && nCode <= 0xFFFD))
+ return false;
+
+ return true;
+}
+
+OUString lcl_unEscapeUnicodeChars(const OUString& rSrc)
+{
+ // Example: Escaped representation of unicode char 0x000D is _x000D_
+
+ sal_Int32 nLen = rSrc.getLength();
+ if (!nLen)
+ return rSrc;
+
+ sal_Int32 nStart = 0;
+ bool bFound = false;
+ const OUString aPrefix = "_x";
+ sal_Int32 nPrefixStart = rSrc.indexOf(aPrefix, nStart);
+
+ if (nPrefixStart == -1)
+ return rSrc;
+
+ OUStringBuffer aBuf(rSrc);
+ sal_Int32 nOffset = 0; // index offset in aBuf w.r.t rSrc.
+
+ do
+ {
+ sal_Int32 nEnd = -1;
+ sal_Unicode nCode = 0;
+ bool bFoundThis = false;
+ for (sal_Int32 nIdx = 0; nIdx < 5; ++nIdx)
+ {
+ sal_Int32 nThisIdx = nPrefixStart + nIdx + 2;
+ if (nThisIdx >= nLen)
+ break;
+
+ sal_Unicode nThisCode = rSrc[nThisIdx];
+ sal_Int32 nLetter = lcl_getHexLetterValue(nThisCode);
+
+ if (!nIdx && nLetter < 0)
+ break;
+
+ if (nLetter >= 0)
+ {
+ nCode = (nCode << 4) + static_cast<sal_Unicode>(nLetter);
+ }
+ else if (nThisCode == '_')
+ {
+ nEnd = nThisIdx + 1;
+ bFoundThis = true;
+ break;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ if (bFoundThis)
+ {
+ // nEnd is already set inside the inner loop in this case.
+ if (lcl_validEscape(nCode))
+ {
+ bFound = true;
+ sal_Int32 nEscStrLen = nEnd - nPrefixStart;
+ aBuf.remove(nPrefixStart - nOffset, nEscStrLen);
+ aBuf.insert(nPrefixStart - nOffset, nCode);
+
+ nOffset += nEscStrLen - 1;
+ }
+ }
+ else
+ {
+ // Start the next search just after last "_x"
+ nEnd = nPrefixStart + 2;
+ }
+
+ nStart = nEnd;
+ nPrefixStart = rSrc.indexOf(aPrefix, nStart);
+ }
+ while (nPrefixStart != -1);
+
+ if (bFound)
+ return aBuf.makeStringAndClear();
+
+ return rSrc;
+}
+
} // namespace
RichStringPortion::RichStringPortion( const WorkbookHelper& rHelper ) :
@@ -60,7 +170,7 @@ RichStringPortion::RichStringPortion( const WorkbookHelper& rHelper ) :
void RichStringPortion::setText( const OUString& rText )
{
- maText = rText;
+ maText = lcl_unEscapeUnicodeChars(rText);
}
FontRef const & RichStringPortion::createFont()
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index 03b35ef76e35..61539c8f90af 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -401,9 +401,22 @@ void SheetDataBuffer::addColXfStyle( sal_Int32 nXfId, sal_Int32 nFormatId, const
void SheetDataBuffer::finalizeImport()
{
+ ScDocumentImport& rDocImport = getDocImport();
+
+ SCTAB nStartTabInvalidatedIters(SCTAB_MAX);
+ SCTAB nEndTabInvalidatedIters(0);
+
// create all array formulas
for( const auto& [rRange, rTokens] : maArrayFormulas )
- finalizeArrayFormula( rRange, rTokens );
+ {
+ finalizeArrayFormula(rRange, rTokens);
+
+ nStartTabInvalidatedIters = std::min(rRange.aStart.Tab(), nStartTabInvalidatedIters);
+ nEndTabInvalidatedIters = std::max(rRange.aEnd.Tab(), nEndTabInvalidatedIters);
+ }
+
+ for (SCTAB nTab = nStartTabInvalidatedIters; nTab <= nEndTabInvalidatedIters; ++nTab)
+ rDocImport.invalidateBlockPositionSet(nTab);
// create all table operations
for( const auto& [rRange, rModel] : maTableOperations )
@@ -439,7 +452,6 @@ void SheetDataBuffer::finalizeImport()
}
}
- ScDocumentImport& rDocImport = getDocImport();
ScDocument& rDoc = rDocImport.getDoc();
StylesBuffer& rStyles = getStyles();
for ( const auto& [rCol, rRowStyles] : maStylesPerColumn )
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 4146a60eb310..1f9211d85ca2 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -329,7 +329,7 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect
}
// coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads
- while( nSheetsLeft > 0)
+ while( nSheetsLeft > 0 && !Application::IsQuit())
{
// This is a much more controlled re-enterancy hazard than
// allowing a yield deeper inside the filter code for progress
@@ -345,12 +345,6 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect
void WorkbookFragment::finalizeImport()
{
- // lock the model to prevent broadcasting, speeds up load a lot
- getScDocument().InitDrawLayer();
- auto pModel = getScDocument().GetDrawLayer();
- bool bWasLocked = pModel->isLocked();
- pModel->setLock(true);
-
ISegmentProgressBarRef xGlobalSegment = getProgressBar().createSegment( PROGRESS_LENGTH_GLOBALS );
// read the theme substream
@@ -474,6 +468,12 @@ void WorkbookFragment::finalizeImport()
}
}
+ // lock the model to prevent broadcasting, speeds up load a lot
+ getScDocument().InitDrawLayer();
+ auto pModel = getScDocument().GetDrawLayer();
+ bool bWasLocked = pModel->isLocked();
+ pModel->setLock(true);
+
// load all worksheets
importSheetFragments(*this, aSheetFragments);
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index b19aa700ca8c..6c56de1e981a 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <o3tl/any.hxx>
#include <osl/thread.h>
#include <osl/diagnose.h>
#include <oox/helper/progressbar.hxx>
@@ -150,9 +151,9 @@ public:
/** Returns the specified cell or page style from the Calc document. */
Reference< XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const;
/** Creates and returns a defined name on-the-fly in the Calc document. */
- ScRangeData* createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags );
+ ScRangeData* createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden );
/** Creates and returns a defined name on the-fly in the correct Calc sheet. */
- ScRangeData* createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab );
+ ScRangeData* createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab, bool bHidden );
/** Creates and returns a database range on-the-fly in the Calc document. */
Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const ScRange& rRangeAddr );
/** Creates and returns an unnamed database range on-the-fly in the Calc document. */
@@ -351,7 +352,7 @@ Reference< XStyle > WorkbookGlobals::getStyleObject( const OUString& rStyleName,
namespace {
-ScRangeData* lcl_addNewByNameAndTokens( ScDocument& rDoc, ScRangeName* pNames, const OUString& rName, const Sequence<FormulaToken>& rTokens, sal_Int16 nIndex, sal_Int32 nUnoType )
+ScRangeData* lcl_addNewByNameAndTokens( ScDocument& rDoc, ScRangeName* pNames, const OUString& rName, const Sequence<FormulaToken>& rTokens, sal_Int16 nIndex, sal_Int32 nUnoType, bool bHidden )
{
bool bDone = false;
ScRangeData::Type nNewType = ScRangeData::Type::Name;
@@ -365,6 +366,9 @@ ScRangeData* lcl_addNewByNameAndTokens( ScDocument& rDoc, ScRangeName* pNames, c
pNew->GuessPosition();
if ( nIndex )
pNew->SetIndex( nIndex );
+ // create but not insert hidden FILTER_CRITERIA named ranges to ScRangeName
+ if ( bHidden && nNewType == ScRangeData::Type::Criteria )
+ return pNew;
if ( pNames->insert(pNew) )
bDone = true;
if (!bDone)
@@ -385,7 +389,7 @@ OUString findUnusedName( const ScRangeName* pRangeName, const OUString& rSuggest
}
ScRangeData* WorkbookGlobals::createNamedRangeObject(
- OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags )
+ OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden )
{
// create the name and insert it into the Calc document
ScRangeData* pScRangeData = nullptr;
@@ -396,13 +400,13 @@ ScRangeData* WorkbookGlobals::createNamedRangeObject(
// find an unused name
orName = findUnusedName( pNames, orName );
// create the named range
- pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags );
+ pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags, bHidden );
}
return pScRangeData;
}
ScRangeData* WorkbookGlobals::createLocalNamedRangeObject(
- OUString& orName, const Sequence< FormulaToken >& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab )
+ OUString& orName, const Sequence< FormulaToken >& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab, bool bHidden )
{
// create the name and insert it into the Calc document
ScRangeData* pScRangeData = nullptr;
@@ -415,7 +419,7 @@ ScRangeData* WorkbookGlobals::createLocalNamedRangeObject(
// find an unused name
orName = findUnusedName( pNames, orName );
// create the named range
- pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags );
+ pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, rTokens, nIndex, nNameFlags, bHidden );
}
return pScRangeData;
}
@@ -761,14 +765,12 @@ void WorkbookHelper::finalizeWorkbookImport()
OUString sName(rProp.Name);
if (sName == SC_POSITIONLEFT)
{
- SCCOL nPosLeft;
- rProp.Value >>= nPosLeft;
+ SCCOL nPosLeft = *o3tl::doAccess<SCCOL>(rProp.Value);
getScDocument().SetPosLeft(nPosLeft);
}
else if (sName == SC_POSITIONTOP)
{
- SCROW nPosTop;
- rProp.Value >>= nPosTop;
+ SCROW nPosTop = *o3tl::doAccess<SCROW>(rProp.Value);
getScDocument().SetPosTop(nPosTop);
}
}
@@ -863,14 +865,14 @@ Reference< XStyle > WorkbookHelper::getStyleObject( const OUString& rStyleName,
return mrBookGlob.getStyleObject( rStyleName, bPageStyle );
}
-ScRangeData* WorkbookHelper::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
+ScRangeData* WorkbookHelper::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden ) const
{
- return mrBookGlob.createNamedRangeObject( orName, rTokens, nIndex, nNameFlags );
+ return mrBookGlob.createNamedRangeObject( orName, rTokens, nIndex, nNameFlags, bHidden );
}
-ScRangeData* WorkbookHelper::createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const
+ScRangeData* WorkbookHelper::createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab, bool bHidden ) const
{
- return mrBookGlob.createLocalNamedRangeObject( orName, rTokens, nIndex, nNameFlags, nTab );
+ return mrBookGlob.createLocalNamedRangeObject( orName, rTokens, nIndex, nNameFlags, nTab, bHidden );
}
Reference< XDatabaseRange > WorkbookHelper::createDatabaseRangeObject( OUString& orName, const ScRange& rRangeAddr ) const
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index 775e9ad9a3a7..58c35f862115 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -467,17 +467,17 @@ ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const
case XLS_TOKEN( oleObjects ):
if ( getCurrentElement() == XLS_TOKEN( controls ) )
{
- if( aMceState.empty() || aMceState.back() == MCE_STATE::Started )
+ if( isMCEStateEmpty() || getMCEState() == MCE_STATE::Started )
{
if ( getCurrentElement() == XLS_TOKEN( oleObjects ) ) importOleObject( rAttribs );
else
importControl( rAttribs );
}
- else if ( !aMceState.empty() && aMceState.back() == MCE_STATE::FoundChoice )
+ else if ( !isMCEStateEmpty() && getMCEState() == MCE_STATE::FoundChoice )
{
// reset the handling within 'Choice'
// this will force attempted handling in Fallback
- aMceState.back() = MCE_STATE::Started;
+ setMCEState( MCE_STATE::Started );
}
}
break;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 7e0bb9272970..d274f713334e 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -168,10 +168,13 @@ OUString getExactMatch(const ScTypedCaseStrSet& rDataSet, const OUString& rStrin
ScTypedCaseStrSet::const_iterator findTextAll(
const ScTypedCaseStrSet& rDataSet, ScTypedCaseStrSet::const_iterator const & itPos,
- const OUString& rStart, ::std::vector< OUString > &rResultVec, bool bBack)
+ const OUString& rStart, ::std::vector< OUString > &rResultVec, bool bBack, size_t nMax = 0)
{
rResultVec.clear(); // clear contents
+ if (!rDataSet.size())
+ return rDataSet.end();
+
size_t nCount = 0;
ScTypedCaseStrSet::const_iterator retit;
if ( bBack ) // Backwards
@@ -222,6 +225,8 @@ ScTypedCaseStrSet::const_iterator findTextAll(
std::advance(retit, nPos);
}
++nCount;
+ if (nMax > 0 && nCount >= nMax)
+ break;
}
}
else // Forwards
@@ -254,6 +259,8 @@ ScTypedCaseStrSet::const_iterator findTextAll(
if ( nCount == 0 )
retit = it; // remember first match iterator
++nCount;
+ if (nMax > 0 && nCount >= nMax)
+ break;
}
}
@@ -1914,7 +1921,7 @@ void ScInputHandler::GetColData()
std::vector<ScTypedStrData> aEntries;
rDoc.GetDataEntries(
- aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aEntries, true);
+ aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aEntries);
if (!aEntries.empty())
pColumnData->insert(aEntries.begin(), aEntries.end());
@@ -1940,11 +1947,16 @@ void ScInputHandler::UseColData() // When typing
OUString aText = GetEditText(mpEditEngine.get());
if (!aText.isEmpty())
{
+ std::vector< OUString > aResultVec;
OUString aNew;
miAutoPosColumn = pColumnData->end();
- miAutoPosColumn = findText(*pColumnData, miAutoPosColumn, aText, aNew, false);
- if (miAutoPosColumn != pColumnData->end())
+ miAutoPosColumn = findTextAll(*pColumnData, miAutoPosColumn, aText, aResultVec, false, 2);
+ bool bShowCompletion = (aResultVec.size() == 1);
+ bUseTab = (aResultVec.size() == 2);
+ if (bShowCompletion)
{
+ assert(miAutoPosColumn != pColumnData->end());
+ aNew = aResultVec[0];
// Strings can contain line endings (e.g. due to dBase import),
// which would result in multiple paragraphs here, which is not desirable.
//! Then GetExactMatch doesn't work either
@@ -1973,18 +1985,14 @@ void ScInputHandler::UseColData() // When typing
pTopView->SetSelection( aSelection );
}
- aAutoSearch = aText; // To keep searching - nAutoPos is set
-
- if (aText.getLength() == aNew.getLength())
- {
- // If the inserted text is found, consume TAB only if there's more coming
- OUString aDummy;
- ScTypedCaseStrSet::const_iterator itNextPos =
- findText(*pColumnData, miAutoPosColumn, aText, aDummy, false);
- bUseTab = itNextPos != pColumnData->end();
- }
- else
- bUseTab = true;
+ aAutoSearch = aText;
+ }
+ else if (bUseTab)
+ {
+ // Allow cycling through possible matches using shortcut.
+ // Make miAutoPosColumn invalid so that Ctrl+TAB provides the first matching one.
+ miAutoPosColumn = pColumnData->end();
+ aAutoSearch = aText;
}
}
}
@@ -1997,7 +2005,7 @@ void ScInputHandler::NextAutoEntry( bool bBack )
EditView* pActiveView = pTopView ? pTopView : pTableView;
if ( pActiveView && pColumnData )
{
- if (miAutoPosColumn != pColumnData->end() && !aAutoSearch.isEmpty())
+ if (!aAutoSearch.isEmpty())
{
// Is the selection still valid (could be changed via the mouse)?
ESelection aSel = pActiveView->GetSelection();
@@ -2680,7 +2688,9 @@ void ScInputHandler::UpdateFormulaMode()
if (pInputWin)
pInputWin->SetFormulaMode(true);
- if ( bAutoComplete )
+ // in LOK, we always need to perform the GetFormulaData() call so
+ // that the formula insertion works
+ if (bAutoComplete || comphelper::LibreOfficeKit::isActive())
GetFormulaData();
UpdateParenthesis();
@@ -3623,7 +3633,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
NextFormulaEntry( bShift );
bUsed = true;
}
- else if (pColumnData && bUseTab && miAutoPosColumn != pColumnData->end())
+ else if (pColumnData && bUseTab)
{
// Iterate through AutoInput entries
NextAutoEntry( bShift );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index b106a188dbd3..5decb8436ec2 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -487,6 +487,20 @@ void ScInputWindow::SetSizePixel( const Size& rNewSize )
ToolBox::SetSizePixel(rNewSize);
}
+void ScInputWindow::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags)
+{
+ ToolBox::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
+ if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+ {
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
+ aItems.emplace_back("size", GetSizePixel().toString());
+ aItems.emplace_back("lines", OString::number(aTextWindow.GetNumLines()));
+ pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
+ Invalidate();
+ }
+}
+
void ScInputWindow::Resize()
{
ToolBox::Resize();
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index fe71ab45b6b3..599e6e9a99b3 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1563,6 +1563,14 @@ bool ScModule::IsModalMode(SfxObjectShell* pDocSh)
!( pRefDlg->IsRefInputMode() && pRefDlg->IsDocAllowed(pDocSh) );
}
}
+ else if ( pDocSh && comphelper::LibreOfficeKit::isActive() )
+ {
+ // m_nCurRefDlgId is not deglobalized so it can be set by other view
+ // in LOK case when no ChildWindow for this view was detected -> fallback
+ ScInputHandler* pHdl = GetInputHdl();
+ if ( pHdl )
+ bIsModal = pHdl->IsModalMode(pDocSh);
+ }
}
else if (pDocSh)
{
@@ -1644,6 +1652,14 @@ bool ScModule::IsFormulaMode()
bIsFormula = pChildWnd->IsVisible() && pRefDlg && pRefDlg->IsRefInputMode();
}
}
+ else if ( comphelper::LibreOfficeKit::isActive() )
+ {
+ // m_nCurRefDlgId is not deglobalized so it can be set by other view
+ // in LOK case when no ChildWindow for this view was detected -> fallback
+ ScInputHandler* pHdl = GetInputHdl();
+ if ( pHdl )
+ bIsFormula = pHdl->IsFormulaMode();
+ }
}
else
{
@@ -1679,7 +1695,13 @@ void ScModule::SetReference( const ScRange& rRef, ScDocument* pDoc,
if( m_nCurRefDlgId )
{
- SfxChildWindow* pChildWnd = lcl_GetChildWinFromAnyView( m_nCurRefDlgId );
+ SfxChildWindow* pChildWnd = nullptr;
+
+ if ( comphelper::LibreOfficeKit::isActive() )
+ pChildWnd = lcl_GetChildWinFromCurrentView( m_nCurRefDlgId );
+ else
+ pChildWnd = lcl_GetChildWinFromAnyView( m_nCurRefDlgId );
+
OSL_ENSURE( pChildWnd, "NoChildWin" );
if ( pChildWnd )
{
@@ -1705,6 +1727,14 @@ void ScModule::SetReference( const ScRange& rRef, ScDocument* pDoc,
}
}
}
+ else if ( comphelper::LibreOfficeKit::isActive() )
+ {
+ // m_nCurRefDlgId is not deglobalized so it can be set by other view
+ // in LOK case when no ChildWindow for this view was detected -> fallback
+ ScInputHandler* pHdl = GetInputHdl();
+ if (pHdl)
+ pHdl->SetReference( aNew, pDoc );
+ }
}
else
{
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
index da54e26ad5a1..76c9e45a9ff3 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -92,23 +92,24 @@ IMPL_LINK_NOARG(ScPivotLayoutTreeListData, DoubleClickHdl, weld::TreeView&, bool
mpFunctionDlg = pFactory->CreateScDPFunctionDlg(mxControl.get(), mpParent->GetLabelDataVector(), rCurrentLabelData, rCurrentFunctionData);
- mpFunctionDlg->StartExecuteAsync([this, pCurrentItemValue, rCurrentFunctionData,
+ mpFunctionDlg->StartExecuteAsync([this, pCurrentItemValue,
rCurrentLabelData, nEntry](int nResult) mutable {
if (nResult == RET_OK)
{
- rCurrentFunctionData.mnFuncMask = mpFunctionDlg->GetFuncMask();
+ ScPivotFuncData& rFunctionData = pCurrentItemValue->maFunctionData;
+ rFunctionData.mnFuncMask = mpFunctionDlg->GetFuncMask();
rCurrentLabelData.mnFuncMask = mpFunctionDlg->GetFuncMask();
- rCurrentFunctionData.maFieldRef = mpFunctionDlg->GetFieldRef();
+ rFunctionData.maFieldRef = mpFunctionDlg->GetFieldRef();
- ScDPLabelData& rDFData = mpParent->GetLabelData(rCurrentFunctionData.mnCol);
+ ScDPLabelData& rDFData = mpParent->GetLabelData(rFunctionData.mnCol);
AdjustDuplicateCount(pCurrentItemValue);
OUString sDataItemName = lclCreateDataItemName(
- rCurrentFunctionData.mnFuncMask,
+ rFunctionData.mnFuncMask,
rDFData.maName,
- rCurrentFunctionData.mnDupCount);
+ rFunctionData.mnDupCount);
mxControl->set_text(nEntry, sDataItemName);
}
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 1275113c7f29..cd355c902714 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/lok.hxx>
#include <csvgrid.hxx>
#include <csvtablebox.hxx>
@@ -105,6 +106,8 @@ void ScCsvGrid::SetDrawingArea(weld::DrawingArea* pDrawingArea)
// the left edge will be lost. If this widget is smaller than the scrolling
// window it is stretched to fit the parent and the problem doesn't arise.
Size aInitialSize(10, 10);
+ if (comphelper::LibreOfficeKit::isActive())
+ aInitialSize = Size(-1, 150);
ScCsvControl::SetDrawingArea(pDrawingArea);
pDrawingArea->set_size_request(aInitialSize.Width(), aInitialSize.Height());
SetOutputSizePixel(aInitialSize);
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 75d915438f44..d665795b8224 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -36,6 +36,8 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <miscuno.hxx>
#include <osl/diagnose.h>
+#include <vcl/svapp.hxx>
+#include <comphelper/lok.hxx>
//! TODO make dynamic
const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT;
@@ -286,14 +288,12 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
, mcTextSep(ScAsciiOptions::cDefaultTextSep)
, meCall(eCall)
, mbDetectSpaceSep(eCall != SC_TEXTTOCOLUMNS)
- , mxFtCharSet(m_xBuilder->weld_label("textcharset"))
, mxLbCharSet(new SvxTextEncodingBox(m_xBuilder->weld_combo_box("charset")))
, mxFtCustomLang(m_xBuilder->weld_label("textlanguage"))
, mxLbCustomLang(new SvxLanguageBox(m_xBuilder->weld_combo_box("language")))
, mxFtRow(m_xBuilder->weld_label("textfromrow"))
, mxNfRow(m_xBuilder->weld_spin_button("fromrow"))
- , mxRbFixed(m_xBuilder->weld_radio_button("tofixedwidth"))
- , mxRbSeparated(m_xBuilder->weld_radio_button("toseparatedby"))
+ , mxRbSeparated(m_xBuilder->weld_check_button("toseparatedby"))
, mxCkbTab(m_xBuilder->weld_check_button("tab"))
, mxCkbSemicolon(m_xBuilder->weld_check_button("semicolon"))
, mxCkbComma(m_xBuilder->weld_check_button("comma"))
@@ -319,8 +319,11 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
m_xDialog->set_title(mxAltTitle->get_label());
break;
case SC_IMPORTFILE:
- aName += " - [" + aDatName + "]";
- m_xDialog->set_title(aName);
+ if (!comphelper::LibreOfficeKit::isActive())
+ {
+ aName += " - [" + aDatName + "]";
+ m_xDialog->set_title(aName);
+ }
break;
default:
break;
@@ -358,7 +361,7 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
if (bSkipEmptyCells)
mxCkbSkipEmptyCells->set_active(true);
if (bFixedWidth && !bIsTSV)
- mxRbFixed->set_active(true);
+ mxRbSeparated->set_active(false);
if (nFromRow != 1)
mxNfRow->set_value(nFromRow);
@@ -483,10 +486,9 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
mxTableBox->SetColTypeHdl( LINK( this, ScImportAsciiDlg, ColTypeHdl ) );
mxRbSeparated->connect_clicked( LINK( this, ScImportAsciiDlg, RbSepFixHdl ) );
- mxRbFixed->connect_clicked( LINK( this, ScImportAsciiDlg, RbSepFixHdl ) );
SetupSeparatorCtrls();
- RbSepFixHdl(*mxRbFixed);
+ RbSepFixHdl( *mxRbSeparated );
UpdateVertical();
@@ -494,7 +496,6 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
if (meCall == SC_TEXTTOCOLUMNS)
{
- mxFtCharSet->set_sensitive(false);
mxLbCharSet->set_sensitive(false);
mxFtCustomLang->set_sensitive(false);
mxLbCustomLang->set_active_id(LANGUAGE_SYSTEM);
@@ -516,6 +517,12 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
mxCkbSkipEmptyCells->set_active(false);
mxCkbSkipEmptyCells->hide();
}
+ m_xDialog->SetInstallLOKNotifierHdl(LINK(this, ScImportAsciiDlg, InstallLOKNotifierHdl));
+}
+
+IMPL_STATIC_LINK_NOARG(ScImportAsciiDlg, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*)
+{
+ return GetpApp();
}
ScImportAsciiDlg::~ScImportAsciiDlg()
@@ -528,7 +535,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString &rText, sal_Unicode& r
return false;
bool bRet = true;
- bool bFixed = mxRbFixed->get_active();
+ bool bFixed = !mxRbSeparated->get_active();
if (!mpRowPosArray)
mpRowPosArray.reset( new sal_uLong[ASCIIDLG_MAXROWS + 2] );
@@ -591,7 +598,7 @@ void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt )
rOpt.SetCharSet( meCharSet );
rOpt.SetCharSetSystem( mbCharSetSystem );
rOpt.SetLanguage(mxLbCustomLang->get_active_id());
- rOpt.SetFixedLen( mxRbFixed->get_active() );
+ rOpt.SetFixedLen( !mxRbSeparated->get_active() );
rOpt.SetStartRow( mxNfRow->get_value() );
mxTableBox->FillColumnData( rOpt );
if( mxRbSeparated->get_active() )
@@ -611,7 +618,7 @@ void ScImportAsciiDlg::SaveParameters()
{
lcl_SaveSeparators( maFieldSeparators, mxCbTextSep->get_active_text(), mxCkbAsOnce->get_active(),
mxCkbQuotedAsText->get_active(), mxCkbDetectNumber->get_active(),
- mxRbFixed->get_active(),
+ !mxRbSeparated->get_active(),
mxNfRow->get_value(),
mxLbCharSet->get_active(),
static_cast<sal_uInt16>(mxLbCustomLang->get_active_id()),
@@ -687,10 +694,10 @@ void ScImportAsciiDlg::UpdateVertical()
IMPL_LINK(ScImportAsciiDlg, RbSepFixHdl, weld::Button&, rButton, void)
{
- if (&rButton == mxRbFixed.get() || &rButton == mxRbSeparated.get())
+ if (&rButton == mxRbSeparated.get())
{
weld::WaitObject aWaitObj(m_xDialog.get());
- if( mxRbFixed->get_active() )
+ if( !mxRbSeparated->get_active() )
mxTableBox->SetFixedWidthMode();
else
mxTableBox->SetSeparatorsMode();
@@ -716,7 +723,7 @@ IMPL_LINK( ScImportAsciiDlg, SeparatorEditHdl, weld::Entry&, rEdit, void )
void ScImportAsciiDlg::SeparatorHdl(const weld::Widget* pCtrl)
{
OSL_ENSURE( pCtrl, "ScImportAsciiDlg::SeparatorHdl - missing sender" );
- OSL_ENSURE( !mxRbFixed->get_active(), "ScImportAsciiDlg::SeparatorHdl - not allowed in fixed width" );
+ OSL_ENSURE( mxRbSeparated->get_active(), "ScImportAsciiDlg::SeparatorHdl - not allowed in fixed width" );
/* #i41550# First update state of the controls. The GetSeparators()
function needs final state of the check boxes. */
@@ -769,7 +776,7 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, ScCsvTableBox&, void)
// when the dialog wasn't already presented to the user.
// As a side effect this has the benefit that the check is only done on the
// first set of visible lines.
- sal_Unicode cDetectSep = (mbDetectSpaceSep && !mxRbFixed->get_active() && !mxCkbSpace->get_active() ? 0 : 0xffff);
+ sal_Unicode cDetectSep = (mbDetectSpaceSep && mxRbSeparated->get_active() && !mxCkbSpace->get_active() ? 0 : 0xffff);
sal_Int32 nBaseLine = mxTableBox->GetGrid().GetFirstVisLine();
sal_Int32 nRead = mxTableBox->GetGrid().GetVisLineCount();
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 3a135d9d0042..40a19baecaa5 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -167,7 +167,8 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint, bool bApi )
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
if (pTabViewShell && pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId())
{
- pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nTab))
+ pPosHelper->invalidateByIndex(nStartRow);
}
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 2bf345635645..551ab8d03f32 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -132,6 +132,8 @@
#include <memory>
#include <vector>
+#include <comphelper/lok.hxx>
+
using namespace com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::lang::XMultiServiceFactory;
@@ -1305,17 +1307,22 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
sc::SetFormulaDirtyContext aCxt;
m_aDocument.SetAllFormulasDirty(aCxt);
- // The same resulting name has to be handled in
- // ScExternalRefCache::initializeDoc() and related, hence
- // pass 'true' for RenameTab()'s bExternalDocument for a
- // composed name so ValidTabName() will not be checked,
- // which could veto the rename in case it contained
- // characters that Excel does not handle. If we wanted to
- // change that then it needed to be handled in all
- // corresponding places of the external references
- // manager/cache. Likely then we'd also need a method to
- // compose a name excluding such characters.
- m_aDocument.RenameTab( 0, INetURLObject( rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
+ bool bIsMobile = comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current()
+ && SfxViewShell::Current()->isLOKMobilePhone();
+ // for mobile case, we use a copy of the original document and give it a temporary name before editing
+ // Therefore, the sheet name becomes ugly, long and nonsensical.
+ if (!bIsMobile)
+ // The same resulting name has to be handled in
+ // ScExternalRefCache::initializeDoc() and related, hence
+ // pass 'true' for RenameTab()'s bExternalDocument for a
+ // composed name so ValidTabName() will not be checked,
+ // which could veto the rename in case it contained
+ // characters that Excel does not handle. If we wanted to
+ // change that then it needed to be handled in all
+ // corresponding places of the external references
+ // manager/cache. Likely then we'd also need a method to
+ // compose a name excluding such characters.
+ m_aDocument.RenameTab( 0, INetURLObject( rMedium.GetName()).GetBase(), true/*bExternalDocument*/);
bOverflowRow = aImpEx.IsOverflowRow();
bOverflowCol = aImpEx.IsOverflowCol();
diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx
index cb3467c8bb69..8ea3c2cce5fb 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -142,7 +142,7 @@ bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, boo
sfx2::SvBaseLink* pBase = rLink.get();
if (bDde && dynamic_cast<ScDdeLink*>(pBase))
return true;
- if (bOle && dynamic_cast<SdrEmbedObjectLink*>(pBase))
+ if (bOle && (dynamic_cast<SdrEmbedObjectLink*>(pBase) || dynamic_cast<SdrIFrameLink*>(pBase)))
return true;
if (bWebService && dynamic_cast<ScWebServiceLink*>(pBase))
return true;
@@ -173,6 +173,13 @@ bool DocumentLinkManager::updateDdeOrOleOrWebServiceLinks(weld::Window* pWin)
continue;
}
+ SdrIFrameLink* pIFrameLink = dynamic_cast<SdrIFrameLink*>(pBase);
+ if (pIFrameLink)
+ {
+ pIFrameLink->Update();
+ continue;
+ }
+
ScWebServiceLink* pWebserviceLink = dynamic_cast<ScWebServiceLink*>(pBase);
if (pWebserviceLink)
{
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 57afdd6da65a..9e28af35c0d1 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -206,16 +206,17 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
case SID_MOVE_SHAPE_HANDLE:
{
const SfxItemSet *pArgs = rReq.GetArgs ();
- if (pArgs && pArgs->Count () == 3)
+ if (pArgs && pArgs->Count () >= 3)
{
const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1);
const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2);
const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3);
+ const SfxInt32Item* OrdNum = rReq.GetArg<SfxInt32Item>(FN_PARAM_4);
const sal_uLong handleNum = handleNumItem->GetValue();
const sal_uLong newPosX = convertTwipToMm100(newPosXTwips->GetValue());
const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue());
- pView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+ pView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), OrdNum ? OrdNum->GetValue() : -1);
}
}
break;
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 11e2290d08ff..c171a156b856 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -44,6 +44,7 @@
#include <scresid.hxx>
#include <strings.hrc>
#include <globstr.hrc>
+#include <comphelper/lok.hxx>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
@@ -197,7 +198,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
aAnchorType == SCA_CELL_RESIZE);
// don't select if from (dispatch) API, to allow subsequent cell operations
- SdrInsertFlags nInsOptions = bApi ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE;
+ SdrInsertFlags nInsOptions = (bApi && !comphelper::LibreOfficeKit::isActive()) ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE;
bool bSuccess = pView->InsertObjectAtView( pObj, *pPV, nInsOptions );
// SetGraphicLink has to be used after inserting the object,
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index e3c306574a73..8f4badd28ecb 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -222,7 +222,8 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
// open hyperlink, if found at object or in object's text
- if ( !sURL.isEmpty() && ScGlobal::ShouldOpenURL() )
+ // Fragments pointing into the current document should be always opened.
+ if ( !sURL.isEmpty() && (ScGlobal::ShouldOpenURL() || sURL.startsWith("#")) )
{
ScGlobal::OpenURL( sURL, sTarget );
rViewShell.FakeButtonUp( rViewShell.GetViewData().GetActivePart() );
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index 46f5598705f2..aa5e1bbb8533 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -52,8 +52,8 @@ class ScDrawView final : public FmFormView
void ImplClearCalcDropMarker();
- // support enhanced text edit for draw objects
- virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const override;
+ // Create a local UndoManager
+ std::unique_ptr<SdrUndoManager> createLocalTextUndoManager() override;
public:
ScDrawView(
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 9150096fec72..c77ecb8d0e59 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -259,6 +259,8 @@ public:
virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
virtual void PixelInvalidate(const tools::Rectangle* pRectangle) override;
+ virtual void setPosSizePixel( long nX, long nY, long nWidth, long nHeight,
+ PosSizeFlags nFlags = PosSizeFlags::All ) override;
virtual void SetSizePixel( const Size& rNewSize ) override;
virtual void Resize() override;
virtual void Select() override;
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 0053055b1265..a832ad9f2bb1 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -334,7 +334,7 @@ public:
void SetSnapPixel();
- void DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool bPage);
+ void DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool bPage, bool bMergeCover = false);
void DrawStrings( bool bPixelToLogic = false );
/// Draw all strings, or provide Rectangle where the text (defined by rAddress) would be drawn.
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index 1b263931bc6f..569a67c9b241 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -54,7 +54,6 @@ class ScImportAsciiDlg : public weld::GenericDialogController
ScImportAsciiCall const meCall; /// How the dialog is called (see asciiopt.hxx)
bool mbDetectSpaceSep; /// Whether to detect a possible space separator.
- std::unique_ptr<weld::Label> mxFtCharSet;
std::unique_ptr<SvxTextEncodingBox> mxLbCharSet;
std::unique_ptr<weld::Label> mxFtCustomLang;
std::unique_ptr<SvxLanguageBox> mxLbCustomLang;
@@ -62,8 +61,7 @@ class ScImportAsciiDlg : public weld::GenericDialogController
std::unique_ptr<weld::Label> mxFtRow;
std::unique_ptr<weld::SpinButton> mxNfRow;
- std::unique_ptr<weld::RadioButton> mxRbFixed;
- std::unique_ptr<weld::RadioButton> mxRbSeparated;
+ std::unique_ptr<weld::CheckButton> mxRbSeparated;
std::unique_ptr<weld::CheckButton> mxCkbTab;
std::unique_ptr<weld::CheckButton> mxCkbSemicolon;
@@ -121,6 +119,8 @@ private:
DECL_LINK( LbColTypeHdl, weld::ComboBox&, void );
DECL_LINK( UpdateTextHdl, ScCsvTableBox&, void );
DECL_LINK( ColTypeHdl, ScCsvTableBox&, void );
+ DECL_STATIC_LINK(ScImportAsciiDlg, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
+
};
inline bool ScImportAsciiDlg::Seek(sal_uLong nPos)
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 15cc5242152a..fed870582dcc 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -112,6 +112,8 @@ void ScEditWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea)
pAcc->InitAcc(nullptr, m_xEditView.get(), nullptr,
sName, pDrawingArea->get_tooltip_text());
}
+
+ SetCursor(m_xEditView->GetCursor());
}
ScEditWindow::~ScEditWindow()
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 5cd457885c71..00740cd958ee 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -88,6 +88,7 @@ static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap()
{OUString(SC_UNO_EMBED_FONT_SCRIPT_LATIN), 0, cppu::UnoType<bool>::get(), 0, 0},
{OUString(SC_UNO_EMBED_FONT_SCRIPT_ASIAN), 0, cppu::UnoType<bool>::get(), 0, 0},
{OUString(SC_UNO_EMBED_FONT_SCRIPT_COMPLEX), 0, cppu::UnoType<bool>::get(), 0, 0},
+ {OUString(SC_UNO_IMAGE_PREFERRED_DPI), 0, cppu::UnoType<sal_Int32>::get(), 0, 0},
{OUString(SC_UNO_SYNTAXSTRINGREF), 0, cppu::UnoType<sal_Int16>::get(), 0, 0},
{ OUString(), 0, css::uno::Type(), 0, 0 }
};
@@ -388,7 +389,13 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
rDoc.SetCalcConfig( aCalcConfig );
}
}
-
+ else if (aPropertyName == SC_UNO_IMAGE_PREFERRED_DPI)
+ {
+ if (aValue.has<sal_Int32>())
+ {
+ rDoc.SetImagePreferredDPI(aValue.get<sal_Int32>());
+ }
+ }
else
{
ScGridOptions aGridOpt(aViewOpt.GetGridOptions());
@@ -589,7 +596,10 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr
}
}
}
-
+ else if (aPropertyName == SC_UNO_IMAGE_PREFERRED_DPI)
+ {
+ aRet <<= rDoc.GetImagePreferredDPI();
+ }
else
{
const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions();
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 0e74d7dd5cda..186c4ffe9d39 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -23,6 +23,7 @@
#include <scitems.hxx>
#include <comphelper/sequence.hxx>
+#include <editeng/brushitem.hxx>
#include <editeng/editview.hxx>
#include <editeng/outliner.hxx>
#include <o3tl/any.hxx>
@@ -78,6 +79,7 @@
#endif
#include <sfx2/lokhelper.hxx>
#include <sfx2/lokcharthelper.hxx>
+#include <sfx2/LokControlHandler.hxx>
#include <cellsuno.hxx>
#include <columnspanset.hxx>
@@ -561,9 +563,17 @@ void ScModelObj::paintTile( VirtualDevice& rDevice,
LokChartHelper::PaintAllChartsOnTile(rDevice, nOutputWidth, nOutputHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
+
+ // Draw Form controls
+ ScDrawLayer* pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
+ SdrPage* pPage = pDrawLayer->GetPage(sal_uInt16(pViewData->GetTabNo()));
+ SdrView* pDrawView = pViewData->GetViewShell()->GetScDrawView();
+ tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, nTileHeight));
+ Size aOutputSize(nOutputWidth, nOutputHeight);
+ LokControlHandler::paintControlTile(pPage, pDrawView, *pGridWindow, rDevice, aOutputSize, aTileRect);
}
-void ScModelObj::setPart( int nPart )
+void ScModelObj::setPart( int nPart, bool /*bAllowChangeFocus*/ )
{
ScViewData* pViewData = ScDocShell::GetViewData();
ScTabView* pTabView = dynamic_cast< ScTabView* >( pViewData->GetView() );
@@ -713,22 +723,33 @@ void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButt
if (aChartHelper.postMouseEvent(nType, nX, nY,
nCount, nButtons, nModifier,
pViewData->GetPPTX(), pViewData->GetPPTY()))
+ {
return;
+ }
+
+ Point aPointTwip(nX, nY);
// check if the user hit a chart which is being edited by someone else
// and, if so, skip current mouse event
if (nType != LOK_MOUSEEVENT_MOUSEMOVE)
{
- if (LokChartHelper::HitAny(Point(nX, nY)))
+ if (LokChartHelper::HitAny(aPointTwip))
return;
}
- // Calc operates in pixels...
- const Point aPos(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY());
+ // Check if a control is hit
+ Point aPointHMM = LokControlHandler::convertTwipToMm100(aPointTwip);
+ ScDrawLayer* pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
+ SdrPage* pPage = pDrawLayer->GetPage(sal_uInt16(pViewData->GetTabNo()));
+ SdrView* pDrawView = pViewData->GetViewShell()->GetScDrawView();
+ if (LokControlHandler::postMouseEvent(pPage, pDrawView, *pGridWindow, nType, aPointHMM, nCount, nButtons, nModifier))
+ return;
- LokMouseEventData aMouseEventData(nType, aPos, nCount, MouseEventModifiers::SIMPLECLICK,
+ // Calc operates in pixels...
+ const Point aPosition(nX * pViewData->GetPPTX(), nY * pViewData->GetPPTY());
+ LokMouseEventData aMouseEventData(nType, aPosition, nCount, MouseEventModifiers::SIMPLECLICK,
nButtons, nModifier);
- aMouseEventData.maLogicPosition = Point(convertTwipToMm100(nX), convertTwipToMm100(nY));
+ aMouseEventData.maLogicPosition = aPointHMM;
SfxLokHelper::postMouseEventAsync(pGridWindow, aMouseEventData);
}
@@ -938,6 +959,19 @@ bool ScModelObj::isMimeTypeSupported()
return EditEngine::HasValidData(aDataHelper.GetTransferable());
}
+static void lcl_sendLOKDocumentBackground(const ScViewData* pViewData)
+{
+ ScDocShell* pDocSh = pViewData->GetDocShell();
+ ScDocument& rDoc = pDocSh->GetDocument();
+ const ScPatternAttr *pAttr = rDoc.GetDefPattern();
+ const SfxPoolItem& rItem = pAttr->GetItem(ATTR_BACKGROUND);
+ const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem);
+ const Color& rColor = rBackground.GetColor();
+
+ ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_BACKGROUND_COLOR, rColor.AsRGBHexString().toUtf8().getStr());
+}
+
void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int nTileTwipWidth_, int nTileTwipHeight_)
{
ScViewData* pViewData = ScDocShell::GetViewData();
@@ -945,6 +979,11 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int
if (!pViewData)
return;
+ // Currently in LOK clients the doc background cannot be changed, so send this sparingly as possible but for every view.
+ // FIXME: Find a better place to trigger this callback where it would be called just once per view creation.
+ // Doing this in ScTabViewShell init code does not work because callbacks do not work at that point for the first view.
+ lcl_sendLOKDocumentBackground(pViewData);
+
const Fraction newZoomX(nTilePixelWidth_ * TWIPS_PER_PIXEL, nTileTwipWidth_);
const Fraction newZoomY(nTilePixelHeight_ * TWIPS_PER_PIXEL, nTileTwipHeight_);
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 67908ba1ba68..6b1fc8cf7ef0 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -254,7 +254,8 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
if (nWhich == FID_INS_COLUMNS_AFTER)
eAction = sc::ColRowEditAction::InsertColumnsAfter;
- bDisable = (!bSimpleArea) || GetViewData()->SimpleRowMarked();
+ bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED)
+ || GetViewData()->SimpleRowMarked();
if (!bEditable && nRow1 == 0 && nRow2 == pDoc->MaxRow())
{
// See if row insertions are allowed.
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 805212fae00f..fd5611547a35 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -529,6 +529,55 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
// subtotal when needed new
pTabViewShell->UISort( rOutParam );
+
+ SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
+ if (pViewFrm)
+ {
+ SfxRequest aRequest(pViewFrm, SID_SORT);
+
+ if ( rOutParam.bInplace )
+ {
+ aRequest.AppendItem( SfxBoolItem( SID_SORT_BYROW,
+ rOutParam.bByRow ) );
+ aRequest.AppendItem( SfxBoolItem( SID_SORT_HASHEADER,
+ rOutParam.bHasHeader ) );
+ aRequest.AppendItem( SfxBoolItem( SID_SORT_CASESENS,
+ rOutParam.bCaseSens ) );
+ aRequest.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT,
+ rOutParam.bNaturalSort ) );
+ aRequest.AppendItem( SfxBoolItem( SID_SORT_INCCOMMENTS,
+ rOutParam.bIncludeComments ) );
+ aRequest.AppendItem( SfxBoolItem( SID_SORT_INCIMAGES,
+ rOutParam.bIncludeGraphicObjects ) );
+ aRequest.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS,
+ rOutParam.bIncludePattern ) );
+ sal_uInt16 nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0;
+ aRequest.AppendItem( SfxUInt16Item( SID_SORT_USERDEF, nUser ) );
+ if ( rOutParam.maKeyState[0].bDoSort )
+ {
+ aRequest.AppendItem( SfxInt32Item( FN_PARAM_1,
+ rOutParam.maKeyState[0].nField + 1 ) );
+ aRequest.AppendItem( SfxBoolItem( FN_PARAM_2,
+ rOutParam.maKeyState[0].bAscending ) );
+ }
+ if ( rOutParam.maKeyState[1].bDoSort )
+ {
+ aRequest.AppendItem( SfxInt32Item( FN_PARAM_3,
+ rOutParam.maKeyState[1].nField + 1 ) );
+ aRequest.AppendItem( SfxBoolItem( FN_PARAM_4,
+ rOutParam.maKeyState[1].bAscending ) );
+ }
+ if ( rOutParam.maKeyState[2].bDoSort )
+ {
+ aRequest.AppendItem( SfxInt32Item( FN_PARAM_5,
+ rOutParam.maKeyState[2].nField + 1 ) );
+ aRequest.AppendItem( SfxBoolItem( FN_PARAM_6,
+ rOutParam.maKeyState[2].bAscending ) );
+ }
+ }
+
+ aRequest.Done();
+ }
}
else
{
diff --git a/sc/source/ui/view/cliputil.cxx b/sc/source/ui/view/cliputil.cxx
index 31bbf37d80e5..9a589d8e30f5 100644
--- a/sc/source/ui/view/cliputil.cxx
+++ b/sc/source/ui/view/cliputil.cxx
@@ -96,11 +96,21 @@ void ScClipUtil::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTab
}
if (comphelper::LibreOfficeKit::isActive())
{
+ bool entireColumnOrRowSelected = false;
+ if (pOwnClip)
+ {
+ ScClipParam clipParam = pOwnClip->GetDocument()->GetClipParam();
+ if (clipParam.maRanges.size() > 0)
+ {
+ if (clipParam.maRanges[0].aEnd.Col() == MAXCOLCOUNT -1 || clipParam.maRanges[0].aEnd.Row() == MAXROWCOUNT - 1)
+ entireColumnOrRowSelected = true;
+ }
+ }
const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pThisDoc->GetAttr(nThisCol, nThisRow, nThisTab, ATTR_LINEBREAK));
- if (pItem->GetValue())
+ if (pItem->GetValue() || entireColumnOrRowSelected)
{
ScTabViewShell::notifyAllViewsSheetGeomInvalidation(
- pTabViewShell, false /* bColumns */, true /* bRows */, true /* bSizes*/,
+ pTabViewShell, true /* bColumns */, true /* bRows */, true /* bSizes*/,
true /* bHidden */, true /* bFiltered */, true /* bGroups */, nThisTab);
}
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 52942816c138..424d416fdd4f 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -2274,9 +2274,15 @@ void ScDBFunc::OnLOKShowHideColRow(bool bColumns, SCCOLROW nStart)
if (pTabViewShell && pTabViewShell->GetDocId() == pThisViewShell->GetDocId())
{
if (bColumns)
- pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex)->invalidateByIndex(nStart);
+ {
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex))
+ pPosHelper->invalidateByIndex(nStart);
+ }
else
- pTabViewShell->GetViewData().GetLOKHeightHelper(nCurrentTabIndex)->invalidateByIndex(nStart);
+ {
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nCurrentTabIndex))
+ pPosHelper->invalidateByIndex(nStart);
+ }
if (pTabViewShell->getPart() == nCurrentTabIndex)
{
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index c7d12df62209..6959726b4efe 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -1103,10 +1103,13 @@ bool ScDrawView::calculateGridOffsetForB2DRange(
return true;
}
-// support enhanced text edit for draw objects
-SdrUndoManager* ScDrawView::getSdrUndoManagerForEnhancedTextEdit() const
+// Create a new view-local UndoManager manager for Calc
+std::unique_ptr<SdrUndoManager> ScDrawView::createLocalTextUndoManager()
{
- return pDoc ? dynamic_cast< SdrUndoManager* >(pDoc->GetUndoManager()) : nullptr;
+ std::unique_ptr<SdrUndoManager> pUndoManager(new SdrUndoManager);
+ ScDocShell* pDocShell = pViewData ? pViewData->GetDocShell() : nullptr;
+ pUndoManager->SetDocShell(pDocShell);
+ return pUndoManager;
}
// #i123922# helper to apply a Graphic to an existing SdrObject
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 35bce5d35625..9c49099f2c8d 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -671,7 +671,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
nSizeX = nSizeX / fZoomX;
nSizeY = nSizeY / fZoomY;
}
- tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, nSizeY));
+ tools::Rectangle aCellRect(bLOKActive ? aPos : OutputToScreenPixel(aPos), Size(nSizeX, nSizeY));
ScDBData* pDBData = pDoc->GetDBAtCursor(nCol, nRow, nTab, ScDBDataPortion::AREA);
if (!pDBData)
@@ -924,7 +924,8 @@ void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow )
Point aScrPos;
Size aScrSize;
getCellGeometry(aScrPos, aScrSize, pViewData, nCol, nRow, eWhich);
- DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol-1, nRow, nTab), pDPObj);
+ bool bLOK = comphelper::LibreOfficeKit::isActive();
+ DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol-1, nRow, nTab), pDPObj);
}
void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow )
@@ -937,7 +938,8 @@ void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow )
Point aScrPos;
Size aScrSize;
getCellGeometry(aScrPos, aScrSize, pViewData, nCol, nRow, eWhich);
- DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol, nRow, nTab), pDPObj);
+ bool bLOK = comphelper::LibreOfficeKit::isActive();
+ DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol, nRow, nTab), pDPObj);
}
void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
@@ -1144,7 +1146,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
bool bEmpty = false;
std::vector<ScTypedStrData> aStrings; // case sensitive
// Fill List
- pDoc->GetDataEntries(nCol, nRow, nTab, aStrings);
+ pDoc->GetDataEntries(nCol, nRow, nTab, aStrings, true /* bValidation */);
if (aStrings.empty())
bEmpty = true;
@@ -2612,8 +2614,14 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt )
}
}
- if ( pViewData->GetView()->GetSelEngine()->SelMouseMove( rMEvt ) )
- return;
+ // In LOK case, avoid spurious "leavingwindow" mouse move events which has negative coordinates.
+ // Such events occur for some reason when a user is selecting a range, (even when not leaving the view area)
+ // with one or more other viewers in that sheet.
+ bool bSkipSelectionUpdate = comphelper::LibreOfficeKit::isActive() &&
+ rMEvt.IsLeaveWindow() && (aCurMousePos.X() < 0 || aCurMousePos.Y() < 0);
+
+ if (!bSkipSelectionUpdate)
+ pViewData->GetView()->GetSelEngine()->SelMouseMove( rMEvt );
}
static void lcl_InitMouseEvent(css::awt::MouseEvent& rEvent, const MouseEvent& rEvt)
@@ -5883,6 +5891,7 @@ void ScGridWindow::UpdateKitSelection(const std::vector<tools::Rectangle>& rRect
}
ScTabViewShell* pViewShell = pViewData->GetViewShell();
+ pViewShell->UpdateInputHandler();
OString sBoundingBoxString = "EMPTY";
if (!aBoundingBox.IsEmpty())
sBoundingBoxString = aBoundingBox.toString();
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index e924c11a0145..e24ed7281b80 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -343,6 +343,7 @@ bool ScGridWindow::DPTestFieldPopupArrow(
const MouseEvent& rMEvt, const ScAddress& rPos, const ScAddress& rDimPos, ScDPObject* pDPObj)
{
bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() );
+ bool bLOK = comphelper::LibreOfficeKit::isActive();
// Get the geometry of the cell.
Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich);
@@ -361,7 +362,7 @@ bool ScGridWindow::DPTestFieldPopupArrow(
if (aRect.IsInside(rMEvt.GetPosPixel()))
{
// Mouse cursor inside the popup arrow box. Launch the field menu.
- DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, rDimPos, pDPObj);
+ DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), aScrSize, rDimPos, pDPObj);
return true;
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 7fa1b6c0001c..6aac6be5fde9 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -818,8 +818,14 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
aOutputData.DrawDocumentBackground();
- if (bGridFirst && (bGrid || bPage) && !bNoBackgroundAndGrid)
- aOutputData.DrawGrid(*pContentDev, bGrid, bPage);
+ if (bGridFirst && (bGrid || bPage))
+ {
+ // Draw lines in background color cover over lok client grid lines in merged cell areas if bNoBackgroundAndGrid is set.
+ if (bNoBackgroundAndGrid)
+ aOutputData.DrawGrid(*pContentDev, false /* bGrid */, false /* bPage */, true /* bMergeCover */);
+ else
+ aOutputData.DrawGrid(*pContentDev, bGrid, bPage);
+ }
aOutputData.DrawBackground(*pContentDev);
@@ -1282,15 +1288,15 @@ namespace
class ScLOKProxyObjectContact final : public sdr::contact::ObjectContactOfPageView
{
private:
- sdr::contact::ObjectContact& mrRealObjectContact;
+ ScDrawView* pScDrawView;
public:
explicit ScLOKProxyObjectContact(
- sdr::contact::ObjectContact& rRealOC,
+ ScDrawView* pDrawView,
SdrPageWindow& rPageWindow,
const sal_Char* pDebugName) :
ObjectContactOfPageView(rPageWindow, pDebugName),
- mrRealObjectContact(rRealOC)
+ pScDrawView(pDrawView)
{
}
@@ -1300,9 +1306,24 @@ namespace
basegfx::B2DVector& rTarget,
const sdr::contact::ViewObjectContact& rClient) const override
{
+ if (!pScDrawView)
+ return;
+
+ SdrPageView* pPageView(pScDrawView->GetSdrPageView());
+ if (!pPageView)
+ return;
+
+ SdrPageWindow* pSdrPageWindow = nullptr;
+ if (pPageView->PageWindowCount() > 0)
+ pSdrPageWindow = pPageView->GetPageWindow(0);
+ if (!pSdrPageWindow)
+ return;
+
+ sdr::contact::ObjectContact& rObjContact(pSdrPageWindow->GetObjectContact());
+
SdrObject* pTargetSdrObject(rClient.GetViewContact().TryToGetSdrObject());
if (pTargetSdrObject)
- rTarget = pTargetSdrObject->GetViewContact().GetViewObjectContact(mrRealObjectContact).getGridOffset();
+ rTarget = pTargetSdrObject->GetViewContact().GetViewObjectContact(rObjContact).getGridOffset();
}
};
@@ -1321,15 +1342,7 @@ namespace
if (!pScDrawView)
return SdrView::createViewSpecificObjectContact(rPageWindow, pDebugName);
- SdrPageView* pPageView(pScDrawView->GetSdrPageView());
- if (!pPageView)
- return SdrView::createViewSpecificObjectContact(rPageWindow, pDebugName);
-
- SdrPageWindow* pSdrPageWindow = pPageView->GetPageWindow(0);
- if (!pSdrPageWindow)
- return SdrView::createViewSpecificObjectContact(rPageWindow, pDebugName);
-
- return new ScLOKProxyObjectContact(pSdrPageWindow->GetObjectContact(), rPageWindow, pDebugName);
+ return new ScLOKProxyObjectContact(pScDrawView, rPageWindow, pDebugName);
}
private:
@@ -1493,12 +1506,13 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
void ScGridWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
{
- OString sRectangle;
+ tools::Rectangle aRectangle;
+ tools::Rectangle* pResultRectangle;
if (!pRectangle)
- sRectangle = "EMPTY";
+ pResultRectangle = nullptr;
else
{
- tools::Rectangle aRectangle(*pRectangle);
+ aRectangle = *pRectangle;
// When dragging shapes the map mode is disabled.
if (IsMapModeEnabled())
{
@@ -1507,11 +1521,11 @@ void ScGridWindow::LogicInvalidate(const tools::Rectangle* pRectangle)
}
else
aRectangle = PixelToLogic(aRectangle, MapMode(MapUnit::MapTwip));
- sRectangle = aRectangle.toString();
+ pResultRectangle = &aRectangle;
}
ScTabViewShell* pViewShell = pViewData->GetViewShell();
- SfxLokHelper::notifyInvalidation(pViewShell, sRectangle);
+ SfxLokHelper::notifyInvalidation(pViewShell, pResultRectangle);
}
void ScGridWindow::SetCellSelectionPixel(int nType, int nPixelX, int nPixelY)
@@ -2066,14 +2080,66 @@ void ScGridWindow::GetRectsAnyFor(const ScMarkData &rMarkData,
::std::vector< tools::Rectangle >& rRects,
bool bInPrintTwips) const
{
- ScMarkData aMultiMark( rMarkData );
- aMultiMark.SetMarking( false );
- aMultiMark.MarkToMulti();
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
-
+ double nPPTX = pViewData->GetPPTX();
+ double nPPTY = pViewData->GetPPTY();
bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
long nLayoutSign = bLayoutRTL ? -1 : 1;
+
+ ScMarkData aMultiMark( rMarkData );
+ aMultiMark.SetMarking( false );
+
+ if (!aMultiMark.IsMultiMarked())
+ {
+ // simple range case - simplify calculation
+ ScRange aSimpleRange;
+ aMultiMark.GetMarkArea( aSimpleRange );
+
+ aMultiMark.MarkToMulti();
+ if ( !aMultiMark.IsMultiMarked() )
+ return;
+
+ SCCOL nX1 = aSimpleRange.aStart.Col();
+ SCROW nY1 = aSimpleRange.aStart.Row();
+ SCCOL nX2 = aSimpleRange.aEnd.Col();
+ SCROW nY2 = aSimpleRange.aEnd.Row();
+
+ PutInOrder( nX1, nX2 );
+ PutInOrder( nY1, nY2 );
+
+ SCCOL nPosX = pViewData->GetPosX( eHWhich );
+ SCROW nPosY = pViewData->GetPosY( eVWhich );
+ // is the selection visible at all?
+ if (nX2 < nPosX || nY2 < nPosY)
+ return;
+
+ Point aScrStartPos = bInPrintTwips ? pViewData->GetPrintTwipsPos(nX1, nY1) :
+ pViewData->GetScrPos(nX1, nY1, eWhich);
+
+ long nStartX = aScrStartPos.X();
+ long nStartY = aScrStartPos.Y();
+
+ Point aScrEndPos = bInPrintTwips ? pViewData->GetPrintTwipsPos(nX2, nY2) :
+ pViewData->GetScrPos(nX2, nY2, eWhich);
+
+ long nWidthTwips = pDoc->GetColWidth(nX2, nTab);
+ const long nWidth = bInPrintTwips ?
+ nWidthTwips : ScViewData::ToPixel(nWidthTwips, nPPTX);
+ long nEndX = aScrEndPos.X() + (nWidth - 1) * nLayoutSign;
+
+ sal_uInt16 nHeightTwips = pDoc->GetRowHeight( nY2, nTab );
+ const long nHeight = bInPrintTwips ?
+ nHeightTwips : ScViewData::ToPixel(nHeightTwips, nPPTY);
+ long nEndY = aScrEndPos.Y() + nHeight - 1;
+
+ ScInvertMerger aInvert( &rRects );
+ aInvert.AddRect( tools::Rectangle( nStartX, nStartY, nEndX, nEndY ) );
+
+ return;
+ }
+
+ aMultiMark.MarkToMulti();
if ( !aMultiMark.IsMultiMarked() )
return;
ScRange aMultiRange;
@@ -2134,9 +2200,6 @@ void ScGridWindow::GetRectsAnyFor(const ScMarkData &rMarkData,
nY2 = nMaxTiledRow;
}
- double nPPTX = pViewData->GetPPTX();
- double nPPTY = pViewData->GetPPTY();
-
ScInvertMerger aInvert( &rRects );
Point aScrPos = bInPrintTwips ? pViewData->GetPrintTwipsPos(nX1, nY1) :
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index b940ffe200b1..40746907fafc 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -292,7 +292,9 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
pObj = pHit;
}
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
- if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
+ // Fragments pointing into the current document need no tooltip
+ // describing the ctrl-click functionality.
+ if ( pInfo && (pInfo->GetHlink().getLength() > 0) && !pInfo->GetHlink().startsWith("#") )
{
aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
aHelpText = SfxHelp::GetURLHelpText(pInfo->GetHlink());
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index ced84e795ecd..3585908d7e07 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -39,6 +39,7 @@
#include <sal/log.hxx>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <tools/UnitConversion.hxx>
#include <output.hxx>
#include <document.hxx>
@@ -286,8 +287,11 @@ void ScOutputData::SetSyntaxMode( bool bNewMode )
}
}
-void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool bPage)
+void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool bPage, bool bMergeCover)
{
+ // bMergeCover : Draw lines in sheet bgcolor to cover lok client grid lines in merged cell areas.
+ // When scNoGridBackground is set in lok mode, bMergeCover is set to true and bGrid to false.
+
SCCOL nX;
SCROW nY;
long nPosX;
@@ -323,11 +327,12 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
// break all the drawing by one change.
// So until that happens, we need to special case.
bool bWorksInPixels = bMetaFile;
+ const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
+ Color aSheetBGColor = rColorCfg.GetColorValue(::svtools::DOCCOLOR).nColor;
if ( eType == OUTTYPE_WINDOW )
{
bWorksInPixels = true;
- const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
aPageColor = rColorCfg.GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
aManualColor = rColorCfg.GetColorValue(svtools::CALCPAGEBREAKMANUAL).nColor;
}
@@ -349,7 +354,8 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
long nLayoutSign = bLayoutRTL ? -1 : 1;
long nSignedOneX = nOneX * nLayoutSign;
- rRenderContext.SetLineColor(aGridColor);
+ rRenderContext.SetLineColor(bMergeCover ? aSheetBGColor : aGridColor);
+
ScGridMerger aGrid(&rRenderContext, nOneX, nOneY);
// vertical lines
@@ -393,7 +399,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
}
else
{
- rRenderContext.SetLineColor( aGridColor );
+ rRenderContext.SetLineColor(bMergeCover ? aSheetBGColor : aGridColor);
bDashed = false;
}
@@ -401,7 +407,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
}
}
- bool bDraw = bGrid || nBreakOld != ScBreakType::NONE; // simple grid only if set that way
+ bool bDraw = bGrid || nBreakOld != ScBreakType::NONE || bMergeCover; // simple grid only if set that way
sal_uInt16 nWidthXplus2 = pRowInfo[0].pCellInfo[nXplus2].nWidth;
bSingle = false; //! get into Fillinfo !!!!!
@@ -451,14 +457,14 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
}
}
- if (pThisRowInfo->bChanged && !bHOver)
+ if ((pThisRowInfo->bChanged && !bHOver && !bMergeCover) || (bHOver && bMergeCover))
{
aGrid.AddVerLine(bWorksInPixels, nPosX-nSignedOneX, nPosY, nNextY-nOneY, bDashed);
}
nPosY = nNextY;
}
}
- else
+ else if (!bMergeCover)
{
aGrid.AddVerLine(bWorksInPixels, nPosX-nSignedOneX, nScrY, nScrY+nScrH-nOneY, bDashed);
}
@@ -510,7 +516,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
}
else
{
- rRenderContext.SetLineColor( aGridColor );
+ rRenderContext.SetLineColor(bMergeCover ? aSheetBGColor : aGridColor);
bDashed = false;
}
@@ -518,7 +524,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
}
}
- bool bDraw = bGrid || nBreakOld != ScBreakType::NONE; // simple grid only if set so
+ bool bDraw = bGrid || nBreakOld != ScBreakType::NONE || bMergeCover; // simple grid only if set so
bool bNextYisNextRow = (pRowInfo[nArrYplus1].nRowNo == nYplus1);
bSingle = !bNextYisNextRow; // Hidden
@@ -556,7 +562,8 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
->IsVerOverlapped();
//! nVisY from Array ??
}
- if (!bVOver)
+
+ if ((!bVOver && !bMergeCover) || (bVOver && bMergeCover))
{
aGrid.AddHorLine(bWorksInPixels, nPosX, nNextX-nSignedOneX, nPosY-nOneY, bDashed);
}
@@ -564,7 +571,7 @@ void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool
nPosX = nNextX;
}
}
- else
+ else if (!bMergeCover)
{
aGrid.AddHorLine(bWorksInPixels, nScrX, nScrX+nScrW-nOneX, nPosY-nOneY, bDashed);
}
@@ -899,20 +906,42 @@ const BitmapEx& getIcon(sc::IconSetBitmapMap & rIconSetBitmapMap, ScIconSetType
}
void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const tools::Rectangle& rRect, long nOneX, long nOneY,
- sc::IconSetBitmapMap & rIconSetBitmapMap)
+ sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels)
{
- //long nSize = 16;
ScIconSetType eType = pOldIconSetInfo->eIconSetType;
sal_Int32 nIndex = pOldIconSetInfo->nIconIndex;
const BitmapEx& rIcon = getIcon(rIconSetBitmapMap, eType, nIndex);
- long aOrigSize = std::max<long>(0,std::min(rRect.GetSize().getWidth() - 4 * nOneX, rRect.GetSize().getHeight() -4 * nOneY));
- rRenderContext.DrawBitmapEx( Point( rRect.Left() + 2 * nOneX, rRect.Top() + 2 * nOneY), Size(aOrigSize, aOrigSize), rIcon );
+
+ long aHeight = 300;
+
+ if (pOldIconSetInfo->mnHeight)
+ {
+ if (bWorksInPixels)
+ {
+ aHeight = rRenderContext.LogicToPixel(Size(0, pOldIconSetInfo->mnHeight), MapMode(MapUnit::MapTwip)).Height();
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ aHeight *= comphelper::LibreOfficeKit::getDPIScale();
+ }
+ }
+ else
+ aHeight = convertTwipToMm100(pOldIconSetInfo->mnHeight);
+ }
+
+ Size aSize = rIcon.GetSizePixel();
+ double fRatio = aSize.Width() / aSize.Height();
+ long aWidth = fRatio * aHeight;
+
+ rRenderContext.Push();
+ rRenderContext.SetClipRegion(vcl::Region(rRect));
+ rRenderContext.DrawBitmapEx(Point(rRect.Left() + 2 * nOneX, rRect.Bottom() - 2 * nOneY - aHeight), Size(aWidth, aHeight), rIcon);
+ rRenderContext.Pop();
}
void drawCells(vcl::RenderContext& rRenderContext, boost::optional<Color> const & pColor, const SvxBrushItem* pBackground, boost::optional<Color>& pOldColor, const SvxBrushItem*& pOldBackground,
tools::Rectangle& rRect, long nPosX, long nLayoutSign, long nOneX, long nOneY, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo,
const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo,
- sc::IconSetBitmapMap & rIconSetBitmapMap)
+ sc::IconSetBitmapMap & rIconSetBitmapMap, bool bWorksInPixels)
{
long nSignedOneX = nOneX * nLayoutSign;
// need to paint if old color scale has been used and now
@@ -929,7 +958,7 @@ void drawCells(vcl::RenderContext& rRenderContext, boost::optional<Color> const
if( pOldDataBarInfo )
drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY);
if( pOldIconSetInfo )
- drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap);
+ drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap, bWorksInPixels);
rRect.SetLeft( nPosX - nSignedOneX );
}
@@ -949,7 +978,7 @@ void drawCells(vcl::RenderContext& rRenderContext, boost::optional<Color> const
if( pOldDataBarInfo )
drawDataBars(rRenderContext, pOldDataBarInfo, rRect, nOneX, nOneY);
if( pOldIconSetInfo )
- drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap);
+ drawIconSets(rRenderContext, pOldIconSetInfo, rRect, nOneX, nOneY, rIconSetBitmapMap, bWorksInPixels);
rRect.SetLeft( nPosX - nSignedOneX );
}
@@ -1112,7 +1141,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
if (bWorksInPixels)
nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X();
- drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap());
+ drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap(), bWorksInPixels);
// extend for all merged cells
nMergedCols = 1;
@@ -1136,7 +1165,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
if (bWorksInPixels)
nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X();
- drawCells(rRenderContext, boost::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap());
+ drawCells(rRenderContext, boost::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap(), bWorksInPixels);
nArrY += nSkip;
}
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 1f924ddaf8f9..0c23821cd26d 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2588,7 +2588,7 @@ void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW
if ((bColumn && aNewArea.getWidth()) || (!bColumn && aNewArea.getHeight()))
{
rTabView.UpdateSelectionOverlay();
- SfxLokHelper::notifyInvalidation(rViewData.GetViewShell(), aNewArea.toString());
+ SfxLokHelper::notifyInvalidation(rViewData.GetViewShell(), &aNewArea);
}
// Provide size in the payload, so clients don't have to query for that.
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 736d47ace777..87206196c7a8 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -412,13 +412,13 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
// Only invalidate if spreadsheet extended to the right
if (aNewColArea.getWidth())
{
- SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewColArea.toString());
+ SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), &aNewColArea);
}
// Only invalidate if spreadsheet extended to the bottom
if (aNewRowArea.getHeight())
{
- SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), aNewRowArea.toString());
+ SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), &aNewRowArea);
}
// Provide size in the payload, so clients don't have to
@@ -2087,8 +2087,8 @@ void ScTabView::MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW
SCROW nScrY = aViewData.GetPosY( eVWhich );
bool bPosVisible =
- ( nCol >= nScrX && nCol <= nScrX + aViewData.VisibleCellsX(eHWhich) + 1 &&
- nRow >= nScrY && nRow <= nScrY + aViewData.VisibleCellsY(eVWhich) + 1 );
+ ( nCol >= nScrX && nCol <= nScrX + aViewData.VisibleCellsX(eHWhich) - 1 &&
+ nRow >= nScrY && nRow <= nScrY + aViewData.VisibleCellsY(eVWhich) - 1 );
// for the active part, create edit view even if outside the visible area,
// so input isn't lost (and the edit view may be scrolled into the visible area)
@@ -2597,7 +2597,9 @@ void ScTabView::DoDPFieldPopup(OUString const & rPivotTableName, sal_Int32 nDime
pDPObject->BuildAllDimensionMembers();
- Point aScreenPoint = pWin->OutputToScreenPixel(pWin->LogicToPixel(aPoint));
+ Point aPos = pWin->LogicToPixel(aPoint);
+ bool bLOK = comphelper::LibreOfficeKit::isActive();
+ Point aScreenPoint = bLOK ? aPos : pWin->OutputToScreenPixel(aPos);
Size aScreenSize = pWin->LogicToPixel(aSize);
pWin->DPLaunchFieldPopupMenu(aScreenPoint, aScreenSize, nDimensionIndex, pDPObject);
@@ -2964,6 +2966,17 @@ void ScTabView::UpdateInputContext()
long ScTabView::GetGridWidth( ScHSplitPos eWhich )
{
+ // at present only the size of the current pane is synchronized with
+ // the size of the visible area in Online;
+ // as a workaround we use the same width for all panes independently
+ // from the eWhich value
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ ScGridWindow* pGridWindow = aViewData.GetActiveWin();
+ if (pGridWindow)
+ return pGridWindow->GetSizePixel().Width();
+ }
+
ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_LEFT ) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
if (pGridWin[eGridWhich])
return pGridWin[eGridWhich]->GetSizePixel().Width();
@@ -2975,6 +2988,17 @@ long ScTabView::GetGridWidth( ScHSplitPos eWhich )
long ScTabView::GetGridHeight( ScVSplitPos eWhich )
{
+ // at present only the size of the current pane is synchronized with
+ // the size of the visible area in Online;
+ // as a workaround we use the same height for all panes independently
+ // from the eWhich value
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ ScGridWindow* pGridWindow = aViewData.GetActiveWin();
+ if (pGridWindow)
+ return pGridWindow->GetSizePixel().Height();
+ }
+
ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_TOP ) ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
if (pGridWin[eGridWhich])
return pGridWin[eGridWhich]->GetSizePixel().Height();
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index d2efc23d5559..693ef04ed055 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -230,6 +230,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
case SID_DRAW_ELLIPSE:
case SID_DRAW_MEASURELINE:
pTabView->SetDrawFuncPtr(new FuConstRectangle(*this, pWin, pView, pDoc, aNewReq));
+ bCreateDirectly = comphelper::LibreOfficeKit::isActive();
break;
case SID_DRAW_CAPTION:
@@ -261,6 +262,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
case SID_DRAW_TEXT_MARQUEE:
case SID_DRAW_NOTEEDIT:
pTabView->SetDrawFuncPtr(new FuText(*this, pWin, pView, pDoc, aNewReq));
+ bCreateDirectly = comphelper::LibreOfficeKit::isActive();
break;
case SID_FM_CREATE_CONTROL:
@@ -361,13 +363,20 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
// insert into page
pView->InsertObjectAtView(pObj.release(), *pPageView);
- if ( nNewId == SID_DRAW_CAPTION || nNewId == SID_DRAW_CAPTION_VERTICAL )
+ switch ( nNewId )
{
+ case SID_DRAW_CAPTION:
+ case SID_DRAW_CAPTION_VERTICAL:
+ case SID_DRAW_TEXT:
+ case SID_DRAW_TEXT_VERTICAL:
// use KeyInput to start edit mode (FuText is created).
// For FuText objects, edit mode is handled within CreateDefaultObject.
// KEY_F2 is handled in FuDraw::KeyInput.
pFuActual->KeyInput( KeyEvent( 0, vcl::KeyCode( KEY_F2 ) ) );
+ break;
+ default:
+ break;
}
}
}
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index a1ff8bc20051..49abd351c0d3 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -543,20 +543,26 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
pSettings[SC_CURSOR_X].Value <<= sal_Int32(nCurX);
pSettings[SC_CURSOR_Y].Name = SC_CURSORPOSITIONY;
pSettings[SC_CURSOR_Y].Value <<= sal_Int32(nCurY);
- pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
- pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eExHSplitMode);
- pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
- pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eExVSplitMode);
- pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = SC_HORIZONTALSPLITPOSITION;
- if (eExHSplitMode == SC_SPLIT_FIX)
- pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosX);
- else
- pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExHSplitPos);
- pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
- if (eExVSplitMode == SC_SPLIT_FIX)
- pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosY);
- else
- pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExVSplitPos);
+
+ // Write freezepan data only when freeze pans are set
+ if(nExFixPosX != 0 || nExFixPosY != 0 || nExHSplitPos != 0 || nExVSplitPos != 0)
+ {
+ pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
+ pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eExHSplitMode);
+ pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
+ pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eExVSplitMode);
+ pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = SC_HORIZONTALSPLITPOSITION;
+ if (eExHSplitMode == SC_SPLIT_FIX)
+ pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosX);
+ else
+ pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExHSplitPos);
+ pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
+ if (eExVSplitMode == SC_SPLIT_FIX)
+ pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosY);
+ else
+ pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExVSplitPos);
+ }
+
// Prevent writing odd settings that would make crash versions that
// don't apply SanitizeWhichActive() when reading the settings.
// See tdf#117093
@@ -2273,7 +2279,8 @@ void ScViewData::SetTabNo( SCTAB nNewTab )
ScPositionHelper* ScViewData::GetLOKWidthHelper(SCTAB nTabIndex)
{
- if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size())))
+ if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size())) ||
+ !maTabData[nTabIndex])
{
return nullptr;
}
@@ -2282,7 +2289,8 @@ ScPositionHelper* ScViewData::GetLOKWidthHelper(SCTAB nTabIndex)
ScPositionHelper* ScViewData::GetLOKHeightHelper(SCTAB nTabIndex)
{
- if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size())))
+ if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size())) ||
+ !maTabData[nTabIndex])
{
return nullptr;
}
@@ -3148,10 +3156,25 @@ void ScViewData::CalcPPT()
}
}
- if (nPPTX != nOldPPTX)
- GetLOKWidthHelper().invalidateByPosition(0L);
- if (nPPTY != nOldPPTY)
- GetLOKHeightHelper().invalidateByPosition(0L);
+ if (pDoc && comphelper::LibreOfficeKit::isActive())
+ {
+ SCTAB nTabCount = maTabData.size();
+ bool bResetWidths = (nPPTX != nOldPPTX);
+ bool bResetHeights = (nPPTY != nOldPPTY);
+ for (SCTAB nTabIdx = 0; nTabIdx < nTabCount; ++nTabIdx)
+ {
+ if (!maTabData[nTabIdx])
+ continue;
+
+ if (bResetWidths)
+ if (auto* pWHelper = GetLOKWidthHelper(nTabIdx))
+ pWHelper->invalidateByPosition(0L);
+
+ if (bResetHeights)
+ if (auto* pHHelper = GetLOKHeightHelper(nTabIdx))
+ pHHelper->invalidateByPosition(0L);
+ }
+ }
}
#define SC_OLD_TABSEP '/'
@@ -4044,7 +4067,12 @@ void ScViewData::AddPixelsWhile( long & rScrY, long nEndPixels, SCROW & rPosY,
if (nHeightEndRow > nEndRow)
nHeightEndRow = nEndRow;
if (!nHeight)
- nRow = nHeightEndRow + 1;
+ {
+ if (ValidTab(nTabNo) && nTabNo <= pDoc->GetMaxTableNumber())
+ nRow = nHeightEndRow + 1;
+ else
+ break;
+ }
else
{
SCROW nRows = nHeightEndRow - nRow + 1;
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 42395787792a..da627069252b 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -21,6 +21,7 @@
#include <svx/svdpage.hxx>
#include <sfx2/docfile.hxx>
#include <comphelper/classids.hxx>
+#include <comphelper/lok.hxx>
#include <sot/formats.hxx>
#include <sot/storage.hxx>
#include <vcl/graph.hxx>
@@ -765,7 +766,15 @@ bool ScViewFunc::PasteFromSystem( SotClipboardFormatId nFormatId, bool bApi )
nullptr, false, !bApi ); // allow warning dialog
if ( !bRet && !bApi )
+ {
ErrorMessage(STR_PASTE_ERROR);
+ }
+ else if (comphelper::LibreOfficeKit::isActive())
+ {
+ SfxViewShell* pViewShell = rViewData.GetViewShell();
+ ScTabViewShell::notifyAllViewsSheetGeomInvalidation(pViewShell, true /* bColumns */, true /* bRows */,
+ true /* bSizes */, false /* bHidden */, false /* bFiltered */, false /* bGroups */, rViewData.GetTabNo());
+ }
}
return bRet;
}
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index facb25c9ddb1..588c81832ea8 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -51,6 +51,7 @@
#include <viewfunc.hxx>
#include <docsh.hxx>
+#include <drwlayer.hxx>
#include <drawview.hxx>
#include <impex.hxx>
#include <dbdata.hxx>
@@ -147,14 +148,39 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
SCCOL nFirstCol, nLastCol;
SCROW nFirstRow, nLastRow;
if ( rSrcDoc.GetDataStart( nSrcTab, nFirstCol, nFirstRow ) )
+ {
rSrcDoc.GetCellArea( nSrcTab, nLastCol, nLastRow );
+ if (nLastCol < nFirstCol)
+ nLastCol = nFirstCol;
+ if (nLastRow < nFirstRow)
+ nLastRow = nFirstRow;
+ }
else
{
nFirstCol = nLastCol = 0;
nFirstRow = nLastRow = 0;
}
+
+ bool bIncludeObjects = false; // include drawing layer objects in CopyToClip ?
+
+ if (nFormatId == SotClipboardFormatId::EMBED_SOURCE)
+ {
+ const ScDrawLayer* pDraw = rSrcDoc.GetDrawLayer();
+ SCCOL nPrintEndCol = nFirstCol;
+ SCROW nPrintEndRow = nFirstRow;
+ bool bHasObjects = pDraw && pDraw->HasObjects();
+ // Extend the range to include the drawing layer objects.
+ if (bHasObjects && rSrcDoc.GetPrintArea(nSrcTab, nPrintEndCol, nPrintEndRow, true))
+ {
+ nLastCol = std::max<SCCOL>(nLastCol, nPrintEndCol);
+ nLastRow = std::max<SCROW>(nLastRow, nPrintEndRow);
+ }
+
+ bIncludeObjects = bHasObjects;
+ }
+
ScClipParam aClipParam(ScRange(nFirstCol, nFirstRow, nSrcTab, nLastCol, nLastRow, nSrcTab), false);
- rSrcDoc.CopyToClip(aClipParam, pClipDoc.get(), &aSrcMark, false, false);
+ rSrcDoc.CopyToClip(aClipParam, pClipDoc.get(), &aSrcMark, false, bIncludeObjects);
ScGlobal::SetClipDocName( xDocShRef->GetTitle( SFX_TITLE_FULLNAME ) );
SetCursor( nPosX, nPosY );
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index e5b1da40162c..08f8ac2f8ce2 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1479,7 +1479,8 @@ void ScViewFunc::OnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset)
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
{
- pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex)->invalidateByIndex(nStartCol);
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKWidthHelper(nCurrentTabIndex))
+ pPosHelper->invalidateByIndex(nStartCol);
// if we remove a column the cursor position and the current selection
// in other views could need to be moved on the left by one column.
@@ -1535,7 +1536,8 @@ void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, long nOffset)
ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
{
- pTabViewShell->GetViewData().GetLOKHeightHelper(nCurrentTabIndex)->invalidateByIndex(nStartRow);
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nCurrentTabIndex))
+ pPosHelper->invalidateByIndex(nStartRow);
// if we remove a row the cursor position and the current selection
// in other views could need to be moved up by one row.
@@ -1592,9 +1594,15 @@ void ScViewFunc::OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth)
if (pTabViewShell && pTabViewShell->GetDocId() == pCurrentViewShell->GetDocId())
{
if (bWidth)
- pTabViewShell->GetViewData().GetLOKWidthHelper(nCurTab)->invalidateByIndex(nStart);
+ {
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKWidthHelper(nCurTab))
+ pPosHelper->invalidateByIndex(nStart);
+ }
else
- pTabViewShell->GetViewData().GetLOKHeightHelper(nCurTab)->invalidateByIndex(nStart);
+ {
+ if (ScPositionHelper* pPosHelper = pTabViewShell->GetViewData().GetLOKHeightHelper(nCurTab))
+ pPosHelper->invalidateByIndex(nStart);
+ }
}
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
@@ -1605,7 +1613,8 @@ void ScViewFunc::OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth)
bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste )
{
ScRange aRange;
- if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE)
+ ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange);
+ if (eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED)
{
ScDocShell* pDocSh = GetViewData().GetDocShell();
const ScMarkData& rMark = GetViewData().GetMarkData();
diff --git a/sc/uiconfig/scalc/ui/notebookbar_online.ui b/sc/uiconfig/scalc/ui/notebookbar_online.ui
new file mode 100644
index 000000000000..85260fe7213d
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/notebookbar_online.ui
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface domain="sw">
+ <requires lib="gtk+" version="3.18"/>
+ <requires lib="LibreOffice" version="1.0"/>
+ <!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="font">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkToolButton" id="Home-CharFontName">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="action_name">.uno:CharFontName</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="fontheight">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_left">5</property>
+ <child>
+ <object class="GtkToolButton" id="Home-FontHeight">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">.uno:FontHeight</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="SectionBottom127">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <child>
+ <object class="GtkToolButton" id="Home-NumberFormatType">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">.uno:NumberFormatType</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/textimportcsv.ui b/sc/uiconfig/scalc/ui/textimportcsv.ui
index 948c5334aaf9..a58d50994397 100644
--- a/sc/uiconfig/scalc/ui/textimportcsv.ui
+++ b/sc/uiconfig/scalc/ui/textimportcsv.ui
@@ -111,7 +111,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
@@ -119,20 +118,6 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="textcharset">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="textimportcsv|textcharset">Ch_aracter set:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">charset</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
- <child>
<object class="GtkLabel" id="textlanguage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -166,8 +151,9 @@
<property name="can_focus">False</property>
</object>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="top_attach">0</property>
+ <property name="width">2</property>
</packing>
</child>
<child>
@@ -201,7 +187,7 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="textimportcsv|label1">Import</property>
+ <property name="label" translatable="yes" context="textimportcsv|label1">Character encoding</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -227,7 +213,6 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
@@ -242,25 +227,8 @@
<property name="hexpand">True</property>
<property name="homogeneous">True</property>
<child>
- <object class="GtkRadioButton" id="tofixedwidth">
- <property name="label" translatable="yes" context="textimportcsv|tofixedwidth">_Fixed width</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <property name="group">toseparatedby</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="toseparatedby">
- <property name="label" translatable="yes" context="textimportcsv|toseparatedby">_Separated by</property>
+ <object class="GtkCheckButton" id="toseparatedby">
+ <property name="label" translatable="yes" context="textimportcsv|toseparatedby">_Use separators</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -287,7 +255,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
@@ -534,7 +501,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
@@ -624,7 +590,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
- <property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
diff --git a/scp2/InstallModule_python.mk b/scp2/InstallModule_python.mk
index e38d58a9b821..8b5a615eab6f 100644
--- a/scp2/InstallModule_python.mk
+++ b/scp2/InstallModule_python.mk
@@ -31,7 +31,7 @@ $(eval $(call gb_InstallModule_define_if_set,scp2/python,\
))
$(eval $(call gb_InstallModule_add_defs,scp2/python,\
- -DPYVERSION=$(PYTHON_VERSION) \
+ -DPYVERSION=3.7.7 \
))
endif
diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 82973266a2b0..912f1b511185 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -21,7 +21,7 @@ import uno
import unohelper
import sys
import os
-import imp
+import types
import time
import ast
import platform
@@ -347,7 +347,7 @@ class ScriptContext(unohelper.Base):
# code = readTextFromStream( sfa.openFileRead( url ) )
# execute the module
-# entry = ModuleEntry( lastRead, imp.new_module("ooo_script_framework") )
+# entry = ModuleEntry( lastRead, types.ModuleType("ooo_script_framework") )
# entry.module.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = g_scriptContext
# entry.module.__file__ = url
# exec code in entry.module.__dict__
@@ -489,7 +489,7 @@ class ProviderContext:
src = ensureSourceState( src )
# execute the module
- entry = ModuleEntry( lastRead, imp.new_module("ooo_script_framework") )
+ entry = ModuleEntry( lastRead, types.ModuleType("ooo_script_framework") )
entry.module.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = self.scriptContext
code = None
@@ -583,7 +583,7 @@ class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation,
if event.ActionCommand == "Run":
code = self.editor.getControl("EditorTextField").getText()
code = ensureSourceState( code )
- mod = imp.new_module("ooo_script_framework")
+ mod = types.ModuleType("ooo_script_framework")
mod.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = self.provCtx.scriptContext
exec(code, mod.__dict__)
values = mod.__dict__.get( CALLABLE_CONTAINER_NAME , None )
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 410f3c782b29..b796800f62b7 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -408,6 +408,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/tools/AsynchronousCall \
sd/source/ui/tools/ConfigurationAccess \
sd/source/ui/tools/EventMultiplexer \
+ sd/source/ui/tools/GraphicSizeCheck \
sd/source/ui/tools/IconCache \
sd/source/ui/tools/IdleDetection \
sd/source/ui/tools/PreviewRenderer \
diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk
index 247767eb6f26..3e3a181f94f5 100644
--- a/sd/UIConfig_sdraw.mk
+++ b/sd/UIConfig_sdraw.mk
@@ -117,6 +117,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\
sd/uiconfig/sdraw/ui/notebookbar_single \
sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact \
sd/uiconfig/sdraw/ui/notebookbar_groupedbar_full \
+ sd/uiconfig/sdraw/ui/notebookbar_online \
sd/uiconfig/sdraw/ui/paranumberingtab \
sd/uiconfig/sdraw/ui/queryunlinkimagedialog \
sd/uiconfig/sdraw/ui/vectorize \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index b5e62f9b67d8..01bfab017db2 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -136,6 +136,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/notebookbar_groups \
sd/uiconfig/simpress/ui/notebookbar_groupedbar_full \
sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact \
+ sd/uiconfig/simpress/ui/notebookbar_online \
sd/uiconfig/simpress/ui/optimpressgeneralpage \
sd/uiconfig/simpress/ui/photoalbum \
sd/uiconfig/simpress/ui/presentationdialog \
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 3e6514f16b80..eb9352ea31f6 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -199,6 +199,9 @@ private:
class Implementation;
::std::unique_ptr<Implementation> mpImpl;
+ /// Returns the current outline view
+ OutlinerView* getOutlinerView();
+
/// Specifies whether to search and replace, to spell check or to do a
/// text conversion.
enum mode {SEARCH, SPELL, TEXT_CONVERSION} meMode;
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index b5b6e574ca0c..e560a6925210 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -200,6 +200,8 @@ private:
bool mbEmbedFontScriptAsian : 1;
bool mbEmbedFontScriptComplex : 1;
+ sal_Int32 mnImagePreferredDPI;
+
SAL_DLLPRIVATE virtual css::uno::Reference< css::uno::XInterface > createUnoModel() override;
public:
@@ -626,6 +628,9 @@ public:
SAL_DLLPRIVATE void SetEmbedFontScriptAsian(bool bUse) { mbEmbedFontScriptAsian = bUse; }
SAL_DLLPRIVATE void SetEmbedFontScriptComplex(bool bUse) { mbEmbedFontScriptComplex = bUse; }
+ sal_Int32 getImagePreferredDPI() const override { return mnImagePreferredDPI; }
+ void setImagePreferredDPI(sal_Int32 nValue) { mnImagePreferredDPI = nValue; }
+
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
private:
diff --git a/sd/qa/unit/data/odp/numfmt.odp b/sd/qa/unit/data/odp/numfmt.odp
index 6fd32ce0a66d..51227ea091d9 100644
--- a/sd/qa/unit/data/odp/numfmt.odp
+++ b/sd/qa/unit/data/odp/numfmt.odp
Binary files differ
diff --git a/sd/qa/unit/data/odp/search-all-notes.odp b/sd/qa/unit/data/odp/search-all-notes.odp
new file mode 100644
index 000000000000..6c38ecabb0ea
--- /dev/null
+++ b/sd/qa/unit/data/odp/search-all-notes.odp
Binary files differ
diff --git a/sd/qa/unit/data/pptx/numfmt.pptx b/sd/qa/unit/data/pptx/numfmt.pptx
index aca6927101d6..f855fbbeb12c 100644
--- a/sd/qa/unit/data/pptx/numfmt.pptx
+++ b/sd/qa/unit/data/pptx/numfmt.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/pass/ofz35597-1.pptx b/sd/qa/unit/data/pptx/pass/ofz35597-1.pptx
new file mode 100644
index 000000000000..e7fcacc25482
--- /dev/null
+++ b/sd/qa/unit/data/pptx/pass/ofz35597-1.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/slidenum_field.pptx b/sd/qa/unit/data/pptx/slidenum_field.pptx
index f3c184056905..3388568831d7 100644
--- a/sd/qa/unit/data/pptx/slidenum_field.pptx
+++ b/sd/qa/unit/data/pptx/slidenum_field.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf140714.pptx b/sd/qa/unit/data/pptx/tdf140714.pptx
new file mode 100644
index 000000000000..6f5e98ec66f1
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf140714.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf142716.pptx b/sd/qa/unit/data/pptx/tdf142716.pptx
new file mode 100644
index 000000000000..4ef29e389449
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf142716.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf143222.pptx b/sd/qa/unit/data/pptx/tdf143222.pptx
new file mode 100644
index 000000000000..63938d1bdc71
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf143222.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf59323.pptx b/sd/qa/unit/data/pptx/tdf59323.pptx
new file mode 100755
index 000000000000..0660c0af4f23
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf59323.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/tdf96061.pptx b/sd/qa/unit/data/pptx/tdf96061.pptx
new file mode 100644
index 000000000000..c6e6aa5ae16f
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf96061.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 399bd4657861..a6279f8eadf1 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -12,6 +12,7 @@
#include <comphelper/sequence.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/editobj.hxx>
+#include <editeng/flditem.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/numitem.hxx>
#include <editeng/unoprnms.hxx>
@@ -20,6 +21,7 @@
#include <svx/svdomedia.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xlndsit.hxx>
+#include <svx/svdoole2.hxx>
#include <rtl/ustring.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -188,6 +190,9 @@ public:
void testTdf131554();
void testTdf132282();
void testTdf128213ShapeRot();
+ void testTdf96061_textHighlight();
+ void testTdf59323_slideFooters();
+ void testTdf143222_embeddedWorksheet();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -294,6 +299,9 @@ public:
CPPUNIT_TEST(testTdf131554);
CPPUNIT_TEST(testTdf132282);
CPPUNIT_TEST(testTdf128213ShapeRot);
+ CPPUNIT_TEST(testTdf96061_textHighlight);
+ CPPUNIT_TEST(testTdf59323_slideFooters);
+ CPPUNIT_TEST(testTdf143222_embeddedWorksheet);
CPPUNIT_TEST_SUITE_END();
@@ -747,26 +755,33 @@ void matchNumberFormat( int nPage, uno::Reference< text::XTextField > const & xF
xPropSet->getPropertyValue("NumberFormat") >>= nNumFmt;
switch( nPage )
{
- case 0: // 13/02/96
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(2), nNumFmt);
+ case 0: // 13/02/96 (StdSmall)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(SvxDateFormat::StdSmall), nNumFmt);
break;
case 1: // 13/02/1996
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(5), nNumFmt);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(SvxDateFormat::B), nNumFmt);
break;
- case 2: // 13 February 1996
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(3), nNumFmt);
+ case 2: // Tuesday, June 29, 2021 (StdBig)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(SvxDateFormat::StdBig), nNumFmt);
break;
- case 3: // 13:49:38
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(2), nNumFmt);
+ case 3: // 13:49:38 (Standard)
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(SvxTimeFormat::Standard), nNumFmt);
break;
case 4: // 13:49
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(3), nNumFmt);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(SvxTimeFormat::HH24_MM), nNumFmt);
break;
case 5: // 01:49 PM
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(6), nNumFmt);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(SvxTimeFormat::HH12_MM), nNumFmt);
break;
case 6: // 01:49:38 PM
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(7), nNumFmt);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Time fields don't match", sal_Int32(SvxTimeFormat::HH12_MM_SS), nNumFmt);
+ break;
+ case 7: // June 29, 2021
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(SvxDateFormat::D), nNumFmt);
+ break;
+ case 8: // Jun 29, 2021
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number formats of Date fields don't match", sal_Int32(SvxDateFormat::C), nNumFmt);
+ break;
}
}
@@ -778,7 +793,7 @@ void SdOOXMLExportTest2::testDatetimeFieldNumberFormat()
xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- for(sal_uInt16 i = 0; i <= 6; ++i)
+ for(sal_uInt16 i = 0; i <= 8; ++i)
{
matchNumberFormat( i, getTextFieldFromPage(0, 0, 0, i, xDocShRef) );
}
@@ -792,7 +807,7 @@ void SdOOXMLExportTest2::testDatetimeFieldNumberFormatPPTX()
xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
- for(sal_uInt16 i = 0; i <= 6; ++i)
+ for(sal_uInt16 i = 0; i <= 8; ++i)
{
matchNumberFormat( i, getTextFieldFromPage(0, 0, 0, i, xDocShRef) );
}
@@ -2752,6 +2767,105 @@ void SdOOXMLExportTest2::testTdf128213ShapeRot()
assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:scene3d/a:camera/a:rot", "rev", "5400000");
}
+void SdOOXMLExportTest2::testTdf96061_textHighlight()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf96061.pptx"), PPTX);
+
+ uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef));
+ uno::Reference<text::XTextRange> const xParagraph1(getParagraphFromShape(0, xShape));
+ uno::Reference<text::XTextRange> xRun1(getRunFromParagraph(0, xParagraph1));
+ uno::Reference< beans::XPropertySet> xPropSet1(xRun1, uno::UNO_QUERY_THROW);
+ sal_Int32 aColor;
+ xPropSet1->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+ uno::Reference<text::XTextRange> const xParagraph2(getParagraphFromShape(1, xShape));
+ uno::Reference<text::XTextRange> xRun2(getRunFromParagraph(0, xParagraph2));
+ uno::Reference< beans::XPropertySet> xPropSet2(xRun2, uno::UNO_QUERY_THROW);
+ xPropSet2->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+
+ xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+ uno::Reference<beans::XPropertySet> xShape2(getShapeFromPage(0, 0, xDocShRef));
+ uno::Reference<text::XTextRange> const xParagraph3(getParagraphFromShape(0, xShape2));
+ uno::Reference<text::XTextRange> xRun3(getRunFromParagraph(0, xParagraph3));
+ uno::Reference< beans::XPropertySet> xPropSet3(xRun3, uno::UNO_QUERY_THROW);
+ xPropSet3->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+ uno::Reference<text::XTextRange> const xParagraph4(getParagraphFromShape(1, xShape2));
+ uno::Reference<text::XTextRange> xRun4(getRunFromParagraph(0, xParagraph4));
+ uno::Reference< beans::XPropertySet> xPropSet4(xRun4, uno::UNO_QUERY_THROW);
+ xPropSet4->getPropertyValue("CharBackColor") >>= aColor;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+}
+
+void SdOOXMLExportTest2::testTdf59323_slideFooters()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf59323.pptx"), PPTX);
+
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDoc->getDrawPages()->getCount());
+
+ for (int nPageIndex = 0; nPageIndex < 3; nPageIndex++)
+ {
+ uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef));
+ uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(true, xPropSet->getPropertyValue("IsFooterVisible").get<bool>());
+ CPPUNIT_ASSERT_EQUAL(true, xPropSet->getPropertyValue("IsDateTimeVisible").get<bool>());
+ CPPUNIT_ASSERT_EQUAL(true, xPropSet->getPropertyValue("IsPageNumberVisible").get<bool>());
+ }
+
+ // Test placeholder indexes
+ xmlDocPtr pXmlDocMaster = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='dt']", "idx", "1");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='ftr']", "idx", "2");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='sldNum']", "idx", "3");
+
+ xmlDocPtr pXmlDocSlide1 = parseExport(tempFile, "ppt/slides/slide1.xml");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='dt']", "idx", "1");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='ftr']", "idx", "2");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='sldNum']", "idx", "3");
+
+ // Test if datetime fields have text in them
+ // This is needed for backwards compatibility
+ assertXPath(pXmlDocSlide1, "//a:fld [@type='datetime1']/a:t");
+
+ xDocShRef->DoClose();
+}
+
+void SdOOXMLExportTest2::testTdf143222_embeddedWorksheet()
+{
+ // Check import of embedded worksheet in slide.
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf143222.pptx"), PPTX);
+
+ const SdrPage* pPage = GetPage(1, xDocShRef.get());
+ const SdrOle2Obj* pOleObj = static_cast<SdrOle2Obj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT_MESSAGE("no object", pOleObj != nullptr);
+
+ // Without the fix we lost the graphic of ole object.
+ const Graphic* pGraphic = pOleObj->GetGraphic();
+ CPPUNIT_ASSERT_MESSAGE("no graphic", pGraphic != nullptr);
+
+ // Check export of embedded worksheet in slide.
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+
+ pPage = GetPage(1, xDocShRef.get());
+ pOleObj = static_cast<SdrOle2Obj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT_MESSAGE("no object after the export", pOleObj != nullptr);
+
+ pGraphic = pOleObj->GetGraphic();
+ CPPUNIT_ASSERT_MESSAGE("no graphic after the export", pGraphic != nullptr);
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index f1d5f65c36ac..f246f6568534 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -56,6 +56,7 @@ public:
void testImageWithSpecialID();
void testTdf62176();
void testTransparentBackground();
+ void testTdf142716();
void testEmbeddedPdf();
void testEmbeddedText();
void testTransparenText();
@@ -72,6 +73,7 @@ public:
void testTdf123557();
void testTdf113822();
void testTdf126761();
+ void testTdf140714();
CPPUNIT_TEST_SUITE(SdExportTest);
@@ -89,6 +91,7 @@ public:
CPPUNIT_TEST(testImageWithSpecialID);
CPPUNIT_TEST(testTdf62176);
CPPUNIT_TEST(testTransparentBackground);
+ CPPUNIT_TEST(testTdf142716);
CPPUNIT_TEST(testEmbeddedPdf);
CPPUNIT_TEST(testEmbeddedText);
CPPUNIT_TEST(testTransparenText);
@@ -105,6 +108,7 @@ public:
CPPUNIT_TEST(testTdf123557);
CPPUNIT_TEST(testTdf113822);
CPPUNIT_TEST(testTdf126761);
+ CPPUNIT_TEST(testTdf140714);
CPPUNIT_TEST_SUITE_END();
@@ -280,6 +284,22 @@ void SdExportTest::testTransparentBackground()
xDocShRef->DoClose();
}
+void SdExportTest::testTdf142716()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142716.pptx"), PPTX);
+ xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+ const SdrPage *pPage = GetPage( 1, xDocShRef );
+ const SdrTextObj *pObj = dynamic_cast<SdrTextObj *>( pPage->GetObj( 0 ) );
+
+ OUString sText = pObj->GetOutlinerParaObject()->GetTextObject().GetText(0);
+
+ // Without fix "yyy" part will be lost.
+ CPPUNIT_ASSERT_EQUAL( OUString( "xxx and yyy" ), sText);
+
+ xDocShRef->DoClose();
+}
+
void SdExportTest::testMediaEmbedding()
{
if (!OpenGLWrapper::isVCLOpenGLEnabled())
@@ -1213,6 +1233,20 @@ void SdExportTest::testTdf126761()
xDocShRef->DoClose();
}
+void SdExportTest::testTdf140714()
+{
+ //Without the fix in place, shape will be imported as GraphicObjectShape instead of CustomShape.
+
+ auto xDocShRef = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf140714.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ uno::Reference<drawing::XShape> xShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString{"com.sun.star.drawing.CustomShape"}, xShape->getShapeType());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 32779db85579..2e7cbf2690f2 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1702,7 +1702,7 @@ void SdImportTest::testTdf95932()
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf95932.pptx"), PPTX);
const SdrPage *pPage = GetPage( 1, xDocShRef );
- SdrObject *const pObj = pPage->GetObj(2);
+ SdrObject *const pObj = pPage->GetObj(1);
CPPUNIT_ASSERT(pObj);
const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>(
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 5797bdda4348..4e9dfe4c8b59 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -64,7 +64,7 @@ public:
void testTdf96206();
void testTdf96708();
void testTdf99396();
- void testTdf99396TextEdit();
+ void testTableObjectUndoTest();
void testFillGradient();
void testTdf44774();
void testTdf38225();
@@ -81,7 +81,7 @@ public:
CPPUNIT_TEST(testTdf96206);
CPPUNIT_TEST(testTdf96708);
CPPUNIT_TEST(testTdf99396);
- CPPUNIT_TEST(testTdf99396TextEdit);
+ CPPUNIT_TEST(testTableObjectUndoTest);
CPPUNIT_TEST(testFillGradient);
CPPUNIT_TEST(testTdf44774);
CPPUNIT_TEST(testTdf38225);
@@ -252,8 +252,10 @@ void SdMiscTest::testTdf99396()
xDocSh->DoClose();
}
-void SdMiscTest::testTdf99396TextEdit()
+void SdMiscTest::testTableObjectUndoTest()
{
+ // See tdf#99396 for the issue
+
// Load the document and select the table.
sd::DrawDocShellRef xDocSh = Load(m_directories.getURLFromSrc("/sd/qa/unit/data/tdf99396.odp"), ODP);
sd::ViewShell* pViewShell = xDocSh->GetViewShell();
@@ -279,14 +281,26 @@ void SdMiscTest::testTdf99396TextEdit()
const SfxItemSet* pArgs = aRequest.GetArgs();
pView->SetAttributes(*pArgs);
}
+ const auto& pLocalUndoManager = pView->getViewLocalUndoManager();
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pLocalUndoManager->GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Apply attributes"), pLocalUndoManager->GetUndoActionComment());
{
auto pTableController = dynamic_cast<sdr::table::SvxTableController*>(pView->getSelectionController().get());
CPPUNIT_ASSERT(pTableController);
SfxRequest aRequest(pViewShell->GetViewFrame(), SID_TABLE_VERT_BOTTOM);
pTableController->Execute(aRequest);
}
+ // Global change "Format cell" is applied only - Change the vertical alignment to "Bottom"
+ CPPUNIT_ASSERT_EQUAL(size_t(1), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Format cell"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment());
+
pView->SdrEndTextEdit();
+ // End of text edit, so the text edit action is added to the undo stack
+ CPPUNIT_ASSERT_EQUAL(size_t(2), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Edit text of Table"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment(0));
+ CPPUNIT_ASSERT_EQUAL(OUString("Format cell"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment(1));
+
// Check that the result is what we expect.
{
uno::Reference<table::XTable> xTable = pTableObject->getTable();
@@ -304,6 +318,10 @@ void SdMiscTest::testTdf99396TextEdit()
// Now undo.
xDocSh->GetUndoManager()->Undo();
+ // Undoing the last action - one left
+ CPPUNIT_ASSERT_EQUAL(size_t(1), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Format cell"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment(0));
+
// Check again that the result is what we expect.
{
uno::Reference<table::XTable> xTable = pTableObject->getTable();
@@ -319,6 +337,9 @@ void SdMiscTest::testTdf99396TextEdit()
CPPUNIT_ASSERT_EQUAL(SvxAdjust::Center, pAdjust->GetAdjust());
}
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(1), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Format cell"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment(0));
/*
* now test tdf#103950 - Undo does not revert bundled font size changes for table cells
@@ -329,8 +350,11 @@ void SdMiscTest::testTdf99396TextEdit()
SfxRequest aRequest(pViewShell->GetViewFrame(), SID_GROW_FONT_SIZE);
static_cast<sd::DrawViewShell*>(pViewShell)->ExecChar(aRequest);
}
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
-
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Apply attributes to Table"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment(0));
+ CPPUNIT_ASSERT_EQUAL(OUString("Grow font size"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment(1));
+ CPPUNIT_ASSERT_EQUAL(OUString("Format cell"), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionComment(2));
xDocSh->DoClose();
}
diff --git a/sd/qa/unit/tiledrendering/data/TextBoxAndRect.odg b/sd/qa/unit/tiledrendering/data/TextBoxAndRect.odg
new file mode 100644
index 000000000000..aa1a37b83147
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/TextBoxAndRect.odg
Binary files differ
diff --git a/sd/qa/unit/tiledrendering/data/duplicate-undo.odp b/sd/qa/unit/tiledrendering/data/duplicate-undo.odp
new file mode 100644
index 000000000000..f66c9f6081d5
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/duplicate-undo.odp
Binary files differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 79163b0cea67..b39321948e32 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -113,6 +113,8 @@ public:
void testCommentChangeImpress();
void testCommentChangeDraw();
void testMultiViewInsertDeletePage();
+ void testMultiViewInsertDeletePage2();
+ void testEditingTextBoxAndInsertShapeInterrupt();
void testDisableUndoRepair();
void testDocumentRepair();
void testLanguageStatus();
@@ -127,6 +129,10 @@ public:
void testLanguageAllText();
void testInsertDeletePageInvalidation();
void testSpellOnlineRenderParameter();
+ void testSlideDuplicateUndo();
+ void testMoveShapeHandle();
+ void testDeleteTable();
+ void testShapeEditInMultipleViews();
CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
CPPUNIT_TEST(testCreateDestroy);
@@ -165,6 +171,8 @@ public:
CPPUNIT_TEST(testCommentChangeImpress);
CPPUNIT_TEST(testCommentChangeDraw);
CPPUNIT_TEST(testMultiViewInsertDeletePage);
+ CPPUNIT_TEST(testMultiViewInsertDeletePage2);
+ CPPUNIT_TEST(testEditingTextBoxAndInsertShapeInterrupt);
CPPUNIT_TEST(testDisableUndoRepair);
CPPUNIT_TEST(testDocumentRepair);
CPPUNIT_TEST(testLanguageStatus);
@@ -179,7 +187,10 @@ public:
CPPUNIT_TEST(testLanguageAllText);
CPPUNIT_TEST(testInsertDeletePageInvalidation);
CPPUNIT_TEST(testSpellOnlineRenderParameter);
-
+ CPPUNIT_TEST(testSlideDuplicateUndo);
+ CPPUNIT_TEST(testMoveShapeHandle);
+ CPPUNIT_TEST(testDeleteTable);
+ CPPUNIT_TEST(testShapeEditInMultipleViews);
CPPUNIT_TEST_SUITE_END();
private:
@@ -729,6 +740,30 @@ void SdTiledRenderingTest::testInsertTable()
CPPUNIT_ASSERT(aPos.Y() != 0);
}
+void SdTiledRenderingTest::testDeleteTable()
+{
+ SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+
+ uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
+ {
+ { "Rows", uno::makeAny(sal_Int32(3)) },
+ { "Columns", uno::makeAny(sal_Int32(5)) }
+ }));
+
+ comphelper::dispatchCommand(".uno:InsertTable", aArgs);
+ Scheduler::ProcessEventsToIdle();
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdrView* pSdrView = pViewShell->GetView();
+ const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+ CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 1);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | awt::Key::A);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_MOD1 | awt::Key::A);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DELETE);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(rMarkList.GetMarkCount() == 0);
+}
+
void SdTiledRenderingTest::testPartHash()
{
SdXImpressDocument* pDoc = createDoc("dummy.odp");
@@ -860,6 +895,7 @@ public:
std::map<int, bool> m_aViewCursorVisibilities;
bool m_bViewSelectionSet;
boost::property_tree::ptree m_aCommentCallbackResult;
+ OString m_ShapeSelection;
ViewCallback()
: m_bGraphicSelectionInvalidated(false),
@@ -911,6 +947,7 @@ public:
case LOK_CALLBACK_GRAPHIC_SELECTION:
{
m_bGraphicSelectionInvalidated = true;
+ m_ShapeSelection = OString(pPayload);
}
break;
case LOK_CALLBACK_GRAPHIC_VIEW_SELECTION:
@@ -1055,9 +1092,6 @@ void SdTiledRenderingTest::testCursorViews()
// second view as well, even if the second view was created after begin
// text edit in the first view.
ViewCallback aView2;
- // This failed: the second view didn't get a lock notification, even if the
- // first view already started text edit.
- CPPUNIT_ASSERT(aView2.m_bViewLock);
SfxLokHelper::setView(nView1);
aView2.m_bTilesInvalidated = false;
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
@@ -1283,6 +1317,38 @@ void SdTiledRenderingTest::testUndoLimiting()
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(pViewShell1->GetView()->IsTextEdit());
+ // View2 UNDO stack should be empty
+ {
+ SfxRequest aReq2(SID_UNDO, SfxCallMode::SLOT, pXImpressDocument->GetDocShell()->GetDoc()->GetPool());
+ aReq2.AppendItem(SfxUInt16Item(SID_UNDO, 1));
+ pViewShell2->ExecuteSlot(aReq2);
+ const auto* pReturnValue = aReq2.GetReturnValue();
+ CPPUNIT_ASSERT(!pReturnValue);
+ }
+
+ // View1 can UNDO
+ {
+ SfxRequest aReq1(SID_UNDO, SfxCallMode::SLOT, pXImpressDocument->GetDocShell()->GetDoc()->GetPool());
+ aReq1.AppendItem(SfxUInt16Item(SID_UNDO, 1));
+ pViewShell1->ExecuteSlot(aReq1);
+ CPPUNIT_ASSERT(aReq1.IsDone());
+ }
+
+ // View1 can REDO
+ {
+ SfxRequest aReq1(SID_REDO, SfxCallMode::SLOT, pXImpressDocument->GetDocShell()->GetDoc()->GetPool());
+ aReq1.AppendItem(SfxUInt16Item(SID_REDO, 1));
+ pViewShell1->ExecuteSlot(aReq1);
+ CPPUNIT_ASSERT(aReq1.IsDone());
+ }
+
+ // Exit text edit mode
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::ESCAPE);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::ESCAPE);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(!pViewShell1->GetView()->IsTextEdit());
+
// Now check view2 cannot undo actions.
{
SfxRequest aReq2(SID_UNDO, SfxCallMode::SLOT, pXImpressDocument->GetDocShell()->GetDoc()->GetPool());
@@ -1921,15 +1987,138 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage()
CPPUNIT_ASSERT_EQUAL(4, pXImpressDocument->getPart());
}
+void SdTiledRenderingTest::testMultiViewInsertDeletePage2()
+{
+ // Load the document.
+ SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+ ViewCallback aView1;
+ int nView1 = SfxLokHelper::getView();
+ uno::Sequence<beans::PropertyValue> aArgs;
+ SdDrawDocument* pDoc = pXImpressDocument->GetDocShell()->GetDoc();
+
+ // Create second view
+ SfxLokHelper::createView();
+ pXImpressDocument->initializeForTiledRendering(aArgs);
+ ViewCallback aView2;
+ int nView2 = SfxLokHelper::getView();
+
+ // the document has 8 slides
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(8), pDoc->GetSdPageCount(PageKind::Standard));
+
+ // Switch to 5th page in 2nd view
+ pXImpressDocument->setPart(4);
+
+ // Begin text edit on the only object on the slide.
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdPage* pActualPage = pViewShell->GetActualPage();
+ SdrObject* pObject1 = pActualPage->GetObj(0);
+ CPPUNIT_ASSERT(pObject1 != nullptr);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject1->GetObjIdentifier());
+ SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1);
+
+ // Double-click outside the text to enter edit mode.
+ const ::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
+ const auto cornerX = convertMm100ToTwip(aRect.getX() + (aRect.getWidth() / 4));
+ const auto cornerY = convertMm100ToTwip(aRect.getY() + (aRect.getHeight() / 4));
+ pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
+ cornerX, cornerY,
+ 2, MOUSE_LEFT, 0);
+ pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
+ cornerX, cornerY,
+ 2, MOUSE_LEFT, 0);
+ Scheduler::ProcessEventsToIdle();
+
+ // We must be in text editing mode and have cursor visible.
+ CPPUNIT_ASSERT(pViewShell->GetView()->IsTextEdit());
+
+ // Insert slide in 1st view
+ SfxLokHelper::setView(nView1);
+ comphelper::dispatchCommand(".uno:InsertPage", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ // See if the current slide number changed in 2nd view too
+ SfxLokHelper::setView(nView2);
+ CPPUNIT_ASSERT_EQUAL(5, pXImpressDocument->getPart());
+
+ // Delete the page in 1st view now
+ SfxLokHelper::setView(nView1);
+ comphelper::dispatchCommand(".uno:DeletePage", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ // See if current slide number changed in 2nd view too
+ SfxLokHelper::setView(nView2);
+ CPPUNIT_ASSERT_EQUAL(4, pXImpressDocument->getPart());
+
+ // We must be still in text editing mode and have cursor visible.
+ CPPUNIT_ASSERT(pViewShell->GetView()->IsTextEdit());
+}
+
+void SdTiledRenderingTest::testEditingTextBoxAndInsertShapeInterrupt()
+{
+ // Load the document.
+ SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+ ViewCallback aView1;
+ int nView1 = SfxLokHelper::getView();
+ uno::Sequence<beans::PropertyValue> aArgs;
+
+ // Create second view
+ SfxLokHelper::createView();
+ pXImpressDocument->initializeForTiledRendering(aArgs);
+ ViewCallback aView2;
+ int nView2 = SfxLokHelper::getView();
+
+ // Switch to 5th page in 2nd view
+ pXImpressDocument->setPart(4);
+
+ // Begin text edit on the only object on the slide.
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdPage* pActualPage = pViewShell->GetActualPage();
+ SdrObject* pObject1 = pActualPage->GetObj(0);
+ CPPUNIT_ASSERT(pObject1 != nullptr);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject1->GetObjIdentifier());
+ SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1);
+
+ // Double-click outside the text to enter edit mode.
+ const ::tools::Rectangle aRect = pTextObject->GetCurrentBoundRect();
+ const auto cornerX = convertMm100ToTwip(aRect.getX() + (aRect.getWidth() / 4));
+ const auto cornerY = convertMm100ToTwip(aRect.getY() + (aRect.getHeight() / 4));
+ pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
+ cornerX, cornerY,
+ 2, MOUSE_LEFT, 0);
+ pXImpressDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP,
+ cornerX, cornerY,
+ 2, MOUSE_LEFT, 0);
+ Scheduler::ProcessEventsToIdle();
+
+ // We must be in text editing mode and have cursor visible.
+ CPPUNIT_ASSERT(pViewShell->GetView()->IsTextEdit());
+
+ // Insert shape in 1st view
+ SfxLokHelper::setView(nView1);
+ comphelper::dispatchCommand(".uno:BasicShapes.rectangle", aArgs);
+
+ // We must be still in text editing mode and have cursor visible.
+ SfxLokHelper::setView(nView2);
+ CPPUNIT_ASSERT(pViewShell->GetView()->IsTextEdit());
+}
+
void SdTiledRenderingTest::testDisableUndoRepair()
{
// Load the document.
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+
+ // Create View 1
SfxViewShell* pView1 = SfxViewShell::Current();
+ sd::ViewShell* pViewShell1 = pXImpressDocument->GetDocShell()->GetViewShell();
int nView1 = SfxLokHelper::getView();
+
+ // Create View 2
SfxLokHelper::createView();
SfxViewShell* pView2 = SfxViewShell::Current();
+ sd::ViewShell* pViewShell2 = pXImpressDocument->GetDocShell()->GetViewShell();
int nView2 = SfxLokHelper::getView();
+
+ // Check UNDO is disabled
{
std::unique_ptr<SfxPoolItem> pItem1;
std::unique_ptr<SfxPoolItem> pItem2;
@@ -1944,15 +2133,24 @@ void SdTiledRenderingTest::testDisableUndoRepair()
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'h', 0);
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'h', 0);
Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(pViewShell1->GetView()->IsTextEdit());
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::ESCAPE);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::ESCAPE);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(!pViewShell1->GetView()->IsTextEdit());
+
+ // Check
{
std::unique_ptr<SfxPoolItem> xItem1;
- std::unique_ptr<SfxPoolItem> xItem2;
pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem1);
+ const auto* pUInt32Item1 = dynamic_cast<const SfxUInt32Item*>(xItem1.get());
+ CPPUNIT_ASSERT(!pUInt32Item1);
+
+ std::unique_ptr<SfxPoolItem> xItem2;
pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem2);
- CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(xItem1.get()));
- const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item*>(xItem2.get());
- CPPUNIT_ASSERT(pUInt32Item);
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item->GetValue());
+ const auto* pUInt32Item2 = dynamic_cast<const SfxUInt32Item*>(xItem2.get());
+ CPPUNIT_ASSERT(pUInt32Item2);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item2->GetValue());
}
// Insert a character in the second view.
@@ -1963,15 +2161,23 @@ void SdTiledRenderingTest::testDisableUndoRepair()
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'c', 0);
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'c', 0);
Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(pViewShell2->GetView()->IsTextEdit());
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::ESCAPE);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::ESCAPE);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(!pViewShell2->GetView()->IsTextEdit());
+
+ // Check
{
std::unique_ptr<SfxPoolItem> xItem1;
- std::unique_ptr<SfxPoolItem> xItem2;
pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem1);
- pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem2);
- CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(xItem2.get()));
const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item*>(xItem1.get());
CPPUNIT_ASSERT(pUInt32Item);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item->GetValue());
+
+ std::unique_ptr<SfxPoolItem> xItem2;
+ pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem2);
+ CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(xItem2.get()));
}
}
@@ -1988,17 +2194,20 @@ void SdTiledRenderingTest::testDocumentRepair()
SfxLokHelper::createView();
SfxViewShell* pView2 = SfxViewShell::Current();
int nView2 = SfxLokHelper::getView();
+ sd::ViewShell* pViewShell2 = pXImpressDocument->GetDocShell()->GetViewShell();
+
CPPUNIT_ASSERT(pView1 != pView2);
{
std::unique_ptr<SfxPoolItem> xItem1;
- std::unique_ptr<SfxPoolItem> xItem2;
pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem1);
- pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem2);
const SfxBoolItem* pItem1 = dynamic_cast<const SfxBoolItem*>(xItem1.get());
- const SfxBoolItem* pItem2 = dynamic_cast<const SfxBoolItem*>(xItem2.get());
CPPUNIT_ASSERT(pItem1);
- CPPUNIT_ASSERT(pItem2);
CPPUNIT_ASSERT_EQUAL(false, pItem1->GetValue());
+
+ std::unique_ptr<SfxPoolItem> xItem2;
+ pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem2);
+ const SfxBoolItem* pItem2 = dynamic_cast<const SfxBoolItem*>(xItem2.get());
+ CPPUNIT_ASSERT(pItem2);
CPPUNIT_ASSERT_EQUAL(false, pItem2->GetValue());
}
@@ -2010,16 +2219,23 @@ void SdTiledRenderingTest::testDocumentRepair()
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'c', 0);
pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'c', 0);
Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(pViewShell2->GetView()->IsTextEdit());
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::ESCAPE);
+ pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::ESCAPE);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(!pViewShell2->GetView()->IsTextEdit());
+
{
std::unique_ptr<SfxPoolItem> xItem1;
- std::unique_ptr<SfxPoolItem> xItem2;
pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem1);
- pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem2);
const SfxBoolItem* pItem1 = dynamic_cast<const SfxBoolItem*>(xItem1.get());
- const SfxBoolItem* pItem2 = dynamic_cast<const SfxBoolItem*>(xItem2.get());
CPPUNIT_ASSERT(pItem1);
- CPPUNIT_ASSERT(pItem2);
CPPUNIT_ASSERT_EQUAL(true, pItem1->GetValue());
+
+ std::unique_ptr<SfxPoolItem> xItem2;
+ pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem2);
+ const SfxBoolItem* pItem2 = dynamic_cast<const SfxBoolItem*>(xItem2.get());
+ CPPUNIT_ASSERT(pItem2);
CPPUNIT_ASSERT_EQUAL(true, pItem2->GetValue());
}
}
@@ -2250,21 +2466,9 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObject);
CPPUNIT_ASSERT(pTextObj);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TEXT), pTextObj->GetObjIdentifier());
- // This test is unreliable: it gives alternating results for the following coordinates.
- // As a compromise, instead of disabling it altogether, we allow for both sets of values.
const Point aPos = pTextObj->GetLastBoundRect().TopLeft();
- if (aPos.getX() < 10000)
- {
- // We get this with 'make CppunitTest_sd_tiledrendering'
- CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(6739), aPos.getX(), 100);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(6822), aPos.getY(), 100);
- }
- else
- {
- // We get this with 'make check'
- CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(12990), aPos.getX(), 100);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(7393), aPos.getY(), 100);
- }
+ CPPUNIT_ASSERT_EQUAL(static_cast<long>(0), aPos.getX());
+ CPPUNIT_ASSERT_EQUAL(static_cast<long>(0), aPos.getY());
}
void SdTiledRenderingTest::testTdf115873()
@@ -2445,6 +2649,341 @@ void SdTiledRenderingTest::testSpellOnlineRenderParameter()
CPPUNIT_ASSERT_EQUAL(!bSet, pXImpressDocument->GetDoc()->GetOnlineSpell());
}
+void SdTiledRenderingTest::testSlideDuplicateUndo()
+{
+ // Create two views.
+ SdXImpressDocument* pXImpressDocument = createDoc("duplicate-undo.odp");
+ int nView0 = SfxLokHelper::getView();
+ SfxLokHelper::createView();
+ pXImpressDocument->initializeForTiledRendering({});
+ int nView1 = SfxLokHelper::getView();
+ SfxLokHelper::setView(nView0);
+
+ // Switch to the 3rd slide on view 0, and start text editing.
+ {
+ pXImpressDocument->setPart(2);
+ sd::ViewShell* pViewShell0 = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdrView* pView = pViewShell0->GetView();
+ SdPage* pActualPage = pViewShell0->GetActualPage();
+ SdrObject* pObject = pActualPage->GetObj(1);
+ SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObject);
+ pView->MarkObj(pTextObj, pView->GetSdrPageView());
+ SfxStringItem aInputString(SID_ATTR_CHAR, "x");
+ pViewShell0->GetViewFrame()->GetDispatcher()->ExecuteList(SID_ATTR_CHAR,
+ SfxCallMode::SYNCHRON, { &aInputString });
+ CPPUNIT_ASSERT(pView->IsTextEdit());
+ CPPUNIT_ASSERT(pView->GetTextEditPageView());
+ }
+
+ // Duplicate the first slide on view 1 and undo it.
+ SfxLokHelper::setView(nView1);
+ comphelper::dispatchCommand(".uno:DuplicatePage", {});
+ Scheduler::ProcessEventsToIdle();
+ pXImpressDocument->setPart(0, /*bAllowChangeFocus=*/false);
+ pXImpressDocument->setPart(1, /*bAllowChangeFocus=*/false);
+ SfxLokHelper::setView(nView0);
+ pXImpressDocument->setPart(0, /*bAllowChangeFocus=*/false);
+ pXImpressDocument->setPart(3, /*bAllowChangeFocus=*/false);
+ SfxLokHelper::setView(nView1);
+ pXImpressDocument->getUndoManager()->undo();
+ // Without the accompanying fix in place, this would have tried to access the outdated page view
+ // pointer, potentially leading to a crash.
+ pXImpressDocument->setPart(2, /*bAllowChangeFocus=*/false);
+
+ // Make sure that view 0 now doesn't have an outdated page view pointer.
+ SfxLokHelper::setView(nView0);
+ sd::ViewShell* pViewShell0 = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdrView* pView0 = pViewShell0->GetView();
+ CPPUNIT_ASSERT(!pView0->GetTextEditPageView());
+}
+
+static void lcl_extractHandleParameters(const OString& selection, int& id, int& x, int& y)
+{
+ OString extraInfo = selection.copy(selection.indexOf("{"));
+ std::stringstream aStream(extraInfo.getStr());
+ boost::property_tree::ptree aTree;
+ boost::property_tree::read_json(aStream, aTree);
+ boost::property_tree::ptree
+ handle0 = aTree
+ .get_child("handles")
+ .get_child("kinds")
+ .get_child("rectangle")
+ .get_child("1")
+ .begin()->second;
+ id = handle0.get_child("id").get_value<int>();
+ x = handle0.get_child("point").get_child("x").get_value<int>();
+ y = handle0.get_child("point").get_child("y").get_value<int>();
+}
+
+void SdTiledRenderingTest::testMoveShapeHandle()
+{
+ SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
+ ViewCallback aView1;
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdPage* pPage = pViewShell->GetActualPage();
+ SdrObject* pObject = pPage->GetObj(0);
+ SdrView* pView = pViewShell->GetView();
+ pView->MarkObj(pObject, pView->GetSdrPageView());
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+ {
+ int id, x, y;
+ lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+ int oldX = x;
+ int oldY = y;
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
+ {
+ {"HandleNum", uno::makeAny(id)},
+ {"NewPosX", uno::makeAny(x+1)},
+ {"NewPosY", uno::makeAny(y+1)}
+ }));
+ comphelper::dispatchCommand(".uno:MoveShapeHandle", aPropertyValues);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
+ lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
+ CPPUNIT_ASSERT_EQUAL(x-1, oldX);
+ CPPUNIT_ASSERT_EQUAL(y-1, oldY);
+ }
+}
+
+void SdTiledRenderingTest::testShapeEditInMultipleViews()
+{
+ SdXImpressDocument* pXImpressDocument = createDoc("TextBoxAndRect.odg");
+ pXImpressDocument->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
+ SdDrawDocument* pDocument = pXImpressDocument->GetDoc();
+
+ // Create view 1
+ const int nView1 = SfxLokHelper::getView();
+ sd::ViewShell* pViewShell1 = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdrView* pView1 = pViewShell1->GetView();
+ Scheduler::ProcessEventsToIdle();
+
+ // Create view 2
+ SfxLokHelper::createView();
+ const int nView2 = SfxLokHelper::getView();
+ CPPUNIT_ASSERT(nView1 != nView2);
+
+ sd::ViewShell* pViewShell2 = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdrView* pView2 = pViewShell2->GetView();
+ Scheduler::ProcessEventsToIdle();
+
+ // Switch to view 1
+ SfxLokHelper::setView(nView1);
+
+ SdPage* pPage1 = pViewShell1->GetActualPage();
+
+ SdrObject* pTextBoxObject = pPage1->GetObj(0);
+ CPPUNIT_ASSERT_EQUAL(OUString("Text Box"), pTextBoxObject->GetName());
+
+ SdrObject* pRectangleObject = pPage1->GetObj(1);
+ CPPUNIT_ASSERT_EQUAL(OUString("Rect"), pRectangleObject->GetName());
+
+ SdrObject* pTableObject = pPage1->GetObj(2);
+ CPPUNIT_ASSERT_EQUAL(OUString("Table1"), pTableObject->GetName());
+
+ // Scenario 1
+ // 2 shapes - "Text Box" and "Rect"
+ // View1 - "Text Box" enters text edit mode, View 2 - moves the "Rect" around
+ {
+ sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
+ CPPUNIT_ASSERT_EQUAL(size_t(0), pUndoManager->GetUndoActionCount());
+
+ pView1->SdrBeginTextEdit(pTextBoxObject);
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // Local undo count for View1 is 0
+ CPPUNIT_ASSERT_EQUAL(size_t(0), pView1->getViewLocalUndoManager()->GetUndoActionCount());
+ // Write 'test' in View1
+ SfxStringItem aInputString(SID_ATTR_CHAR, "test");
+ pViewShell1->GetViewFrame()->GetDispatcher()->ExecuteList(SID_ATTR_CHAR, SfxCallMode::SYNCHRON, { &aInputString });
+ // Local undo count for View1 is now 1
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pView1->getViewLocalUndoManager()->GetUndoActionCount());
+
+ // Mark rectangle object
+ pView2->MarkObj(pRectangleObject, pView2->GetSdrPageView());
+
+ // Check the initial position of the object
+ tools::Rectangle aRectangle = pRectangleObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(6250L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(7000L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(6501L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(4501L, aRectangle.GetHeight());
+
+ // On View2 - Move handle 0 on the shape to a new mosition - resize
+ Point aNewPosition = aRectangle.TopLeft() + Point(-1250, -1000);
+ pView2->MoveShapeHandle(0, aNewPosition, -1);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pUndoManager->GetUndoActionCount());
+
+ // Check the object has a new size
+ aRectangle = pRectangleObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(5000L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(6000L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(7751L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(5501L, aRectangle.GetHeight());
+
+ // View1 is still in text edit mode...
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // On View2 - relative move the shape to a different position
+ pView2->MoveMarkedObj(Size(1000, 2000), /*bCopy=*/false);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(2), pUndoManager->GetUndoActionCount());
+
+ // Check the object is at a different position
+ aRectangle = pRectangleObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(6000L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(8000L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(7751L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(5501L, aRectangle.GetHeight());
+
+ // View1 is still in text edit mode...
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // End Text edit - check undo count increase from 2 -> 3
+ CPPUNIT_ASSERT_EQUAL(size_t(2), pUndoManager->GetUndoActionCount());
+ pView1->SdrEndTextEdit();
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(3), pUndoManager->GetUndoActionCount());
+
+ // Check that both views exited the text edit mode
+ CPPUNIT_ASSERT_EQUAL(false, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+ }
+
+ // Scenario 2
+ // 1 shapes - "Text Box"
+ // View1 - "Text Box" enters text edit mode, View 2 - moves the "Text Box" around
+ {
+ sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
+ CPPUNIT_ASSERT_EQUAL(size_t(3), pUndoManager->GetUndoActionCount());
+
+ pView1->SdrBeginTextEdit(pTextBoxObject);
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // Local undo count for View1 is 0
+ CPPUNIT_ASSERT_EQUAL(size_t(0), pView1->getViewLocalUndoManager()->GetUndoActionCount());
+ // Write 'test' in View1
+ SfxStringItem aInputString(SID_ATTR_CHAR, "test");
+ pViewShell1->GetViewFrame()->GetDispatcher()->ExecuteList(SID_ATTR_CHAR, SfxCallMode::SYNCHRON, { &aInputString });
+ // Local undo count for View1 is now 1
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pView1->getViewLocalUndoManager()->GetUndoActionCount());
+
+ // Mark rectangle object
+ pView2->MarkObj(pTextBoxObject, pView2->GetSdrPageView());
+
+ // Check the initial position of the object
+ tools::Rectangle aRectangle = pTextBoxObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(2250L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(2000L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(4501L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(2001L, aRectangle.GetHeight());
+
+ // On View2 - Move handle 0 on the shape to a new mosition - resize
+ Point aNewPosition = aRectangle.TopLeft() + Point(-1250, -1000);
+ pView2->MoveShapeHandle(0, aNewPosition, -1);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(4), pUndoManager->GetUndoActionCount());
+
+ // Check the object has a new size
+ aRectangle = pTextBoxObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(1000L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(1000L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(4990L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(2175L, aRectangle.GetHeight());
+
+ // View1 is still in text edit mode...
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // On View2 - relative move the shape to a different position
+ pView2->MoveMarkedObj(Size(1000, 2000), /*bCopy=*/false);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(5), pUndoManager->GetUndoActionCount());
+
+ // Check the object is at a different position
+ aRectangle = pTextBoxObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(2000L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(3000L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(4990L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(2175L, aRectangle.GetHeight());
+
+ // View1 is still in text edit mode...
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // End Text edit - check undo count increase from 5 -> 6
+ CPPUNIT_ASSERT_EQUAL(size_t(5), pUndoManager->GetUndoActionCount());
+ pView1->SdrEndTextEdit();
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(6), pUndoManager->GetUndoActionCount());
+
+ // Check that both views exited the text edit mode
+ CPPUNIT_ASSERT_EQUAL(false, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+ }
+
+ // Scenario 3
+ // 1 shapes - "Table1"
+ // View1 - "Table1" enters text edit mode, View 2 - moves the "Table1" around
+ {
+ sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
+ CPPUNIT_ASSERT_EQUAL(size_t(6), pUndoManager->GetUndoActionCount());
+
+ pView1->SdrBeginTextEdit(pTableObject);
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // Local undo count for View1 is 0
+ CPPUNIT_ASSERT_EQUAL(size_t(0), pView1->getViewLocalUndoManager()->GetUndoActionCount());
+ // Write 'test' in View1
+ SfxStringItem aInputString(SID_ATTR_CHAR, "test");
+ pViewShell1->GetViewFrame()->GetDispatcher()->ExecuteList(SID_ATTR_CHAR, SfxCallMode::SYNCHRON, { &aInputString });
+ // Local undo count for View1 is now 1
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pView1->getViewLocalUndoManager()->GetUndoActionCount());
+
+ // Mark rectangle object
+ pView2->MarkObj(pTableObject, pView2->GetSdrPageView());
+
+ // Check the initial position of the table
+ tools::Rectangle aRectangle = pTableObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(2919L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(18063L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(14099L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(5999L, aRectangle.GetHeight());
+
+ // On View2 - relative move the shape to a different position
+ pView2->MoveMarkedObj(Size(1000, 2000), /*bCopy=*/false);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(7), pUndoManager->GetUndoActionCount());
+
+ // Check the object is at a different position
+ aRectangle = pTableObject->GetLogicRect();
+ CPPUNIT_ASSERT_EQUAL(3919L, aRectangle.TopLeft().X());
+ CPPUNIT_ASSERT_EQUAL(20063L, aRectangle.TopLeft().Y());
+ CPPUNIT_ASSERT_EQUAL(14099L, aRectangle.GetWidth());
+ CPPUNIT_ASSERT_EQUAL(5999L, aRectangle.GetHeight());
+
+ // View1 is still in text edit mode...
+ CPPUNIT_ASSERT_EQUAL(true, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+
+ // End Text edit - check undo count increase from 7 -> 8
+ CPPUNIT_ASSERT_EQUAL(size_t(7), pUndoManager->GetUndoActionCount());
+ pView1->SdrEndTextEdit();
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT_EQUAL(size_t(8), pUndoManager->GetUndoActionCount());
+
+ // Check that both views exited the text edit mode
+ CPPUNIT_ASSERT_EQUAL(false, pView1->IsTextEdit());
+ CPPUNIT_ASSERT_EQUAL(false, pView2->IsTextEdit());
+ }
+}
CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 738b09a3fd7d..274160105156 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -13,6 +13,7 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <comphelper/processfactory.hxx>
@@ -20,6 +21,7 @@
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/intitem.hxx>
+#include <svl/srchitem.hxx>
#include <svx/svxids.hrc>
#include <svx/svdoashp.hxx>
#include <svx/svdotable.hxx>
@@ -38,6 +40,7 @@
#include <comphelper/propertysequence.hxx>
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <svx/xflclit.hxx>
+#include <vcl/scheduler.hxx>
using namespace ::com::sun::star;
@@ -51,6 +54,8 @@ protected:
public:
virtual void setUp() override;
virtual void tearDown() override;
+
+ void checkCurrentPageNumber(sal_uInt16 nNum);
};
void SdUiImpressTest::setUp()
@@ -69,6 +74,18 @@ void SdUiImpressTest::tearDown()
test::BootstrapFixture::tearDown();
}
+void SdUiImpressTest::checkCurrentPageNumber(sal_uInt16 nNum)
+{
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawView> xDrawView(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xPage(xDrawView->getCurrentPage(), uno::UNO_SET_THROW);
+ uno::Reference<beans::XPropertySet> xPropertySet(xPage, uno::UNO_QUERY);
+
+ sal_uInt16 nPageNumber;
+ xPropertySet->getPropertyValue("Number") >>= nPageNumber;
+ CPPUNIT_ASSERT_EQUAL(nNum, nPageNumber);
+}
+
CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf111522)
{
// Load the document and create two new windows.
@@ -200,6 +217,43 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf128651)
CPPUNIT_ASSERT_EQUAL_MESSAGE("Redo changes width", nUndoWidth, nRedoWidth);
}
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127481)
+{
+ mxComponent = loadFromDesktop("private:factory/simpress",
+ "com.sun.star.presentation.PresentationDocument");
+
+ CPPUNIT_ASSERT(mxComponent.is());
+
+ auto pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ SdPage* pActualPage = pViewShell->GetActualPage();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pActualPage->GetObjCount());
+
+ uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
+ { { "Rows", uno::makeAny(sal_Int32(1)) }, { "Columns", uno::makeAny(sal_Int32(1)) } }));
+
+ dispatchCommand(mxComponent, ".uno:InsertTable", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pActualPage->GetObjCount());
+
+ dispatchCommand(mxComponent, ".uno:DuplicatePage", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ checkCurrentPageNumber(2);
+
+ pActualPage = pViewShell->GetActualPage();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pActualPage->GetObjCount());
+
+ auto pTableObject = dynamic_cast<sdr::table::SdrTableObj*>(pActualPage->GetObj(2));
+ CPPUNIT_ASSERT(pTableObject);
+
+ //without the fix, it would crash here
+ pViewShell->GetView()->SdrBeginTextEdit(pTableObject);
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pActualPage->GetObjCount());
+}
+
namespace
{
void dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand,
@@ -282,16 +336,41 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testSpellOnlineParameter)
auto pImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
bool bSet = pImpressDocument->GetDoc()->GetOnlineSpell();
- uno::Sequence<beans::PropertyValue> params(comphelper::InitPropertySequence({{"Enable", uno::makeAny(!bSet)}}));
+ uno::Sequence<beans::PropertyValue> params(
+ comphelper::InitPropertySequence({ { "Enable", uno::makeAny(!bSet) } }));
dispatchCommand(mxComponent, ".uno:SpellOnline", params);
CPPUNIT_ASSERT_EQUAL(!bSet, pImpressDocument->GetDoc()->GetOnlineSpell());
// set the same state as now and we don't expect any change (no-toggle)
- params = comphelper::InitPropertySequence({{"Enable", uno::makeAny(!bSet)}});
+ params = comphelper::InitPropertySequence({ { "Enable", uno::makeAny(!bSet) } });
dispatchCommand(mxComponent, ".uno:SpellOnline", params);
CPPUNIT_ASSERT_EQUAL(!bSet, pImpressDocument->GetDoc()->GetOnlineSpell());
}
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testSearchAllInDocumentAndNotes)
+{
+ // tdf#142478
+ // "find all" produces a crash when the search string exists in notes
+ // and the document
+
+ mxComponent = loadFromDesktop(
+ m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/search-all-notes.odp"));
+
+ auto pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+ sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
+ CPPUNIT_ASSERT(pViewShell);
+
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({
+ { "SearchItem.SearchString", uno::makeAny(OUString("Crash")) },
+ { "SearchItem.Backward", uno::makeAny(false) },
+ { "SearchItem.Command", uno::makeAny(sal_uInt16(SvxSearchCmd::FIND_ALL)) },
+ }));
+
+ dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
+
+ Scheduler::ProcessEventsToIdle();
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 440515544003..3de2e0ff397b 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -76,6 +76,11 @@ interface DrawView
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
+ SID_GRAPHIC_SIZE_CHECK
+ [
+ ExecMethod = FuTemporary ;
+ StateMethod = GetMenuState ;
+ ]
SID_EXTERNAL_EDIT
[
ExecMethod = FuTemporary ;
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index a675db0efb5e..4efd8ec9e6a7 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -3594,7 +3594,7 @@ SfxBoolItem MasterSlidesPanel SID_MASTER_SLIDES_PANEL
GroupId = SfxGroupId::Modify;
]
-SfxVoidItem SlideMasterPage SID_SLIDE_MASTER_MODE
+SfxBoolItem SlideMasterPage SID_SLIDE_MASTER_MODE
()
[
AutoUpdate = FALSE,
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 93074a90ce41..65e254c4b400 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -135,6 +135,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
, mbEmbedFontScriptLatin(true)
, mbEmbedFontScriptAsian(true)
, mbEmbedFontScriptComplex(true)
+, mnImagePreferredDPI(0)
{
mpDrawPageListWatcher.reset(new ImpDrawPageListWatcher(*this));
mpMasterPageListWatcher.reset(new ImpMasterPageListWatcher(*this));
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx
index d4f2b618f25d..eefec66f0432 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -119,6 +119,15 @@ private:
static void WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExport& rDML, const css::uno::Reference<css::drawing::XShape>& rXShape, int nDiagramId);
+ /** Create a new placeholder index for a master placeholder shape
+
+ @param rXShape Master placeholder shape
+ @returns Placeholder index
+ */
+ unsigned CreateNewPlaceholderIndex(const css::uno::Reference<css::drawing::XShape>& rXShape);
+ css::uno::Reference<css::drawing::XShape> GetReferencedPlaceholderXShape(const PlaceholderType eType, PageType ePageType) const;
+ void WritePlaceholderReferenceShapes(PowerPointShapeExport& rDML, PageType ePageType);
+
/// Should we export as .pptm, ie. do we contain macros?
bool mbPptm;
@@ -141,6 +150,10 @@ private:
::oox::drawingml::ShapeExport::ShapeHashMap maShapeMap;
+ unsigned mnPlaceholderIndexMax; ///< Last used placeholder index
+ /// Map of placeholder indexes for Master placeholders
+ std::unordered_map< css::uno::Reference<css::drawing::XShape>, unsigned > maPlaceholderShapeToIndexMap;
+
struct AuthorComments {
sal_Int32 nId;
sal_Int32 nLastIndex;
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 8a7db7302ff0..5e93fbb446bf 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -28,6 +28,7 @@
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/storagehelper.hxx>
+#include <comphelper/xmltools.hxx>
#include <sax/fshelper.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
@@ -52,6 +53,10 @@
#include "pptx-animations.hxx"
#include "../ppt/pptanimations.hxx"
+#include <svx/svdpage.hxx>
+#include <svx/unoapi.hxx>
+#include <sdpage.hxx>
+
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <utility>
@@ -109,7 +114,11 @@ public:
ShapeExport& WriteTextShape(const Reference< XShape >& xShape) override;
ShapeExport& WriteUnknownShape(const Reference< XShape >& xShape) override;
ShapeExport& WritePlaceholderShape(const Reference< XShape >& xShape, PlaceholderType ePlaceholder);
+ /** Writes a placeholder shape that references the placeholder on the master slide */
+ ShapeExport& WritePlaceholderReferenceShape(PlaceholderType ePlaceholder, unsigned nReferencedPlaceholderIdx, PageType ePageType, Reference<XPropertySet>& rXPagePropSet);
ShapeExport& WritePageShape(const Reference< XShape >& xShape, PageType ePageType, bool bPresObj);
+ /** Writes textbody of a placeholder that references the placeholder on the master slide */
+ ShapeExport& WritePlaceholderReferenceTextBody(PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet> xPagePropSet);
// helper parts
bool WritePlaceholder(const Reference< XShape >& xShape, PlaceholderType ePlaceholder, bool bMaster);
@@ -128,8 +137,35 @@ void WriteSndAc(const FSHelperPtr& pFS, const OUString& sSoundRelId, const OUStr
pFS->endElement(FSNS(XML_p, XML_stSnd));
pFS->endElement(FSNS(XML_p, XML_sndAc));
}
-}
+const char* getPlaceholderTypeName(PlaceholderType ePlaceholder)
+{
+ switch (ePlaceholder)
+ {
+ case SlideImage:
+ return "sldImg";
+ case Notes:
+ return "body";
+ case Header:
+ return "hdr";
+ case Footer:
+ return "ftr";
+ case SlideNumber:
+ return "sldNum";
+ case DateAndTime:
+ return "dt";
+ case Outliner:
+ return "body";
+ case Title:
+ return "title";
+ case Subtitle:
+ return "subTitle";
+ default:
+ SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder);
+ return "";
+ }
+}
+}
}
}
@@ -335,6 +371,7 @@ PowerPointExport::PowerPointExport(const Reference< XComponentContext >& rContex
, mnAnimationNodeIdMax(1)
, mnDiagramId(1)
, mbCreateNotes(false)
+ , mnPlaceholderIndexMax(1)
{
comphelper::SequenceAsHashMap aArgumentsMap(rArguments);
mbPptm = aArgumentsMap.getUnpackedValueOrDefault("IsPPTM", false);
@@ -1412,6 +1449,8 @@ void PowerPointExport::WriteShapeTree(const FSHelperPtr& pFS, PageType ePageType
}
}
+ if ( ePageType == NORMAL || ePageType == LAYOUT )
+ WritePlaceholderReferenceShapes(aDML, ePageType);
pFS->endElementNS(XML_p, XML_spTree);
}
@@ -1449,41 +1488,22 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap
mpFS->endElementNS(XML_p, XML_cNvSpPr);
mpFS->startElementNS(XML_p, XML_nvPr);
- const char* pType = nullptr;
- switch (ePlaceholder)
+ bool bUsePlaceholderIndex
+ = ePlaceholder == Footer || ePlaceholder == DateAndTime || ePlaceholder == SlideNumber;
+ const char* pType = getPlaceholderTypeName(ePlaceholder);
+
+ SAL_INFO("sd.eppt", "write placeholder " << pType);
+ if (bUsePlaceholderIndex)
{
- case SlideImage:
- pType = "sldImg";
- break;
- case Notes:
- pType = "body";
- break;
- case Header:
- pType = "hdr";
- break;
- case Footer:
- pType = "ftr";
- break;
- case SlideNumber:
- pType = "sldNum";
- break;
- case DateAndTime:
- pType = "dt";
- break;
- case Outliner:
- pType = "body";
- break;
- case Title:
- pType = "title";
- break;
- case Subtitle:
- pType = "subTitle";
- break;
- default:
- SAL_INFO("sd.eppt", "warning: unhandled placeholder type: " << ePlaceholder);
+ mpFS->singleElementNS(
+ XML_p, XML_ph, XML_type, pType, XML_idx,
+ OString::number(
+ static_cast<PowerPointExport*>(GetFB())->CreateNewPlaceholderIndex(xShape)));
+ }
+ else
+ {
+ mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType);
}
- SAL_INFO("sd.eppt", "write placeholder " << pType);
- mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType);
mpFS->endElementNS(XML_p, XML_nvPr);
mpFS->endElementNS(XML_p, XML_nvSpPr);
@@ -1496,13 +1516,150 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderShape(const Reference< XShap
WriteBlipFill(xProps, "Graphic");
mpFS->endElementNS(XML_p, XML_spPr);
- WriteTextBox(xShape, XML_p);
+ WriteTextBox(xShape, XML_p, bUsePlaceholderIndex);
+
+ mpFS->endElementNS(XML_p, XML_sp);
+
+ return *this;
+}
+
+ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceShape(
+ PlaceholderType ePlaceholder, unsigned nReferencedPlaceholderIdx, PageType ePageType,
+ Reference<XPropertySet>& rXPagePropSet)
+{
+ mpFS->startElementNS(XML_p, XML_sp);
+
+ // non visual shape properties
+ mpFS->startElementNS(XML_p, XML_nvSpPr);
+ const OString aPlaceholderID("PlaceHolder " + OString::number(mnShapeIdMax++));
+ GetFS()->singleElementNS(XML_p, XML_cNvPr, XML_id, OString::number(mnShapeIdMax), XML_name,
+ aPlaceholderID.getStr());
+
+ mpFS->startElementNS(XML_p, XML_cNvSpPr);
+ mpFS->singleElementNS(XML_a, XML_spLocks, XML_noGrp, "1");
+ mpFS->endElementNS(XML_p, XML_cNvSpPr);
+ mpFS->startElementNS(XML_p, XML_nvPr);
+
+ const char* pType = getPlaceholderTypeName(ePlaceholder);
+ mpFS->singleElementNS(XML_p, XML_ph, XML_type, pType, XML_idx,
+ OString::number(nReferencedPlaceholderIdx));
+ mpFS->endElementNS(XML_p, XML_nvPr);
+ mpFS->endElementNS(XML_p, XML_nvSpPr);
+
+ // visual shape properties
+ mpFS->startElementNS(XML_p, XML_spPr);
+ mpFS->endElementNS(XML_p, XML_spPr);
+
+ WritePlaceholderReferenceTextBody(ePlaceholder, ePageType, rXPagePropSet);
mpFS->endElementNS(XML_p, XML_sp);
return *this;
}
+ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody(
+ PlaceholderType ePlaceholder, PageType ePageType, const Reference<XPropertySet> xPagePropSet)
+{
+ mpFS->startElementNS(XML_p, XML_txBody);
+ mpFS->singleElementNS(XML_a, XML_bodyPr);
+ mpFS->startElementNS(XML_a, XML_p);
+
+ switch (ePlaceholder)
+ {
+ case Header:
+ break;
+ case Footer:
+ {
+ OUString aFooterText;
+ if (ePageType == LAYOUT)
+ {
+ aFooterText = "Footer";
+ }
+ else
+ {
+ xPagePropSet->getPropertyValue("FooterText") >>= aFooterText;
+ }
+ mpFS->startElementNS(XML_a, XML_r);
+ mpFS->startElementNS(XML_a, XML_t);
+ mpFS->writeEscaped(aFooterText);
+ mpFS->endElementNS(XML_a, XML_t);
+ mpFS->endElementNS(XML_a, XML_r);
+ break;
+ }
+ case SlideNumber:
+ {
+ OUString aSlideNum;
+ sal_Int32 nSlideNum = 0;
+ if (ePageType == LAYOUT)
+ {
+ aSlideNum = "<#>";
+ }
+ else
+ {
+ xPagePropSet->getPropertyValue("Number") >>= nSlideNum;
+ aSlideNum = OUString::number(nSlideNum);
+ }
+ OString aUUID(comphelper::xml::generateGUIDString());
+ mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID.getStr(), XML_type, "slidenum");
+ mpFS->startElementNS(XML_a, XML_t);
+ mpFS->writeEscaped(aSlideNum);
+ mpFS->endElementNS(XML_a, XML_t);
+ mpFS->endElementNS(XML_a, XML_fld);
+ break;
+ }
+ case DateAndTime:
+ {
+ OUString aDateTimeType = "datetime1";
+ bool bIsDateTimeFixed = false;
+ xPagePropSet->getPropertyValue("IsDateTimeFixed") >>= bIsDateTimeFixed;
+
+ // Ideally "Date" should be replaced with the formatted date text
+ // but since variable datetime overrides the text, this seems fine for now.
+ OUString aDateTimeText = "Date";
+
+ if(ePageType != LAYOUT && !bIsDateTimeFixed)
+ {
+ sal_Int32 nDateTimeFormat = 0;
+ xPagePropSet->getPropertyValue("DateTimeFormat") >>= nDateTimeFormat;
+
+ // 4 LSBs represent the date
+ SvxDateFormat eDate = static_cast<SvxDateFormat>(nDateTimeFormat & 0x0f);
+ // the 4 bits after the date bits represent the time
+ SvxTimeFormat eTime = static_cast<SvxTimeFormat>(nDateTimeFormat >> 4);
+ aDateTimeType = GetDatetimeTypeFromDateTime(eDate, eTime);
+
+ if (aDateTimeType == "datetime")
+ aDateTimeType = "datetime1";
+ }
+
+ if(!bIsDateTimeFixed)
+ {
+ OString aUUID(comphelper::xml::generateGUIDString());
+ mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID.getStr(), XML_type, aDateTimeType.toUtf8());
+ }
+ else
+ {
+ xPagePropSet->getPropertyValue("DateTimeText") >>= aDateTimeText;
+ mpFS->startElementNS(XML_a, XML_r);
+ }
+
+ mpFS->startElementNS(XML_a, XML_t);
+ mpFS->writeEscaped(aDateTimeText);
+ mpFS->endElementNS(XML_a, XML_t);
+
+ mpFS->endElementNS(XML_a, bIsDateTimeFixed ? XML_r : XML_fld);
+ break;
+ }
+ default:
+ SAL_INFO("sd.eppt", "warning: no defined textbody for referenced placeholder type: "
+ << ePlaceholder);
+ }
+ mpFS->endElementNS(XML_a, XML_p);
+ mpFS->endElementNS(XML_p, XML_txBody);
+
+ return *this;
+}
+
#define SYS_COLOR_SCHEMES " <a:dk1>\
<a:sysClr val=\"windowText\" lastClr=\"000000\"/>\
</a:dk1>\
@@ -2011,6 +2168,106 @@ void PowerPointExport::WriteDiagram(const FSHelperPtr& pFS, PowerPointShapeExpor
pFS->endElementNS(XML_p, XML_graphicFrame);
}
+void PowerPointExport::WritePlaceholderReferenceShapes(PowerPointShapeExport& rDML, PageType ePageType)
+{
+ bool bCheckProps = ePageType == NORMAL;
+ Reference<XShape> xShape;
+ Any aAny;
+ OUString aText;
+ if (ePageType == LAYOUT
+ || (bCheckProps && PropValue::GetPropertyValue(aAny, mXPagePropSet, "IsFooterVisible", true)
+ && aAny == true && GetPropertyValue(aAny, mXPagePropSet, "FooterText", true)
+ && (aAny >>= aText) && !aText.isEmpty()))
+ {
+ if ((xShape = GetReferencedPlaceholderXShape(Footer, ePageType)))
+ rDML.WritePlaceholderReferenceShape(Footer,
+ maPlaceholderShapeToIndexMap.find(xShape)->second,
+ ePageType, mXPagePropSet);
+ }
+
+ if (ePageType == LAYOUT
+ || (bCheckProps
+ && PropValue::GetPropertyValue(aAny, mXPagePropSet, "IsPageNumberVisible", true)
+ && aAny == true))
+ {
+ if ((xShape = GetReferencedPlaceholderXShape(SlideNumber, ePageType)))
+ rDML.WritePlaceholderReferenceShape(SlideNumber,
+ maPlaceholderShapeToIndexMap.find(xShape)->second,
+ ePageType, mXPagePropSet);
+ }
+
+ if (ePageType == LAYOUT
+ || (bCheckProps
+ && PropValue::GetPropertyValue(aAny, mXPagePropSet, "IsDateTimeVisible", true)
+ && aAny == true
+ && ((GetPropertyValue(aAny, mXPagePropSet, "DateTimeText", true) && (aAny >>= aText)
+ && !aText.isEmpty())
+ || mXPagePropSet->getPropertyValue("IsDateTimeFixed") == false)))
+ {
+ if ((xShape = GetReferencedPlaceholderXShape(DateAndTime, ePageType)))
+ rDML.WritePlaceholderReferenceShape(DateAndTime,
+ maPlaceholderShapeToIndexMap.find(xShape)->second,
+ ePageType, mXPagePropSet);
+ }
+}
+
+unsigned PowerPointExport::CreateNewPlaceholderIndex(const css::uno::Reference<XShape> &rXShape)
+{
+ maPlaceholderShapeToIndexMap.insert({rXShape, mnPlaceholderIndexMax});
+ return mnPlaceholderIndexMax++;
+}
+
+Reference<XShape> PowerPointExport::GetReferencedPlaceholderXShape(const PlaceholderType eType,
+ PageType ePageType) const
+{
+ PresObjKind ePresObjKind = PresObjKind::PRESOBJ_NONE;
+ switch (eType)
+ {
+ case oox::core::None:
+ break;
+ case oox::core::SlideImage:
+ break;
+ case oox::core::Notes:
+ break;
+ case oox::core::Header:
+ ePresObjKind = PresObjKind::PRESOBJ_HEADER;
+ break;
+ case oox::core::Footer:
+ ePresObjKind = PresObjKind::PRESOBJ_FOOTER;
+ break;
+ case oox::core::SlideNumber:
+ ePresObjKind = PresObjKind::PRESOBJ_SLIDENUMBER;
+ break;
+ case oox::core::DateAndTime:
+ ePresObjKind = PresObjKind::PRESOBJ_DATETIME;
+ break;
+ case oox::core::Outliner:
+ break;
+ case oox::core::Title:
+ ePresObjKind = PresObjKind::PRESOBJ_TITLE;
+ break;
+ case oox::core::Subtitle:
+ break;
+ }
+ if (ePresObjKind != PresObjKind::PRESOBJ_NONE)
+ {
+ SdPage* pMasterPage;
+ if (ePageType == LAYOUT)
+ {
+ // since Layout pages do not have drawpages themselves - mXDrawPage is still the master they reference to..
+ pMasterPage = SdPage::getImplementation(mXDrawPage);
+ }
+ else
+ {
+ pMasterPage
+ = &static_cast<SdPage&>(SdPage::getImplementation(mXDrawPage)->TRG_GetMasterPage());
+ }
+ if (SdrObject* pMasterFooter = pMasterPage->GetPresObj(ePresObjKind))
+ return GetXShapeForSdrObject(pMasterFooter);
+ }
+ return nullptr;
+}
+
// UNO component
extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
css_comp_Impress_oox_PowerPointExport(uno::XComponentContext* rxCtxt,
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index ad8e2a97eae6..db04442f9830 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <rtl/xmlencode.hxx>
#include <sal/log.hxx>
#include <rtl/tencinfo.h>
#include <comphelper/processfactory.hxx>
@@ -281,10 +282,10 @@ OUString HtmlState::SetLink( const OUString& aLink, const OUString& aTarget )
if (!aLink.isEmpty())
{
- aStr += "<a href=\"" + aLink;
+ aStr += "<a href=\"" + rtl::encodeForXml(aLink);
if (!aTarget.isEmpty())
{
- aStr += "\" target=\"" + aTarget;
+ aStr += "\" target=\"" + rtl::encodeForXml(aTarget);
}
aStr += "\">";
mbLink = true;
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 6bc036f7fa21..290eea440e3c 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -71,12 +71,17 @@ bool SdPdfFilter::Import()
// Create the page and insert the Graphic.
SdPage* pPage = mrDocument.GetSdPage(nPageNumber, PageKind::Standard);
+ if (!pPage) // failed to duplicate page, out of memory?
+ return false;
// Make the page size match the rendered image.
pPage->SetSize(aSizeHMM);
SdrGrafObj* pSdrGrafObj = new SdrGrafObj(pPage->getSdrModelFromSdrPage(), rGraphic,
tools::Rectangle(Point(), aSizeHMM));
+ if (!pSdrGrafObj) // out of memory
+ return false;
+
pPage->InsertObject(pSdrGrafObj);
for (auto const& rPDFAnnotation : rPDFGraphicResult.maAnnotations)
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index 96a805040cb9..a0dc99664c3f 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -28,6 +28,7 @@
#include <sdresid.hxx>
#include <drawdoc.hxx>
#include <svx/svxdlg.hxx>
+#include <comphelper/lok.hxx>
#include <memory>
@@ -48,14 +49,13 @@ rtl::Reference<FuPoor> FuTransform::Create( ViewShell* pViewSh, ::sd::Window* pW
namespace {
-void setUndo(::sd::View* pView, const SfxItemSet* pArgs)
+void setUndo(::sd::View* pView, const SfxItemSet* pArgs, bool addPageMargin)
{
// Undo
OUString aString = pView->GetDescriptionOfMarkedObjects() +
" " + SdResId(STR_TRANSFORM);
pView->BegUndo(aString);
-
- pView->SetGeoAttrToMarked(*pArgs);
+ pView->SetGeoAttrToMarked(*pArgs, addPageMargin);
pView->SetAttributes(*pArgs);
pView->EndUndo();
}
@@ -71,7 +71,9 @@ void FuTransform::DoExecute( SfxRequest& rReq )
if (pArgs)
{
- setUndo(mpView, pArgs);
+ // If this comes from LOK, that means the shape is moved by mouse
+ // only then pArgs is pre-set.
+ setUndo(mpView, pArgs, comphelper::LibreOfficeKit::isActive());
return;
}
@@ -116,7 +118,8 @@ void FuTransform::DoExecute( SfxRequest& rReq )
if (nResult == RET_OK)
{
pRequest->Done(*(pDlg->GetOutputItemSet()));
- setUndo(mpView, pRequest->GetArgs());
+ // Page margin is already calculated at this point.
+ setUndo(mpView, pRequest->GetArgs(), false);
}
// deferred until the dialog ends
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index cd283c76fa57..daa2c36478e2 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -244,7 +244,7 @@ public:
void ResetActualPage();
void ResetActualLayer();
- bool SwitchPage(sal_uInt16 nPage);
+ bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus = true);
bool IsSwitchPageAllowed() const;
/**
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 4693ce3e9596..152ed5d33c91 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -139,6 +139,9 @@ public:
ViewShell* GetViewShell() const { return mpViewSh; }
SfxViewShell* GetSfxViewShell() const override;
+ // Create a local UndoManager
+ std::unique_ptr<SdrUndoManager> createLocalTextUndoManager() override;
+
virtual bool SdrBeginTextEdit(SdrObject* pObj, SdrPageView* pPV = nullptr, vcl::Window* pWin = nullptr, bool bIsNewObj = false,
SdrOutliner* pGivenOutliner = nullptr, OutlinerView* pGivenOutlinerView = nullptr,
bool bDontDeleteOutliner = false, bool bOnlyOneView = false, bool bGrabFocus = true) override;
diff --git a/sd/source/ui/inc/tools/GraphicSizeCheck.hxx b/sd/source/ui/inc/tools/GraphicSizeCheck.hxx
new file mode 100644
index 000000000000..9da3d569bd3a
--- /dev/null
+++ b/sd/source/ui/inc/tools/GraphicSizeCheck.hxx
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <memory>
+#include <drawdoc.hxx>
+#include <svx/GenericCheckDialog.hxx>
+#include <svx/svdograf.hxx>
+
+namespace sd
+{
+class GraphicSizeViolation final
+{
+private:
+ SdrGrafObj* m_pGraphicObject;
+
+ sal_Int32 m_nLowDPILimit = 0;
+ sal_Int32 m_nHighDPILimit = 0;
+
+ sal_Int32 m_nDPIX = 0;
+ sal_Int32 m_nDPIY = 0;
+
+public:
+ GraphicSizeViolation(sal_Int32 nDPI, SdrGrafObj* pGraphicObject);
+ bool check();
+
+ OUString getGraphicName();
+
+ SdrGrafObj* getObject() const { return m_pGraphicObject; }
+
+ bool isDPITooLow() { return m_nDPIX < m_nLowDPILimit || m_nDPIY < m_nLowDPILimit; }
+
+ bool isDPITooHigh() { return m_nDPIX > m_nHighDPILimit || m_nDPIY > m_nHighDPILimit; }
+
+ sal_Int32 getDPIX() { return m_nDPIX; }
+
+ sal_Int32 getDPIY() { return m_nDPIY; }
+};
+
+class GraphicSizeCheck final
+{
+private:
+ SdDrawDocument* m_pDocument;
+ std::vector<std::unique_ptr<GraphicSizeViolation>> m_aGraphicSizeViolationList;
+
+public:
+ GraphicSizeCheck(SdDrawDocument* pDocument)
+ : m_pDocument(pDocument)
+ {
+ }
+
+ void check();
+
+ std::vector<std::unique_ptr<GraphicSizeViolation>>& getViolationList()
+ {
+ return m_aGraphicSizeViolationList;
+ }
+};
+
+class GraphicSizeCheckGUIEntry : public svx::CheckData
+{
+private:
+ SdDrawDocument* m_pDocument;
+ std::unique_ptr<GraphicSizeViolation> m_pViolation;
+
+public:
+ GraphicSizeCheckGUIEntry(SdDrawDocument* pDocument,
+ std::unique_ptr<GraphicSizeViolation>&& pViolation)
+ : m_pDocument(pDocument)
+ , m_pViolation(std::move(pViolation))
+ {
+ }
+
+ OUString getText() override;
+
+ bool canMarkObject() override { return true; }
+
+ void markObject() override;
+
+ bool hasProperties() override { return true; }
+
+ void runProperties() override;
+};
+
+class GraphicSizeCheckGUIResult : public svx::CheckDataCollection
+{
+public:
+ GraphicSizeCheckGUIResult(SdDrawDocument* m_pDocument);
+
+ OUString getTitle() override;
+};
+
+} // end of namespace sd
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 08629b074b5b..6b949a27bbb7 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -232,12 +232,13 @@ public:
long nTileWidth,
long nTileHeight ) override;
virtual Size getDocumentSize() override;
- virtual void setPart( int nPart ) override;
+ virtual void setPart( int nPart, bool bAllowChangeFocus = true ) override;
virtual int getPart() override;
virtual int getParts() override;
virtual OUString getPartName( int nPart ) override;
virtual OUString getPartHash( int nPart ) override;
virtual VclPtr<vcl::Window> getDocWindow() override;
+ bool isMasterViewMode();
virtual void setPartMode( int nPartMode ) override;
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 0ba486884b25..6ed5af536527 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -328,14 +328,6 @@ void SlideBackground::HandleContextChange(
mpInsertImage->Show();
}
- // The Insert Image button in the sidebar issues .uno:SelectBackground,
- // which when invoked without arguments will open the file-open-dialog
- // to prompt the user to select a file. This is useless in LOOL.
- // Hide for now so the user will only be able to use the menu to insert
- // background image, which prompts the user for file selection in the browser.
- if (comphelper::LibreOfficeKit::isActive())
- mpInsertImage->Hide();
-
// Need to do a relayouting, otherwise the panel size is not updated after show / hide controls
sfx2::sidebar::Panel* pPanel = dynamic_cast<sfx2::sidebar::Panel*>(GetParent());
if(pPanel)
@@ -357,6 +349,14 @@ void SlideBackground::HandleContextChange(
mpBackgroundLabel->Hide();
}
}
+
+ // The Insert Image button in the sidebar issues .uno:SelectBackground,
+ // which when invoked without arguments will open the file-open-dialog
+ // to prompt the user to select a file. This is useless in LOOL.
+ // Hide for now so the user will only be able to use the menu to insert
+ // background image, which prompts the user for file selection in the browser.
+ if (comphelper::LibreOfficeKit::isActive())
+ mpInsertImage->Hide();
}
void SlideBackground::Update()
diff --git a/sd/source/ui/tools/GraphicSizeCheck.cxx b/sd/source/ui/tools/GraphicSizeCheck.cxx
new file mode 100644
index 000000000000..6571b8834ff0
--- /dev/null
+++ b/sd/source/ui/tools/GraphicSizeCheck.cxx
@@ -0,0 +1,211 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <memory>
+#include <tools/GraphicSizeCheck.hxx>
+#include <svx/strings.hrc>
+#include <svx/svdobj.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/svxids.hrc>
+#include <sfx2/dispatch.hxx>
+
+#include <sdresid.hxx>
+#include <DrawViewShell.hxx>
+#include <DrawDocShell.hxx>
+
+namespace sd
+{
+namespace
+{
+class ModelTraverseHandler
+{
+public:
+ virtual ~ModelTraverseHandler() {}
+
+ virtual void handleSdrObject(SdrObject* pObject) = 0;
+};
+
+class ModelTraverser
+{
+private:
+ std::vector<std::shared_ptr<ModelTraverseHandler>> m_pNodeHandler;
+ SdDrawDocument* m_pDocument;
+
+public:
+ ModelTraverser(SdDrawDocument* pDocument)
+ : m_pDocument(pDocument)
+ {
+ }
+
+ void traverse()
+ {
+ if (!m_pDocument)
+ return;
+
+ for (sal_uInt16 nPage = 0; nPage < m_pDocument->GetPageCount(); ++nPage)
+ {
+ SdrPage* pPage = m_pDocument->GetPage(nPage);
+ if (pPage)
+ {
+ for (size_t nObject = 0; nObject < pPage->GetObjCount(); ++nObject)
+ {
+ SdrObject* pObject = pPage->GetObj(nObject);
+ if (pObject)
+ {
+ for (auto& pNodeHandler : m_pNodeHandler)
+ {
+ pNodeHandler->handleSdrObject(pObject);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ void addNodeHandler(std::shared_ptr<ModelTraverseHandler> pHandler)
+ {
+ m_pNodeHandler.push_back(pHandler);
+ }
+};
+}
+
+GraphicSizeViolation::GraphicSizeViolation(sal_Int32 nDPI, SdrGrafObj* pGraphicObject)
+ : m_pGraphicObject(pGraphicObject)
+{
+ constexpr double fLowPercentage = 110;
+ constexpr double fHighPercentage = 50;
+
+ m_nLowDPILimit = sal_Int32(100.0 / fLowPercentage * nDPI);
+ m_nHighDPILimit = sal_Int32(100.0 / fHighPercentage * nDPI);
+}
+
+bool GraphicSizeViolation::check()
+{
+ Graphic aGraphic = m_pGraphicObject->GetGraphic();
+ Size aSizePixel = aGraphic.GetSizePixel();
+ Size aGraphicSize = m_pGraphicObject->GetLogicRect().GetSize();
+
+ double nSizeXInch = double(convertMm100ToTwip(aGraphicSize.Width())) / 1440.0;
+ double nSizeYInch = double(convertMm100ToTwip(aGraphicSize.Height())) / 1440.0;
+
+ m_nDPIX = sal_Int32(aSizePixel.Width() / nSizeXInch);
+ m_nDPIY = sal_Int32(aSizePixel.Height() / nSizeYInch);
+
+ return isDPITooLow() || isDPITooHigh();
+}
+
+OUString GraphicSizeViolation::getGraphicName() { return m_pGraphicObject->GetName(); }
+
+namespace
+{
+class GraphicSizeCheckHandler : public ModelTraverseHandler
+{
+ sal_Int32 m_nDPI;
+ std::vector<std::unique_ptr<GraphicSizeViolation>>& m_rGraphicSizeViolationList;
+
+public:
+ GraphicSizeCheckHandler(
+ sal_Int32 nDPI,
+ std::vector<std::unique_ptr<GraphicSizeViolation>>& rGraphicSizeViolationList)
+ : m_nDPI(nDPI)
+ , m_rGraphicSizeViolationList(rGraphicSizeViolationList)
+ {
+ }
+
+ void handleSdrObject(SdrObject* pObject) override
+ {
+ auto* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject);
+ if (!pGraphicObject)
+ return;
+
+ auto pEntry = std::make_unique<GraphicSizeViolation>(m_nDPI, pGraphicObject);
+ if (pEntry->check())
+ {
+ m_rGraphicSizeViolationList.push_back(std::move(pEntry));
+ }
+ }
+};
+
+} // end anonymous namespace
+
+void GraphicSizeCheck::check()
+{
+ if (!m_pDocument)
+ return;
+
+ sal_Int32 nDPI = m_pDocument->getImagePreferredDPI();
+ if (nDPI == 0)
+ return;
+
+ auto pHandler = std::make_shared<GraphicSizeCheckHandler>(nDPI, m_aGraphicSizeViolationList);
+
+ ModelTraverser aModelTraverser(m_pDocument);
+ aModelTraverser.addNodeHandler(pHandler);
+ aModelTraverser.traverse();
+}
+
+OUString GraphicSizeCheckGUIEntry::getText()
+{
+ OUString sText;
+
+ if (m_pViolation->isDPITooLow())
+ {
+ sText = SdResId(STR_WARNING_GRAPHIC_PIXEL_COUNT_LOW);
+ }
+ else if (m_pViolation->isDPITooHigh())
+ {
+ sText = SdResId(STR_WARNING_GRAPHIC_PIXEL_COUNT_HIGH);
+ }
+
+ sText = sText.replaceAll("%NAME%", m_pViolation->getGraphicName());
+ sText = sText.replaceAll("%DPIX%", OUString::number(m_pViolation->getDPIX()));
+ sText = sText.replaceAll("%DPIY%", OUString::number(m_pViolation->getDPIY()));
+
+ return sText;
+}
+
+void GraphicSizeCheckGUIEntry::markObject()
+{
+ sd::ViewShell* pViewShell = m_pDocument->GetDocSh()->GetViewShell();
+ SdrView* pView = pViewShell->GetView();
+ pView->ShowSdrPage(m_pViolation->getObject()->getSdrPageFromSdrObject());
+ pView->UnmarkAll();
+ pView->MarkObj(m_pViolation->getObject(), pView->GetSdrPageView());
+}
+
+void GraphicSizeCheckGUIEntry::runProperties()
+{
+ markObject();
+ sd::ViewShell* pViewShell = m_pDocument->GetDocSh()->GetViewShell();
+ pViewShell->GetDispatcher()->Execute(SID_ATTR_GRAF_CROP, SfxCallMode::SYNCHRON);
+}
+
+GraphicSizeCheckGUIResult::GraphicSizeCheckGUIResult(SdDrawDocument* pDocument)
+{
+ GraphicSizeCheck aCheck(pDocument);
+ aCheck.check();
+
+ auto& rCollection = getCollection();
+ for (auto& rpViolation : aCheck.getViolationList())
+ {
+ auto rGUIEntry
+ = std::make_unique<GraphicSizeCheckGUIEntry>(pDocument, std::move(rpViolation));
+ rCollection.push_back(std::move(rGUIEntry));
+ }
+}
+
+OUString GraphicSizeCheckGUIResult::getTitle()
+{
+ return SdResId(STR_GRAPHIC_SIZE_CHECK_DIALOG_TITLE);
+}
+
+} // end of namespace sd
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index b765dc59a0dc..7ef72d693b69 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -142,6 +142,7 @@ enum SdDocumentSettingsPropertyHandles
,HANDLE_SLIDESPERHANDOUT, HANDLE_HANDOUTHORIZONTAL,
HANDLE_EMBED_FONTS, HANDLE_EMBED_USED_FONTS,
HANDLE_EMBED_LATIN_SCRIPT_FONTS, HANDLE_EMBED_ASIAN_SCRIPT_FONTS, HANDLE_EMBED_COMPLEX_SCRIPT_FONTS,
+ HANDLE_IMAGE_PREFERRED_DPI
};
#define MID_PRINTER 1
@@ -210,6 +211,7 @@ enum SdDocumentSettingsPropertyHandles
{ OUString("EmbedLatinScriptFonts"), HANDLE_EMBED_LATIN_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0, 0 },
{ OUString("EmbedAsianScriptFonts"), HANDLE_EMBED_ASIAN_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0, 0 },
{ OUString("EmbedComplexScriptFonts"), HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0, 0 },
+ { OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType<sal_Int32>::get(), 0, 0 },
{ OUString(), 0, css::uno::Type(), 0, 0 }
};
@@ -1019,6 +1021,18 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
}
break;
+ case HANDLE_IMAGE_PREFERRED_DPI:
+ {
+ if (pValues->has<sal_Int32>())
+ {
+ auto nNewValue = pValues->get<sal_Int32>();
+ bChanged = (pDoc->getImagePreferredDPI() != nNewValue);
+ pDoc->setImagePreferredDPI(nNewValue);
+ bOk = true;
+ }
+ }
+ break;
+
default:
throw UnknownPropertyException( OUString::number((*ppEntries)->mnHandle), static_cast<cppu::OWeakObject*>(this));
}
@@ -1293,6 +1307,12 @@ DocumentSettings::_getPropertyValues(
}
break;
+ case HANDLE_IMAGE_PREFERRED_DPI:
+ {
+ *pValue <<= pDoc->getImagePreferredDPI();
+ }
+ break;
+
default:
throw UnknownPropertyException( OUString::number((*ppEntries)->mnHandle), static_cast<cppu::OWeakObject*>(this));
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 69c2a94dd946..e6b6012f79c6 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -45,6 +45,7 @@
#include <unomodel.hxx>
#include "unopool.hxx"
#include <sfx2/lokhelper.hxx>
+#include <sfx2/dispatch.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -122,6 +123,8 @@
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
+#include <app.hrc>
+
#define TWIPS_PER_PIXEL 15
using namespace ::cppu;
@@ -2274,31 +2277,35 @@ OUString SdXImpressDocument::getPartInfo(int nPart)
const bool bIsVisible = pViewSh->IsVisible(nPart);
const bool bIsSelected = pViewSh->IsSelected(nPart);
+ const sal_Int16 nMasterPageCount= pViewSh->GetDoc()->GetMasterSdPageCount(pViewSh->GetPageKind());
OUString aPartInfo = "{ \"visible\": \"" +
OUString::number(static_cast<unsigned int>(bIsVisible)) +
"\", \"selected\": \"" +
OUString::number(static_cast<unsigned int>(bIsSelected)) +
+ "\", \"masterPageCount\": \"" +
+ OUString::number(nMasterPageCount) +
"\" }";
return aPartInfo;
}
-void SdXImpressDocument::setPart( int nPart )
+void SdXImpressDocument::setPart( int nPart, bool bAllowChangeFocus )
{
DrawViewShell* pViewSh = GetViewShell();
if (!pViewSh)
return;
- pViewSh->SwitchPage( nPart );
+ pViewSh->SwitchPage( nPart, bAllowChangeFocus );
}
int SdXImpressDocument::getParts()
{
- // TODO: master pages?
- // Read: drviews1.cxx
if (!mpDoc)
return 0;
+ if (isMasterViewMode())
+ return mpDoc->GetMasterSdPageCount(PageKind::Standard);
+
return mpDoc->GetSdPageCount(PageKind::Standard);
}
@@ -2311,9 +2318,14 @@ int SdXImpressDocument::getPart()
return pViewSh->GetViewShellBase().getPart();
}
-OUString SdXImpressDocument::getPartName( int nPart )
+OUString SdXImpressDocument::getPartName(int nPart)
{
- SdPage* pPage = mpDoc->GetSdPage( nPart, PageKind::Standard );
+ SdPage* pPage;
+ if (isMasterViewMode())
+ pPage = mpDoc->GetMasterSdPage(nPart, PageKind::Standard);
+ else
+ pPage = mpDoc->GetSdPage(nPart, PageKind::Standard);
+
if (!pPage)
{
SAL_WARN("sd", "DrawViewShell not available!");
@@ -2323,9 +2335,14 @@ OUString SdXImpressDocument::getPartName( int nPart )
return pPage->GetName();
}
-OUString SdXImpressDocument::getPartHash( int nPart )
+OUString SdXImpressDocument::getPartHash(int nPart)
{
- SdPage* pPage = mpDoc->GetSdPage( nPart, PageKind::Standard );
+ SdPage* pPage;
+ if (isMasterViewMode())
+ pPage = mpDoc->GetMasterSdPage(nPart, PageKind::Standard);
+ else
+ pPage = mpDoc->GetSdPage(nPart, PageKind::Standard);
+
if (!pPage)
{
SAL_WARN("sd", "DrawViewShell not available!");
@@ -2335,6 +2352,23 @@ OUString SdXImpressDocument::getPartHash( int nPart )
return OUString::number(pPage->GetHashCode());
}
+bool SdXImpressDocument::isMasterViewMode()
+{
+ DrawViewShell* pViewSh = GetViewShell();
+ if (!pViewSh)
+ return false;
+
+ if (pViewSh->GetDispatcher())
+ {
+ const SfxPoolItem* xItem = nullptr;
+ pViewSh->GetDispatcher()->QueryState(SID_SLIDE_MASTER_MODE, xItem);
+ const SfxBoolItem* isMasterViewMode = dynamic_cast<const SfxBoolItem*>(xItem);
+ if (isMasterViewMode && isMasterViewMode->GetValue())
+ return true;
+ }
+ return false;
+}
+
VclPtr<vcl::Window> SdXImpressDocument::getDocWindow()
{
SolarMutexGuard aGuard;
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 2a6a41998e71..33fe01b2b080 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -61,6 +61,7 @@
#include <comphelper/lok.hxx>
#include <comphelper/scopeguard.hxx>
#include <VectorGraphicSearchContext.hxx>
+#include <fusearch.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -220,6 +221,11 @@ SdOutliner::~SdOutliner()
{
}
+OutlinerView* SdOutliner::getOutlinerView()
+{
+ return mpImpl->GetOutlinerView();
+}
+
/** Prepare find&replace or spellchecking. This distinguishes between three
cases:
<ol>
@@ -309,7 +315,7 @@ void SdOutliner::EndSpelling()
// Remove and, if previously created by us, delete the outline
// view.
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
{
RemoveView(pOutlinerView);
@@ -362,7 +368,7 @@ bool SdOutliner::SpellNextDocument()
Initialize (true);
mpWindow = pViewShell->GetActiveWindow();
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
pOutlinerView->SetWindow(mpWindow);
ProvideNextTextObject ();
@@ -520,7 +526,7 @@ void SdOutliner::Initialize (bool bDirectionIsForward)
// current selection and place cursor at its start or end.
if( nullptr != dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() ))
{
- ESelection aSelection = mpImpl->GetOutlinerView()->GetSelection ();
+ ESelection aSelection = getOutlinerView()->GetSelection ();
if (mbDirectionIsForward)
{
aSelection.nEndPara = aSelection.nStartPara;
@@ -531,7 +537,7 @@ void SdOutliner::Initialize (bool bDirectionIsForward)
aSelection.nStartPara = aSelection.nEndPara;
aSelection.nStartPos = aSelection.nEndPos;
}
- mpImpl->GetOutlinerView()->SetSelection (aSelection);
+ getOutlinerView()->SetSelection (aSelection);
}
// When not beginning the search at the beginning of the search area
@@ -586,7 +592,7 @@ bool SdOutliner::SearchAndReplaceAll()
if( nullptr != dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() ))
{
// Put the cursor to the beginning/end of the outliner.
- mpImpl->GetOutlinerView()->SetSelection (GetSearchStartPosition ());
+ getOutlinerView()->SetSelection (GetSearchStartPosition ());
// The outliner does all the work for us when we are in this mode.
SearchAndReplaceOnce();
@@ -807,20 +813,18 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
{
DetectChange ();
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock());
- if (!pOutlinerView || !GetEditEngine().HasView(&pOutlinerView->GetEditView()))
+ if (!getOutlinerView() || !GetEditEngine().HasView(&getOutlinerView()->GetEditView()))
{
mpImpl->ProvideOutlinerView(*this, pViewShell, mpWindow);
- pOutlinerView = mpImpl->GetOutlinerView();
}
if (pViewShell)
{
mpView = pViewShell->GetView();
mpWindow = pViewShell->GetActiveWindow();
- pOutlinerView->SetWindow(mpWindow);
+ getOutlinerView()->SetWindow(mpWindow);
auto& rVectorGraphicSearchContext = mpImpl->getVectorGraphicSearchContext();
if (nullptr != dynamic_cast<const sd::DrawViewShell*>(pViewShell.get()))
{
@@ -872,14 +876,14 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
// the next match.
if (meMode == SEARCH && mpSearchItem->GetCommand() == SvxSearchCmd::REPLACE)
{
- if (pOutlinerView->GetSelection().HasRange())
- pOutlinerView->StartSearchAndReplace(*mpSearchItem);
+ if (getOutlinerView()->GetSelection().HasRange())
+ getOutlinerView()->StartSearchAndReplace(*mpSearchItem);
}
// Search for the next match.
if (mpSearchItem->GetCommand() != SvxSearchCmd::REPLACE_ALL)
{
- nMatchCount = pOutlinerView->StartSearchAndReplace(*mpSearchItem);
+ nMatchCount = getOutlinerView()->StartSearchAndReplace(*mpSearchItem);
}
}
@@ -899,16 +903,16 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
// Now that the mbEndOfSearch flag guards this block the
// following assertion and return should not be
// necessary anymore.
- DBG_ASSERT(GetEditEngine().HasView(&pOutlinerView->GetEditView() ),
+ DBG_ASSERT(GetEditEngine().HasView(&getOutlinerView()->GetEditView() ),
"SearchAndReplace without valid view!" );
- if ( ! GetEditEngine().HasView( &pOutlinerView->GetEditView() ) )
+ if ( ! GetEditEngine().HasView( &getOutlinerView()->GetEditView() ) )
{
mpDrawDocument->GetDocSh()->SetWaitCursor( false );
return true;
}
if (meMode == SEARCH)
- pOutlinerView->StartSearchAndReplace(*mpSearchItem);
+ getOutlinerView()->StartSearchAndReplace(*mpSearchItem);
}
}
}
@@ -919,12 +923,12 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
// wrap around search is done.
while (true)
{
- int nResult = pOutlinerView->StartSearchAndReplace(*mpSearchItem);
+ int nResult = getOutlinerView()->StartSearchAndReplace(*mpSearchItem);
if (nResult == 0)
{
if (HandleFailedSearch ())
{
- pOutlinerView->SetSelection (GetSearchStartPosition ());
+ getOutlinerView()->SetSelection (GetSearchStartPosition ());
continue;
}
}
@@ -939,7 +943,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti
if (pViewShell && comphelper::LibreOfficeKit::isActive() && mbStringFound)
{
- sendLOKSearchResultCallback(pViewShell, pOutlinerView, pSelections);
+ sendLOKSearchResultCallback(pViewShell, getOutlinerView(), pSelections);
}
return mbEndOfSearch;
@@ -969,7 +973,7 @@ void SdOutliner::DetectChange()
mpView->UnmarkAllObj (pPageView);
mpView->SdrEndTextEdit();
SetUpdateMode(false);
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
pOutlinerView->SetOutputArea( ::tools::Rectangle( Point(), Size(1, 1) ) );
if (meMode == SPELL)
@@ -1125,8 +1129,8 @@ void SdOutliner::RestoreStartPosition()
{
PutTextIntoOutliner();
EnterEditMode(false);
- if (OutlinerView* pOutlinerView = mpImpl->GetOutlinerView())
- pOutlinerView->SetSelection(maStartSelection);
+ if (getOutlinerView())
+ getOutlinerView()->SetSelection(maStartSelection);
}
}
}
@@ -1191,7 +1195,7 @@ void SdOutliner::ProvideNextTextObject()
DBG_UNHANDLED_EXCEPTION("sd.view");
}
SetUpdateMode(false);
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
pOutlinerView->SetOutputArea( ::tools::Rectangle( Point(), Size(1, 1) ) );
if (meMode == SPELL)
@@ -1361,7 +1365,7 @@ void SdOutliner::EndOfSearch()
if( nullptr != dynamic_cast< const sd::OutlineViewShell *>( pViewShell.get() ))
{
// Set cursor to first character of the document.
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
pOutlinerView->SetSelection (GetSearchStartPosition ());
}
@@ -1513,7 +1517,7 @@ void SdOutliner::PrepareSearchAndReplace()
mpDrawDocument->GetDocSh()->SetWaitCursor( false );
// Start search at the right end of the current object's text
// depending on the search direction.
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
pOutlinerView->SetSelection (GetSearchStartPosition ());
}
@@ -1550,6 +1554,11 @@ void SdOutliner::SetViewMode (PageKind ePageKind)
bool bMatchMayExist = mbMatchMayExist;
sd::ViewShellBase& rBase = pViewShell->GetViewShellBase();
+
+ rtl::Reference<sd::FuSearch> xFuSearch;
+ if (pViewShell->GetView())
+ xFuSearch = pViewShell->GetView()->getSearchContext().getFunctionSearch();
+
SetViewShell(std::shared_ptr<sd::ViewShell>());
sd::framework::FrameworkHelper::Instance(rBase)->RequestView(
sViewURL,
@@ -1560,7 +1569,11 @@ void SdOutliner::SetViewMode (PageKind ePageKind)
// instead. But that would involve major restructuring of the
// Outliner code.
sd::framework::FrameworkHelper::Instance(rBase)->RequestSynchronousUpdate();
- SetViewShell(rBase.GetMainViewShell());
+
+ auto pNewViewShell = rBase.GetMainViewShell();
+ SetViewShell(pNewViewShell);
+ if (xFuSearch.is() && pNewViewShell->GetView())
+ pNewViewShell->GetView()->getSearchContext().setSearchFunction(xFuSearch);
// Switching to another view shell has intermediatly called
// EndSpelling(). A PrepareSpelling() is pending, so call that now.
@@ -1600,7 +1613,7 @@ void SdOutliner::SetPage (EditMode eEditMode, sal_uInt16 nPageIndex)
void SdOutliner::EnterEditMode (bool bGrabFocus)
{
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (!(pOutlinerView && mpSearchSpellTextObj))
return;
@@ -1668,7 +1681,7 @@ ESelection SdOutliner::GetSearchStartPosition() const
bool SdOutliner::HasNoPreviousMatch()
{
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
DBG_ASSERT (pOutlinerView!=nullptr, "outline view in SdOutliner::HasNoPreviousMatch is NULL");
@@ -1681,7 +1694,7 @@ bool SdOutliner::HandleFailedSearch()
{
bool bContinueSearch = false;
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr && mpSearchItem != nullptr)
{
// Detect whether there is/may be a prior match. If there is then
@@ -1731,7 +1744,7 @@ void SdOutliner::SetViewShell (const std::shared_ptr<sd::ViewShell>& rpViewShell
mpWindow = rpViewShell->GetActiveWindow();
mpImpl->ProvideOutlinerView(*this, rpViewShell, mpWindow);
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
pOutlinerView->SetWindow(mpWindow);
}
@@ -1777,7 +1790,7 @@ void SdOutliner::StartConversion( LanguageType nSourceLanguage, LanguageType nT
BeginConversion();
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
{
pOutlinerView->StartTextConversion(
@@ -1860,7 +1873,7 @@ bool SdOutliner::ConvertNextDocument()
Initialize ( true );
- OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
+ OutlinerView* pOutlinerView = getOutlinerView();
if (pOutlinerView != nullptr)
{
mpWindow = pViewShell->GetActiveWindow();
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 3a370de8b33b..468a2cba3078 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -70,6 +70,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <vcl/uitest/logger.hxx>
#include <vcl/uitest/eventdescription.hxx>
+#include <svl/intitem.hxx>
using namespace com::sun::star;
@@ -342,7 +343,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
if ( mpDrawView->IsTextEdit() )
{
- mpDrawView->SdrEndTextEdit();
+ // This exits the text edit mode when going in and out of window focus, which is not needed
+ // Let's keep this call as comment for now as it probably just needs a better conditional.
+ // mpDrawView->SdrEndTextEdit();
}
LayerTabBar* pLayerBar = GetLayerTabControl();
@@ -651,6 +654,7 @@ void DrawViewShell::ResetActualPage()
return;
sal_uInt16 nCurrentPageId = maTabControl->GetCurPageId();
+ sal_uInt16 nNewPageId = nCurrentPageId;
sal_uInt16 nCurrentPageNum = maTabControl->GetPagePos(nCurrentPageId);
sal_uInt16 nPageCount = (meEditMode == EditMode::Page)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind);
@@ -677,7 +681,8 @@ void DrawViewShell::ResetActualPage()
GetDoc()->SetSelected(pPage, false);
}
- maTabControl->SetCurPageId(maTabControl->GetPageId(nCurrentPageNum));
+ nNewPageId = maTabControl->GetPageId(nCurrentPageNum);
+ maTabControl->SetCurPageId(nNewPageId);
}
else // EditMode::MasterPage
{
@@ -697,12 +702,16 @@ void DrawViewShell::ResetActualPage()
nCurrentPageNum = i;
}
- maTabControl->SetCurPageId(maTabControl->GetPageId(nCurrentPageNum));
+ nNewPageId = maTabControl->GetPageId(nCurrentPageNum);
+ maTabControl->SetCurPageId(nNewPageId);
SwitchPage(nCurrentPageNum);
}
- GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHPAGE,
- SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
+ bool bAllowChangeFocus = nNewPageId != nCurrentPageId;
+ SfxBoolItem aI(SID_SWITCHPAGE, bAllowChangeFocus);
+ GetViewFrame()->GetDispatcher()->ExecuteList(SID_SWITCHPAGE,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aI });
}
/**
@@ -817,8 +826,11 @@ bool DrawViewShell::IsVisible(sal_uInt16 nPage)
/**
* Switch to desired page.
* nSelectPage refers to the current EditMode
+ * bAllowChangeFocus set to false when slide is inserted before current page
+ * and we need to only update the current page number,
+ * do not disturb editing in that case
*/
-bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
+bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus)
{
/** Under some circumstances there are nested calls to SwitchPage() and
may crash the application (activation of form controls when the
@@ -922,7 +934,8 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
}
}
- mpDrawView->SdrEndTextEdit();
+ if (bAllowChangeFocus)
+ mpDrawView->SdrEndTextEdit();
mpActualPage = nullptr;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index b530b0bd1658..bc7ab3231390 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -189,6 +189,7 @@
#include <controller/SlsSelectionManager.hxx>
#include <controller/SlsInsertionIndicatorHandler.hxx>
#include <controller/SlsPageSelector.hxx>
+#include <tools/GraphicSizeCheck.hxx>
#include <ViewShellBase.hxx>
#include <memory>
@@ -1472,6 +1473,17 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
+ case SID_GRAPHIC_SIZE_CHECK:
+ {
+ sd::GraphicSizeCheckGUIResult aResult(GetDoc());
+ svx::GenericCheckDialog aDialog(GetFrameWeld(), aResult);
+ aDialog.run();
+
+ Cancel();
+ rReq.Ignore();
+ }
+ break;
+
case SID_ATTRIBUTES_LINE: // BASIC
{
SetCurrentFunction( FuLine::Create( this, GetActiveWindow(), mpDrawView.get(), GetDoc(), rReq ) );
@@ -1501,16 +1513,18 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_MOVE_SHAPE_HANDLE:
{
const SfxItemSet *pArgs = rReq.GetArgs ();
- if (pArgs && pArgs->Count () == 3)
+ if (pArgs && pArgs->Count () >= 3)
{
const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1);
const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2);
const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3);
+ const SfxInt32Item* OrdNum = rReq.GetArg<SfxInt32Item>(FN_PARAM_4);
const sal_uLong handleNum = handleNumItem->GetValue();
const sal_uLong newPosX = convertTwipToMm100(newPosXTwips->GetValue());
const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue());
- mpDrawView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+
+ mpDrawView->MoveShapeHandle(handleNum, Point(newPosX, newPosY), OrdNum ? OrdNum->GetValue() : -1);
Cancel();
}
break;
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index c5e1450f70e2..b243e9db4919 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -106,6 +106,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
// End text edit mode for some requests.
sal_uInt16 nSlot = rReq.GetSlot();
+ bool bAllowFocusChange = true;
switch (nSlot)
{
case SID_OUTPUT_QUALITY_COLOR:
@@ -114,6 +115,15 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
case SID_OUTPUT_QUALITY_CONTRAST:
// Do nothing.
break;
+ case SID_SWITCHPAGE:
+ if (rReq.GetArgs() && rReq.GetArgs()->Count () == 1)
+ {
+ const SfxBoolItem* pAllowFocusChange = rReq.GetArg<SfxBoolItem>(SID_SWITCHPAGE);
+ bAllowFocusChange = pAllowFocusChange->GetValue();
+ if (!bAllowFocusChange)
+ break;
+ }
+ BOOST_FALLTHROUGH;
default:
if ( mpDrawView->IsTextEdit() )
{
@@ -137,7 +147,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
const SfxItemSet *pArgs = rReq.GetArgs ();
sal_uInt16 nSelectedPage = 0;
- if (! pArgs)
+ if (! pArgs || pArgs->Count () == 1)
{
nSelectedPage = maTabControl->GetCurPagePos();
}
@@ -183,7 +193,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if( GetDocSh() && (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED))
GetDocSh()->SetModified();
- SwitchPage(nSelectedPage);
+ SwitchPage(nSelectedPage, bAllowFocusChange);
if(HasCurrentFunction(SID_BEZIER_EDIT))
GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index be16871f630f..6b4c28d01e94 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -57,12 +57,34 @@
#include <drawview.hxx>
#include <svx/bmpmask.hxx>
#include <LayerTabBar.hxx>
+#include <ViewShellBase.hxx>
+#include <SlideSorterViewShell.hxx>
#include <svx/svditer.hxx>
#include <navigatr.hxx>
#include <memory>
+namespace {
+ void EndTextEditOnPage(sal_uInt16 nPageId)
+ {
+ SfxViewShell* pShell = SfxViewShell::GetFirst();
+ while (pShell)
+ {
+ ::sd::ViewShellBase* pBase = dynamic_cast<::sd::ViewShellBase*>(pShell);
+ if (pBase)
+ {
+ ::sd::ViewShell* pViewSh = pBase->GetMainViewShell().get();
+ ::sd::DrawViewShell* pDrawSh = dynamic_cast<::sd::DrawViewShell*>(pViewSh);
+ if (pDrawSh && pDrawSh->GetDrawView() && pDrawSh->getCurrentPage()->getPageId() == nPageId)
+ pDrawSh->GetDrawView()->SdrEndTextEdit();
+ }
+
+ pShell = SfxViewShell::GetNext(*pShell);
+ }
+ }
+}
+
namespace sd {
#define PIPETTE_RANGE 0
@@ -87,9 +109,16 @@ void DrawViewShell::DeleteActualPage()
for (sal_uInt16 i = 0; i < nPageCount; i++)
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
- if(pPage->IsSelected())
+ sal_uInt16 nPageIndex = maTabControl->GetPagePos(pPage->getPageId());
+
+ slidesorter::SlideSorterViewShell* pVShell
+ = slidesorter::SlideSorterViewShell::GetSlideSorter(GetViewShellBase());
+ bool bUseSlideSorter = pVShell != nullptr;
+
+ if((bUseSlideSorter && IsSelected(nPageIndex)) || (!bUseSlideSorter && pPage->IsSelected()))
{
- Reference< XDrawPage > xPage( xPages->getByIndex( maTabControl->GetPagePos(pPage->getPageId()) ), UNO_QUERY_THROW );
+ EndTextEditOnPage(pPage->getPageId());
+ Reference< XDrawPage > xPage( xPages->getByIndex( nPageIndex ), UNO_QUERY_THROW );
pagesToDelete.push_back(xPage);
}
}
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index e330d0416ce8..6aefeb33e77f 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -608,6 +608,10 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
if(!(HasCurrentFunction() && ((rReq.GetModifier() & KEY_MOD1) || bCreateDirectly)))
return;
+ // disable interactive drawing for LOK
+ if (bCreateDirectly)
+ GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
+
// get SdOptions
SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
sal_uInt32 nDefaultObjectSizeWidth(pOptions->GetDefaultObjectSizeWidth());
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index ee65cb87fa94..7e081e36cfc3 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -513,6 +513,10 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
rSet.DisableItem(SID_SAVE_GRAPHIC);
rSet.DisableItem(SID_EXTERNAL_EDIT);
}
+ if (GetDoc()->getImagePreferredDPI() <= 0)
+ {
+ rSet.DisableItem(SID_GRAPHIC_SIZE_CHECK);
+ }
}
} // end of namespace sd
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 0abaff31fc9f..f6bf3381231b 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -79,6 +79,8 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <DrawController.hxx>
+#include <undo/undomanager.hxx>
+
#include <memory>
#include <numeric>
@@ -618,6 +620,14 @@ SfxViewShell* View::GetSfxViewShell() const
return pRet;
}
+// Create a new view-local UndoManager manager for Impress/Draw
+std::unique_ptr<SdrUndoManager> View::createLocalTextUndoManager()
+{
+ std::unique_ptr<SdrUndoManager> pUndoManager(new sd::UndoManager);
+ pUndoManager->SetDocShell(mpDocSh);
+ return pUndoManager;
+}
+
bool View::SdrBeginTextEdit(
SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin,
bool bIsNewObj,
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 0bf877f6fc02..3d804dff36e5 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -170,6 +170,8 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
else if ( pPV )
{
+ Size aSizePixel = rGraphic.GetSizePixel();
+
// create new object
Size aSize;
@@ -192,15 +194,34 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
MapMode( MapUnit::Map100thMM ) );
}
- pNewGrafObj = new SdrGrafObj(
- getSdrModelFromSdrView(),
- rGraphic,
- ::tools::Rectangle(rPos, aSize));
- SdrPage* pPage = pPV->GetPage();
- Size aPageSize( pPage->GetSize() );
- aPageSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) );
- aPageSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) );
- pNewGrafObj->AdjustToMaxRect( ::tools::Rectangle( Point(), aPageSize ), true );
+ sal_Int32 nPreferredDPI = mrDoc.getImagePreferredDPI();
+ if (nPreferredDPI > 0)
+ {
+ constexpr double fTwipsInAnInch = 1444.0;
+ auto nWidth = (aSizePixel.Width() / double(nPreferredDPI)) * fTwipsInAnInch;
+ auto nHeight = (aSizePixel.Height() / double(nPreferredDPI)) * fTwipsInAnInch;
+ nWidth = convertTwipToMm100(nWidth);
+ nHeight = convertTwipToMm100(nHeight);
+
+ if (nWidth > 0 && nHeight > 0)
+ aSize = Size(nWidth, nHeight);
+ }
+
+ pNewGrafObj = new SdrGrafObj(getSdrModelFromSdrView(), rGraphic, ::tools::Rectangle(rPos, aSize));
+
+ if (nPreferredDPI > 0)
+ {
+ // move to the center of insertion point
+ pNewGrafObj->NbcMove(Size(-aSize.Width() / 2, -aSize.Height() / 2));
+ }
+ else
+ {
+ SdrPage* pPage = pPV->GetPage();
+ Size aPageSize( pPage->GetSize() );
+ aPageSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) );
+ aPageSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) );
+ pNewGrafObj->AdjustToMaxRect( ::tools::Rectangle( Point(), aPageSize ), true );
+ }
SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER;
bool bIsPresTarget = false;
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 118f1545b186..a6ce2c02b2b3 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -1009,18 +1009,19 @@ void Window::LogicInvalidate(const ::tools::Rectangle* pRectangle)
if (!pDrawViewShell || pDrawViewShell->IsInSwitchPage())
return;
- OString sRectangle;
+ ::tools::Rectangle aRectangle;
+ ::tools::Rectangle* pResultRectangle;
if (!pRectangle)
- sRectangle = "EMPTY";
+ pResultRectangle = nullptr;
else
{
- ::tools::Rectangle aRectangle(*pRectangle);
+ aRectangle = *pRectangle;
if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
- sRectangle = aRectangle.toString();
+ pResultRectangle = &aRectangle;
}
SfxViewShell& rSfxViewShell = pDrawViewShell->GetViewShellBase();
- SfxLokHelper::notifyInvalidation(&rSfxViewShell, sRectangle);
+ SfxLokHelper::notifyInvalidation(&rSfxViewShell, pResultRectangle);
}
void Window::LogicMouseButtonDown(const MouseEvent& rMouseEvent)
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index f1373d4470bc..d0840ffa2612 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -416,6 +416,7 @@
<menu:menuitem menu:id=".uno:ColorSettings"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:GrafAttrCrop"/>
+ <menu:menuitem menu:id=".uno:GraphicSizeCheck"/>
</menu:menupopup>
</menu:menu>
<menu:menuseparator/>
diff --git a/sd/uiconfig/sdraw/ui/notebookbar_online.ui b/sd/uiconfig/sdraw/ui/notebookbar_online.ui
new file mode 100644
index 000000000000..1151d7b502d0
--- /dev/null
+++ b/sd/uiconfig/sdraw/ui/notebookbar_online.ui
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface domain="sw">
+ <requires lib="gtk+" version="3.18"/>
+ <requires lib="LibreOffice" version="1.0"/>
+ <!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="font">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkToolButton" id="Home-CharFontName">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="action_name">.uno:CharFontName</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="fontheight">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_left">5</property>
+ <child>
+ <object class="GtkToolButton" id="Home-FontHeight">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">.uno:FontHeight</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index cec28407957b..dcd10c48bcb1 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -447,6 +447,7 @@
<menu:menuitem menu:id=".uno:ColorSettings"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:GrafAttrCrop"/>
+ <menu:menuitem menu:id=".uno:GraphicSizeCheck"/>
</menu:menupopup>
</menu:menu>
<menu:menu menu:id=".uno:FormatObjectMenu">
diff --git a/sd/uiconfig/simpress/ui/notebookbar.ui b/sd/uiconfig/simpress/ui/notebookbar.ui
index c8f258613db7..0f84fee9b661 100644
--- a/sd/uiconfig/simpress/ui/notebookbar.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar.ui
@@ -1168,7 +1168,7 @@
<object class="GtkMenuItem" id="MenuInsert-ImportFromFile">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:ImportFromFile</property>
+ <property name="action_name">.uno:ImportSlideFromFile</property>
</object>
</child>
<child>
@@ -1242,14 +1242,14 @@
<object class="GtkMenuItem" id="MenuInsert-InsertPageField">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPageField</property>
+ <property name="action_name">.uno:InsertSlideField</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="MenuInsert-InsertPagesField">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPagesField</property>
+ <property name="action_name">.uno:InsertSlidesField</property>
</object>
</child>
<child>
@@ -3431,7 +3431,7 @@
<object class="GtkToolButton" id="Home-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -3456,7 +3456,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="action_name">.uno:DuplicatePage</property>
+ <property name="action_name">.uno:DuplicateSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -3468,7 +3468,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="action_name">.uno:DeletePage</property>
+ <property name="action_name">.uno:DeleteSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -4971,7 +4971,7 @@
<object class="GtkToolButton" id="Insert-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -5014,7 +5014,7 @@
<object class="GtkToolButton" id="Insert-DuplicatePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:DuplicatePage</property>
+ <property name="action_name">.uno:DuplicateSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -5038,7 +5038,7 @@
<object class="GtkToolButton" id="Insert-ImportFromFile">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:ImportFromFile</property>
+ <property name="action_name">.uno:ImportSlideFromFile</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6152,7 +6152,7 @@
<object class="GtkToolButton" id="Insert-InsertPage1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6246,7 +6246,7 @@
<object class="GtkToolButton" id="Slide-PageSetup">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6390,7 +6390,7 @@
<object class="GtkToolButton" id="Slide-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6433,7 +6433,7 @@
<object class="GtkToolButton" id="Slide-DuplicatePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:DuplicatePage</property>
+ <property name="action_name">.uno:DuplicateSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6457,7 +6457,7 @@
<object class="GtkToolButton" id="Slide-DeletePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:DeletePage</property>
+ <property name="action_name">.uno:DeleteSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6522,7 +6522,7 @@
<object class="GtkToolButton" id="Slide-RenamePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:RenamePage</property>
+ <property name="action_name">.uno:RenameSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6657,7 +6657,7 @@
<object class="GtkToolButton" id="Slide-MovePageUp">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:MovePageUp</property>
+ <property name="action_name">.uno:MoveSlideUp</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6682,7 +6682,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="action_name">.uno:MovePageDown</property>
+ <property name="action_name">.uno:MoveSlideDown</property>
</object>
<packing>
<property name="expand">False</property>
@@ -16883,7 +16883,7 @@
<object class="GtkToolButton" id="MasterPageMenu-PageSetup1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
</object>
<packing>
<property name="expand">False</property>
@@ -17094,7 +17094,7 @@
<object class="GtkToolButton" id="MasterPageMenu-PageSetup">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sd/uiconfig/simpress/ui/notebookbar_compact.ui b/sd/uiconfig/simpress/ui/notebookbar_compact.ui
index 6b16a8114c25..f4c2da53ea96 100644
--- a/sd/uiconfig/simpress/ui/notebookbar_compact.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar_compact.ui
@@ -1287,7 +1287,7 @@
<object class="GtkMenuItem" id="MenuInsert-ImportFromFile">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:ImportFromFile</property>
+ <property name="action_name">.uno:ImportSlideFromFile</property>
</object>
</child>
<child>
@@ -1361,14 +1361,14 @@
<object class="GtkMenuItem" id="MenuInsert-InsertPageField">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPageField</property>
+ <property name="action_name">.uno:InsertSlideField</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="MenuInsert-InsertPagesField">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPagesField</property>
+ <property name="action_name">.uno:InsertSlidesField</property>
</object>
</child>
<child>
@@ -3440,7 +3440,7 @@
<object class="GtkToolButton" id="Home-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -3480,7 +3480,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="action_name">.uno:DuplicatePage</property>
+ <property name="action_name">.uno:DuplicateSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -4823,7 +4823,7 @@
<object class="GtkToolButton" id="Insert-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -4860,7 +4860,7 @@
<object class="GtkToolButton" id="Insert-DuplicatePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:DuplicatePage</property>
+ <property name="action_name">.uno:DuplicateSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6000,7 +6000,7 @@
<object class="GtkToolButton" id="Page-PageSetup">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6142,7 +6142,7 @@
<object class="GtkToolButton" id="Page-DeletePage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:DeletePage</property>
+ <property name="action_name">.uno:DeleteSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6281,7 +6281,7 @@
<object class="GtkToolButton" id="Page-MovePageUp">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:MovePageUp</property>
+ <property name="action_name">.uno:MoveSlideUp</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6322,7 +6322,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="action_name">.uno:MovePageDown</property>
+ <property name="action_name">.uno:MoveSlideDown</property>
</object>
<packing>
<property name="expand">False</property>
@@ -18024,7 +18024,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="visible_horizontal">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
<property name="icon_name">sfx2/res/symphony/open_more.png</property>
</object>
<packing>
@@ -18447,7 +18447,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
</object>
<packing>
<property name="expand">True</property>
diff --git a/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui b/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui
index 8859be5e67d1..f520bc410b93 100644
--- a/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact.ui
@@ -562,7 +562,7 @@
<object class="GtkMenuItem" id="MenuEdit-PageSetup">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
</object>
</child>
</object>
@@ -1760,14 +1760,14 @@
<object class="GtkMenuItem" id="MenuInsert-InsertPageField">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPageField</property>
+ <property name="action_name">.uno:InsertSlideField</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="MenuInsert-InsertPagesField">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPagesField</property>
+ <property name="action_name">.uno:InsertSlidesField</property>
</object>
</child>
<child>
@@ -3283,7 +3283,7 @@
<object class="GtkToolButton" id="Default-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -4502,7 +4502,7 @@
<object class="GtkToolButton" id="Text-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -6789,7 +6789,7 @@
<object class="GtkToolButton" id="Default-InsertPage1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui b/sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui
index 2210b4e86b20..6c9dfcb7021b 100644
--- a/sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar_groupedbar_full.ui
@@ -712,7 +712,7 @@
<object class="GtkMenuItem" id="MenuEdit-PageSetup">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
</object>
</child>
</object>
@@ -1677,14 +1677,14 @@
<object class="GtkMenuItem" id="InsertPageFieldD">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPageField</property>
+ <property name="action_name">.uno:InsertSlideField</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="InsertPagesFieldD">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPagesField</property>
+ <property name="action_name">.uno:InsertSlidesField</property>
</object>
</child>
<child>
@@ -3703,7 +3703,7 @@
<object class="GtkToolButton" id="InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -3727,7 +3727,7 @@
<object class="GtkToolButton" id="DuplicateSlide2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:DuplicatePage</property>
+ <property name="action_name">.uno:DuplicateSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -5786,7 +5786,7 @@
<object class="GtkToolButton" id="InsertPageField3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPageField</property>
+ <property name="action_name">.uno:InsertSlideField</property>
</object>
<packing>
<property name="expand">False</property>
@@ -5856,7 +5856,7 @@
<object class="GtkToolButton" id="InsertPagesField3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPagesField</property>
+ <property name="action_name">.uno:InsertSlidesField</property>
</object>
<packing>
<property name="expand">False</property>
@@ -11852,7 +11852,7 @@
<object class="GtkToolButton" id="InsertPageField1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPageField</property>
+ <property name="action_name">.uno:InsertSlideField</property>
</object>
<packing>
<property name="expand">False</property>
@@ -11863,7 +11863,7 @@
<object class="GtkToolButton" id="InsertPagesField1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPagesField</property>
+ <property name="action_name">.uno:InsertSlidesField</property>
</object>
<packing>
<property name="expand">False</property>
@@ -11933,7 +11933,7 @@
<object class="GtkToolButton" id="InsertPageTitleField1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPageTitleField</property>
+ <property name="action_name">.uno:InsertSlideTitleField</property>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sd/uiconfig/simpress/ui/notebookbar_online.ui b/sd/uiconfig/simpress/ui/notebookbar_online.ui
new file mode 100644
index 000000000000..1151d7b502d0
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/notebookbar_online.ui
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface domain="sw">
+ <requires lib="gtk+" version="3.18"/>
+ <requires lib="LibreOffice" version="1.0"/>
+ <!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="font">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkToolButton" id="Home-CharFontName">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="action_name">.uno:CharFontName</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="fontheight">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_left">5</property>
+ <child>
+ <object class="GtkToolButton" id="Home-FontHeight">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">.uno:FontHeight</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sd/uiconfig/simpress/ui/notebookbar_single.ui b/sd/uiconfig/simpress/ui/notebookbar_single.ui
index 428e694f9c18..6d984318d099 100644
--- a/sd/uiconfig/simpress/ui/notebookbar_single.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar_single.ui
@@ -196,7 +196,7 @@
<object class="GtkToolButton" id="Home-InsertPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">.uno:InsertPage</property>
+ <property name="action_name">.uno:InsertSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -248,7 +248,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="action_name">.uno:DuplicatePage</property>
+ <property name="action_name">.uno:DuplicateSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -260,7 +260,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
- <property name="action_name">.uno:DeletePage</property>
+ <property name="action_name">.uno:DeleteSlide</property>
</object>
<packing>
<property name="expand">False</property>
@@ -11387,7 +11387,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="visible_horizontal">False</property>
- <property name="action_name">.uno:PageSetup</property>
+ <property name="action_name">.uno:SlideSetup</property>
<property name="icon_name">sfx2/res/symphony/open_more.png</property>
</object>
<packing>
diff --git a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
index 2c4e4202a6e6..e484f57d1527 100644
--- a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
+++ b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
@@ -146,7 +146,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
diff --git a/sdext/Executable_xpdfimport.mk b/sdext/Executable_xpdfimport.mk
index 360358d450d2..7b951a2cd0c6 100644
--- a/sdext/Executable_xpdfimport.mk
+++ b/sdext/Executable_xpdfimport.mk
@@ -22,6 +22,10 @@ $(eval $(call gb_Executable_add_exception_objects,xpdfimport,\
sdext/source/pdfimport/xpdfwrapper/wrapper_gpl \
))
+$(eval $(call gb_Executable_use_system_win32_libs,xpdfimport,\
+ shell32 \
+))
+
$(eval $(call gb_Executable_add_default_nativeres,xpdfimport))
# vim:set noet sw=4 ts=4:
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 3d36e77110be..ad25b2edd85b 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -486,12 +486,6 @@ void Parser::parseFontFamilyName( FontAttributes& rResult )
const sal_Unicode* pCopy = rResult.familyName.getStr();
sal_Int32 nLen = rResult.familyName.getLength();
- // parse out truetype subsets (e.g. BAAAAA+Thorndale)
- if( nLen > 8 && pCopy[6] == '+' )
- {
- pCopy += 7;
- nLen -= 7;
- }
// TODO: Looks like this block needs to be refactored
while( nLen )
@@ -613,52 +607,6 @@ void Parser::readFont()
// extract textual attributes (bold, italic in the name, etc.)
parseFontFamilyName(aResult);
- // need to read font file?
- if( nFileLen )
- {
- uno::Sequence<sal_Int8> aFontFile(nFileLen);
- readBinaryData( aFontFile );
-
- awt::FontDescriptor aFD;
- uno::Sequence< uno::Any > aArgs(1);
- aArgs[0] <<= aFontFile;
-
- try
- {
- uno::Reference< beans::XMaterialHolder > xMat(
- m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
- "com.sun.star.awt.FontIdentificator", aArgs, m_xContext ),
- uno::UNO_QUERY );
- if( xMat.is() )
- {
- uno::Any aRes( xMat->getMaterial() );
- if( aRes >>= aFD )
- {
- if (!aFD.Name.isEmpty())
- {
- aResult.familyName = aFD.Name;
- parseFontFamilyName(aResult);
- }
- aResult.isBold = (aFD.Weight > 100.0);
- aResult.isItalic = (aFD.Slant == awt::FontSlant_OBLIQUE ||
- aFD.Slant == awt::FontSlant_ITALIC );
- aResult.isUnderline = false;
- aResult.size = 0;
- }
- }
- }
- catch( uno::Exception& )
- {
- }
-
- if( aResult.familyName.isEmpty() )
- {
- // last fallback
- aResult.familyName = "Arial";
- aResult.isUnderline = false;
- }
-
- }
if (!m_xDev)
m_xDev.disposeAndReset(VclPtr<VirtualDevice>::Create());
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 16ad04bf660a..676aefe91859 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -432,14 +432,19 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* gfxFont, GfxState* state )
FontAttributes aNewFont;
int nSize = 0;
-#if POPPLER_CHECK_VERSION(0, 64, 0)
- const
+#if POPPLER_CHECK_VERSION(20, 12, 0)
+ std::string familyName = gfxFont->getNameWithoutSubsetTag();
+#else
+ std::string familyName = gfxFont->getName()->toStr();
+ if (familyName.length() > 7 && familyName.at(6) == '+')
+ {
+ familyName = familyName.substr(7);
+ }
#endif
- GooString* pFamily = gfxFont->getName();
- if( pFamily )
+ if( familyName != "" )
{
aNewFont.familyName.clear();
- aNewFont.familyName.append( gfxFont->getName() );
+ aNewFont.familyName.append( familyName );
}
else
{
@@ -456,12 +461,21 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* gfxFont, GfxState* state )
{
// TODO(P3): Unfortunately, need to read stream twice, since
// we must write byte count to stdout before
+#if POPPLER_CHECK_VERSION(22, 6, 0)
+ std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
+ if ( pBuf )
+ {
+ aNewFont.isEmbedded = true;
+ nSize = pBuf->size();
+ }
+#else
char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
if( pBuf )
{
aNewFont.isEmbedded = true;
gfree(pBuf);
}
+#endif
}
m_aFontMap[ nNewId ] = aNewFont;
@@ -474,13 +488,29 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
return;
int nSize = 0;
+#if POPPLER_CHECK_VERSION(22, 6, 0)
+ std::optional<std::vector<unsigned char>> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() );
+ if ( pBuf )
+ nSize = pBuf->size();
+ if ( nSize == 0 )
+ return;
+#else
char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize );
if( !pBuf )
return;
+#endif
// ---sync point--- see SYNC STREAMS above
fflush(stdout);
+#if POPPLER_CHECK_VERSION(22, 6, 0)
+ if( fwrite(pBuf->data(), sizeof(*pBuf->data()), nSize, g_binary_out) != static_cast<size_t>(nSize) )
+ {
+ exit(1); // error
+ }
+ // ---sync point--- see SYNC STREAMS above
+ fflush(g_binary_out);
+#else
if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast<size_t>(nSize) )
{
gfree(pBuf);
@@ -489,6 +519,7 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
// ---sync point--- see SYNC STREAMS above
fflush(g_binary_out);
gfree(pBuf);
+#endif
}
#if POPPLER_CHECK_VERSION(0, 83, 0)
@@ -635,8 +666,15 @@ void PDFOutDev::updateLineDash(GfxState *state)
return;
assert(state);
- double* dashArray; int arrayLen; double startOffset;
+ int arrayLen; double startOffset;
+#if POPPLER_CHECK_VERSION(22, 9, 0)
+ const std::vector<double> &dash = state->getLineDash(&startOffset);
+ const double* dashArray = dash.data();
+ arrayLen = dash.size();
+#else
+ double* dashArray;
state->getLineDash(&dashArray, &arrayLen, &startOffset);
+#endif
printf( "updateLineDash" );
if( arrayLen && dashArray )
@@ -742,7 +780,11 @@ void PDFOutDev::updateFont(GfxState *state)
{
assert(state);
+#if POPPLER_CHECK_VERSION(22, 6, 0)
+ GfxFont *gfxFont = state->getFont().get();
+#else
GfxFont *gfxFont = state->getFont();
+#endif
if( !gfxFont )
return;
@@ -786,9 +828,6 @@ void PDFOutDev::updateFont(GfxState *state)
aEsc.data() );
}
printf( "\n" );
-
- if( nEmbedSize )
- writeFontFile(gfxFont);
}
void PDFOutDev::updateRender(GfxState *state)
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index b1a54bd09c5f..3ab3381652cd 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -119,6 +119,15 @@ int main(int argc, char **argv)
_setmode( _fileno( g_binary_out ), _O_BINARY );
#endif
+#if POPPLER_CHECK_VERSION(22, 6, 0)
+ PDFDoc aDoc( std::make_unique<GooString>(pFileName),
+ std::optional<GooString>(pOwnerPasswordStr),
+ std::optional<GooString>(pUserPasswordStr) );
+
+ PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
+ std::optional<GooString>(pOwnerPasswordStr),
+ std::optional<GooString>(pUserPasswordStr) );
+#else
PDFDoc aDoc( pFileName,
pOwnerPasswordStr,
pUserPasswordStr );
@@ -126,6 +135,7 @@ int main(int argc, char **argv)
PDFDoc aErrDoc( pErrFileName,
pOwnerPasswordStr,
pUserPasswordStr );
+#endif
// Check various permissions for aDoc.
PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index b26dfc2fb3af..601bbe1f9628 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -204,12 +204,6 @@ void PresenterController::disposing()
if (mxConfigurationController.is())
mxConfigurationController->removeConfigurationChangeListener(this);
- Reference<XComponent> xWindowManagerComponent (
- static_cast<XWeak*>(mpWindowManager.get()), UNO_QUERY);
- mpWindowManager = nullptr;
- if (xWindowManagerComponent.is())
- xWindowManagerComponent->dispose();
-
if (mxController.is())
{
Reference<frame::XFrame> xFrame (mxController->getFrame());
@@ -218,6 +212,12 @@ void PresenterController::disposing()
mxController = nullptr;
}
+ Reference<XComponent> xWindowManagerComponent (
+ static_cast<XWeak*>(mpWindowManager.get()), UNO_QUERY);
+ mpWindowManager = nullptr;
+ if (xWindowManagerComponent.is())
+ xWindowManagerComponent->dispose();
+
mxComponentContext = nullptr;
mxConfigurationController = nullptr;
mxSlideShowController = nullptr;
diff --git a/setup_native/source/packinfo/finals_instsetoo.txt.in b/setup_native/source/packinfo/finals_instsetoo.txt
index 0804f7e49150..d5a68d369f7b 100644
--- a/setup_native/source/packinfo/finals_instsetoo.txt.in
+++ b/setup_native/source/packinfo/finals_instsetoo.txt
@@ -30,4 +30,3 @@
# OpenOffice pro de \\<server>\<path>\msi\OOO300_m6_native_packed-1_de.9352\openofficeorg30.msi
# OpenOfficeLanguagePack pro es \\<server>\<path>\msi\OOO300_m6_native_packed-1_es.9352\openofficeorg30.msi
# URE pro en-US \\<server>\<path>\msi\OOO300_m6_native_packed-1_en-US.9352\ure14.msi
-CollaboraOffice pro en-US,ar,as,ast,bg,bn-IN,br,ca,ca-valencia,cy,cs,da,de,el,en-GB,es,et,eu,fi,fr,ga,gd,gl,gu,he,hi,hr,hu,id,is,it,ja,km,kn,ko,lt,lv,ml,mr,nb,nl,nn,oc,or,pa-IN,pl,pt,pt-BR,ro,ru,sk,sl,sr,sr-Latn,sv,ta,te,tr,uk,vi,zh-CN,zh-TW c:\lo\src\cp-6.4-2-@WINDOWS_SDK_ARCH@\Collabora_Office_6.4-2_Win_@WINDOWS_SDK_ARCH@.msi
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 14885d95710d..d2e437b758b6 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -433,7 +433,28 @@ IMPL_STATIC_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBas
return false;
#else
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OUString aError;
+ std::unique_ptr<ErrorInfo> pErrorInfo = ErrorInfo::GetErrorInfo(StarBASIC::GetErrorCode());
+ if (ErrorStringFactory::CreateString(pErrorInfo.get(), aError))
+ {
+ const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+ std::shared_ptr<weld::MessageDialog> xBox(
+ Application::CreateMessageDialog(
+ pViewFrame->GetWindow().GetFrameWeld(),
+ VclMessageType::Error,
+ VclButtonsType::Ok,
+ aError,
+ true));
+
+ xBox->runAsync(xBox, [](sal_Int32 /*nResult*/) {});
+ }
+ return true;
+ }
+
#ifndef DISABLE_DYNLOADING
+
// load basctl module
osl::Module aMod;
aMod.loadRelative(&thisModule, SVLIBRARY("basctl"));
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 47fb7a5f92c7..4f9af60cb981 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -955,6 +955,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
// Sidebar
pViewFrame->ShowChildWindow( SID_SIDEBAR );
+ if (comphelper::LibreOfficeKit::isActive())
+ aSidebarMode = "Opened";
+
sfx2::sidebar::SidebarController* pSidebar =
sfx2::sidebar::SidebarController::GetSidebarControllerForFrame( xFrame );
if ( pSidebar )
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index 98e036e0a7ea..b50d1e63c789 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -76,10 +76,10 @@ css::uno::Sequence<OUString> SAL_CALL SfxMacroLoader::getSupportedServiceNames()
return aSeq;
}
-SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl()
+SfxObjectShell* SfxMacroLoader::GetObjectShell(const Reference <XFrame>& xFrame)
{
SfxObjectShell* pDocShell = nullptr;
- Reference < XFrame > xFrame( m_xFrame.get(), UNO_QUERY );
+
if ( xFrame.is() )
{
SfxFrame* pFrame=nullptr;
@@ -96,6 +96,11 @@ SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl()
return pDocShell;
}
+SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl()
+{
+ Reference < XFrame > xFrame( m_xFrame.get(), UNO_QUERY );
+ return SfxMacroLoader::GetObjectShell(xFrame);
+}
uno::Reference<frame::XDispatch> SAL_CALL SfxMacroLoader::queryDispatch(
const util::URL& aURL ,
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index dc1e80cbf1b4..8366e2eef254 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -50,6 +50,7 @@
#include <vcl/svapp.hxx>
#include <vcl/uitest/logger.hxx>
#include <boost/property_tree/json_parser.hpp>
+#include <tools/json_writer.hxx>
#include <sfx2/app.hxx>
#include <sfx2/unoctitm.hxx>
@@ -71,6 +72,7 @@
#include <unotools/pathoptions.hxx>
#include <osl/time.h>
#include <sfx2/lokhelper.hxx>
+#include <basic/sberrors.hxx>
#include <iostream>
#include <map>
@@ -616,6 +618,21 @@ void SfxDispatchController_Impl::dispatch( const css::util::URL& aURL,
collectUIInformation(aURL, aArgs);
SolarMutexGuard aGuard;
+
+ if (comphelper::LibreOfficeKit::isActive() &&
+ SfxViewShell::Current()->isBlockedCommand(aURL.Complete))
+ {
+ tools::JsonWriter aTree;
+ aTree.put("code", "");
+ aTree.put("kind", "BlockedCommand");
+ aTree.put("cmd", aURL.Complete);
+ aTree.put("message", "Blocked feature");
+ aTree.put("viewID", SfxViewShell::Current()->GetViewShellId().get());
+
+ SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_COMMAND_BLOCKED, aTree.extractData());
+ return;
+ }
+
if (
!(pDispatch &&
(
@@ -1169,7 +1186,11 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra
aEvent.FeatureURL.Path == "Substract" ||
aEvent.FeatureURL.Path == "DistributeSelection" ||
aEvent.FeatureURL.Path == "Intersect" ||
- aEvent.FeatureURL.Path == "ResetAttributes")
+ aEvent.FeatureURL.Path == "ResetAttributes" ||
+ aEvent.FeatureURL.Path == "IncrementIndent" ||
+ aEvent.FeatureURL.Path == "DecrementIndent" ||
+ aEvent.FeatureURL.Path == "NumberFormatDecDecimals" ||
+ aEvent.FeatureURL.Path == "NumberFormatIncDecimals")
{
aBuffer.append(aEvent.IsEnabled ? OUStringLiteral("enabled") : OUStringLiteral("disabled"));
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index af3459680517..b5dfa876446b 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/util/Duration.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/CmisProperty.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <vcl/timer.hxx>
#include <vcl/settings.hxx>
@@ -715,6 +716,8 @@ SfxDocumentPage::SfxDocumentPage(weld::Container* pPage, weld::DialogController*
, m_xUseThumbnailSaveCB(m_xBuilder->weld_check_button("thumbnailsavecb"))
, m_xTemplFt(m_xBuilder->weld_label("templateft"))
, m_xTemplValFt(m_xBuilder->weld_label("showtemplate"))
+ , m_xImagePreferredDpiCheckButton(m_xBuilder->weld_check_button("image-preferred-dpi-checkbutton"))
+ , m_xImagePreferredDpiComboBox(m_xBuilder->weld_combo_box("image-preferred-dpi-combobox"))
{
m_aUnknownSize = m_xShowSizeFT->get_label();
m_xShowSizeFT->set_label(OUString());
@@ -727,6 +730,7 @@ SfxDocumentPage::SfxDocumentPage(weld::Container* pPage, weld::DialogController*
m_xChangePassBtn->connect_clicked( LINK( this, SfxDocumentPage, ChangePassHdl ) );
m_xSignatureBtn->connect_clicked( LINK( this, SfxDocumentPage, SignatureHdl ) );
m_xDeleteBtn->connect_clicked( LINK( this, SfxDocumentPage, DeleteHdl ) );
+ m_xImagePreferredDpiCheckButton->connect_toggled(LINK(this, SfxDocumentPage, ImagePreferredDPICheckBoxClicked));
// [i96288] Check if the document signature command is enabled
// on the main list enable/disable the pushbutton accordingly
@@ -767,6 +771,12 @@ IMPL_LINK_NOARG(SfxDocumentPage, SignatureHdl, weld::Button&, void)
}
}
+IMPL_LINK_NOARG(SfxDocumentPage, ImagePreferredDPICheckBoxClicked, weld::ToggleButton&, void)
+{
+ bool bEnabled = m_xImagePreferredDpiCheckButton->get_state() == TRISTATE_TRUE;
+ m_xImagePreferredDpiComboBox->set_sensitive(bEnabled);
+}
+
IMPL_LINK_NOARG(SfxDocumentPage, ChangePassHdl, weld::Button&, void)
{
SfxObjectShell* pShell = SfxObjectShell::Current();
@@ -917,6 +927,26 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet )
}
}
+ SfxObjectShell* pDocSh = SfxObjectShell::Current();
+ if (pDocSh)
+ {
+ uno::Reference<lang::XMultiServiceFactory> xFac(pDocSh->GetModel(), uno::UNO_QUERY);
+ if (xFac.is())
+ {
+ uno::Reference<beans::XPropertySet> xProps(xFac->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ if (xProps.is())
+ {
+ sal_Int32 nImagePreferredDPI = 0;
+ if (m_xImagePreferredDpiCheckButton->get_state() == TRISTATE_TRUE)
+ {
+ OUString aImagePreferredDPIString = m_xImagePreferredDpiComboBox->get_active_text();
+ nImagePreferredDPI = aImagePreferredDPIString.toInt32();
+ }
+ xProps->setPropertyValue("ImagePreferredDPI", uno::makeAny(nImagePreferredDPI));
+ }
+ }
+ }
+
return bRet;
}
@@ -1071,6 +1101,35 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
m_xDeleteBtn->set_sensitive( bEnableUseUserData );
m_xUseThumbnailSaveCB->set_active(bUseThumbnailSave);
m_xUseThumbnailSaveCB->save_state();
+
+ SfxObjectShell* pDocSh = SfxObjectShell::Current();
+ sal_Int32 nImagePreferredDPI = 0;
+ if (pDocSh)
+ {
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFac( pDocSh->GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY_THROW );
+
+ xProps->getPropertyValue("ImagePreferredDPI") >>= nImagePreferredDPI;
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+ if (nImagePreferredDPI > 0)
+ {
+ m_xImagePreferredDpiCheckButton->set_state(TRISTATE_TRUE);
+ m_xImagePreferredDpiComboBox->set_sensitive(true);
+ m_xImagePreferredDpiComboBox->set_entry_text(OUString::number(nImagePreferredDPI));
+ }
+ else
+ {
+ m_xImagePreferredDpiCheckButton->set_state(TRISTATE_FALSE);
+ m_xImagePreferredDpiComboBox->set_sensitive(false);
+ m_xImagePreferredDpiComboBox->set_entry_text("");
+ }
+
}
SfxDocumentInfoDialog::SfxDocumentInfoDialog(weld::Window* pParent, const SfxItemSet& rItemSet)
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 8a69523c0e8d..d7b75e2667fa 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -174,6 +174,8 @@ void SfxTabPage::Reset( const SfxItemSet* )
{
}
+bool SfxTabPage::DeferResetToFirstActivation() { return false; }
+
void SfxTabPage::ActivatePage( const SfxItemSet& )
/* [Description]
@@ -925,7 +927,10 @@ void SfxTabDialogController::CreatePages()
pDataObject->xTabPage->SetUserData(sUserData);
PageCreated(pDataObject->sId, *pDataObject->xTabPage);
- pDataObject->xTabPage->Reset(m_pSet.get());
+ if (pDataObject->xTabPage->DeferResetToFirstActivation())
+ pDataObject->bRefresh = true; // Reset will be called in ActivatePageHdl
+ else
+ pDataObject->xTabPage->Reset(m_pSet.get());
}
}
diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx
index 60156ad6d4f3..af761bd99de4 100644
--- a/sfx2/source/dialog/tplpitem.cxx
+++ b/sfx2/source/dialog/tplpitem.cxx
@@ -31,9 +31,11 @@ SfxTemplateItem::SfxTemplateItem() :
SfxTemplateItem::SfxTemplateItem
(
sal_uInt16 nWhichId, // Slot-ID
- const OUString& rStyle // Name of the current Styles
+ const OUString& rStyle, // Name of the current Styles
+ const OUString& rStyleIdentifier // Prog Name of current Style
) : SfxFlagItem( nWhichId, static_cast<sal_uInt16>(SfxStyleSearchBits::All) ),
- aStyle( rStyle )
+ aStyle( rStyle ),
+ aStyleIdentifier( rStyleIdentifier )
{
}
@@ -42,7 +44,8 @@ SfxTemplateItem::SfxTemplateItem
bool SfxTemplateItem::operator==( const SfxPoolItem& rCmp ) const
{
return ( SfxFlagItem::operator==( rCmp ) &&
- aStyle == static_cast<const SfxTemplateItem&>(rCmp).aStyle );
+ aStyle == static_cast<const SfxTemplateItem&>(rCmp).aStyle &&
+ aStyleIdentifier == static_cast<const SfxTemplateItem&>(rCmp).aStyleIdentifier );
}
@@ -58,6 +61,7 @@ bool SfxTemplateItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
aTemplate.Value = static_cast<sal_uInt16>(GetValue());
aTemplate.StyleName = aStyle;
+ aTemplate.StyleNameIdentifier = aStyleIdentifier;
rVal <<= aTemplate;
return true;
@@ -72,6 +76,7 @@ bool SfxTemplateItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId
{
SetValue( static_cast<SfxStyleSearchBits>(aTemplate.Value) );
aStyle = aTemplate.StyleName;
+ aStyleIdentifier = aTemplate.StyleNameIdentifier;
return true;
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index ae24bf153ea2..afcb06d08478 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2750,7 +2750,7 @@ void SfxMedium::Download( const Link<void*,void>& aLink )
GetInStream();
if ( pImpl->m_pInStream && !aLink.IsSet() )
{
- while( !pImpl->bDownloadDone )
+ while( !pImpl->bDownloadDone && !Application::IsQuit())
Application::Yield();
}
}
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index 8b1271545dfb..84d724f7c58f 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -32,18 +32,22 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <comphelper/propertyvalue.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/ref.hxx>
#include <svtools/miscopt.hxx>
#include <svl/ownlist.hxx>
#include <svl/itemprop.hxx>
+#include <sfx2/docfile.hxx>
#include <sfx2/frmdescr.hxx>
+#include <sfx2/objsh.hxx>
#include <sfx2/sfxdlg.hxx>
#include <sfx2/sfxsids.hrc>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
#include <tools/debug.hxx>
+#include <macroloader.hxx>
using namespace ::com::sun::star;
@@ -159,38 +163,62 @@ sal_Bool SAL_CALL IFrameObject::load(
{
if ( SvtMiscOptions().IsPluginsEnabled() )
{
- DBG_ASSERT( !mxFrame.is(), "Frame already existing!" );
- VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
- VclPtr<IFrameWindow_Impl> pWin = VclPtr<IFrameWindow_Impl>::Create( pParent, maFrmDescr.IsFrameBorderOn() );
- pWin->SetSizePixel( pParent->GetOutputSizePixel() );
- pWin->SetBackground();
- pWin->Show();
+ util::URL aTargetURL;
+ aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE );
+ uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) );
+ xTrans->parseStrict( aTargetURL );
- uno::Reference < awt::XWindow > xWindow( pWin->GetComponentInterface(), uno::UNO_QUERY );
- xFrame->setComponent( xWindow, uno::Reference < frame::XController >() );
+ INetURLObject aURLObject(aTargetURL.Complete);
+ if (aURLObject.GetProtocol() == INetProtocol::Macro || aURLObject.isSchemeEqualTo(u"vnd.sun.star.script"))
+ return false;
- // we must destroy the IFrame before the parent is destroyed
- xWindow->addEventListener( this );
+ uno::Reference<frame::XFramesSupplier> xParentFrame = xFrame->getCreator();
+ SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame);
- mxFrame = frame::Frame::create( mxContext );
- uno::Reference < awt::XWindow > xWin( pWin->GetComponentInterface(), uno::UNO_QUERY );
- mxFrame->initialize( xWin );
- mxFrame->setName( maFrmDescr.GetName() );
+ bool bUpdateAllowed(true);
+ if (pDoc)
+ {
+ comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pDoc->getEmbeddedObjectContainer();
+ bUpdateAllowed = rEmbeddedObjectContainer.getUserAllowsLinkUpdate();
+ }
+ if (!bUpdateAllowed)
+ return false;
- uno::Reference < frame::XFramesSupplier > xFramesSupplier( xFrame, uno::UNO_QUERY );
- if ( xFramesSupplier.is() )
- mxFrame->setCreator( xFramesSupplier );
+ OUString sReferer;
+ if (pDoc && pDoc->HasName())
+ sReferer = pDoc->GetMedium()->GetName();
- util::URL aTargetURL;
- aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE );
- uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( mxContext ) );
- xTrans->parseStrict( aTargetURL );
+ uno::Reference<css::awt::XWindow> xParentWindow(xFrame->getContainerWindow());
+
+ if (!mxFrame.is())
+ {
+ VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow(xParentWindow);
+ VclPtr<IFrameWindow_Impl> pWin = VclPtr<IFrameWindow_Impl>::Create( pParent, maFrmDescr.IsFrameBorderOn() );
+ pWin->SetSizePixel( pParent->GetOutputSizePixel() );
+ pWin->SetBackground();
+ pWin->Show();
+
+ uno::Reference < awt::XWindow > xWindow( pWin->GetComponentInterface(), uno::UNO_QUERY );
+ xFrame->setComponent( xWindow, uno::Reference < frame::XController >() );
+
+ // we must destroy the IFrame before the parent is destroyed
+ xWindow->addEventListener( this );
+
+ mxFrame = frame::Frame::create( mxContext );
+ uno::Reference < awt::XWindow > xWin( pWin->GetComponentInterface(), uno::UNO_QUERY );
+ mxFrame->initialize( xWin );
+ mxFrame->setName( maFrmDescr.GetName() );
+
+ uno::Reference < frame::XFramesSupplier > xFramesSupplier( xFrame, uno::UNO_QUERY );
+ if ( xFramesSupplier.is() )
+ mxFrame->setCreator( xFramesSupplier );
+ }
- uno::Sequence < beans::PropertyValue > aProps(2);
- aProps[0].Name = "PluginMode";
- aProps[0].Value <<= sal_Int16(2);
- aProps[1].Name = "ReadOnly";
- aProps[1].Value <<= true;
+ uno::Sequence < beans::PropertyValue > aProps{
+ comphelper::makePropertyValue("PluginMode", sal_Int16(2)),
+ comphelper::makePropertyValue("ReadOnly", true),
+ comphelper::makePropertyValue("Referer", sReferer)
+ };
uno::Reference < frame::XDispatch > xDisp = mxFrame->queryDispatch( aTargetURL, "_self", 0 );
if ( xDisp.is() )
xDisp->dispatch( aTargetURL, aProps );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 619054815bff..6963f62cf6b5 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1851,9 +1851,10 @@ void SfxObjectShell::AfterSigning(bool bSignSuccess, bool bSignScriptingContent)
EnableSetModified();
}
-bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent)
+bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent, weld::Window* pDialogParent)
{
- if (GetMedium()->IsOriginallyReadOnly())
+ // in LOK case we support only viewer / readonly mode so far
+ if (GetMedium()->IsOriginallyReadOnly() || comphelper::LibreOfficeKit::isActive())
{
// If the file is physically read-only, we just show the existing signatures
try
@@ -1863,6 +1864,10 @@ bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent)
uno::Reference<security::XDocumentDigitalSignatures> xSigner(
security::DocumentDigitalSignatures::createWithVersionAndValidSignature(
comphelper::getProcessComponentContext(), aODFVersion, HasValidSignatures()));
+
+ if (pDialogParent)
+ xSigner->setParentWindow(pDialogParent->GetXWindow());
+
if (bSignScriptingContent)
xSigner->showScriptingContentSignatures(GetMedium()->GetZipStorageToSign_Impl(),
uno::Reference<io::XInputStream>());
@@ -1876,6 +1881,18 @@ bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent)
{
std::unique_ptr<SvStream> pStream(
utl::UcbStreamHelper::CreateStream(GetName(), StreamMode::READ));
+
+ if (!pStream)
+ {
+ pStream = utl::UcbStreamHelper::CreateStream(GetMedium()->GetName(), StreamMode::READ);
+
+ if (!pStream)
+ {
+ SAL_WARN( "sfx.doc", "Couldn't use signing functionality!" );
+ return true;
+ }
+ }
+
uno::Reference<io::XInputStream> xStream(new utl::OStreamWrapper(*pStream));
xSigner->showDocumentContentSignatures(uno::Reference<embed::XStorage>(),
xStream);
@@ -1908,7 +1925,7 @@ void SfxObjectShell::SignDocumentContent(weld::Window* pDialogParent)
if (!PrepareForSigning(pDialogParent))
return;
- if (CheckIsReadonly(false))
+ if (CheckIsReadonly(false, pDialogParent))
return;
bool bSignSuccess = GetMedium()->SignContents_Impl(pDialogParent, false, HasValidSignatures());
@@ -2005,7 +2022,7 @@ void SfxObjectShell::SignSignatureLine(weld::Window* pDialogParent,
if (!PrepareForSigning(pDialogParent))
return;
- if (CheckIsReadonly(false))
+ if (CheckIsReadonly(false, pDialogParent))
return;
bool bSignSuccess = GetMedium()->SignContents_Impl(pDialogParent,
@@ -2030,7 +2047,7 @@ void SfxObjectShell::SignScriptingContent(weld::Window* pDialogParent)
if (!PrepareForSigning(pDialogParent))
return;
- if (CheckIsReadonly(true))
+ if (CheckIsReadonly(true, pDialogParent))
return;
bool bSignSuccess = GetMedium()->SignContents_Impl(pDialogParent, true, HasValidSignatures());
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 2141a590b212..8d101e8aac04 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -774,7 +774,15 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
}
else
{
- bOk = ConvertFrom(*pMedium);
+ if (tools::isEmptyFileUrl(pMedium->GetName()))
+ {
+ // The import filter would fail with empty input.
+ bOk = true;
+ }
+ else
+ {
+ bOk = ConvertFrom(*pMedium);
+ }
InitOwnModel_Impl();
}
}
@@ -874,7 +882,8 @@ ErrCode SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell const *
SfxItemSet* pSet = pMedium->GetItemSet();
const SfxStringItem* pOptions = SfxItemSet::GetItem<SfxStringItem>(pSet, SID_FILE_FILTEROPTIONS, false);
const SfxUnoAnyItem* pData = SfxItemSet::GetItem<SfxUnoAnyItem>(pSet, SID_FILTER_DATA, false);
- if ( !pData && !pOptions )
+ const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+ if ( !pData && (bTiledRendering || !pOptions) )
{
css::uno::Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
css::uno::Reference< XNameAccess > xFilterCFG;
@@ -993,6 +1002,39 @@ bool SfxObjectShell::DoSave()
pImpl->bIsSaving = true;
+ if (IsOwnStorageFormat(*GetMedium()))
+ {
+ SvtSaveOptions::ODFSaneDefaultVersion nDefVersion = SvtSaveOptions::ODFSVER_012;
+ if (!utl::ConfigManager::IsFuzzing())
+ {
+ SvtSaveOptions aSaveOpt;
+ nDefVersion = aSaveOpt.GetODFSaneDefaultVersion();
+ }
+ uno::Reference<beans::XPropertySet> const xProps(GetMedium()->GetStorage(), uno::UNO_QUERY);
+ assert(xProps.is());
+ if (nDefVersion >= SvtSaveOptions::ODFSVER_012) // property exists only since ODF 1.2
+ {
+ try // tdf#134582 set Version on embedded objects as they
+ { // could have been loaded with a different/old version
+#if 0
+// not on old branch
+ if (SvtSaveOptions::ODFSVER_013 <= nDefVersion)
+ {
+ xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_013_TEXT));
+ }
+ else
+#endif
+ {
+ xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_012_TEXT));
+ }
+ }
+ catch (uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("sfx.doc", "SfxObjectShell::DoSave");
+ }
+ }
+ }
+
uno::Sequence< beans::NamedValue > aEncryptionData;
if ( IsPackageStorageFormat_Impl( *GetMedium() ) )
{
@@ -1128,6 +1170,8 @@ bool SfxObjectShell::SaveTo_Impl
UpdateDocInfoForSave();
ModifyBlocker_Impl aMod(this);
+ // tdf#41063, tdf#135244: prevent jumping to cursor at any temporary modification
+ auto aViewGuard(LockAllViews());
std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter();
if ( !pFilter )
@@ -2387,6 +2431,7 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
bool bHasBaseURL = false;
bool bHasFilterName = false;
bool bIsRedactMode = false;
+ bool bIsPreview = false;
sal_Int32 nEnd = aOldArgs.getLength();
for ( sal_Int32 i = 0; i < nEnd; i++ )
@@ -2404,6 +2449,13 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
bHasFilterName = true;
}
+ const css::uno::Sequence<css::beans::PropertyValue>& rMediumArgs = rMedium.GetArgs();
+ for ( sal_Int32 i = 0; i < rMediumArgs.getLength(); i++ )
+ {
+ if( rMediumArgs[i].Name == "IsPreview" )
+ rMediumArgs[i].Value >>= bIsPreview;
+ }
+
// FIXME: Handle this inside TransformItems()
if (pItems->GetItemState(SID_IS_REDACT_MODE) == SfxItemState::SET)
bIsRedactMode = true;
@@ -2444,6 +2496,13 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
aArgs[nEnd-1].Value <<= bIsRedactMode;
}
+ if (bIsPreview)
+ {
+ aArgs.realloc( ++nEnd );
+ aArgs[nEnd-1].Name = "IsPreview";
+ aArgs[nEnd-1].Value <<= bIsPreview;
+ }
+
return xFilter->filter( aArgs );
}catch(...)
{}
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 661074a9a102..7be718388e26 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -436,7 +436,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
//wait until printing is done
SfxPrinter* pDocPrinter = pViewSh->GetPrinter();
- while ( pDocPrinter->IsPrinting() )
+ while ( pDocPrinter->IsPrinting() && !Application::IsQuit())
Application::Yield();
}
@@ -491,7 +491,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread
/* SAFE { */
{
SolarMutexGuard aGuard;
- while( m_pPrinter->IsPrinting() )
+ while( m_pPrinter->IsPrinting() && !Application::IsQuit())
Application::Yield();
m_pPrinter.clear(); // don't delete it! It's borrowed only :-)
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a297faad0ec8..8c5b2dd87fef 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1063,48 +1063,72 @@ void SAL_CALL SfxBaseModel::setArgs(const Sequence<beans::PropertyValue>& aArgs)
{
OUString sValue;
bool bValue;
-
+ bool ok = false;
if (rArg.Name == "SuggestedSaveAsName")
{
- rArg.Value >>= sValue;
- pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASNAME, sValue));
+ if (rArg.Value >>= sValue)
+ {
+ pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASNAME, sValue));
+ ok = true;
+ }
}
else if (rArg.Name == "SuggestedSaveAsDir")
{
- rArg.Value >>= sValue;
- pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASDIR, sValue));
+ if (rArg.Value >>= sValue)
+ {
+ pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASDIR, sValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockContentExtraction")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_CONTENT_EXTRACTION, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_CONTENT_EXTRACTION, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockExport")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EXPORT, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EXPORT, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockPrint")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_PRINT, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_PRINT, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockSave")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_SAVE, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_SAVE, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockEditDoc")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EDITDOC, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EDITDOC, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "Replaceable")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_REPLACEABLE, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_REPLACEABLE, bValue));
+ ok = true;
+ }
}
- else
+ if (!ok)
{
throw lang::IllegalArgumentException("Setting property not supported: " + rArg.Name,
comphelper::getProcessComponentContext(), 0);
diff --git a/sfx2/source/inc/macroloader.hxx b/sfx2/source/inc/macroloader.hxx
index 9e1dfba18ed0..b3e7a5ec1abc 100644
--- a/sfx2/source/inc/macroloader.hxx
+++ b/sfx2/source/inc/macroloader.hxx
@@ -82,6 +82,8 @@ public:
virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
+
+ static SfxObjectShell* GetObjectShell(const css::uno::Reference<css::frame::XFrame>& xFrame);
};
#endif
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index e854a5e047d7..cc06c280f71a 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -295,6 +295,9 @@ bool SfxNotebookBar::IsActive()
OUString aActive = comphelper::getString( aAppNode.getNodeValue( "Active" ) );
+ if (comphelper::LibreOfficeKit::isActive() && aActive == "notebookbar_online.ui")
+ return true;
+
const utl::OConfigurationNode aModesNode = aAppNode.openNode("Modes");
const Sequence<OUString> aModeNodeNames( aModesNode.getNodeNames() );
@@ -360,6 +363,8 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
OUString aModuleName = xModuleManager->identify( xFrame );
vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum( aModuleName );
OUString sFile = lcl_getNotebookbarFileName( eApp );
+ if (comphelper::LibreOfficeKit::isActive())
+ sFile = "notebookbar_online.ui";
OUString sNewFile = rUIFile + sFile;
OUString sCurrentFile;
VclPtr<NotebookBar> pNotebookBar = pSysWindow->GetNotebookBar();
@@ -439,8 +444,10 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
}
else if (auto pNotebookBar = pSysWindow->GetNotebookBar())
{
- pNotebookBar->Hide();
- pNotebookBar->GetParent()->Resize();
+ vcl::Window* pParent = pNotebookBar->GetParent();
+ RemoveListeners(pSysWindow);
+ pSysWindow->CloseNotebookBar();
+ pParent->Resize();
SfxNotebookBar::ShowMenubar(true);
}
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index c132b9e506d0..d8975e1744dd 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -248,7 +248,8 @@ void SidebarController::disposeDecks()
(hide + "=false").c_str());
}
- mpParentWindow->ReleaseLOKNotifier();
+ if (mpParentWindow)
+ mpParentWindow->ReleaseLOKNotifier();
}
mpCurrentDeck.clear();
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 4b7fdada7851..e178e5338eb7 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -194,12 +194,6 @@ void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& a
if ( m_pClient && aEvent.EventName == "OnVisAreaChanged" && m_nAspect != embed::Aspects::MSOLE_ICON )
{
- if ( comphelper::LibreOfficeKit::isActive() )
- {
- if ( SfxViewShell* pViewShell = m_pClient->GetViewShell() )
- pViewShell->libreOfficeKitViewCallback( LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE" );
- }
-
m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area
m_pClient->ViewChanged();
m_pClient->Invalidate();
@@ -319,7 +313,8 @@ void SAL_CALL SfxInPlaceClient_Impl::visibilityChanged( sal_Bool bVisible )
throw uno::RuntimeException();
m_pClient->GetViewShell()->OutplaceActivated( bVisible );
- m_pClient->Invalidate();
+ if (m_pClient) // it can change in the above code
+ m_pClient->Invalidate();
}
@@ -346,7 +341,18 @@ void SAL_CALL SfxInPlaceClient_Impl::activatingInplace()
if ( comphelper::LibreOfficeKit::isActive() )
{
if ( SfxViewShell* pViewShell = m_pClient->GetViewShell() )
- pViewShell->libreOfficeKitViewCallback( LOK_CALLBACK_GRAPHIC_SELECTION, "INPLACE" );
+ {
+ tools::Rectangle aRect(m_pClient->GetObjArea());
+
+ if (m_pClient->GetEditWin())
+ {
+ if (m_pClient->GetEditWin()->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ aRect = OutputDevice::LogicToLogic(aRect, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ }
+
+ OString str = aRect.toString() + ", \"INPLACE\"";
+ pViewShell->libreOfficeKitViewCallback( LOK_CALLBACK_GRAPHIC_SELECTION, str.getStr() );
+ }
}
}
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 9208c6e35476..8eab6c772528 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -177,6 +177,23 @@ void SfxLokHelper::setView(int nId)
}
+SfxViewShell* SfxLokHelper::getViewOfId(int nId)
+{
+ SfxApplication* pApp = SfxApplication::Get();
+ if (pApp == nullptr)
+ return nullptr;
+
+ const ViewShellId nViewShellId(nId);
+ SfxViewShellArr_Impl& rViewArr = pApp->GetViewShells_Impl();
+ for (SfxViewShell* pViewShell : rViewArr)
+ {
+ if (pViewShell->GetViewShellId() == nViewShellId)
+ return pViewShell;
+ }
+
+ return nullptr;
+}
+
int SfxLokHelper::getView(const SfxViewShell* pViewShell)
{
if (!pViewShell)
@@ -489,14 +506,16 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView,
pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_WINDOW, s.getStr());
}
-void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload)
+void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, tools::Rectangle const* pRect)
{
- OStringBuffer aBuf(32);
-
if (DisableCallbacks::disabled())
return;
- aBuf.append(rPayload);
+ OStringBuffer aBuf(64);
+ if (pRect)
+ aBuf.append(pRect->toString());
+ else
+ aBuf.append("EMPTY");
if (comphelper::LibreOfficeKit::isPartInInvalidation())
{
aBuf.append(", ");
@@ -608,7 +627,7 @@ namespace
void LOKPostAsyncEvent(void* pEv, void*)
{
- LOKAsyncEventData* pLOKEv = static_cast<LOKAsyncEventData*>(pEv);
+ std::unique_ptr<LOKAsyncEventData> pLOKEv(static_cast<LOKAsyncEventData*>(pEv));
if (pLOKEv->mpWindow->IsDisposed())
return;
@@ -629,6 +648,9 @@ namespace
if (!pFocusWindow)
pFocusWindow = pLOKEv->mpWindow;
+ if (pLOKEv->mpWindow->IsDisposed())
+ return;
+
switch (pLOKEv->mnEvent)
{
case VclEventId::WindowKeyInput:
@@ -637,11 +659,13 @@ namespace
KeyEvent singlePress(pLOKEv->maKeyEvent.GetCharCode(),
pLOKEv->maKeyEvent.GetKeyCode());
for (sal_uInt16 i = 0; i <= nRepeat; ++i)
- pFocusWindow->KeyInput(singlePress);
+ if (!pFocusWindow->IsDisposed())
+ pFocusWindow->KeyInput(singlePress);
break;
}
case VclEventId::WindowKeyUp:
- pFocusWindow->KeyUp(pLOKEv->maKeyEvent);
+ if (!pFocusWindow->IsDisposed())
+ pFocusWindow->KeyUp(pLOKEv->maKeyEvent);
break;
case VclEventId::WindowMouseButtonDown:
pLOKEv->mpWindow->LogicMouseButtonDown(pLOKEv->maMouseEvent);
@@ -672,8 +696,6 @@ namespace
assert(false);
break;
}
-
- delete pLOKEv;
}
void postEventAsync(LOKAsyncEventData *pEvent)
@@ -717,6 +739,16 @@ void SfxLokHelper::postKeyEventAsync(const VclPtr<vcl::Window> &xWindow,
postEventAsync(pLOKEv);
}
+void SfxLokHelper::setBlockedCommandList(int nViewId, const char* bolckedCommandList)
+{
+ SfxViewShell* pViewShell = SfxLokHelper::getViewOfId(nViewId);
+
+ if(pViewShell)
+ {
+ pViewShell->setBlockedCommandList(bolckedCommandList);
+ }
+}
+
void SfxLokHelper::postExtTextEventAsync(const VclPtr<vcl::Window> &xWindow,
int nType, const OUString &rText)
{
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 75ec246b4fb6..456915a8cfd6 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/task/PasswordContainer.hpp>
#include <officecfg/Office/Common.hxx>
#include <officecfg/Setup.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -1369,6 +1370,24 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
}
} //bShowTipOfTheDay
+ if (officecfg::Office::Common::Passwords::HasMaster::get() &&
+ officecfg::Office::Common::Passwords::StorageVersion::get() == 0)
+ {
+ // master password stored in deprecated format
+ VclPtr<SfxInfoBarWindow> pOldMasterPasswordInfoBar =
+ AppendInfoBar("oldmasterpassword", "",
+ SfxResId(STR_REFRESH_MASTER_PASSWORD), InfobarType::DANGER, false);
+ if (pOldMasterPasswordInfoBar)
+ {
+ VclPtrInstance<PushButton> const xBtn(&GetWindow());
+ xBtn->SetText(SfxResId(STR_REFRESH_PASSWORD));
+ xBtn->SetSizePixel(xBtn->GetOptimalSize());
+ xBtn->SetClickHdl(LINK(this,
+ SfxViewFrame, RefreshMasterPasswordHdl));
+ pOldMasterPasswordInfoBar->addButton(xBtn);
+ }
+ }
+
// read-only infobar if necessary
const SfxViewShell *pVSh;
const SfxShell *pFSh;
@@ -1517,6 +1536,27 @@ IMPL_LINK_NOARG(SfxViewFrame, SignDocumentHandler, Button*, void)
GetDispatcher()->Execute(SID_SIGNATURE);
}
+IMPL_LINK_NOARG(SfxViewFrame, RefreshMasterPasswordHdl, Button*, void)
+{
+ bool bChanged = false;
+ try
+ {
+ Reference< task::XPasswordContainer2 > xMasterPasswd(
+ task::PasswordContainer::create(comphelper::getProcessComponentContext()));
+
+ css::uno::Reference<css::frame::XFrame> xFrame = GetFrame().GetFrameInterface();
+ css::uno::Reference<css::awt::XWindow> xContainerWindow = xFrame->getContainerWindow();
+
+ uno::Reference<task::XInteractionHandler> xTmpHandler(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(),
+ xContainerWindow));
+ bChanged = xMasterPasswd->changeMasterPassword(xTmpHandler);
+ }
+ catch (const Exception&)
+ {}
+ if (bChanged)
+ RemoveInfoBar(u"oldmasterpassword");
+}
+
void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
{
m_pImpl->bResizeInToOut = true;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index d7790fcdb6f5..f8f4f615966b 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -98,7 +98,7 @@
#include <sfx2/lokhelper.hxx>
#include <openuriexternally.hxx>
#include <shellimpl.hxx>
-
+#include <iostream>
#include <vector>
#include <libxml/xmlwriter.h>
@@ -1480,6 +1480,7 @@ void SfxViewShell::libreOfficeKitViewCallback(int nType, const char* pPayload) c
{
case LOK_CALLBACK_FORM_FIELD_BUTTON:
case LOK_CALLBACK_TEXT_SELECTION:
+ case LOK_CALLBACK_COMMENT:
break;
default:
// Reject e.g. invalidate during paint.
@@ -2100,4 +2101,23 @@ weld::Window* SfxViewShell::GetFrameWeld() const
return pWindow ? pWindow->GetFrameWeld() : nullptr;
}
+void SfxViewShell::setBlockedCommandList(const char* bolckedCommandList)
+{
+ if(!mvLOKBlockedCommandList.empty())
+ return;
+
+ OUString BolckedListString(bolckedCommandList, strlen(bolckedCommandList), RTL_TEXTENCODING_UTF8);
+ OUString command = BolckedListString.getToken(0, ' ');
+ for (size_t i = 1; !command.isEmpty(); i++)
+ {
+ mvLOKBlockedCommandList.emplace(command);
+ command = BolckedListString.getToken(i, ' ');
+ }
+}
+
+bool SfxViewShell::isBlockedCommand(OUString command)
+{
+ return mvLOKBlockedCommandList.find(command) != mvLOKBlockedCommandList.end();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/uiconfig/ui/documentinfopage.ui b/sfx2/uiconfig/ui/documentinfopage.ui
index 6799a99f5665..d51a82876170 100644
--- a/sfx2/uiconfig/ui/documentinfopage.ui
+++ b/sfx2/uiconfig/ui/documentinfopage.ui
@@ -1,224 +1,225 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.38.2 -->
<interface domain="sfx">
<requires lib="gtk+" version="3.18"/>
+ <!-- n-columns=3 n-rows=14 -->
<object class="GtkGrid" id="DocumentInfoPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="border_width">12</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
+ <property name="border-width">12</property>
+ <property name="row-spacing">6</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkLabel" id="label13">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label13">_Created:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showcreate</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showcreate</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label14">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label14">_Modified:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showmodify</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showmodify</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label15">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label15">_Digitally signed:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showsigned</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showsigned</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label16">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label16">Last pri_nted:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showprint</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showprint</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">8</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label17">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label17">Total _editing time:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showedittime</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showedittime</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label18">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label18">Re_vision number:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showrevision</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showrevision</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">10</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showcreate">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">4</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showmodify">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">5</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showsigned">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes" context="documentinfopage|showsigned">Multiply signed document</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">7</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showprint">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">8</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showedittime">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">9</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">9</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showrevision">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">10</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">10</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="userdatacb">
<property name="label" translatable="yes" context="documentinfopage|userdatacb">_Apply user data</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
<property name="xalign">0</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">11</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">11</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="thumbnailsavecb">
<property name="label" translatable="yes" context="documentinfopage|thumbnailsavecb">Save preview image with this document</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="no_show_all">True</property>
- <property name="use_underline">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="no-show-all">True</property>
+ <property name="use-underline">True</property>
<property name="xalign">0</property>
- <property name="draw_indicator">True</property>
+ <property name="draw-indicator">True</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">12</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">12</property>
</packing>
</child>
<child>
<object class="GtkButton" id="reset">
<property name="label" translatable="yes" context="documentinfopage|reset">Reset Properties</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="no-show-all">True</property>
<property name="valign">center</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">11</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">11</property>
<property name="height">2</property>
</packing>
</child>
@@ -226,179 +227,256 @@
<object class="GtkButton" id="signature">
<property name="label" translatable="yes" context="documentinfopage|signature">Di_gital Signatures...</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="has-focus">True</property>
+ <property name="receives-default">True</property>
<property name="valign">center</property>
- <property name="use_underline">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">6</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">6</property>
<property name="height">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label11">_Size:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showsize</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showsize</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showsize">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="label" translatable="yes" context="documentinfopage|showsize">unknown</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">3</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|label8">_Location:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showlocation</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showlocation</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showlocation">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="selectable">True</property>
<property name="ellipsize">middle</property>
- <property name="max_width_chars">50</property>
+ <property name="max-width-chars">50</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="xpad">1</property>
<property name="label" translatable="yes" context="documentinfopage|label7">_Type:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showtype</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showtype</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showtype">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="changepass">
<property name="label" translatable="yes" context="documentinfopage|changepass">Change _Password</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="valign">start</property>
- <property name="use_underline">True</property>
+ <property name="use-underline">True</property>
</object>
<packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">2</property>
+ <property name="top-attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="templateft">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes" context="documentinfopage|templateft">Template:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">showtemplate</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">showtemplate</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="showtemplate">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="selectable">True</property>
- <property name="max_width_chars">56</property>
+ <property name="max-width-chars">56</property>
<property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">6</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">6</property>
</packing>
</child>
<child>
+ <!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="column_spacing">12</property>
+ <property name="can-focus">False</property>
+ <property name="column-spacing">12</property>
<child>
<object class="GtkImage" id="icon">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="valign">center</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="nameed">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can-focus">False</property>
<property name="selectable">True</property>
- <property name="single_line_mode">True</property>
- <property name="max_width_chars">56</property>
+ <property name="single-line-mode">True</property>
+ <property name="max-width-chars">56</property>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="image-preferred-dpi-checkbutton">
+ <property name="label" translatable="yes" context="documentinfopage|image-preferred-dpi-checkbutton">Image preferred DPI</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="hexpand">True</property>
+ <property name="draw-indicator">True</property>
+ <accessibility>
+ <relation type="label-for" target="image-preferred-dpi-combobox"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="image-preferred-dpi-combobox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="has-entry">True</property>
+ <items>
+ <item>96</item>
+ <item>150</item>
+ <item>200</item>
+ <item>300</item>
+ <item>600</item>
+ </items>
+ <child internal-child="entry">
+ <object class="GtkEntry">
+ <property name="can-focus">False</property>
+ </object>
+ </child>
+ <accessibility>
+ <relation type="labelled-by" target="image-preferred-dpi-checkbutton"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="left-attach">1</property>
+ <property name="top-attach">13</property>
</packing>
</child>
<child>
@@ -410,5 +488,11 @@
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx
index 3daea4a2b18a..2a86d961e148 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -150,6 +150,11 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
{
throw css::lang::IllegalArgumentException(
"XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, 0);
+ } else if (pathname.endsWithIgnoreAsciiCase(".class")
+ || pathname.endsWithIgnoreAsciiCase(".fileloc")
+ || pathname.endsWithIgnoreAsciiCase(".jar"))
+ {
+ dir = true;
}
}
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index ddc222fe71cf..8e8237dd12af 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -410,20 +410,32 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
}
}
pathname = o3tl::toU(path);
+ // ShellExecuteExW appears to ignore trailing dots, so remove them:
+ while (pathname.endsWith(".", &pathname)) {}
auto const n = pathname.lastIndexOf('.');
if (n > pathname.lastIndexOf('\\')) {
auto const ext = pathname.copy(n + 1);
- OUString env;
- if (osl_getEnvironment(OUString("PATHEXT").pData, &env.pData) != osl_Process_E_None)
- {
- SAL_INFO("shell", "osl_getEnvironment(PATHEXT) failed");
- }
- if (!(checkExtension(ext, env)
- && checkExtension(
- ext, ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY")))
- {
- throw css::lang::IllegalArgumentException(
- "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, 0);
+ if (!ext.isEmpty()) {
+ OUString env;
+ if (osl_getEnvironment(OUString("PATHEXT").pData, &env.pData)
+ != osl_Process_E_None)
+ {
+ SAL_INFO("shell", "osl_getEnvironment(PATHEXT) failed");
+ }
+ if (!(checkExtension(ext, env)
+ && checkExtension(
+ ext,
+ ".ADE;.ADP;.APK;.APPLICATION;.APPX;.APPXBUNDLE;.BAT;.CAB;.CHM;.CLASS;"
+ ".CMD;.COM;.CPL;.DLL;.DMG;.EX;.EX_;.EXE;.GADGET;.HTA;.INF;.INS;.IPA;"
+ ".ISO;.ISP;.JAR;.JS;.JSE;.LIB;.LNK;.MDE;.MSC;.MSH;.MSH1;.MSH2;.MSHXML;"
+ ".MSH1XML;.MSH2XML;.MSI;.MSIX;.MSIXBUNDLE;.MSP;.MST;.NSH;.PIF;.PS1;"
+ ".PS1XML;.PS2;.PS2XML;.PSC1;.PSC2;.PY;.REG;.SCF;.SCR;.SCT;.SHB;.SYS;"
+ ".VB;.VBE;.VBS;.VXD;.WS;.WSC;.WSF;.WSH;")))
+ {
+ throw css::lang::IllegalArgumentException(
+ "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {},
+ 0);
+ }
}
}
}
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index c1776053ec1e..60cb9771436c 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -516,7 +516,7 @@ sub create_tar_gz_file_from_directory
unlink("$installdir/install");
}
- my $systemcall = "cd $changedir; $fakerootstring tar -cf - $packdir | gzip > $targzname";
+ my $systemcall = "cd $changedir; $fakerootstring tar -cf - $packdir | $installer::globals::packertool > $targzname";
my $returnvalue = system($systemcall);
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
index ed0066c65f2e..7b5a5da77198 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -1193,7 +1193,7 @@ sub set_autoprovreq_in_specfile
close (FINDREQUIRES);
}
- $autoreqprovline .= "%define _binary_filedigest_algorithm 1\n%define _binary_payload w9.gzdio\n";
+ $autoreqprovline .= "%define _binary_filedigest_algorithm 1\n%define _binary_payload w1T.xzdio\n";
for ( my $i = 0; $i <= $#{$changefile}; $i++ )
{
@@ -1839,7 +1839,7 @@ sub create_packages_without_epm
# Solaris: pkgmk -o -f solaris-2.8-sparc/SUNWso8m34.prototype -d solaris-2.8-sparc
# Solaris: pkgtrans solaris-2.8-sparc SUNWso8m34.pkg SUNWso8m34
- # Solaris: tar -cf - SUNWso8m34 | gzip > SUNWso8m34.tar.gz
+ # Solaris: tar -cf - SUNWso8m34 | $installer::globals::packertool > SUNWso8m34.tar.gz
if ( $installer::globals::issolarispkgbuild )
{
@@ -1983,7 +1983,7 @@ sub create_packages_without_epm
#########################
# my $targzname = $packagename . ".tar.gz";
- # $systemcall = "cd $destinationdir; tar -cf - $packagename | gzip > $targzname";
+ # $systemcall = "cd $destinationdir; tar -cf - $packagename | $installer::globals::packertool > $targzname";
# print "... $systemcall ...\n";
# $returnvalue = system($systemcall);
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
index e57627bb441b..11442ef202a8 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -129,6 +129,8 @@ BEGIN
$strip = 0;
+ $packertool = "gzip"; # the default package compression tool for *NIX
+
$logfilename = "logfile.log"; # the default logfile name for global errors
@logfileinfo = ();
@errorlogfileinfo = ();
@@ -219,7 +221,7 @@ BEGIN
$fix_number_of_cab_files = 1;
$cabfilecompressionlevel = 21; # Using LZX compression, possible values are: 15 | 16 | ... | 21 (best compression)
$number_of_cabfiles = 1; # only for $fix_number_of_cab_files = 1
- $include_cab_in_msi = 0;
+ $include_cab_in_msi = 1;
$msidatabasename = "";
$prepare_winpatch = 0;
$previous_idt_dir = "";
diff --git a/solenv/bin/modules/installer/helppack.pm b/solenv/bin/modules/installer/helppack.pm
index 726157be2e27..456e91ecfdb0 100644
--- a/solenv/bin/modules/installer/helppack.pm
+++ b/solenv/bin/modules/installer/helppack.pm
@@ -130,7 +130,7 @@ sub create_tar_gz_file
$packagename =~ s/\.rpm\s*$//;
my $targzname = $packagename . ".tar.gz";
- my $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > $targzname";
+ my $systemcall = "cd $installdir; tar -cf - $packagestring | $installer::globals::packertool > $targzname";
installer::logger::print_message( "... $systemcall ...\n" );
my $returnvalue = system($systemcall);
diff --git a/solenv/bin/modules/installer/languagepack.pm b/solenv/bin/modules/installer/languagepack.pm
index a39769144de6..14a870866128 100644
--- a/solenv/bin/modules/installer/languagepack.pm
+++ b/solenv/bin/modules/installer/languagepack.pm
@@ -128,7 +128,7 @@ sub create_tar_gz_file
$packagename =~ s/\.rpm\s*$//;
my $targzname = $packagename . ".tar.gz";
- $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > $targzname";
+ $systemcall = "cd $installdir; tar -cf - $packagestring | $installer::globals::packertool > $targzname";
installer::logger::print_message( "... $systemcall ...\n" );
my $returnvalue = system($systemcall);
diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm
index 9d8efbb558a6..657b543ee702 100644
--- a/solenv/bin/modules/installer/parameter.pm
+++ b/solenv/bin/modules/installer/parameter.pm
@@ -56,6 +56,7 @@ The following parameter are needed:
-languagepack : do create a languagepack, no product pack (optional)
-helppack : do create a helppack, no product pack (optional)
-strip: Stripping files (Unix only)
+-packer: Path and parameters for tarball packaging tool (default: gzip (Unix only))
-log : Logging all available information (optional)
Examples for Windows:
@@ -127,6 +128,7 @@ sub getparameter
elsif ($param eq "-helppack") { $installer::globals::helppack = 1;}
elsif ($param eq "-debian") { $installer::globals::debian = 1; }
elsif ($param eq "-strip") { $installer::globals::strip = 1; }
+ elsif ($param eq "-packer") { $installer::globals::packertool = shift(@ARGV); }
elsif ($param eq "-destdir") # new parameter for simple installer
{
$installer::globals::rootpath ne "" && die "must set destdir before -i or -simple";
diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm
index e3682bafe736..4c9be245b52b 100644
--- a/solenv/bin/modules/installer/simplepackage.pm
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -461,7 +461,7 @@ sub create_package
my $megabytes = 1500;
$megabytes = 2000 if $ENV{'ENABLE_DBGUTIL'};
$systemcall = "cd $localtempdir && hdiutil create -megabytes $megabytes -srcfolder $folder $archive -ov -fs HFS+ -volname \"$volume_name\" -format UDBZ";
- if (( $ref ne "" ) && ( $$ref ne "" )) {
+ if (( $ref ne "" ) && ( $$ref ne "" ) && system("hdiutil 2>&1 | grep unflatten") == 0) {
$systemcall .= " && hdiutil unflatten $archive && Rez -a $$ref -o $archive && hdiutil flatten $archive";
}
}
@@ -474,7 +474,7 @@ sub create_package
$fakerootstring = "fakeroot";
}
- $systemcall = "cd $tempdir; $fakerootstring tar -cf - . | gzip > $archive";
+ $systemcall = "cd $tempdir; $fakerootstring tar -cf - . | $installer::globals::packertool > $archive";
}
if ( $makesystemcall )
diff --git a/solenv/bin/modules/installer/windows/admin.pm b/solenv/bin/modules/installer/windows/admin.pm
index 3dfba9e7a8de..f822afe7eaec 100644
--- a/solenv/bin/modules/installer/windows/admin.pm
+++ b/solenv/bin/modules/installer/windows/admin.pm
@@ -287,9 +287,8 @@ sub create_directory_structure
{
if ( ! exists($fullpathhash{$dir}) ) { $fullpathhash{$dir} = $targetdir; }
}
- # FIXME why is this hack needed? ERROR: Did not find full directory path for dir: "SystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA"
+ # FIXME why is this hack needed? ERROR: Did not find full directory path for dir: "ystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA"
$fullpathhash{"SystemFolder_x86_VC.194841A2_D0F2_3B96_9F71_05BA91BEA0FA"} = $targetdir . $installer::globals::separator . "System";
- $fullpathhash{"SystemFolder_x86_VC.E281B893_10D7_34CE_BB0E_B69D88E154A5"} = $targetdir . $installer::globals::separator . "System";
$fullpathhash{"System64Folder_amd64_VC.AF4EABEE_4589_3789_BA0A_C83A71662E1D"} = $targetdir . $installer::globals::separator . "System64";
return \%fullpathhash;
diff --git a/solenv/bin/modules/installer/windows/msp.pm b/solenv/bin/modules/installer/windows/msp.pm
index 3783634ff395..069b5dfeb0f6 100644
--- a/solenv/bin/modules/installer/windows/msp.pm
+++ b/solenv/bin/modules/installer/windows/msp.pm
@@ -288,7 +288,7 @@ sub set_mspfilename
{
my ($allvariables, $mspdir, $languagesarrayref) = @_;
- my $databasename = $allvariables->{'ONEWORDPRODUCTNAME'} . "-" . $allvariables->{'PRODUCTVERSION'} . "-" . $allvariables->{'WINDOWSPATCHLEVEL'} . ".msp";
+ my $databasename = $allvariables->{'PRODUCTNAME'} . "-" . $allvariables->{'PRODUCTVERSION'} . "-" . $allvariables->{'WINDOWSPATCHLEVEL'} . ".msp";
my $fullmspname = $mspdir . $installer::globals::separator . $databasename;
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
index d002595c69fe..13c576cd54a9 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -913,7 +913,7 @@ sub collectpackagemaps
# Create a tar gz file with all package maps
my $tarfilename = $subdirname . ".tar";
my $targzname = $tarfilename . ".gz";
- $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | gzip > $targzname";
+ $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | $installer::globals::packertool > $targzname";
installer::systemactions::make_systemcall($systemcall);
installer::systemactions::remove_complete_directory($pkgmapsubdir, 1);
}
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 0383463a64c3..8034d542047c 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -33,7 +33,7 @@ core_factory_list = [
("libi18nsearchlo.a", "i18nsearch_component_getFactory"),
("libinvocadaptlo.a", "invocadapt_component_getFactory"),
("liblnglo.a", "lng_component_getFactory"),
- ("liblnthlo.a", "lnth_component_getFactory", "#ifndef IOS"),
+ ("liblnthlo.a", "lnth_component_getFactory"),
("liblocalebe1lo.a", "localebe1_component_getFactory"),
("libpackage2.a", "package2_component_getFactory"),
("libsmlo.a", "sm_component_getFactory"),
@@ -58,8 +58,9 @@ core_factory_list = [
("libxmlscriptlo.a", "xmlscript_component_getFactory"),
("libmcnttype.a", "mcnttype_component_getFactory"),
("libvcllo.a", "vcl_component_getFactory"),
- ("libspelllo.a", "spell_component_getFactory", "#ifndef IOS"),
+ ("libspelllo.a", "spell_component_getFactory"),
("libpdffilterlo.a", "pdffilter_component_getFactory"),
+ ("libpdfimportlo.a", "pdfimport_component_getFactory", "#if HAVE_FEATURE_PDFIMPORT"),
("libsvgiolo.a", "svgio_component_getFactory"),
("libsvtlo.a", "svt_component_getFactory"),
("libctllo.a", "ctl_component_getFactory"),
@@ -69,9 +70,16 @@ core_factory_list = [
("libguesslanglo.a", "guesslang_component_getFactory"),
("libbiblo.a", "bib_component_getFactory"),
("libdbalo.a", "dba_component_getFactory"),
- ]
+ ("libscriptframe.a", "scriptframe_component_getFactory"),
+ ("libbasprovlo.a", "basprov_component_getFactory"),
+ ("libucppkg1.a", "ucppkg1_component_getFactory"),
+ ("libiolo.a", "io_component_getFactory"),
+]
core_constructor_list = [
+# basic/util/sb.component
+ ("com_sun_star_comp_sfx2_ScriptLibraryContainer_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
+ ("com_sun_star_comp_sfx2_DialogLibraryContainer_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
# canvas/source/factory/canvasfactory.component
"com_sun_star_comp_rendering_CanvasFactory_get_implementation",
# chart2/source/chartcore.component
@@ -361,6 +369,7 @@ edit_constructor_list = [
"Calc_XMLOasisMetaExporter_get_implementation",
"Calc_XMLOasisSettingsExporter_get_implementation",
"Calc_XMLOasisStylesExporter_get_implementation",
+ "Calc_FilterOptionsDialog_get_implementation",
# starmath/util/sm.component
"Math_XMLOasisMetaExporter_get_implementation",
"Math_XMLOasisSettingsExporter_get_implementation",
@@ -394,6 +403,7 @@ calc_factory_list = [
("libanalysislo.a", "analysis_component_getFactory"),
("libdatelo.a", "date_component_getFactory"),
("libpricinglo.a", "pricing_component_getFactory"),
+ ("libvbaobjlo.a", "vbaobj_component_getFactory"),
]
calc_constructor_list = [
@@ -409,9 +419,14 @@ calc_constructor_list = [
"com_sun_star_comp_oox_xls_FormulaParser_get_implementation",
# scripting/source/vbaevents/vbaevents.component
("ooo_vba_VBAToOOEventDesc_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
+ ("ooo_vba_EventListener_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
# svl/util/svl.component
"com_sun_star_uno_util_numbers_SvNumberFormatsSupplierServiceObject_get_implementation",
"com_sun_star_uno_util_numbers_SvNumberFormatterServiceObject_get_implementation",
+# sc/util/vbaobj.component
+ "ScVbaEventsHelper_get_implementation",
+ "ScVbaGlobals_get_implementation",
+ "ScVbaTextFrame_get_implementation"
]
draw_factory_list = [
@@ -457,8 +472,6 @@ writer_factory_list = [
]
writer_constructor_list = [
-# basic/util/sb.component
- ("com_sun_star_comp_sfx2_ScriptLibraryContainer_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
# filter/source/textfilterdetect/textfd.component
"com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation",
# sw/util/sw.component
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 864518c389e4..2bc3f662b09c 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -14826,6 +14826,7 @@ sw/qa/extras/docbookexport/docbookexport.cxx
sw/qa/extras/globalfilter/globalfilter.cxx
sw/qa/extras/htmlexport/htmlexport.cxx
sw/qa/extras/htmlimport/htmlimport.cxx
+sw/qa/extras/layout/layout.cxx
sw/qa/extras/mailmerge/mailmerge.cxx
sw/qa/extras/odfexport/odfexport.cxx
sw/qa/extras/odfimport/odfimport.cxx
diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index 4ff860db39e6..2c7cfdda3447 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -231,10 +231,11 @@
"dest-filename": "external/tarballs/libe-book-0.1.3.tar.xz"
},
{
- "url": "https://dev-www.libreoffice.org/src/libetonyek-0.1.9.tar.xz",
- "sha256": "e61677e8799ce6e55b25afc11aa5339113f6a49cff031f336e32fa58635b1a4a",
+ "url": "https://dev-www.libreoffice.org/src/libetonyek-0.1.10.tar.xz",
+ "sha256": "b430435a6e8487888b761dc848b7981626eb814884963ffe25eb26a139301e9a",
"type": "file",
- "dest-filename": "external/tarballs/libetonyek-0.1.9.tar.xz"
+ "dest": "external/tarballs",
+ "dest-filename": "libetonyek-0.1.10.tar.xz"
},
{
"url": "https://dev-www.libreoffice.org/src/libexttextcat-3.4.5.tar.xz",
@@ -267,16 +268,16 @@
"dest-filename": "external/tarballs/libmspub-0.1.4.tar.xz"
},
{
- "url": "https://dev-www.libreoffice.org/src/libmwaw-0.3.15.tar.xz",
- "sha256": "0440bb09f05e3419423d8dfa36ee847056ebfd837f9cbc091fdb5b057daab0b1",
+ "url": "https://dev-www.libreoffice.org/src/libmwaw-0.3.16.tar.xz",
+ "sha256": "0c639edba5297bde5575193bf5b5f2f469956beaff5c0206d91ce9df6bde1868",
"type": "file",
- "dest-filename": "external/tarballs/libmwaw-0.3.15.tar.xz"
+ "dest-filename": "external/tarballs/libmwaw-0.3.16.tar.xz"
},
{
- "url": "https://dev-www.libreoffice.org/src/libodfgen-0.1.6.tar.bz2",
- "sha256": "2c7b21892f84a4c67546f84611eccdad6259875c971e98ddb027da66ea0ac9c2",
+ "url": "https://dev-www.libreoffice.org/src/libodfgen-0.1.8.tar.xz",
+ "sha256": "55200027fd46623b9bdddd38d275e7452d1b0ff8aeddcad6f9ae6dc25f610625",
"type": "file",
- "dest-filename": "external/tarballs/libodfgen-0.1.6.tar.bz2"
+ "dest-filename": "external/tarballs/libodfgen-0.1.8.tar.xz"
},
{
"url": "https://dev-www.libreoffice.org/src/libpagemaker-0.0.4.tar.xz",
@@ -381,10 +382,10 @@
"dest-filename": "external/tarballs/poppler-0.82.0.tar.xz"
},
{
- "url": "https://dev-www.libreoffice.org/src/postgresql-9.2.24.tar.bz2",
- "sha256": "a754c02f7051c2f21e52f8669a421b50485afcde9a581674d6106326b189d126",
+ "url": "https://dev-www.libreoffice.org/src/postgresql-13.1.tar.bz2",
+ "sha256": "12345c83b89aa29808568977f5200d6da00f88a035517f925293355432ffe61f",
"type": "file",
- "dest-filename": "external/tarballs/postgresql-9.2.24.tar.bz2"
+ "dest-filename": "external/tarballs/postgresql-13.1.tar.bz2"
},
{
"url": "https://dev-www.libreoffice.org/src/QR-Code-generator-1.4.0.tar.gz",
diff --git a/solenv/gdb/boost/util/printing.py b/solenv/gdb/boost/util/printing.py
index 1d5d0bac9fc6..4088f3a3fa3b 100644
--- a/solenv/gdb/boost/util/printing.py
+++ b/solenv/gdb/boost/util/printing.py
@@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from collections import Mapping
+from collections.abc import Mapping
import gdb
import re
import six
diff --git a/solenv/gdb/libreoffice/util/printing.py b/solenv/gdb/libreoffice/util/printing.py
index 9cbae3080a64..7ce29899355a 100644
--- a/solenv/gdb/libreoffice/util/printing.py
+++ b/solenv/gdb/libreoffice/util/printing.py
@@ -7,7 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-from collections import Mapping
+from collections.abc import Mapping
import gdb
import re
import six
diff --git a/solenv/sanitizers/ui/modules/swriter.suppr b/solenv/sanitizers/ui/modules/swriter.suppr
index 43134e801be7..3bce4efa1af8 100644
--- a/solenv/sanitizers/ui/modules/swriter.suppr
+++ b/solenv/sanitizers/ui/modules/swriter.suppr
@@ -166,6 +166,7 @@ sw/uiconfig/swriter/ui/mmsendmails.ui://GtkProgressBar[@id='progress'] no-labell
sw/uiconfig/swriter/ui/mmsendmails.ui://GtkLabel[@id='errorstatus'] orphan-label
sw/uiconfig/swriter/ui/mmsalutationpage.ui://GtkLabel[@id='documentindex'] orphan-label
sw/uiconfig/swriter/ui/mmsalutationpage.ui://GtkLabel[@id='femalefi'] orphan-label
+sw/uiconfig/swriter/ui/mmselectpage.ui://GtkComboBoxText[@id='recentdoclb'] no-labelled-by
sw/uiconfig/swriter/ui/notebookbar_groups.ui://GtkLabel[@id='filegrouplabel'] orphan-label
sw/uiconfig/swriter/ui/notebookbar_groups.ui://GtkLabel[@id='clipboardgrouplabel'] orphan-label
sw/uiconfig/swriter/ui/notebookbar_groups.ui://svtlo-FontNameBox[@id='fontnamelist'] no-labelled-by
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index f00812b30b8d..3b490c6ac1fe 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -142,7 +142,7 @@ SvtScriptType SvtLanguageOptions::GetScriptTypeOfLanguage( LanguageType nLang )
{
if( LANGUAGE_DONTKNOW == nLang )
nLang = LANGUAGE_ENGLISH_US;
- else if( LANGUAGE_SYSTEM == nLang )
+ else if (LANGUAGE_SYSTEM == nLang || LANGUAGE_PROCESS_OR_USER_DEFAULT == nLang)
nLang = SvtSysLocale().GetLanguageTag().getLanguageType();
sal_Int16 nScriptType = MsLangId::getScriptType( nLang );
diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx
index 5a3f0271c40d..1b882bb89deb 100644
--- a/svl/source/crypto/cryptosign.cxx
+++ b/svl/source/crypto/cryptosign.cxx
@@ -2097,8 +2097,12 @@ bool Signing::Verify(const std::vector<unsigned char>& aData,
aDerCert[i] = pCertificate->derCert.data[i];
OUStringBuffer aBuffer;
comphelper::Base64::encode(aBuffer, aDerCert);
- rInformation.ouX509Certificate = aBuffer.makeStringAndClear();
- rInformation.ouSubject = OUString(pCertificate->subjectName, PL_strlen(pCertificate->subjectName), RTL_TEXTENCODING_UTF8);
+ SignatureInformation::X509Data temp;
+ temp.emplace_back();
+ temp.back().X509Certificate = aBuffer.makeStringAndClear();
+ temp.back().X509Subject = OUString(pCertificate->subjectName, PL_strlen(pCertificate->subjectName), RTL_TEXTENCODING_UTF8);
+ rInformation.X509Datas.clear();
+ rInformation.X509Datas.emplace_back(temp);
}
PRTime nSigningTime;
@@ -2277,8 +2281,12 @@ bool Signing::Verify(const std::vector<unsigned char>& aData,
aDerCert[i] = pSignerCertContext->pbCertEncoded[i];
OUStringBuffer aBuffer;
comphelper::Base64::encode(aBuffer, aDerCert);
- rInformation.ouX509Certificate = aBuffer.makeStringAndClear();
- rInformation.ouSubject = GetSubjectName(pSignerCertContext);
+ SignatureInformation::X509Data temp;
+ temp.emplace_back();
+ temp.back().X509Certificate = aBuffer.makeStringAndClear();
+ temp.back().X509Subject = GetSubjectName(pSignerCertContext);
+ rInformation.X509Datas.clear();
+ rInformation.X509Datas.emplace_back(temp);
}
if (bNonDetached)
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 950201bef962..233e88d2bb20 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -391,7 +391,7 @@ struct DoesStyleMatchStyleSheetPredicate final : public svl::StyleSheetPredicate
SfxStyleSheetIterator::SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase,
SfxStyleFamily eFam, SfxStyleSearchBits n)
: pCurrentStyle(nullptr)
- , nCurrentPosition(0)
+ , mnCurrentPosition(0)
{
pBasePool=pBase;
nSearchFamily=eFam;
@@ -434,7 +434,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx)
if( IsTrivialSearch())
{
retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(nIdx);
- nCurrentPosition = nIdx;
+ mnCurrentPosition = nIdx;
}
else if(nMask == SfxStyleSearchBits::All)
{
@@ -443,7 +443,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx)
pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetPositionsByFamily(nSearchFamily).at(nIdx))
;
retval = ref.get();
- nCurrentPosition = nIdx;
+ mnCurrentPosition = nIdx;
}
else
{
@@ -452,7 +452,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx)
pBasePool->pImpl->mxIndexedStyleSheets->GetNthStyleSheetThatMatchesPredicate(nIdx, predicate);
if (ref.get() != nullptr)
{
- nCurrentPosition = pBasePool->pImpl->mxIndexedStyleSheets->FindStyleSheetPosition(*ref);
+ mnCurrentPosition = pBasePool->pImpl->mxIndexedStyleSheets->FindStyleSheetPosition(*ref);
retval = ref.get();
}
}
@@ -483,21 +483,21 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next()
if ( IsTrivialSearch() )
{
unsigned nStyleSheets = pBasePool->pImpl->mxIndexedStyleSheets->GetNumberOfStyleSheets();
- unsigned newPosition = nCurrentPosition +1;
+ unsigned newPosition = mnCurrentPosition +1;
if (nStyleSheets > newPosition)
{
- nCurrentPosition = newPosition;
- retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(nCurrentPosition);
+ mnCurrentPosition = newPosition;
+ retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(mnCurrentPosition);
}
}
else if(nMask == SfxStyleSearchBits::All)
{
- unsigned newPosition = nCurrentPosition +1;
+ unsigned newPosition = mnCurrentPosition +1;
const std::vector<unsigned>& familyVector =
pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetPositionsByFamily(nSearchFamily);
if (familyVector.size() > newPosition)
{
- nCurrentPosition = newPosition;
+ mnCurrentPosition = newPosition;
unsigned stylePosition = familyVector[newPosition];
retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(stylePosition);
}
@@ -507,10 +507,10 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next()
DoesStyleMatchStyleSheetPredicate predicate(this);
rtl::Reference< SfxStyleSheetBase > ref =
pBasePool->pImpl->mxIndexedStyleSheets->GetNthStyleSheetThatMatchesPredicate(
- 0, predicate, nCurrentPosition+1);
+ 0, predicate, mnCurrentPosition+1);
retval = ref.get();
if (retval != nullptr) {
- nCurrentPosition = pBasePool->pImpl->mxIndexedStyleSheets->FindStyleSheetPosition(*ref);
+ mnCurrentPosition = pBasePool->pImpl->mxIndexedStyleSheets->FindStyleSheetPosition(*ref);
}
}
pCurrentStyle = retval;
@@ -530,7 +530,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const OUString& rStr)
unsigned pos = positions.front();
SfxStyleSheetBase* pStyle = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(pos);
- nCurrentPosition = pos;
+ mnCurrentPosition = pos;
pCurrentStyle = pStyle;
return pCurrentStyle;
}
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 5fd5a1e7c825..6230ea3f7223 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3140,6 +3140,14 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex,
return sString.makeStringAndClear();
}
+bool SvNumberFormatter::IsUserDefinedAndNotOverloaded(sal_uInt32 F_Index) const
+{
+ ::osl::MutexGuard aGuard( GetInstanceMutex() );
+ const SvNumberformat* pFormat = GetFormatEntry(F_Index);
+
+ return pFormat && (pFormat->GetType() & SvNumFormatType::DEFINED);
+}
+
bool SvNumberFormatter::IsUserDefined(const OUString& sStr,
LanguageType eLnge)
{
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 02947cd3892c..380188ef495c 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+#include <sal/log.hxx>
#include "passwordcontainer.hxx"
@@ -182,15 +184,18 @@ PassMap StorageItem::getInfo()
Sequence< OUString > aNodeNames = ConfigItem::GetNodeNames( "Store" );
sal_Int32 aNodeCount = aNodeNames.getLength();
- Sequence< OUString > aPropNames( aNodeCount );
+ Sequence< OUString > aPropNames( aNodeCount * 2);
std::transform(aNodeNames.begin(), aNodeNames.end(), aPropNames.begin(),
[](const OUString& rName) -> OUString {
return "Store/Passwordstorage['" + rName + "']/Password"; });
+ std::transform(aNodeNames.begin(), aNodeNames.end(), aPropNames.getArray() + aNodeCount,
+ [](const OUString& rName) -> OUString {
+ return "Store/Passwordstorage['" + rName + "']/InitializationVector"; });
Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aPropNames );
- if( aPropertyValues.getLength() != aNodeCount )
+ if( aPropertyValues.getLength() != aNodeCount * 2)
{
OSL_FAIL( "Problems during reading" );
return aResult;
@@ -206,14 +211,16 @@ PassMap StorageItem::getInfo()
OUString aName = aUrlUsr[1];
OUString aEPasswd;
+ OUString aIV;
aPropertyValues[aNodeInd] >>= aEPasswd;
+ aPropertyValues[aNodeInd + aNodeCount] >>= aIV;
PassMap::iterator aIter = aResult.find( aUrl );
if( aIter != aResult.end() )
- aIter->second.emplace_back( aName, aEPasswd );
+ aIter->second.emplace_back( aName, aEPasswd, aIV );
else
{
- NamePassRecord aNewRecord( aName, aEPasswd );
+ NamePassRecord aNewRecord( aName, aEPasswd, aIV );
std::vector< NamePassRecord > listToAdd( 1, aNewRecord );
aResult.insert( PairUrlRecord( aUrl, listToAdd ) );
@@ -259,18 +266,37 @@ bool StorageItem::useStorage()
return aResult;
}
+sal_Int32 StorageItem::getStorageVersion()
+{
+ Sequence<OUString> aNodeNames { "StorageVersion" };
+
+ Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aNodeNames );
+
+ if( aPropertyValues.getLength() != aNodeNames.getLength() )
+ {
+ OSL_FAIL( "Problems during reading" );
+ return 0;
+ }
-bool StorageItem::getEncodedMP( OUString& aResult )
+ sal_Int32 nResult = 0;
+ aPropertyValues[0] >>= nResult;
+
+ return nResult;
+}
+
+bool StorageItem::getEncodedMP( OUString& aResult, OUString& aResultIV )
{
if( hasEncoded )
{
aResult = mEncoded;
+ aResultIV = mEncodedIV;
return true;
}
- Sequence< OUString > aNodeNames( 2 );
+ Sequence< OUString > aNodeNames( 3 );
aNodeNames[0] = "HasMaster";
aNodeNames[1] = "Master";
+ aNodeNames[2] = "MasterInitializationVector";
Sequence< Any > aPropertyValues = ConfigItem::GetProperties( aNodeNames );
@@ -282,30 +308,37 @@ bool StorageItem::getEncodedMP( OUString& aResult )
aPropertyValues[0] >>= hasEncoded;
aPropertyValues[1] >>= mEncoded;
+ aPropertyValues[2] >>= mEncodedIV;
aResult = mEncoded;
+ aResultIV = mEncodedIV;
return hasEncoded;
}
-void StorageItem::setEncodedMP( const OUString& aEncoded, bool bAcceptEmpty )
+void StorageItem::setEncodedMP( const OUString& aEncoded, const OUString& aEncodedIV, bool bAcceptEmpty )
{
- Sequence< OUString > sendNames(2);
- Sequence< uno::Any > sendVals(2);
+ Sequence< OUString > sendNames(4);
+ Sequence< uno::Any > sendVals(4);
sendNames[0] = "HasMaster";
sendNames[1] = "Master";
+ sendNames[2] = "MasterInitializationVector";
+ sendNames[3] = "StorageVersion";
bool bHasMaster = ( !aEncoded.isEmpty() || bAcceptEmpty );
sendVals[0] <<= bHasMaster;
sendVals[1] <<= aEncoded;
+ sendVals[2] <<= aEncodedIV;
+ sendVals[3] <<= nCurrentStorageVersion;
ConfigItem::SetModified();
ConfigItem::PutProperties( sendNames, sendVals );
hasEncoded = bHasMaster;
mEncoded = aEncoded;
+ mEncodedIV = aEncodedIV;
}
@@ -341,11 +374,13 @@ void StorageItem::update( const OUString& aURL, const NamePassRecord& aRecord )
forIndex.push_back( aURL );
forIndex.push_back( aRecord.GetUserName() );
- Sequence< beans::PropertyValue > sendSeq(1);
+ Sequence< beans::PropertyValue > sendSeq(2);
- sendSeq[0].Name = "Store/Passwordstorage['" + createIndex( forIndex ) + "']/Password";
+ sendSeq[0].Name = "Store/Passwordstorage['" + createIndex( { aURL, aRecord.GetUserName() } ) + "']/InitializationVector";
+ sendSeq[0].Value <<= aRecord.GetPersistentIV();
- sendSeq[0].Value <<= aRecord.GetPersPasswords();
+ sendSeq[1].Name = "Store/Passwordstorage['" + createIndex( forIndex ) + "']/Password";
+ sendSeq[1].Value <<= aRecord.GetPersPasswords();
ConfigItem::SetModified();
ConfigItem::SetSetProperties( "Store", sendSeq );
@@ -406,7 +441,7 @@ void SAL_CALL PasswordContainer::disposing( const EventObject& )
}
}
-std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLine, const OUString& aMasterPasswd, css::task::PasswordRequestMode mode )
+std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLine, const OUString& aIV, const OUString& aMasterPasswd, css::task::PasswordRequestMode mode )
{
if( !aMasterPasswd.isEmpty() )
{
@@ -421,9 +456,16 @@ std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLin
for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
code[ ind ] = static_cast<char>(aMasterPasswd.copy( ind*2, 2 ).toUInt32(16));
+ unsigned char iv[RTL_DIGEST_LENGTH_MD5] = {0};
+ if (!aIV.isEmpty())
+ {
+ for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
+ iv[ ind ] = static_cast<char>(aIV.copy( ind*2, 2 ).toUInt32(16));
+ }
+
rtlCipherError result = rtl_cipher_init (
aDecoder, rtl_Cipher_DirectionDecode,
- code, RTL_DIGEST_LENGTH_MD5, nullptr, 0 );
+ code, RTL_DIGEST_LENGTH_MD5, iv, RTL_DIGEST_LENGTH_MD5 );
if( result == rtl_Cipher_E_None )
{
@@ -456,7 +498,7 @@ std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLin
"Can't decode!", css::uno::Reference<css::uno::XInterface>(), mode);
}
-OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& lines, const OUString& aMasterPasswd )
+OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& lines, const OUString& aIV, const OUString& aMasterPasswd)
{
if( !aMasterPasswd.isEmpty() )
{
@@ -473,9 +515,16 @@ OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& lines
for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
code[ ind ] = static_cast<char>(aMasterPasswd.copy( ind*2, 2 ).toUInt32(16));
+ unsigned char iv[RTL_DIGEST_LENGTH_MD5] = {0};
+ if (!aIV.isEmpty())
+ {
+ for( int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ind++ )
+ iv[ ind ] = static_cast<char>(aIV.copy( ind*2, 2 ).toUInt32(16));
+ }
+
rtlCipherError result = rtl_cipher_init (
aEncoder, rtl_Cipher_DirectionEncode,
- code, RTL_DIGEST_LENGTH_MD5, nullptr, 0 );
+ code, RTL_DIGEST_LENGTH_MD5, iv, RTL_DIGEST_LENGTH_MD5 );
if( result == rtl_Cipher_E_None )
{
@@ -543,7 +592,7 @@ void PasswordContainer::UpdateVector( const OUString& aURL, std::vector< NamePas
if( aRecord.HasPasswords( PERSISTENT_RECORD ) )
{
- aNPIter.SetPersPasswords( aRecord.GetPersPasswords() );
+ aNPIter.SetPersPasswords( aRecord.GetPersPasswords(), aRecord.GetPersistentIV() );
if( writeFile )
{
@@ -576,7 +625,8 @@ UserRecord PasswordContainer::CopyToUserRecord( const NamePassRecord& aRecord, b
{
try
{
- ::std::vector< OUString > aDecodedPasswords = DecodePasswords( aRecord.GetPersPasswords(), GetMasterPassword( aHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER );
+ ::std::vector< OUString > aDecodedPasswords = DecodePasswords( aRecord.GetPersPasswords(), aRecord.GetPersistentIV(),
+ GetMasterPassword( aHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER );
aPasswords.insert( aPasswords.end(), aDecodedPasswords.begin(), aDecodedPasswords.end() );
}
catch( NoMasterException& )
@@ -621,6 +671,19 @@ void SAL_CALL PasswordContainer::addPersistent( const OUString& Url, const OUStr
PrivateAdd( Url, UserName, Passwords, PERSISTENT_RECORD, aHandler );
}
+OUString PasswordContainer::createIV()
+{
+ rtlRandomPool randomPool = mRandomPool.get();
+ unsigned char iv[RTL_DIGEST_LENGTH_MD5];
+ rtl_random_getBytes(randomPool, iv, RTL_DIGEST_LENGTH_MD5);
+ OUStringBuffer aBuffer;
+ for (sal_uInt8 i : iv)
+ {
+ aBuffer.append(OUString::number(i >> 4, 16));
+ aBuffer.append(OUString::number(i & 15, 16));
+ }
+ return aBuffer.makeStringAndClear();
+}
void PasswordContainer::PrivateAdd( const OUString& Url, const OUString& UserName, const Sequence< OUString >& Passwords, char Mode, const Reference< XInteractionHandler >& aHandler )
{
@@ -628,7 +691,11 @@ void PasswordContainer::PrivateAdd( const OUString& Url, const OUString& UserNam
::std::vector< OUString > aStorePass = comphelper::sequenceToContainer< std::vector<OUString> >( Passwords );
if( Mode == PERSISTENT_RECORD )
- aRecord.SetPersPasswords( EncodePasswords( aStorePass, GetMasterPassword( aHandler ) ) );
+ {
+ OUString sIV = createIV();
+ OUString sEncodedPasswords = EncodePasswords( aStorePass, sIV, GetMasterPassword( aHandler ) );
+ aRecord.SetPersPasswords( sEncodedPasswords, sIV );
+ }
else if( Mode == MEMORY_RECORD )
aRecord.SetMemPasswords( aStorePass );
else
@@ -800,6 +867,18 @@ OUString PasswordContainer::RequestPasswordFromUser( PasswordRequestMode aRMode,
return aResult;
}
+// Mangle the key to match an old bug
+static OUString ReencodeAsOldHash(const OUString& rPass)
+{
+ OUStringBuffer aBuffer;
+ for (int ind = 0; ind < RTL_DIGEST_LENGTH_MD5; ++ind)
+ {
+ unsigned char i = static_cast<char>(rPass.copy(ind * 2, 2).toUInt32(16));
+ aBuffer.append(static_cast< sal_Unicode >('a' + (i >> 4)));
+ aBuffer.append(static_cast< sal_Unicode >('a' + (i & 15)));
+ }
+ return aBuffer.makeStringAndClear();
+}
OUString const & PasswordContainer::GetMasterPassword( const Reference< XInteractionHandler >& aHandler )
{
@@ -809,10 +888,10 @@ OUString const & PasswordContainer::GetMasterPassword( const Reference< XInterac
if( m_aMasterPasswd.isEmpty() && aHandler.is() )
{
- OUString aEncodedMP;
+ OUString aEncodedMP, aEncodedMPIV;
bool bDefaultPassword = false;
- if( !m_pStorageFile->getEncodedMP( aEncodedMP ) )
+ if( !m_pStorageFile->getEncodedMP( aEncodedMP, aEncodedMPIV ) )
aRMode = PasswordRequestMode_PASSWORD_CREATE;
else if ( aEncodedMP.isEmpty() )
{
@@ -834,11 +913,15 @@ OUString const & PasswordContainer::GetMasterPassword( const Reference< XInterac
m_aMasterPasswd = aPass;
std::vector< OUString > aMaster( 1, m_aMasterPasswd );
- m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, m_aMasterPasswd ) );
+ OUString sIV = createIV();
+ m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, sIV, m_aMasterPasswd ), sIV );
}
else
{
- std::vector< OUString > aRM( DecodePasswords( aEncodedMP, aPass, aRMode ) );
+ if (m_pStorageFile->getStorageVersion() == 0)
+ aPass = ReencodeAsOldHash(aPass);
+
+ std::vector< OUString > aRM( DecodePasswords( aEncodedMP, aEncodedMPIV, aPass, aRMode ) );
if( aRM.empty() || aPass != aRM[0] )
{
bAskAgain = true;
@@ -995,7 +1078,8 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere
{
sal_Int32 oldLen = aUsers.getLength();
aUsers.realloc( oldLen + 1 );
- aUsers[ oldLen ] = UserRecord( aNP.GetUserName(), comphelper::containerToSequence( DecodePasswords( aNP.GetPersPasswords(), GetMasterPassword( xHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER ) ) );
+ aUsers[ oldLen ] = UserRecord( aNP.GetUserName(), comphelper::containerToSequence( DecodePasswords( aNP.GetPersPasswords(), aNP.GetPersistentIV(),
+ GetMasterPassword( xHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER ) ) );
}
if( aUsers.hasElements() )
@@ -1012,12 +1096,12 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere
sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::Reference< task::XInteractionHandler >& xHandler )
{
bool bResult = false;
- OUString aEncodedMP;
+ OUString aEncodedMP, aEncodedMPIV;
uno::Reference< task::XInteractionHandler > xTmpHandler = xHandler;
::osl::MutexGuard aGuard( mMutex );
// the method should fail if there is no master password
- if( m_pStorageFile && m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP ) )
+ if( m_pStorageFile && m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP, aEncodedMPIV ) )
{
if ( aEncodedMP.isEmpty() )
{
@@ -1042,6 +1126,13 @@ sal_Bool SAL_CALL PasswordContainer::authorizateWithMasterPassword( const uno::R
do {
aPass = RequestPasswordFromUser( aRMode, xTmpHandler );
+
+
+ if (!aPass.isEmpty() && m_pStorageFile->getStorageVersion() == 0)
+ {
+ aPass = ReencodeAsOldHash(aPass);
+ }
+
bResult = ( !aPass.isEmpty() && aPass == m_aMasterPasswd );
aRMode = PasswordRequestMode_PASSWORD_REENTER; // further questions with error notification
} while( !bResult && !aPass.isEmpty() );
@@ -1079,8 +1170,8 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference<
bool bCanChangePassword = true;
// if there is already a stored master password it should be entered by the user before the change happen
- OUString aEncodedMP;
- if( !m_aMasterPasswd.isEmpty() || m_pStorageFile->getEncodedMP( aEncodedMP ) )
+ OUString aEncodedMP, aEncodedMPIV;
+ if( !m_aMasterPasswd.isEmpty() || m_pStorageFile->getEncodedMP( aEncodedMP, aEncodedMPIV ) )
bCanChangePassword = authorizateWithMasterPassword( xTmpHandler );
if ( bCanChangePassword )
@@ -1099,7 +1190,8 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference<
// store the new master password
m_aMasterPasswd = aPass;
std::vector< OUString > aMaster( 1, m_aMasterPasswd );
- m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, m_aMasterPasswd ) );
+ OUString aIV = createIV();
+ m_pStorageFile->setEncodedMP( EncodePasswords( aMaster, aIV, m_aMasterPasswd ), aIV );
// store all the entries with the new password
for ( const auto& rURL : aPersistent )
@@ -1124,7 +1216,7 @@ void SAL_CALL PasswordContainer::removeMasterPassword()
if ( m_pStorageFile )
{
m_aMasterPasswd.clear();
- m_pStorageFile->setEncodedMP( OUString() ); // let the master password be removed from configuration
+ m_pStorageFile->setEncodedMP( OUString(), OUString() ); // let the master password be removed from configuration
}
}
@@ -1135,8 +1227,8 @@ sal_Bool SAL_CALL PasswordContainer::hasMasterPassword( )
if ( !m_pStorageFile )
throw uno::RuntimeException();
- OUString aEncodedMP;
- return ( m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP ) );
+ OUString aEncodedMP, aEncodedMPIV;
+ return ( m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP, aEncodedMPIV ) );
}
sal_Bool SAL_CALL PasswordContainer::allowPersistentStoring( sal_Bool bAllow )
@@ -1183,8 +1275,8 @@ sal_Bool SAL_CALL PasswordContainer::useDefaultMasterPassword( const uno::Refere
bool bCanChangePassword = true;
// if there is already a stored nondefault master password it should be entered by the user before the change happen
- OUString aEncodedMP;
- if( m_pStorageFile->getEncodedMP( aEncodedMP ) && !aEncodedMP.isEmpty() )
+ OUString aEncodedMP, aEncodedMPIV;
+ if( m_pStorageFile->getEncodedMP( aEncodedMP, aEncodedMPIV ) && !aEncodedMP.isEmpty() )
bCanChangePassword = authorizateWithMasterPassword( xTmpHandler );
if ( bCanChangePassword )
@@ -1201,7 +1293,7 @@ sal_Bool SAL_CALL PasswordContainer::useDefaultMasterPassword( const uno::Refere
// store the empty string to flag the default master password
m_aMasterPasswd = aPass;
- m_pStorageFile->setEncodedMP( OUString(), true );
+ m_pStorageFile->setEncodedMP( OUString(), OUString(), true );
// store all the entries with the new password
for ( const auto& rURL : aPersistent )
@@ -1225,8 +1317,8 @@ sal_Bool SAL_CALL PasswordContainer::isDefaultMasterPasswordUsed()
if ( !m_pStorageFile )
throw uno::RuntimeException();
- OUString aEncodedMP;
- return ( m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP ) && aEncodedMP.isEmpty() );
+ OUString aEncodedMP, aEncodedMPIV;
+ return ( m_pStorageFile->useStorage() && m_pStorageFile->getEncodedMP( aEncodedMP, aEncodedMPIV ) && aEncodedMP.isEmpty() );
}
diff --git a/svl/source/passwordcontainer/passwordcontainer.hxx b/svl/source/passwordcontainer/passwordcontainer.hxx
index 09fb7e03629d..4e3a6629139e 100644
--- a/svl/source/passwordcontainer/passwordcontainer.hxx
+++ b/svl/source/passwordcontainer/passwordcontainer.hxx
@@ -33,6 +33,7 @@
#include <unotools/configitem.hxx>
#include <ucbhelper/interactionrequest.hxx>
+#include <rtl/random.h>
#include <rtl/ref.hxx>
#include <osl/mutex.hxx>
@@ -51,11 +52,12 @@ class NamePassRecord
::std::vector< OUString > m_aMemPass;
// persistent passwords are encrypted in one string
- bool m_bHasPersPass;
+ bool m_bHasPersPass;
OUString m_aPersPass;
+ OUString m_aPersistentIV;
void InitArrays( bool bHasMemoryList, const ::std::vector< OUString >& aMemoryList,
- bool bHasPersistentList, const OUString& aPersistentList )
+ bool bHasPersistentList, const OUString& aPersistentList, const OUString& aPersistentIV )
{
m_bHasMemPass = bHasMemoryList;
if ( bHasMemoryList )
@@ -63,7 +65,10 @@ class NamePassRecord
m_bHasPersPass = bHasPersistentList;
if ( bHasPersistentList )
+ {
m_aPersPass = aPersistentList;
+ m_aPersistentIV = aPersistentIV;
+ }
}
public:
@@ -75,11 +80,12 @@ public:
{
}
- NamePassRecord( const OUString& aName, const OUString& aPersistentList )
+ NamePassRecord( const OUString& aName, const OUString& aPersistentList, const OUString& aPersistentIV )
: m_aName( aName )
, m_bHasMemPass( false )
, m_bHasPersPass( true )
, m_aPersPass( aPersistentList )
+ , m_aPersistentIV( aPersistentIV )
{
}
@@ -88,7 +94,8 @@ public:
, m_bHasMemPass( false )
, m_bHasPersPass( false )
{
- InitArrays( aRecord.m_bHasMemPass, aRecord.m_aMemPass, aRecord.m_bHasPersPass, aRecord.m_aPersPass );
+ InitArrays( aRecord.m_bHasMemPass, aRecord.m_aMemPass,
+ aRecord.m_bHasPersPass, aRecord.m_aPersPass, aRecord.m_aPersistentIV );
}
NamePassRecord& operator=( const NamePassRecord& aRecord )
@@ -99,7 +106,9 @@ public:
m_aMemPass.clear();
m_aPersPass.clear();
- InitArrays( aRecord.m_bHasMemPass, aRecord.m_aMemPass, aRecord.m_bHasPersPass, aRecord.m_aPersPass );
+ m_aPersistentIV.clear();
+ InitArrays( aRecord.m_bHasMemPass, aRecord.m_aMemPass,
+ aRecord.m_bHasPersPass, aRecord.m_aPersPass, aRecord.m_aPersistentIV );
}
return *this;
}
@@ -135,15 +144,24 @@ public:
return OUString();
}
+ OUString GetPersistentIV() const
+ {
+ if ( m_bHasPersPass )
+ return m_aPersistentIV;
+
+ return OUString();
+ }
+
void SetMemPasswords( const ::std::vector< OUString >& aMemList )
{
m_aMemPass = aMemList;
m_bHasMemPass = true;
}
- void SetPersPasswords( const OUString& aPersList )
+ void SetPersPasswords( const OUString& aPersList, const OUString& aPersIV )
{
m_aPersPass = aPersList;
+ m_aPersistentIV = aPersIV;
m_bHasPersPass = true;
}
@@ -158,6 +176,7 @@ public:
{
m_bHasPersPass = false;
m_aPersPass.clear();
+ m_aPersistentIV.clear();
}
}
@@ -167,6 +186,10 @@ public:
typedef ::std::pair< const OUString, ::std::vector< NamePassRecord > > PairUrlRecord;
typedef ::std::map< OUString, ::std::vector< NamePassRecord > > PassMap;
+// org.openoffice.Office.Common/Passwords/StorageVersion bump if details of
+// how password details are saved changes. Enables migration from previous
+// schemes.
+constexpr sal_Int32 nCurrentStorageVersion = 1;
class PasswordContainer;
@@ -177,6 +200,7 @@ private:
PasswordContainer* mainCont;
bool hasEncoded;
OUString mEncoded;
+ OUString mEncodedIV;
virtual void ImplCommit() override;
@@ -195,8 +219,10 @@ public:
void remove( const OUString& url, const OUString& rec );
void clear();
- bool getEncodedMP( OUString& aResult );
- void setEncodedMP( const OUString& aResult, bool bAcceptEnmpty = false );
+ sal_Int32 getStorageVersion();
+
+ bool getEncodedMP( OUString& aResult, OUString& aResultIV );
+ void setEncodedMP( const OUString& aResult, const OUString& aResultIV, bool bAcceptEmpty = false );
void setUseStorage( bool bUse );
bool useStorage();
@@ -217,6 +243,29 @@ private:
css::uno::Reference< css::lang::XComponent > mComponent;
SysCredentialsConfig mUrlContainer;
+ class RandomPool
+ {
+ private:
+ rtlRandomPool m_aRandomPool;
+ public:
+ RandomPool() : m_aRandomPool(rtl_random_createPool())
+ {
+ }
+ rtlRandomPool get()
+ {
+ return m_aRandomPool;
+ }
+ ~RandomPool()
+ {
+ // Clean up random pool memory
+ rtl_random_destroyPool(m_aRandomPool);
+ }
+ };
+
+ RandomPool mRandomPool;
+
+ OUString createIV();
+
/// @throws css::uno::RuntimeException
css::uno::Sequence< css::task::UserRecord > CopyToUserRecordSequence(
const ::std::vector< NamePassRecord >& original,
@@ -267,10 +316,10 @@ css::task::UrlRecord find(
const css::uno::Reference< css::task::XInteractionHandler >& Handler );
/// @throws css::uno::RuntimeException
- static ::std::vector< OUString > DecodePasswords( const OUString& aLine, const OUString& aMasterPassword, css::task::PasswordRequestMode mode );
+ static ::std::vector< OUString > DecodePasswords( const OUString& aLine, const OUString& aIV, const OUString& aMasterPassword, css::task::PasswordRequestMode mode );
/// @throws css::uno::RuntimeException
- static OUString EncodePasswords(const std::vector< OUString >& lines, const OUString& aMasterPassword );
+ static OUString EncodePasswords(const std::vector< OUString >& lines, const OUString& aIV, const OUString& aMasterPassword );
public:
PasswordContainer( const css::uno::Reference< css::lang::XMultiServiceFactory >& );
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index bfbc2e21593b..b3724f87ee00 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -175,11 +175,13 @@ bool DavDetailsContainer::verifyScheme( const OUString& rScheme )
{
bValid = true;
m_pDialog->m_xCBDavs->set_active(false);
+ ToggledDavsHdl(*m_pDialog->m_xCBDavs);
}
else if ( rScheme == "https://" )
{
bValid = true;
m_pDialog->m_xCBDavs->set_active(true);
+ ToggledDavsHdl(*m_pDialog->m_xCBDavs);
}
return bValid;
}
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 2b4311cde7f6..519e7da7268c 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -208,23 +208,24 @@ bool SvtLanguageTable::HasLanguageType( const LanguageType eType )
OUString SvtLanguageTableImpl::GetString( const LanguageType eType ) const
{
- LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType );
- sal_uInt32 nPos = FindIndex(eLang);
+ const LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( eType);
+ const sal_uInt32 nPos = (eType == LANGUAGE_PROCESS_OR_USER_DEFAULT ?
+ FindIndex(LANGUAGE_SYSTEM) : FindIndex( nLang));
if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < GetEntryCount() )
return m_aStrings[nPos].first;
//Rather than return a fairly useless "Unknown" name, return a geeky but usable-in-a-pinch lang-tag
- OUString sLangTag( lcl_getDescription( LanguageTag::convertToBcp47(eType)));
+ OUString sLangTag( lcl_getDescription( LanguageTag::convertToBcp47(nLang)));
SAL_WARN("svtools.misc", "Language: 0x"
- << std::hex << eType
+ << std::hex << nLang
<< " with unknown name, so returning lang-tag of: "
<< sLangTag);
// And add it to the table if it is an on-the-fly-id, which it usually is,
// so it is available in all subsequent language boxes.
- if (LanguageTag::isOnTheFlyID( eType))
- const_cast<SvtLanguageTableImpl*>(this)->AddItem( sLangTag, eType);
+ if (LanguageTag::isOnTheFlyID( nLang))
+ const_cast<SvtLanguageTableImpl*>(this)->AddItem( sLangTag, nLang);
return sLangTag;
}
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 67f5a87862ad..563ef0f76755 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1058,6 +1058,7 @@ HtmlTokenId HTMLParser::GetNextToken_()
sTmpBuffer.appendUtf32( nNextCh );
nNextCh = GetNextChar();
} while( '>' != nNextCh && '/' != nNextCh && !rtl::isAsciiWhiteSpace( nNextCh ) &&
+ !linguistic::IsControlChar(nNextCh) &&
IsParserWorking() && !rInput.eof() );
if( !sTmpBuffer.isEmpty() )
@@ -1135,8 +1136,11 @@ HtmlTokenId HTMLParser::GetNextToken_()
if( !bDone )
sTmpBuffer.appendUtf32(nNextCh);
}
- else
+ else if (!linguistic::IsControlChar(nNextCh)
+ || nNextCh == '\r' || nNextCh == '\n' || nNextCh == '\t')
+ {
sTmpBuffer.appendUtf32(nNextCh);
+ }
if( !bDone )
nNextCh = GetNextChar();
}
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index 8bd9d94f2366..5193979f36d2 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
+#include <vcl/commandinfoprovider.hxx>
#include <vcl/svapp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/toolbox.hxx>
@@ -501,6 +502,30 @@ void ToolboxController::bindListener()
catch ( Exception& )
{
}
+
+ // it may be a command alias
+ if (!xDispatch.is())
+ {
+ try
+ {
+ auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(listener.first,
+ vcl::CommandInfoProvider::GetModuleIdentifier(m_xFrame));
+ OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties);
+
+ if (!sRealCommand.isEmpty())
+ {
+ aTargetURL.Complete = sRealCommand;
+ if ( m_xUrlTransformer.is() )
+ m_xUrlTransformer->parseStrict( aTargetURL );
+
+ xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 );
+ }
+ }
+ catch ( Exception& )
+ {
+ }
+ }
+
listener.second = xDispatch;
Listener aListener( aTargetURL, xDispatch );
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index dc312a81d772..7882033e0815 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -105,6 +105,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
svx/source/customshapes/EnhancedCustomShapeEngine \
svx/source/customshapes/EnhancedCustomShapeFontWork \
svx/source/customshapes/EnhancedCustomShapeHandle \
+ svx/source/dialog/GenericCheckDialog \
svx/source/dialog/_bmpmask \
svx/source/dialog/charmap \
svx/source/dialog/searchcharmap \
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 2dad0a2bb7a8..a82c8503f00e 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -55,6 +55,8 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/functionmenu \
svx/uiconfig/ui/gallerymenu1 \
svx/uiconfig/ui/gallerymenu2 \
+ svx/uiconfig/ui/genericcheckdialog \
+ svx/uiconfig/ui/genericcheckentry \
svx/uiconfig/ui/headfootformatpage \
svx/uiconfig/ui/imapdialog \
svx/uiconfig/ui/imapmenu \
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index e5107db90048..3f268536390e 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -8373,7 +8373,7 @@ SfxBoolItem Text SID_ATTR_CHAR
SfxBoolItem DrawText SID_DRAW_TEXT
-
+(SfxBoolItem CreateDirectly FN_PARAM_1)
[
AutoUpdate = TRUE,
FastCall = FALSE,
@@ -12278,8 +12278,25 @@ SfxVoidItem SpellCheckApplySuggestion SID_SPELLCHECK_APPLY_SUGGESTION
GroupId = SfxGroupId::Format;
]
+SfxVoidItem GraphicSizeCheck SID_GRAPHIC_SIZE_CHECK
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = SfxGroupId::Modify;
+]
+
SfxVoidItem MoveShapeHandle SID_MOVE_SHAPE_HANDLE
-(SfxUInt32Item HandleNum FN_PARAM_1 SfxUInt32Item NewPosX FN_PARAM_2 SfxUInt32Item NewPosY FN_PARAM_3)
+(SfxUInt32Item HandleNum FN_PARAM_1 SfxUInt32Item NewPosX FN_PARAM_2 SfxUInt32Item NewPosY FN_PARAM_3 SfxInt32Item OrdNum FN_PARAM_4)
[
AutoUpdate = FALSE,
FastCall = TRUE,
diff --git a/svx/source/dialog/GenericCheckDialog.cxx b/svx/source/dialog/GenericCheckDialog.cxx
new file mode 100644
index 000000000000..09fc3d678769
--- /dev/null
+++ b/svx/source/dialog/GenericCheckDialog.cxx
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <svx/GenericCheckDialog.hxx>
+#include <vcl/svapp.hxx>
+
+namespace svx
+{
+GenericCheckEntry::GenericCheckEntry(weld::Container* pParent,
+ std::unique_ptr<CheckData>& pCheckData)
+ : m_xBuilder(Application::CreateBuilder(pParent, "svx/ui/genericcheckentry.ui"))
+ , m_xContainer(m_xBuilder->weld_container("checkEntryBox"))
+ , m_xLabel(m_xBuilder->weld_label("label"))
+ , m_xMarkButton(m_xBuilder->weld_button("markButton"))
+ , m_xPropertiesButton(m_xBuilder->weld_button("propertiesButton"))
+ , m_pCheckData(pCheckData)
+{
+ m_xLabel->set_label(m_pCheckData->getText());
+ m_xMarkButton->set_visible(m_pCheckData->canMarkObject());
+ m_xMarkButton->connect_clicked(LINK(this, GenericCheckEntry, MarkButtonClicked));
+ m_xPropertiesButton->set_visible(m_pCheckData->hasProperties());
+ m_xPropertiesButton->connect_clicked(LINK(this, GenericCheckEntry, PropertiesButtonClicked));
+
+ m_xContainer->show();
+}
+
+IMPL_LINK_NOARG(GenericCheckEntry, MarkButtonClicked, weld::Button&, void)
+{
+ m_pCheckData->markObject();
+}
+
+IMPL_LINK_NOARG(GenericCheckEntry, PropertiesButtonClicked, weld::Button&, void)
+{
+ m_pCheckData->runProperties();
+}
+
+GenericCheckDialog::GenericCheckDialog(weld::Window* pParent,
+ CheckDataCollection& rCheckDataCollection)
+ : GenericDialogController(pParent, "svx/ui/genericcheckdialog.ui", "GenericCheckDialog")
+ , m_rCheckDataCollection(rCheckDataCollection)
+ , m_xCheckBox(m_xBuilder->weld_box("checkBox"))
+{
+ set_title(m_rCheckDataCollection.getTitle());
+}
+
+GenericCheckDialog::~GenericCheckDialog() {}
+
+short GenericCheckDialog::run()
+{
+ sal_Int32 i = 0;
+
+ for (std::unique_ptr<CheckData>& pCheckData : m_rCheckDataCollection.getCollection())
+ {
+ auto xEntry = std::make_unique<GenericCheckEntry>(m_xCheckBox.get(), pCheckData);
+ m_xCheckBox->reorder_child(xEntry->get_widget(), i++);
+ m_aCheckEntries.push_back(std::move(xEntry));
+ }
+ return GenericDialogController::run();
+}
+
+} // end svx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index cdefa9972966..f946a034429d 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -729,7 +729,7 @@ short RecoveryDialog::execute()
m_pCore->doRecovery();
m_bWaitForCore = true;
- while(m_bWaitForCore)
+ while(m_bWaitForCore && !Application::IsQuit())
Application::Yield();
m_pCore->setUpdateListener(nullptr);
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index a409731f18c0..2a0d98744a93 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1392,6 +1392,10 @@ namespace svxform
void DataNavigatorWindow::dispose()
{
+ Reference< XFrameActionListener > xListener(
+ static_cast< XFrameActionListener* >( m_xDataListener.get() ), UNO_QUERY );
+ m_xFrame->removeFrameActionListener( xListener );
+
SvtViewOptions aViewOpt( EViewType::TabDialog, CFGNAME_DATANAVIGATOR );
aViewOpt.SetPageID(m_pTabCtrl->GetPageName(m_pTabCtrl->GetCurPageId()));
aViewOpt.SetUserItem(CFGNAME_SHOWDETAILS, Any(m_bShowDetails));
@@ -1405,9 +1409,6 @@ namespace svxform
m_aPageList[i].disposeAndClear();
m_aPageList.clear();
- Reference< XFrameActionListener > xListener(
- static_cast< XFrameActionListener* >( m_xDataListener.get() ), UNO_QUERY );
- m_xFrame->removeFrameActionListener( xListener );
RemoveBroadcaster();
m_xDataListener.clear();
disposeBuilder();
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 5838a1610e0f..d0756018d7b2 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -348,7 +348,8 @@ namespace sdr
// Get info about the need to visualize GluePoints
bool ObjectContactOfPageView::AreGluePointsVisible() const
{
- return GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
+ bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+ return !bTiledRendering && GetPageWindow().GetPageView().GetView().ImpIsGlueVisible();
}
// check if text animation is allowed.
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index 882b911a8fab..89e099da71c3 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -234,8 +234,11 @@ void ViewObjectContact::ActionChanged()
// invalidate current valid range
GetObjectContact().InvalidatePartOfView(maObjectRange);
- // reset ObjectRange, it needs to be recalculated
- maObjectRange.reset();
+ // reset gridOffset, it needs to be recalculated
+ if (GetObjectContact().supportsGridOffsets())
+ resetGridOffset();
+ else
+ maObjectRange.reset();
}
// register at OC for lazy invalidate
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index b85ab66a9e12..775f35510c3a 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -449,7 +449,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
const tools::Rectangle aRectTwips = OutputDevice::LogicToLogic(aRect100thMM, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
if (SfxViewShell* pViewShell = SfxViewShell::Current())
- SfxLokHelper::notifyInvalidation(pViewShell, aRectTwips.toString());
+ SfxLokHelper::notifyInvalidation(pViewShell, &aRectTwips);
}
}
diff --git a/svx/source/svdraw/selectioncontroller.cxx b/svx/source/svdraw/selectioncontroller.cxx
index 28dda4ed27a2..5f6f51312f4e 100644
--- a/svx/source/svdraw/selectioncontroller.cxx
+++ b/svx/source/svdraw/selectioncontroller.cxx
@@ -47,6 +47,10 @@ void SelectionController::onSelectionHasChanged()
{
}
+void SelectionController::onSelectAll()
+{
+}
+
void SelectionController::GetState( SfxItemSet& /*rSet*/ )
{
}
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 80c421e40149..bbb640e6c6c7 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1360,7 +1360,7 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
if( bUndo )
{
- getSdrDragView().EndTextEditAllViews();
+ getSdrDragView().EndTextEditCurrentView();
if(!getSdrDragView().IsInsObjPoint() && pObj->IsInserted() )
{
if (DragStat().IsEndDragChangesAttributes())
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index e807b0a65610..78a065ff9fc5 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -41,6 +41,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdrpagewindow.hxx>
+#include <comphelper/lok.hxx>
using namespace sdr;
@@ -225,10 +226,12 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl
// Coordinate maybe affected by GridOffset, so we may need to
// adapt to Model-coordinates here
- if(getPossibleGridOffsetForPosition(
+ if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj
+ && getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectByIndex(0), GetSdrPageView()))
+ || (getPossibleGridOffsetForPosition(
aGridOffset,
basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
- GetSdrPageView()))
+ GetSdrPageView())))
{
aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
@@ -526,10 +529,12 @@ void SdrDragView::MovDragObj(const Point& rPnt)
// Coordinate maybe affected by GridOffset, so we may need to
// adapt to Model-coordinates here
- if(getPossibleGridOffsetForPosition(
+ if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj
+ && getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectByIndex(0), GetSdrPageView()))
+ || (getPossibleGridOffsetForPosition(
aGridOffset,
basegfx::B2DPoint(aPnt.X(), aPnt.Y()),
- GetSdrPageView()))
+ GetSdrPageView())))
{
aPnt.AdjustX(basegfx::fround(-aGridOffset.getX()));
aPnt.AdjustY(basegfx::fround(-aGridOffset.getY()));
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index b301d19312d2..44d9684e2ef9 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -973,11 +973,8 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInser
if (!pObj->IsInserted()) {
rPV.GetObjList()->InsertObject(pObj, SAL_MAX_SIZE);
}
- if( IsUndoEnabled())
- {
- EndTextEditAllViews();
+ if( IsUndoEnabled() && CanDoSdrUndo())
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
- }
if (!(nOptions & SdrInsertFlags::DONTMARK)) {
if (!(nOptions & SdrInsertFlags::ADDMARK)) UnmarkAllObj();
@@ -1032,6 +1029,22 @@ bool SdrEditView::IsUndoEnabled() const
return mpModel->IsUndoEnabled();
}
+bool SdrEditView::CanDoSdrUndo() const
+{
+ size_t nViews = mpModel->GetListenerCount();
+ for (size_t nView = 0; nView < nViews; ++nView)
+ {
+ SdrEditView* pView = dynamic_cast<SdrEditView*>(mpModel->GetListener(nView));
+ if (!pView)
+ continue;
+
+ if (pView->IsTextEdit())
+ return false;
+ }
+
+ return true;
+}
+
void SdrEditView::EndTextEditAllViews() const
{
size_t nViews = mpModel->GetListenerCount();
@@ -1046,4 +1059,14 @@ void SdrEditView::EndTextEditAllViews() const
}
}
+void SdrEditView::EndTextEditCurrentView()
+{
+ if (IsTextEdit())
+ {
+ SdrView* pSdrView = dynamic_cast<SdrView*>(this);
+ if (pSdrView)
+ pSdrView->SdrEndTextEdit();
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index cf29f4a268df..21a0830bbd1a 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -99,7 +99,7 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
BegUndo(ImpGetDescriptionString(STR_EditPosSize));
}
@@ -190,7 +190,7 @@ void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr(SvxResId(STR_EditMove));
if (bCopy)
aStr += SvxResId(STR_EditWithCopy);
@@ -223,7 +223,7 @@ void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, cons
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditResize)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -258,7 +258,7 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
BegUndo(ImpGetDescriptionString(STR_EditResize));
}
@@ -319,7 +319,7 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditRotate)};
if (bCopy) aStr+=SvxResId(STR_EditWithCopy);
BegUndo(aStr);
@@ -376,7 +376,7 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr;
Point aDif(rRef2-rRef1);
if (aDif.X()==0)
@@ -476,7 +476,7 @@ void SdrEditView::ShearMarkedObj(const Point& rRef, long nAngle, bool bVShear, b
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditShear)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -592,7 +592,7 @@ void SdrEditView::CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookM
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(bNoContortion ? STR_EditCrook : STR_EditCrookContortion)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -666,7 +666,7 @@ void SdrEditView::DistortMarkedObj(const tools::Rectangle& rRef, const XPolygon&
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr {ImpGetDescriptionString(STR_EditDistort)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -1111,7 +1111,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
}
@@ -1291,7 +1291,7 @@ void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRe
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr;
if (pStyleSheet!=nullptr)
aStr = ImpGetDescriptionString(STR_EditSetStylesheet);
@@ -1534,7 +1534,7 @@ static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP)
return Point(); // Should not happen!
}
-void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
+void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin)
{
const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
@@ -1542,6 +1542,12 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr)
if(GetSdrPageView())
{
+ if (addPageMargin)
+ {
+ SdrPage * pPage = GetSdrPageView()->GetPage();
+ Point upperLeft(pPage->GetLeftBorder(), pPage->GetUpperBorder());
+ aRect.Move(upperLeft.getX(), upperLeft.getY());
+ }
GetSdrPageView()->LogicToPagePos(aRect);
}
@@ -1853,7 +1859,7 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
const bool bUndo = IsUndoEnabled();
if( bUndo )
{
- EndTextEditAllViews();
+ EndTextEditCurrentView();
OUString aStr(GetDescriptionOfMarkedObjects());
if (eHor==SdrHorAlign::NONE)
{
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 43ea7336af56..32057e0b5163 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -77,24 +77,37 @@
void SdrObjEditView::ImpClearVars()
{
- bQuickTextEditMode = true;
- pTextEditOutliner.reset();
- pTextEditOutlinerView = nullptr;
- pTextEditPV = nullptr;
- pTextEditWin = nullptr;
+ mbQuickTextEditMode = true;
+ mpTextEditOutliner.reset();
+ mpTextEditOutlinerView = nullptr;
+ mpTextEditPV = nullptr;
+ mpTextEditWin = nullptr;
pTextEditCursorBuffer = nullptr;
- bTextEditNewObj = false;
- bMacroDown = false;
+ mbTextEditNewObj = false;
+ mbMacroDown = false;
pMacroObj = nullptr;
pMacroPV = nullptr;
pMacroWin = nullptr;
nMacroTol = 0;
- bTextEditDontDelete = false;
- bTextEditOnlyOneView = false;
+ mbTextEditDontDelete = false;
+ mbTextEditOnlyOneView = false;
}
SdrObjEditView::SdrObjEditView(SdrModel& rSdrModel, OutputDevice* pOut)
: SdrGlueEditView(rSdrModel, pOut)
+ , mpTextEditPV(nullptr)
+ , mpTextEditOutlinerView(nullptr)
+ , mpTextEditWin(nullptr)
+ , pTextEditCursorBuffer(nullptr)
+ , pMacroObj(nullptr)
+ , pMacroPV(nullptr)
+ , pMacroWin(nullptr)
+ , nMacroTol(0)
+ , mbTextEditDontDelete(false)
+ , mbTextEditOnlyOneView(false)
+ , mbTextEditNewObj(false)
+ , mbQuickTextEditMode(true)
+ , mbMacroDown(false)
, mpOldTextEditUndoManager(nullptr)
{
ImpClearVars();
@@ -102,11 +115,11 @@ SdrObjEditView::SdrObjEditView(SdrModel& rSdrModel, OutputDevice* pOut)
SdrObjEditView::~SdrObjEditView()
{
- pTextEditWin = nullptr; // so there's no ShowCursor in SdrEndTextEdit
+ mpTextEditWin = nullptr; // so there's no ShowCursor in SdrEndTextEdit
assert(!IsTextEdit());
if (IsTextEdit())
SdrEndTextEdit();
- pTextEditOutliner.reset();
+ mpTextEditOutliner.reset();
assert(nullptr == mpOldTextEditUndoManager); // should have been reset
}
@@ -210,6 +223,12 @@ void SdrObjEditView::HideSdrPage()
{
lcl_RemoveTextEditOutlinerViews(this, GetSdrPageView(), GetFirstOutputDevice());
+ if (mpTextEditPV == GetSdrPageView())
+ {
+ // HideSdrPage() will clear mpPageView, avoid a dangling pointer.
+ mpTextEditPV = nullptr;
+ }
+
SdrGlueEditView::HideSdrPage();
}
@@ -228,7 +247,7 @@ void SdrObjEditView::TakeActionRect(tools::Rectangle& rRect) const
void SdrObjEditView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
SdrGlueEditView::Notify(rBC, rHint);
- if (pTextEditOutliner != nullptr)
+ if (mpTextEditOutliner != nullptr)
{
// change of printer while editing
if (rHint.GetId() == SfxHintId::ThisIsAnSdrHint)
@@ -237,11 +256,11 @@ void SdrObjEditView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
SdrHintKind eKind = pSdrHint->GetKind();
if (eKind == SdrHintKind::RefDeviceChange)
{
- pTextEditOutliner->SetRefDevice(mpModel->GetRefDevice());
+ mpTextEditOutliner->SetRefDevice(mpModel->GetRefDevice());
}
if (eKind == SdrHintKind::DefaultTabChange)
{
- pTextEditOutliner->SetDefTab(mpModel->GetDefaultTabulator());
+ mpTextEditOutliner->SetDefTab(mpModel->GetDefaultTabulator());
}
}
}
@@ -258,7 +277,7 @@ void SdrObjEditView::ModelHasChanged()
SdrTextObj* pTextObj = mxTextEditObj.get();
if (pTextObj != nullptr)
{
- sal_uIntPtr nOutlViewCnt = pTextEditOutliner->GetViewCount();
+ sal_uIntPtr nOutlViewCnt = mpTextEditOutliner->GetViewCount();
bool bAreaChg = false;
bool bAnchorChg = false;
bool bColorChg = false;
@@ -293,34 +312,34 @@ void SdrObjEditView::ModelHasChanged()
if (aNewArea != aOldArea || aEditArea1 != aTextEditArea
|| aMinArea1 != aMinTextEditArea
- || pTextEditOutliner->GetMinAutoPaperSize() != aPaperMin1
- || pTextEditOutliner->GetMaxAutoPaperSize() != aPaperMax1)
+ || mpTextEditOutliner->GetMinAutoPaperSize() != aPaperMin1
+ || mpTextEditOutliner->GetMaxAutoPaperSize() != aPaperMax1)
{
aTextEditArea = aEditArea1;
aMinTextEditArea = aMinArea1;
- pTextEditOutliner->SetUpdateMode(false);
- pTextEditOutliner->SetMinAutoPaperSize(aPaperMin1);
- pTextEditOutliner->SetMaxAutoPaperSize(aPaperMax1);
- pTextEditOutliner->SetPaperSize(Size(0, 0)); // re-format Outliner
+ mpTextEditOutliner->SetUpdateMode(false);
+ mpTextEditOutliner->SetMinAutoPaperSize(aPaperMin1);
+ mpTextEditOutliner->SetMaxAutoPaperSize(aPaperMax1);
+ mpTextEditOutliner->SetPaperSize(Size(0, 0)); // re-format Outliner
if (!bContourFrame)
{
- pTextEditOutliner->ClearPolygon();
- EEControlBits nStat = pTextEditOutliner->GetControlWord();
+ mpTextEditOutliner->ClearPolygon();
+ EEControlBits nStat = mpTextEditOutliner->GetControlWord();
nStat |= EEControlBits::AUTOPAGESIZE;
- pTextEditOutliner->SetControlWord(nStat);
+ mpTextEditOutliner->SetControlWord(nStat);
}
else
{
- EEControlBits nStat = pTextEditOutliner->GetControlWord();
+ EEControlBits nStat = mpTextEditOutliner->GetControlWord();
nStat &= ~EEControlBits::AUTOPAGESIZE;
- pTextEditOutliner->SetControlWord(nStat);
+ mpTextEditOutliner->SetControlWord(nStat);
tools::Rectangle aAnchorRect;
pTextObj->TakeTextAnchorRect(aAnchorRect);
- pTextObj->ImpSetContourPolygon(*pTextEditOutliner, aAnchorRect, true);
+ pTextObj->ImpSetContourPolygon(*mpTextEditOutliner, aAnchorRect, true);
}
for (sal_uIntPtr nOV = 0; nOV < nOutlViewCnt; nOV++)
{
- OutlinerView* pOLV = pTextEditOutliner->GetView(nOV);
+ OutlinerView* pOLV = mpTextEditOutliner->GetView(nOV);
EVControlBits nStat0 = pOLV->GetControlWord();
EVControlBits nStat = nStat0;
// AutoViewSize only if not ContourFrame.
@@ -331,16 +350,16 @@ void SdrObjEditView::ModelHasChanged()
if (nStat != nStat0)
pOLV->SetControlWord(nStat);
}
- pTextEditOutliner->SetUpdateMode(true);
+ mpTextEditOutliner->SetUpdateMode(true);
bAreaChg = true;
}
}
- if (pTextEditOutlinerView != nullptr)
+ if (mpTextEditOutlinerView != nullptr)
{ // check fill and anchor
- EEAnchorMode eOldAnchor = pTextEditOutlinerView->GetAnchorMode();
+ EEAnchorMode eOldAnchor = mpTextEditOutlinerView->GetAnchorMode();
eNewAnchor = pTextObj->GetOutlinerViewAnchorMode();
bAnchorChg = eOldAnchor != eNewAnchor;
- Color aOldColor(pTextEditOutlinerView->GetBackgroundColor());
+ Color aOldColor(mpTextEditOutlinerView->GetBackgroundColor());
aNewColor = GetTextEditBackgroundColor(*this);
bColorChg = aOldColor != aNewColor;
}
@@ -363,7 +382,7 @@ void SdrObjEditView::ModelHasChanged()
{
for (sal_uIntPtr nOV = 0; nOV < nOutlViewCnt; nOV++)
{
- OutlinerView* pOLV = pTextEditOutliner->GetView(nOV);
+ OutlinerView* pOLV = mpTextEditOutliner->GetView(nOV);
{ // invalidate old OutlinerView area
vcl::Window* pWin = pOLV->GetWindow();
tools::Rectangle aTmpRect(aOldArea);
@@ -384,7 +403,7 @@ void SdrObjEditView::ModelHasChanged()
aTextEditArea); // because otherwise, we're not re-anchoring correctly
ImpInvalidateOutlinerView(*pOLV);
}
- pTextEditOutlinerView->ShowCursor();
+ mpTextEditOutlinerView->ShowCursor();
}
}
ImpMakeTextCursorAreaVisible();
@@ -671,7 +690,7 @@ void SdrObjEditView::EditViewSelectionChange() const
}
}
-OutputDevice& SdrObjEditView::EditViewOutputDevice() const { return *pTextEditWin; }
+OutputDevice& SdrObjEditView::EditViewOutputDevice() const { return *mpTextEditWin; }
void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow) const
{
@@ -728,8 +747,8 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const tools::
{
const SdrTextObj* pText = GetTextEditObject();
bool bTextFrame(pText && pText->IsTextFrame());
- bool bFitToSize(pTextEditOutliner->GetControlWord() & EEControlBits::STRETCHING);
- bool bModified(pTextEditOutliner->IsModified());
+ bool bFitToSize(mpTextEditOutliner->GetControlWord() & EEControlBits::STRETCHING);
+ bool bModified(mpTextEditOutliner->IsModified());
tools::Rectangle aBlankRect(rOutlView.GetOutputArea());
aBlankRect.Union(aMinTextEditArea);
tools::Rectangle aPixRect(rTargetDevice.LogicToPixel(aBlankRect));
@@ -747,7 +766,7 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const tools::
if (!bModified)
{
- pTextEditOutliner->ClearModifyFlag();
+ mpTextEditOutliner->ClearModifyFlag();
}
if (bTextFrame && !bFitToSize)
@@ -847,11 +866,11 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, OutlinerVie
bool bContourFrame = pText != nullptr && pText->IsContourTextFrame();
// create OutlinerView
OutlinerView* pOutlView = pGivenView;
- pTextEditOutliner->SetUpdateMode(false);
+ mpTextEditOutliner->SetUpdateMode(false);
if (pOutlView == nullptr)
{
- pOutlView = new OutlinerView(pTextEditOutliner.get(), pWin);
+ pOutlView = new OutlinerView(mpTextEditOutliner.get(), pWin);
}
else
{
@@ -883,11 +902,11 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, OutlinerVie
if (pText != nullptr)
{
pOutlView->SetAnchorMode(pText->GetOutlinerViewAnchorMode());
- pTextEditOutliner->SetFixedCellHeight(
+ mpTextEditOutliner->SetFixedCellHeight(
pText->GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue());
}
// do update before setting output area so that aTextEditArea can be recalculated
- pTextEditOutliner->SetUpdateMode(true);
+ mpTextEditOutliner->SetUpdateMode(true);
pOutlView->SetOutputArea(aTextEditArea);
ImpInvalidateOutlinerView(*pOutlView);
return pOutlView;
@@ -895,7 +914,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, OutlinerVie
IMPL_LINK(SdrObjEditView, ImpOutlinerStatusEventHdl, EditStatus&, rEditStat, void)
{
- if (pTextEditOutliner)
+ if (mpTextEditOutliner)
{
SdrTextObj* pTextObj = mxTextEditObj.get();
if (pTextObj)
@@ -907,7 +926,7 @@ IMPL_LINK(SdrObjEditView, ImpOutlinerStatusEventHdl, EditStatus&, rEditStat, voi
void SdrObjEditView::ImpChainingEventHdl()
{
- if (pTextEditOutliner)
+ if (mpTextEditOutliner)
{
SdrTextObj* pTextObj = mxTextEditObj.get();
OutlinerView* pOLV = GetTextEditOutlinerView();
@@ -1047,10 +1066,11 @@ IMPL_LINK(SdrObjEditView, ImpOutlinerCalcFieldValueHdl, EditFieldInfo*, pFI, voi
IMPL_LINK_NOARG(SdrObjEditView, EndTextEditHdl, SdrUndoManager*, void) { SdrEndTextEdit(); }
-SdrUndoManager* SdrObjEditView::getSdrUndoManagerForEnhancedTextEdit() const
+// Default implementation - null UndoManager
+std::unique_ptr<SdrUndoManager> SdrObjEditView::createLocalTextUndoManager()
{
- // default returns registered UndoManager
- return GetModel() ? dynamic_cast<SdrUndoManager*>(GetModel()->GetSdrUndoManager()) : nullptr;
+ SAL_WARN("svx", "SdrObjEditView::createLocalTextUndoManager needs to be overridden");
+ return std::unique_ptr<SdrUndoManager>();
}
bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::Window* pWin,
@@ -1075,9 +1095,9 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
pWin->GrabFocus(); // to force the cursor into the edit view
}
- bTextEditDontDelete = bDontDeleteOutliner && pGivenOutliner != nullptr;
- bTextEditOnlyOneView = bOnlyOneView;
- bTextEditNewObj = bIsNewObj;
+ mbTextEditDontDelete = bDontDeleteOutliner && pGivenOutliner != nullptr;
+ mbTextEditOnlyOneView = bOnlyOneView;
+ mbTextEditNewObj = bIsNewObj;
const sal_uInt32 nWinCount(PaintWindowCount());
sal_uInt32 i;
bool bBrk(false);
@@ -1118,44 +1138,44 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
bBrk = true;
}
- if (pTextEditOutliner)
+ if (mpTextEditOutliner)
{
OSL_FAIL("SdrObjEditView::SdrBeginTextEdit(): Old Outliner still exists.");
- pTextEditOutliner.reset();
+ mpTextEditOutliner.reset();
}
if (!bBrk)
{
- pTextEditWin = pWin;
- pTextEditPV = pPV;
+ mpTextEditWin = pWin;
+ mpTextEditPV = pPV;
mxTextEditObj.reset(pObj);
if (pGivenOutliner)
{
- pTextEditOutliner.reset(pGivenOutliner);
+ mpTextEditOutliner.reset(pGivenOutliner);
pGivenOutliner = nullptr; // so we don't delete it on the error path
}
else
- pTextEditOutliner = SdrMakeOutliner(OutlinerMode::TextObject,
- mxTextEditObj->getSdrModelFromSdrObject());
+ mpTextEditOutliner = SdrMakeOutliner(OutlinerMode::TextObject,
+ mxTextEditObj->getSdrModelFromSdrObject());
{
SvtAccessibilityOptions aOptions;
- pTextEditOutliner->ForceAutoColor(aOptions.GetIsAutomaticFontColor());
+ mpTextEditOutliner->ForceAutoColor(aOptions.GetIsAutomaticFontColor());
}
- aOldCalcFieldValueLink = pTextEditOutliner->GetCalcFieldValueHdl();
+ aOldCalcFieldValueLink = mpTextEditOutliner->GetCalcFieldValueHdl();
// FieldHdl has to be set by SdrBeginTextEdit, because this call an UpdateFields
- pTextEditOutliner->SetCalcFieldValueHdl(
+ mpTextEditOutliner->SetCalcFieldValueHdl(
LINK(this, SdrObjEditView, ImpOutlinerCalcFieldValueHdl));
- pTextEditOutliner->SetBeginPasteOrDropHdl(LINK(this, SdrObjEditView, BeginPasteOrDropHdl));
- pTextEditOutliner->SetEndPasteOrDropHdl(LINK(this, SdrObjEditView, EndPasteOrDropHdl));
+ mpTextEditOutliner->SetBeginPasteOrDropHdl(LINK(this, SdrObjEditView, BeginPasteOrDropHdl));
+ mpTextEditOutliner->SetEndPasteOrDropHdl(LINK(this, SdrObjEditView, EndPasteOrDropHdl));
// It is just necessary to make the visualized page known. Set it.
- pTextEditOutliner->setVisualizedPage(pPV->GetPage());
+ mpTextEditOutliner->setVisualizedPage(pPV->GetPage());
- pTextEditOutliner->SetTextObjNoInit(mxTextEditObj.get());
+ mpTextEditOutliner->SetTextObjNoInit(mxTextEditObj.get());
- if (mxTextEditObj->BegTextEdit(*pTextEditOutliner))
+ if (mxTextEditObj->BegTextEdit(*mpTextEditOutliner))
{
SdrTextObj* pTextObj = mxTextEditObj.get();
DBG_ASSERT(pTextObj, "svx::SdrObjEditView::BegTextEdit(), no text object?");
@@ -1166,9 +1186,9 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
pTextObj->SetTextAnimationAllowed(false);
// remember old cursor
- if (pTextEditOutliner->GetViewCount() != 0)
+ if (mpTextEditOutliner->GetViewCount() != 0)
{
- pTextEditOutliner->RemoveView(static_cast<size_t>(0));
+ mpTextEditOutliner->RemoveView(static_cast<size_t>(0));
}
// Determine EditArea via TakeTextEditArea.
@@ -1178,7 +1198,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
tools::Rectangle aTextRect;
tools::Rectangle aAnchorRect;
- pTextObj->TakeTextRect(*pTextEditOutliner, aTextRect, true,
+ pTextObj->TakeTextRect(*mpTextEditOutliner, aTextRect, true,
&aAnchorRect /* Give true here, not false */);
if (!pTextObj->IsContourTextFrame())
@@ -1212,19 +1232,19 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
// to call AdjustMarkHdl() always.
AdjustMarkHdl();
- pTextEditOutlinerView = ImpMakeOutlinerView(pWin, pGivenOutlinerView);
+ mpTextEditOutlinerView = ImpMakeOutlinerView(pWin, pGivenOutlinerView);
- if (!comphelper::LibreOfficeKit::isActive() && pTextEditOutlinerView)
+ if (!comphelper::LibreOfficeKit::isActive() && mpTextEditOutlinerView)
{
// activate visualization of EditView on Overlay, suppress when
// LibreOfficeKit is active
- pTextEditOutlinerView->GetEditView().setEditViewCallbacks(this);
+ mpTextEditOutlinerView->GetEditView().setEditViewCallbacks(this);
const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
const SdrTextObj* pText = GetTextEditObject();
const bool bTextFrame(pText && pText->IsTextFrame());
- const bool bFitToSize(pTextEditOutliner->GetControlWord()
+ const bool bFitToSize(mpTextEditOutliner->GetControlWord()
& EEControlBits::STRETCHING);
const bool bVisualizeSurroundingFrame(bTextFrame && !bFitToSize);
SdrPageView* pPageView = GetSdrPageView();
@@ -1242,7 +1262,8 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
if (xManager.is())
{
std::unique_ptr<TextEditOverlayObject> pNewTextEditOverlayObject(
- new TextEditOverlayObject(aHilightColor, *pTextEditOutlinerView,
+ new TextEditOverlayObject(aHilightColor,
+ *mpTextEditOutlinerView,
bVisualizeSurroundingFrame));
xManager->add(*pNewTextEditOverlayObject);
@@ -1257,15 +1278,15 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
}
// check if this view is already inserted
- sal_uIntPtr i2, nCount = pTextEditOutliner->GetViewCount();
+ sal_uIntPtr i2, nCount = mpTextEditOutliner->GetViewCount();
for (i2 = 0; i2 < nCount; i2++)
{
- if (pTextEditOutliner->GetView(i2) == pTextEditOutlinerView)
+ if (mpTextEditOutliner->GetView(i2) == mpTextEditOutlinerView)
break;
}
if (i2 == nCount)
- pTextEditOutliner->InsertView(pTextEditOutlinerView, 0);
+ mpTextEditOutliner->InsertView(mpTextEditOutlinerView, 0);
maHdlList.SetMoveOutside(false);
maHdlList.SetMoveOutside(true);
@@ -1282,7 +1303,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
{
OutlinerView* pOutlView
= ImpMakeOutlinerView(static_cast<vcl::Window*>(&rOutDev), nullptr);
- pTextEditOutliner->InsertView(pOutlView, static_cast<sal_uInt16>(i));
+ mpTextEditOutliner->InsertView(pOutlView, static_cast<sal_uInt16>(i));
}
}
@@ -1309,19 +1330,19 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
static_cast<vcl::Window*>(&rOutDev), nullptr);
pOutlView->HideCursor();
static_cast<vcl::Window*>(&rOutDev)->SetCursor(nullptr);
- pTextEditOutliner->InsertView(pOutlView);
+ mpTextEditOutliner->InsertView(pOutlView);
}
}
}
}
}
- pTextEditOutlinerView->ShowCursor();
- pTextEditOutliner->SetStatusEventHdl(
+ mpTextEditOutlinerView->ShowCursor();
+ mpTextEditOutliner->SetStatusEventHdl(
LINK(this, SdrObjEditView, ImpOutlinerStatusEventHdl));
if (pTextObj->IsChainable())
{
- pTextEditOutlinerView->SetEndCutPasteLinkHdl(
+ mpTextEditOutlinerView->SetEndCutPasteLinkHdl(
LINK(this, SdrObjEditView, ImpAfterCutOrPasteChainingEventHdl));
}
@@ -1329,7 +1350,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
if (mpItemBrowser != nullptr)
mpItemBrowser->SetDirty();
#endif
- pTextEditOutliner->ClearModifyFlag();
+ mpTextEditOutliner->ClearModifyFlag();
if (pTextObj->IsFitToSize())
{
@@ -1342,7 +1363,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
GetModel()->Broadcast(aHint);
}
- pTextEditOutliner->setVisualizedPage(nullptr);
+ mpTextEditOutliner->setVisualizedPage(nullptr);
if (mxSelectionController.is())
mxSelectionController->onSelectionHasChanged();
@@ -1350,7 +1371,11 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
if (GetModel() && IsUndoEnabled()
&& !GetModel()->GetDisableTextEditUsesCommonUndoManager())
{
- SdrUndoManager* pSdrUndoManager = getSdrUndoManagerForEnhancedTextEdit();
+ SdrUndoManager* pSdrUndoManager = nullptr;
+ mpLocalTextEditUndoManager = createLocalTextUndoManager();
+
+ if (mpLocalTextEditUndoManager)
+ pSdrUndoManager = mpLocalTextEditUndoManager.get();
if (pSdrUndoManager)
{
@@ -1359,7 +1384,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
// it that text edit starts by setting a callback if it needs to end text edit mode.
assert(nullptr == mpOldTextEditUndoManager);
- mpOldTextEditUndoManager = pTextEditOutliner->SetUndoManager(pSdrUndoManager);
+ mpOldTextEditUndoManager = mpTextEditOutliner->SetUndoManager(pSdrUndoManager);
pSdrUndoManager->SetEndTextEditHdl(LINK(this, SdrObjEditView, EndTextEditHdl));
}
else
@@ -1373,14 +1398,14 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
}
else
{
- pTextEditOutliner->SetCalcFieldValueHdl(aOldCalcFieldValueLink);
- pTextEditOutliner->SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*, void>());
- pTextEditOutliner->SetEndPasteOrDropHdl(Link<PasteOrDropInfos*, void>());
+ mpTextEditOutliner->SetCalcFieldValueHdl(aOldCalcFieldValueLink);
+ mpTextEditOutliner->SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*, void>());
+ mpTextEditOutliner->SetEndPasteOrDropHdl(Link<PasteOrDropInfos*, void>());
}
}
- if (pTextEditOutliner != nullptr)
+ if (mpTextEditOutliner != nullptr)
{
- pTextEditOutliner->setVisualizedPage(nullptr);
+ mpTextEditOutliner->setVisualizedPage(nullptr);
}
// something went wrong...
@@ -1393,12 +1418,12 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
pGivenOutlinerView = nullptr;
}
}
- pTextEditOutliner.reset();
+ mpTextEditOutliner.reset();
- pTextEditOutlinerView = nullptr;
+ mpTextEditOutlinerView = nullptr;
mxTextEditObj.reset(nullptr);
- pTextEditPV = nullptr;
- pTextEditWin = nullptr;
+ mpTextEditPV = nullptr;
+ mpTextEditWin = nullptr;
maHdlList.SetMoveOutside(false);
return false;
@@ -1408,23 +1433,23 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
{
SdrEndTextEditKind eRet = SdrEndTextEditKind::Unchanged;
SdrTextObj* pTEObj = mxTextEditObj.get();
- vcl::Window* pTEWin = pTextEditWin;
- OutlinerView* pTEOutlinerView = pTextEditOutlinerView;
+ vcl::Window* pTEWin = mpTextEditWin;
+ OutlinerView* pTEOutlinerView = mpTextEditOutlinerView;
vcl::Cursor* pTECursorBuffer = pTextEditCursorBuffer;
SdrUndoManager* pUndoEditUndoManager = nullptr;
bool bNeedToUndoSavedRedoTextEdit(false);
- if (GetModel() && IsUndoEnabled() && pTEObj && pTextEditOutliner
+ if (GetModel() && IsUndoEnabled() && pTEObj && mpTextEditOutliner
&& !GetModel()->GetDisableTextEditUsesCommonUndoManager())
{
// change back the UndoManager to the remembered original one
- SfxUndoManager* pOriginal = pTextEditOutliner->SetUndoManager(mpOldTextEditUndoManager);
+ SfxUndoManager* pOriginal = mpTextEditOutliner->SetUndoManager(mpOldTextEditUndoManager);
mpOldTextEditUndoManager = nullptr;
if (pOriginal)
{
// check if we got back our document undo manager
- SdrUndoManager* pSdrUndoManager = getSdrUndoManagerForEnhancedTextEdit();
+ SdrUndoManager* pSdrUndoManager = mpLocalTextEditUndoManager.get();
if (pSdrUndoManager && dynamic_cast<SdrUndoManager*>(pOriginal) == pSdrUndoManager)
{
@@ -1456,6 +1481,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
"expected document UndoManager (!)");
delete pOriginal;
}
+
+ mpLocalTextEditUndoManager.reset();
}
}
else
@@ -1471,17 +1498,17 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
// if new mechanism was used, clean it up. At cleanup no need to check
// for LibreOfficeKit
- if (pTextEditOutlinerView)
+ if (mpTextEditOutlinerView)
{
- pTextEditOutlinerView->GetEditView().setEditViewCallbacks(nullptr);
+ mpTextEditOutlinerView->GetEditView().setEditViewCallbacks(nullptr);
maTEOverlayGroup.clear();
}
mxTextEditObj.reset(nullptr);
- pTextEditPV = nullptr;
- pTextEditWin = nullptr;
- SdrOutliner* pTEOutliner = pTextEditOutliner.release();
- pTextEditOutlinerView = nullptr;
+ mpTextEditPV = nullptr;
+ mpTextEditWin = nullptr;
+ SdrOutliner* pTEOutliner = mpTextEditOutliner.release();
+ mpTextEditOutlinerView = nullptr;
pTextEditCursorBuffer = nullptr;
aTextEditArea = tools::Rectangle();
@@ -1545,7 +1572,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
// check deletion of entire TextObj
std::unique_ptr<SdrUndoAction> pDelUndo;
bool bDelObj = false;
- if (bTextEditNewObj)
+ if (mbTextEditNewObj)
{
bDelObj = pTEObj->IsTextFrame() && !pTEObj->HasText() && !pTEObj->IsEmptyPresObj()
&& !pTEObj->HasFill() && !pTEObj->HasLine();
@@ -1609,7 +1636,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
vcl::Window* pWin = pOLV->GetWindow();
tools::Rectangle aRect(pOLV->GetOutputArea());
pTEOutliner->RemoveView(i);
- if (!bTextEditDontDelete || i != 0)
+ if (!mbTextEditDontDelete || i != 0)
{
// may not own the zeroth one
delete pOLV;
@@ -1627,7 +1654,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
pWin->SetLineColor(COL_BLACK);
}
// and now the Outliner itself
- if (!bTextEditDontDelete)
+ if (!mbTextEditDontDelete)
delete pTEOutliner;
else
pTEOutliner->Clear();
@@ -1677,19 +1704,19 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
bool SdrObjEditView::IsTextEdit() const { return mxTextEditObj.is(); }
// info about TextEditPageView. Default is 0L.
-SdrPageView* SdrObjEditView::GetTextEditPageView() const { return pTextEditPV; }
+SdrPageView* SdrObjEditView::GetTextEditPageView() const { return mpTextEditPV; }
OutlinerView* SdrObjEditView::ImpFindOutlinerView(vcl::Window const* pWin) const
{
if (pWin == nullptr)
return nullptr;
- if (pTextEditOutliner == nullptr)
+ if (mpTextEditOutliner == nullptr)
return nullptr;
OutlinerView* pNewView = nullptr;
- sal_uIntPtr nWinCount = pTextEditOutliner->GetViewCount();
+ sal_uIntPtr nWinCount = mpTextEditOutliner->GetViewCount();
for (sal_uIntPtr i = 0; i < nWinCount && pNewView == nullptr; i++)
{
- OutlinerView* pView = pTextEditOutliner->GetView(i);
+ OutlinerView* pView = mpTextEditOutliner->GetView(i);
if (pView->GetWindow() == pWin)
pNewView = pView;
}
@@ -1698,17 +1725,17 @@ OutlinerView* SdrObjEditView::ImpFindOutlinerView(vcl::Window const* pWin) const
void SdrObjEditView::SetTextEditWin(vcl::Window* pWin)
{
- if (mxTextEditObj.is() && pWin != nullptr && pWin != pTextEditWin)
+ if (mxTextEditObj.is() && pWin != nullptr && pWin != mpTextEditWin)
{
OutlinerView* pNewView = ImpFindOutlinerView(pWin);
- if (pNewView != nullptr && pNewView != pTextEditOutlinerView)
+ if (pNewView != nullptr && pNewView != mpTextEditOutlinerView)
{
- if (pTextEditOutlinerView != nullptr)
+ if (mpTextEditOutlinerView != nullptr)
{
- pTextEditOutlinerView->HideCursor();
+ mpTextEditOutlinerView->HideCursor();
}
- pTextEditOutlinerView = pNewView;
- pTextEditWin = pWin;
+ mpTextEditOutlinerView = pNewView;
+ mpTextEditWin = pWin;
pWin->GrabFocus(); // Make the cursor blink here as well
pNewView->ShowCursor();
ImpMakeTextCursorAreaVisible();
@@ -1722,7 +1749,7 @@ bool SdrObjEditView::IsTextEditHit(const Point& rHit) const
if (mxTextEditObj.is())
{
tools::Rectangle aEditArea;
- OutlinerView* pOLV = pTextEditOutliner->GetView(0);
+ OutlinerView* pOLV = mpTextEditOutliner->GetView(0);
if (pOLV != nullptr)
{
aEditArea.Union(pOLV->GetOutputArea());
@@ -1733,12 +1760,12 @@ bool SdrObjEditView::IsTextEditHit(const Point& rHit) const
Point aPnt(rHit);
aPnt -= aEditArea.TopLeft();
long nHitTol = 2000;
- OutputDevice* pRef = pTextEditOutliner->GetRefDevice();
+ OutputDevice* pRef = mpTextEditOutliner->GetRefDevice();
if (pRef)
nHitTol = OutputDevice::LogicToLogic(nHitTol, MapUnit::Map100thMM,
pRef->GetMapMode().GetMapUnit());
- bOk = pTextEditOutliner->IsTextPos(aPnt, static_cast<sal_uInt16>(nHitTol));
+ bOk = mpTextEditOutliner->IsTextPos(aPnt, static_cast<sal_uInt16>(nHitTol));
}
}
return bOk;
@@ -1750,7 +1777,7 @@ bool SdrObjEditView::IsTextEditFrameHit(const Point& rHit) const
if (mxTextEditObj.is())
{
SdrTextObj* pText = mxTextEditObj.get();
- OutlinerView* pOLV = pTextEditOutliner->GetView(0);
+ OutlinerView* pOLV = mpTextEditOutliner->GetView(0);
if (pOLV)
{
vcl::Window* pWin = pOLV->GetWindow();
@@ -1799,7 +1826,7 @@ TextChainCursorManager* SdrObjEditView::ImpHandleMotionThroughBoxesKeyInput(cons
bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
{
- if (pTextEditOutlinerView)
+ if (mpTextEditOutlinerView)
{
/* Start special handling of keys within a chain */
// We possibly move to another box before any handling
@@ -1810,11 +1837,11 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
return true;
/* End special handling of keys within a chain */
- if (pTextEditOutlinerView->PostKeyEvent(rKEvt, pWin))
+ if (mpTextEditOutlinerView->PostKeyEvent(rKEvt, pWin))
{
if (mpModel)
{
- if (pTextEditOutliner && pTextEditOutliner->IsModified())
+ if (mpTextEditOutliner && mpTextEditOutliner->IsModified())
mpModel->SetChanged();
}
@@ -1823,7 +1850,7 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
ImpMoveCursorAfterChainingEvent(xCursorManager.get());
/* End chaining processing */
- if (pWin != nullptr && pWin != pTextEditWin)
+ if (pWin != nullptr && pWin != mpTextEditWin)
SetTextEditWin(pWin);
#ifdef DBG_UTIL
if (mpItemBrowser != nullptr)
@@ -1838,16 +1865,16 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin)
{
- if (pTextEditOutlinerView != nullptr)
+ if (mpTextEditOutlinerView != nullptr)
{
- bool bPostIt = pTextEditOutliner->IsInSelectionMode();
+ bool bPostIt = mpTextEditOutliner->IsInSelectionMode();
if (!bPostIt)
{
Point aPt(rMEvt.GetPosPixel());
if (pWin != nullptr)
aPt = pWin->PixelToLogic(aPt);
- else if (pTextEditWin != nullptr)
- aPt = pTextEditWin->PixelToLogic(aPt);
+ else if (mpTextEditWin != nullptr)
+ aPt = mpTextEditWin->PixelToLogic(aPt);
bPostIt = IsTextEditHit(aPt);
}
if (bPostIt)
@@ -1855,7 +1882,7 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin
Point aPixPos(rMEvt.GetPosPixel());
if (pWin)
{
- tools::Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
+ tools::Rectangle aR(pWin->LogicToPixel(mpTextEditOutlinerView->GetOutputArea()));
if (aPixPos.X() < aR.Left())
aPixPos.setX(aR.Left());
if (aPixPos.X() > aR.Right())
@@ -1867,9 +1894,9 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin
}
MouseEvent aMEvt(aPixPos, rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(),
rMEvt.GetModifier());
- if (pTextEditOutlinerView->MouseButtonDown(aMEvt))
+ if (mpTextEditOutlinerView->MouseButtonDown(aMEvt))
{
- if (pWin != nullptr && pWin != pTextEditWin
+ if (pWin != nullptr && pWin != mpTextEditWin
&& pWin->GetOutDevType() == OUTDEV_WINDOW)
SetTextEditWin(static_cast<vcl::Window*>(pWin));
#ifdef DBG_UTIL
@@ -1886,22 +1913,22 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, OutputDevice* pWin
bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, OutputDevice* pWin)
{
- if (pTextEditOutlinerView != nullptr)
+ if (mpTextEditOutlinerView != nullptr)
{
- bool bPostIt = pTextEditOutliner->IsInSelectionMode();
+ bool bPostIt = mpTextEditOutliner->IsInSelectionMode();
if (!bPostIt)
{
Point aPt(rMEvt.GetPosPixel());
if (pWin != nullptr)
aPt = pWin->PixelToLogic(aPt);
- else if (pTextEditWin != nullptr)
- aPt = pTextEditWin->PixelToLogic(aPt);
+ else if (mpTextEditWin != nullptr)
+ aPt = mpTextEditWin->PixelToLogic(aPt);
bPostIt = IsTextEditHit(aPt);
}
if (bPostIt && pWin)
{
Point aPixPos(rMEvt.GetPosPixel());
- tools::Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
+ tools::Rectangle aR(pWin->LogicToPixel(mpTextEditOutlinerView->GetOutputArea()));
if (aPixPos.X() < aR.Left())
aPixPos.setX(aR.Left());
if (aPixPos.X() > aR.Right())
@@ -1912,7 +1939,7 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, OutputDevice* pWin)
aPixPos.setY(aR.Bottom());
MouseEvent aMEvt(aPixPos, rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(),
rMEvt.GetModifier());
- if (pTextEditOutlinerView->MouseButtonUp(aMEvt))
+ if (mpTextEditOutlinerView->MouseButtonUp(aMEvt))
{
#ifdef DBG_UTIL
if (mpItemBrowser != nullptr)
@@ -1928,27 +1955,27 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, OutputDevice* pWin)
bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin)
{
- if (pTextEditOutlinerView != nullptr)
+ if (mpTextEditOutlinerView != nullptr)
{
- bool bSelMode = pTextEditOutliner->IsInSelectionMode();
+ bool bSelMode = mpTextEditOutliner->IsInSelectionMode();
bool bPostIt = bSelMode;
if (!bPostIt)
{
Point aPt(rMEvt.GetPosPixel());
if (pWin)
aPt = pWin->PixelToLogic(aPt);
- else if (pTextEditWin)
- aPt = pTextEditWin->PixelToLogic(aPt);
+ else if (mpTextEditWin)
+ aPt = mpTextEditWin->PixelToLogic(aPt);
bPostIt = IsTextEditHit(aPt);
}
if (bPostIt)
{
Point aPixPos(rMEvt.GetPosPixel());
- tools::Rectangle aR(pTextEditOutlinerView->GetOutputArea());
+ tools::Rectangle aR(mpTextEditOutlinerView->GetOutputArea());
if (pWin)
aR = pWin->LogicToPixel(aR);
- else if (pTextEditWin)
- aR = pTextEditWin->LogicToPixel(aR);
+ else if (mpTextEditWin)
+ aR = mpTextEditWin->LogicToPixel(aR);
if (aPixPos.X() < aR.Left())
aPixPos.setX(aR.Left());
if (aPixPos.X() > aR.Right())
@@ -1959,7 +1986,7 @@ bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin)
aPixPos.setY(aR.Bottom());
MouseEvent aMEvt(aPixPos, rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(),
rMEvt.GetModifier());
- if (pTextEditOutlinerView->MouseMove(aMEvt) && bSelMode)
+ if (mpTextEditOutlinerView->MouseMove(aMEvt) && bSelMode)
{
#ifdef DBG_UTIL
if (mpItemBrowser != nullptr)
@@ -1976,18 +2003,18 @@ bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin)
bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
{
// as long as OutlinerView returns a sal_Bool, it only gets CommandEventId::StartDrag
- if (pTextEditOutlinerView != nullptr)
+ if (mpTextEditOutlinerView != nullptr)
{
if (rCEvt.GetCommand() == CommandEventId::StartDrag)
{
- bool bPostIt = pTextEditOutliner->IsInSelectionMode() || !rCEvt.IsMouseEvent();
+ bool bPostIt = mpTextEditOutliner->IsInSelectionMode() || !rCEvt.IsMouseEvent();
if (!bPostIt && rCEvt.IsMouseEvent())
{
Point aPt(rCEvt.GetMousePosPixel());
if (pWin != nullptr)
aPt = pWin->PixelToLogic(aPt);
- else if (pTextEditWin != nullptr)
- aPt = pTextEditWin->PixelToLogic(aPt);
+ else if (mpTextEditWin != nullptr)
+ aPt = mpTextEditWin->PixelToLogic(aPt);
bPostIt = IsTextEditHit(aPt);
}
if (bPostIt)
@@ -1995,7 +2022,8 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
Point aPixPos(rCEvt.GetMousePosPixel());
if (rCEvt.IsMouseEvent() && pWin)
{
- tools::Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
+ tools::Rectangle aR(
+ pWin->LogicToPixel(mpTextEditOutlinerView->GetOutputArea()));
if (aPixPos.X() < aR.Left())
aPixPos.setX(aR.Left());
if (aPixPos.X() > aR.Right())
@@ -2007,8 +2035,8 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
}
CommandEvent aCEvt(aPixPos, rCEvt.GetCommand(), rCEvt.IsMouseEvent());
// Command is void at the OutlinerView, sadly
- pTextEditOutlinerView->Command(aCEvt);
- if (pWin != nullptr && pWin != pTextEditWin)
+ mpTextEditOutlinerView->Command(aCEvt);
+ if (pWin != nullptr && pWin != mpTextEditWin)
SetTextEditWin(pWin);
#ifdef DBG_UTIL
if (mpItemBrowser != nullptr)
@@ -2020,12 +2048,12 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
}
else
{
- pTextEditOutlinerView->Command(rCEvt);
+ mpTextEditOutlinerView->Command(rCEvt);
if (mpModel && comphelper::LibreOfficeKit::isActive())
{
// It could execute CommandEventId::ExtTextInput, while SdrObjEditView::KeyInput
// isn't called
- if (pTextEditOutliner && pTextEditOutliner->IsModified())
+ if (mpTextEditOutliner && mpTextEditOutliner->IsModified())
mpModel->SetChanged();
}
return true;
@@ -2037,24 +2065,25 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
bool SdrObjEditView::ImpIsTextEditAllSelected() const
{
bool bRet = false;
- if (pTextEditOutliner != nullptr && pTextEditOutlinerView != nullptr)
+ if (mpTextEditOutliner != nullptr && mpTextEditOutlinerView != nullptr)
{
- if (SdrTextObj::HasTextImpl(pTextEditOutliner.get()))
+ if (SdrTextObj::HasTextImpl(mpTextEditOutliner.get()))
{
- const sal_Int32 nParaCnt = pTextEditOutliner->GetParagraphCount();
- Paragraph* pLastPara = pTextEditOutliner->GetParagraph(nParaCnt > 1 ? nParaCnt - 1 : 0);
+ const sal_Int32 nParaCnt = mpTextEditOutliner->GetParagraphCount();
+ Paragraph* pLastPara
+ = mpTextEditOutliner->GetParagraph(nParaCnt > 1 ? nParaCnt - 1 : 0);
- ESelection aESel(pTextEditOutlinerView->GetSelection());
+ ESelection aESel(mpTextEditOutlinerView->GetSelection());
if (aESel.nStartPara == 0 && aESel.nStartPos == 0 && aESel.nEndPara == (nParaCnt - 1))
{
- if (pTextEditOutliner->GetText(pLastPara).getLength() == aESel.nEndPos)
+ if (mpTextEditOutliner->GetText(pLastPara).getLength() == aESel.nEndPos)
bRet = true;
}
// in case the selection was done backwards
if (!bRet && aESel.nEndPara == 0 && aESel.nEndPos == 0
&& aESel.nStartPara == (nParaCnt - 1))
{
- if (pTextEditOutliner->GetText(pLastPara).getLength() == aESel.nStartPos)
+ if (mpTextEditOutliner->GetText(pLastPara).getLength() == aESel.nStartPos)
bRet = true;
}
}
@@ -2068,15 +2097,15 @@ bool SdrObjEditView::ImpIsTextEditAllSelected() const
void SdrObjEditView::ImpMakeTextCursorAreaVisible()
{
- if (pTextEditOutlinerView != nullptr && pTextEditWin != nullptr)
+ if (mpTextEditOutlinerView != nullptr && mpTextEditWin != nullptr)
{
- vcl::Cursor* pCsr = pTextEditWin->GetCursor();
+ vcl::Cursor* pCsr = mpTextEditWin->GetCursor();
if (pCsr != nullptr)
{
Size aSiz(pCsr->GetSize());
if (aSiz.Width() != 0 && aSiz.Height() != 0)
{
- MakeVisible(tools::Rectangle(pCsr->GetPos(), aSiz), *pTextEditWin);
+ MakeVisible(tools::Rectangle(pCsr->GetPos(), aSiz), *mpTextEditWin);
}
}
}
@@ -2091,8 +2120,8 @@ SvtScriptType SdrObjEditView::GetScriptType() const
if (mxTextEditObj->GetOutlinerParaObject())
nScriptType = mxTextEditObj->GetOutlinerParaObject()->GetTextObject().GetScriptType();
- if (pTextEditOutlinerView)
- nScriptType = pTextEditOutlinerView->GetSelectedScriptType();
+ if (mpTextEditOutlinerView)
+ nScriptType = mpTextEditOutlinerView->GetSelectedScriptType();
}
else
{
@@ -2123,10 +2152,10 @@ void SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) c
if (IsTextEdit())
{
- DBG_ASSERT(pTextEditOutlinerView != nullptr,
- "SdrObjEditView::GetAttributes(): pTextEditOutlinerView=NULL");
- DBG_ASSERT(pTextEditOutliner != nullptr,
- "SdrObjEditView::GetAttributes(): pTextEditOutliner=NULL");
+ DBG_ASSERT(mpTextEditOutlinerView != nullptr,
+ "SdrObjEditView::GetAttributes(): mpTextEditOutlinerView=NULL");
+ DBG_ASSERT(mpTextEditOutliner != nullptr,
+ "SdrObjEditView::GetAttributes(): mpTextEditOutliner=NULL");
// take care of bOnlyHardAttr(!)
if (!bOnlyHardAttr && mxTextEditObj->GetStyleSheet())
@@ -2135,10 +2164,10 @@ void SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) c
// add object attributes
rTargetSet.Put(mxTextEditObj->GetMergedItemSet());
- if (pTextEditOutlinerView)
+ if (mpTextEditOutlinerView)
{
// FALSE= regard InvalidItems as "holes," not as Default
- rTargetSet.Put(pTextEditOutlinerView->GetAttribs(), false);
+ rTargetSet.Put(mpTextEditOutlinerView->GetAttribs(), false);
}
if (GetMarkedObjectCount() == 1 && GetMarkedObjectByIndex(0) == mxTextEditObj.get())
@@ -2155,7 +2184,7 @@ void SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) c
bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
bool bRet = false;
- bool bTextEdit = pTextEditOutlinerView != nullptr && mxTextEditObj.is();
+ bool bTextEdit = mpTextEditOutlinerView != nullptr && mxTextEditObj.is();
bool bAllTextSelected = ImpIsTextEditAllSelected();
const SfxItemSet* pSet = &rSet;
@@ -2285,11 +2314,11 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
// and now the attributes to the EditEngine
if (bReplaceAll)
{
- pTextEditOutlinerView->RemoveAttribs(true);
+ mpTextEditOutlinerView->RemoveAttribs(true);
}
- pTextEditOutlinerView->SetAttribs(rSet);
+ mpTextEditOutlinerView->SetAttribs(rSet);
- Outliner* pTEOutliner = pTextEditOutlinerView->GetOutliner();
+ Outliner* pTEOutliner = mpTextEditOutlinerView->GetOutliner();
if (mpModel && pTEOutliner && pTEOutliner->IsModified())
mpModel->SetChanged();
@@ -2315,9 +2344,9 @@ SfxStyleSheet* SdrObjEditView::GetStyleSheet() const
return pSheet;
}
- if (pTextEditOutlinerView)
+ if (mpTextEditOutlinerView)
{
- pSheet = pTextEditOutlinerView->GetStyleSheet();
+ pSheet = mpTextEditOutlinerView->GetStyleSheet();
}
else
{
@@ -2336,9 +2365,9 @@ void SdrObjEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveH
// if we are currently in edit mode we must also set the stylesheet
// on all paragraphs in the Outliner for the edit view
- if (nullptr != pTextEditOutlinerView)
+ if (nullptr != mpTextEditOutlinerView)
{
- Outliner* pOutliner = pTextEditOutlinerView->GetOutliner();
+ Outliner* pOutliner = mpTextEditOutlinerView->GetOutliner();
const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
@@ -2354,10 +2383,10 @@ void SdrObjEditView::AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pW
{
SdrGlueEditView::AddWindowToPaintView(pNewWin, pWindow);
- if (mxTextEditObj.is() && !bTextEditOnlyOneView && pNewWin->GetOutDevType() == OUTDEV_WINDOW)
+ if (mxTextEditObj.is() && !mbTextEditOnlyOneView && pNewWin->GetOutDevType() == OUTDEV_WINDOW)
{
OutlinerView* pOutlView = ImpMakeOutlinerView(static_cast<vcl::Window*>(pNewWin), nullptr);
- pTextEditOutliner->InsertView(pOutlView);
+ mpTextEditOutliner->InsertView(pOutlView);
}
}
@@ -2365,15 +2394,15 @@ void SdrObjEditView::DeleteWindowFromPaintView(OutputDevice* pOldWin)
{
SdrGlueEditView::DeleteWindowFromPaintView(pOldWin);
- if (mxTextEditObj.is() && !bTextEditOnlyOneView && pOldWin->GetOutDevType() == OUTDEV_WINDOW)
+ if (mxTextEditObj.is() && !mbTextEditOnlyOneView && pOldWin->GetOutDevType() == OUTDEV_WINDOW)
{
- for (sal_uIntPtr i = pTextEditOutliner->GetViewCount(); i > 0;)
+ for (sal_uIntPtr i = mpTextEditOutliner->GetViewCount(); i > 0;)
{
i--;
- OutlinerView* pOLV = pTextEditOutliner->GetView(i);
+ OutlinerView* pOLV = mpTextEditOutliner->GetView(i);
if (pOLV && pOLV->GetWindow() == static_cast<vcl::Window*>(pOldWin))
{
- pTextEditOutliner->RemoveView(i);
+ mpTextEditOutliner->RemoveView(i);
}
}
}
@@ -2383,7 +2412,7 @@ void SdrObjEditView::DeleteWindowFromPaintView(OutputDevice* pOldWin)
bool SdrObjEditView::IsTextEditInSelectionMode() const
{
- return pTextEditOutliner != nullptr && pTextEditOutliner->IsInSelectionMode();
+ return mpTextEditOutliner != nullptr && mpTextEditOutliner->IsInSelectionMode();
}
// MacroMode
@@ -2398,7 +2427,7 @@ void SdrObjEditView::BegMacroObj(const Point& rPnt, short nTol, SdrObject* pObj,
pMacroObj = pObj;
pMacroPV = pPV;
pMacroWin = pWin;
- bMacroDown = false;
+ mbMacroDown = false;
nMacroTol = sal_uInt16(nTol);
aMacroDownPos = rPnt;
MovMacroObj(rPnt);
@@ -2407,7 +2436,7 @@ void SdrObjEditView::BegMacroObj(const Point& rPnt, short nTol, SdrObject* pObj,
void SdrObjEditView::ImpMacroUp(const Point& rUpPos)
{
- if (pMacroObj != nullptr && bMacroDown)
+ if (pMacroObj != nullptr && mbMacroDown)
{
SdrObjMacroHitRec aHitRec;
aHitRec.aPos = rUpPos;
@@ -2415,13 +2444,13 @@ void SdrObjEditView::ImpMacroUp(const Point& rUpPos)
aHitRec.pVisiLayer = &pMacroPV->GetVisibleLayers();
aHitRec.pPageView = pMacroPV;
pMacroObj->PaintMacro(*pMacroWin, tools::Rectangle(), aHitRec);
- bMacroDown = false;
+ mbMacroDown = false;
}
}
void SdrObjEditView::ImpMacroDown(const Point& rDownPos)
{
- if (pMacroObj != nullptr && !bMacroDown)
+ if (pMacroObj != nullptr && !mbMacroDown)
{
SdrObjMacroHitRec aHitRec;
aHitRec.aPos = rDownPos;
@@ -2429,7 +2458,7 @@ void SdrObjEditView::ImpMacroDown(const Point& rDownPos)
aHitRec.pVisiLayer = &pMacroPV->GetVisibleLayers();
aHitRec.pPageView = pMacroPV;
pMacroObj->PaintMacro(*pMacroWin, tools::Rectangle(), aHitRec);
- bMacroDown = true;
+ mbMacroDown = true;
}
}
@@ -2463,7 +2492,7 @@ void SdrObjEditView::BrkMacroObj()
bool SdrObjEditView::EndMacroObj()
{
- if (pMacroObj != nullptr && bMacroDown)
+ if (pMacroObj != nullptr && mbMacroDown)
{
ImpMacroUp(aMacroDownPos);
SdrObjMacroHitRec aHitRec;
@@ -2581,14 +2610,14 @@ sal_uInt16 SdrObjEditView::GetSelectionLevel() const
sal_uInt16 nLevel = 0xFFFF;
if (IsTextEdit())
{
- DBG_ASSERT(pTextEditOutlinerView != nullptr,
- "SdrObjEditView::GetAttributes(): pTextEditOutlinerView=NULL");
- DBG_ASSERT(pTextEditOutliner != nullptr,
- "SdrObjEditView::GetAttributes(): pTextEditOutliner=NULL");
- if (pTextEditOutlinerView)
+ DBG_ASSERT(mpTextEditOutlinerView != nullptr,
+ "SdrObjEditView::GetAttributes(): mpTextEditOutlinerView=NULL");
+ DBG_ASSERT(mpTextEditOutliner != nullptr,
+ "SdrObjEditView::GetAttributes(): mpTextEditOutliner=NULL");
+ if (mpTextEditOutlinerView)
{
//start and end position
- ESelection aSelect = pTextEditOutlinerView->GetSelection();
+ ESelection aSelect = mpTextEditOutlinerView->GetSelection();
sal_uInt16 nStartPara = ::std::min(aSelect.nStartPara, aSelect.nEndPara);
sal_uInt16 nEndPara = ::std::max(aSelect.nStartPara, aSelect.nEndPara);
//get level from each paragraph
@@ -2596,7 +2625,7 @@ sal_uInt16 SdrObjEditView::GetSelectionLevel() const
for (sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++)
{
sal_uInt16 nParaDepth
- = 1 << static_cast<sal_uInt16>(pTextEditOutliner->GetDepth(nPara));
+ = 1 << static_cast<sal_uInt16>(mpTextEditOutliner->GetDepth(nPara));
if (!(nLevel & nParaDepth))
nLevel += nParaDepth;
}
diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index 2f9d53028988..f9a6992a0ec7 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -23,6 +23,7 @@
#include <svx/svdglue.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdtrans.hxx>
+#include <comphelper/lok.hxx>
static const Size aGlueHalfSize(4,4);
@@ -253,6 +254,8 @@ void SdrGluePoint::Shear(const Point& rRef, double tn, bool bVShear, const SdrOb
void SdrGluePoint::Invalidate(vcl::Window& rWin, const SdrObject* pObj) const
{
+ if (comphelper::LibreOfficeKit::isActive())
+ return;
bool bMapMode=rWin.IsMapModeEnabled();
Point aPt(pObj!=nullptr ? GetAbsolutePos(*pObj) : GetPos());
aPt=rWin.LogicToPixel(aPt);
@@ -329,6 +332,8 @@ sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
void SdrGluePointList::Invalidate(vcl::Window& rWin, const SdrObject* pObj) const
{
+ if (comphelper::LibreOfficeKit::isActive())
+ return;
for (auto& xGP : aList)
xGP->Invalidate(rWin,pObj);
}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index db05163b1ec4..caf9321b41dd 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -251,9 +251,9 @@ void SdrMarkView::ModelHasChanged()
{
//TODO: Is MarkedObjRect valid at this point?
tools::Rectangle aSelection(GetMarkedObjRect());
- OString sSelection;
+ tools::Rectangle* pResultRect;
if (aSelection.IsEmpty())
- sSelection = "EMPTY";
+ pResultRect = nullptr;
else
{
sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
@@ -282,11 +282,11 @@ void SdrMarkView::ModelHasChanged()
}
}
- sSelection = aSelection.toString();
+ pResultRect = &aSelection;
}
if(SfxViewShell* pViewShell = GetSfxViewShell())
- SfxLokHelper::notifyInvalidation(pViewShell, sSelection);
+ SfxLokHelper::notifyInvalidation(pViewShell, pResultRect);
}
}
@@ -703,6 +703,66 @@ OUString lcl_getDragParameterString( const OUString& rCID )
}
} // anonymous namespace
+bool SdrMarkView::dumpGluePointsToJSON(boost::property_tree::ptree& rTree)
+{
+ bool result = false;
+ if (OutputDevice* rOutDev = mpMarkedPV->GetView().GetFirstOutputDevice())
+ {
+ bool bConvertUnit = false;
+ if (rOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ bConvertUnit = true;
+ const SdrObjList* pOL = mpMarkedPV->GetObjList();
+ if (!pOL)
+ return false;
+ const size_t nObjCount = pOL->GetObjCount();
+ boost::property_tree::ptree elements;
+ for (size_t nObjNum = 0; nObjNum < nObjCount; ++nObjNum)
+ {
+ SdrObject* pObj = pOL->GetObj(nObjNum);
+ if (!pObj)
+ continue;
+ if (pObj == GetMarkedObjectByIndex(0))
+ continue;
+ const SdrGluePointList* pGPL = pObj->GetGluePointList();
+ bool VertexObject = !(pGPL && pGPL->GetCount());
+ const size_t count = !VertexObject ? pGPL->GetCount() : 4;
+ boost::property_tree::ptree object;
+ boost::property_tree::ptree points;
+ for (size_t i = 0; i < count; ++i)
+ {
+ boost::property_tree::ptree node;
+ boost::property_tree::ptree point;
+ const SdrGluePoint& rGP = !VertexObject ? (*pGPL)[i] : pObj->GetVertexGluePoint(i);
+ Point rPoint = rGP.GetAbsolutePos(*pObj);
+ if (bConvertUnit)
+ rPoint = OutputDevice::LogicToLogic(rPoint, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ point.put("x", rPoint.getX());
+ point.put("y", rPoint.getY());
+ node.add_child("point", point);
+ points.push_back(std::make_pair("", node));
+ }
+ basegfx::B2DVector aGridOffset(0.0, 0.0);
+ Point objLogicRectTopLeft = pObj->GetLogicRect().TopLeft();
+ if(getPossibleGridOffsetForPosition(aGridOffset, basegfx::B2DPoint(objLogicRectTopLeft.X(), objLogicRectTopLeft.Y()), GetSdrPageView()))
+ {
+ Point p(aGridOffset.getX(), aGridOffset.getY());
+ if (bConvertUnit)
+ p = OutputDevice::LogicToLogic(p, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ boost::property_tree::ptree gridOffset;
+ gridOffset.put("x", p.getX());
+ gridOffset.put("y", p.getY());
+ object.add_child("gridoffset", gridOffset);
+ }
+ object.put("ordnum", pObj->GetOrdNum());
+ object.add_child("gluepoints", points);
+ elements.push_back(std::make_pair("", object));
+ result = true;
+ }
+ rTree.add_child("shapes", elements);
+ }
+ return result;
+}
+
void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxViewShell* pOtherShell)
{
SfxViewShell* pViewShell = GetSfxViewShell();
@@ -710,6 +770,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
tools::Rectangle aSelection(rRect);
bool bIsChart = false;
Point addLogicOffset = Point(0,0);
+ bool convertMapMode = false;
if (!rRect.IsEmpty())
{
sal_uInt32 nTotalPaintWindows = this->PaintWindowCount();
@@ -739,7 +800,10 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice())
{
if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM)
+ {
aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ convertMapMode = true;
+ }
}
}
@@ -751,13 +815,19 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
OString sSelectionText;
OString sSelectionTextView;
boost::property_tree::ptree aTableJsonTree;
+ boost::property_tree::ptree aGluePointsTree;
bool bTableSelection = false;
+ size_t bConnectorSelection = false;
if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_TABLE)
{
auto& rTableObject = dynamic_cast<sdr::table::SdrTableObj&>(*mpMarkedObj);
bTableSelection = rTableObject.createTableEdgesJson(aTableJsonTree);
}
+ if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_EDGE)
+ {
+ bConnectorSelection = dumpGluePointsToJSON(aGluePointsTree);
+ }
if (GetMarkedObjectCount())
{
SdrMark* pM = GetSdrMarkByIndex(0);
@@ -780,6 +850,26 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
aExtraInfo.append("\",\"type\":");
aExtraInfo.append(OString::number(pO->GetObjIdentifier()));
+ // In core, the gridOffset is calculated based on the LogicRect's TopLeft coordinate
+ // In online, we have the SnapRect and we calculate it based on its TopLeft coordinate
+ // SnapRect's TopLeft and LogicRect's TopLeft match unless there is rotation
+ // but the rotation is not applied to the LogicRect. Therefore,
+ // what we calculate in online does not match with the core in case of the rotation.
+ // Here we can send the correct gridOffset in the selection callback, this way
+ // whether the shape is rotated or not, we will always have the correct gridOffset
+ // Note that the gridOffset is calculated from the first selected obj
+ basegfx::B2DVector aGridOffset(0.0, 0.0);
+ if(getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectByIndex(0), GetSdrPageView()))
+ {
+ Point p(aGridOffset.getX(), aGridOffset.getY());
+ if (convertMapMode)
+ p = OutputDevice::LogicToLogic(p, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ aExtraInfo.append(",\"gridOffsetX\":");
+ aExtraInfo.append(OString::number(p.getX()));
+ aExtraInfo.append(",\"gridOffsetY\":");
+ aExtraInfo.append(OString::number(p.getY()));
+ }
+
if (bWriterGraphic)
{
aExtraInfo.append(", \"isWriterGraphic\": true");
@@ -912,11 +1002,11 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
{
boost::property_tree::ptree responseJSON;
boost::property_tree::ptree others;
+ boost::property_tree::ptree anchor;
boost::property_tree::ptree rectangle;
boost::property_tree::ptree poly;
boost::property_tree::ptree custom;
boost::property_tree::ptree nodes;
- const bool convertMapMode = mpMarkedPV->GetView().GetFirstOutputDevice()->GetMapMode().GetMapUnit() == MapUnit::Map100thMM;
for (size_t i = 0; i < maHdlList.GetHdlCount(); i++)
{
SdrHdl *pHdl = maHdlList.GetHdl(i);
@@ -947,6 +1037,14 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
{
selectedNode = &custom;
}
+ else if (kind == static_cast<sal_Int32>(SdrHdlKind::Anchor) || kind == static_cast<sal_Int32>(SdrHdlKind::Anchor_TR))
+ {
+ if (getSdrModelFromSdrView().IsWriter())
+ selectedNode = &anchor;
+ else
+ // put it to others as we dont render them except in writer
+ selectedNode = &others;
+ }
else
{
selectedNode = &others;
@@ -965,12 +1063,20 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
nodes.add_child("rectangle", rectangle);
nodes.add_child("poly", poly);
nodes.add_child("custom", custom);
+ nodes.add_child("anchor", anchor);
nodes.add_child("others", others);
responseJSON.add_child("kinds", nodes);
std::stringstream aStream;
boost::property_tree::write_json(aStream, responseJSON, /*pretty=*/ false);
handleArrayStr = ", \"handles\":";
handleArrayStr += aStream.str().c_str();
+ if (bConnectorSelection)
+ {
+ aStream.str("");
+ boost::property_tree::write_json(aStream, aGluePointsTree, /*pretty=*/ false);
+ handleArrayStr += ", \"GluePoints\":";
+ handleArrayStr += aStream.str().c_str();
+ }
}
sSelectionText = aSelection.toString() +
", " + OString::number(nRotAngle);
@@ -1002,7 +1108,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView
boost::property_tree::write_json(aStream, aTableJsonTree);
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, aStream.str().c_str());
}
- else
+ else if (!getSdrModelFromSdrView().IsWriter())
{
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, "{}");
}
@@ -1319,11 +1425,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
}
}
- // moved it here to access all the handles for callback.
- if (bTiledRendering && pViewShell)
- {
- SetMarkHandlesForLOKit(aRect, pOtherShell);
- }
// rotation point/axis of reflection
if(!bLimitedRotation)
{
@@ -1336,6 +1437,12 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell)
// add custom handles (used by other apps, e.g. AnchorPos)
AddCustomHdl();
+ // moved it here to access all the handles for callback.
+ if (bTiledRendering && pViewShell)
+ {
+ SetMarkHandlesForLOKit(aRect, pOtherShell);
+ }
+
// try to restore focus handle index from remembered values
if(bSaveOldFocus)
{
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 99dee49aa2d2..d767a92bbbf6 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -1909,7 +1909,7 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat)
DisconnectFromNode(bDragA);
// look for new connection
- ImpFindConnector(aPointNow, *rDragStat.GetPageView(), *pDraggedOne, pOriginalEdge);
+ ImpFindConnector(aPointNow, *rDragStat.GetPageView(), *pDraggedOne, pOriginalEdge, nullptr, &rDragStat);
if(pDraggedOne->pObj)
{
@@ -2130,7 +2130,7 @@ PointerStyle SdrEdgeObj::GetCreatePointer() const
return PointerStyle::DrawConnect;
}
-bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut)
+bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrObjConnection& rCon, const SdrEdgeObj* pThis, OutputDevice* pOut, SdrDragStat* pDragStat)
{
rCon.ResetVars();
if (pOut==nullptr) pOut=rPV.GetView().GetFirstOutputDevice();
@@ -2153,11 +2153,29 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO
size_t no=pOL->GetObjCount();
bool bFnd = false;
SdrObjConnection aTestCon;
+ bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+ bool bHasRequestedOrdNum = false;
+ sal_uInt32 requestedOrdNum = -1;
+
+ if (bTiledRendering && pDragStat)
+ {
+ auto& glueOptions = pDragStat->GetGlueOptions();
+ if (glueOptions.objectOrdNum != -1)
+ {
+ requestedOrdNum = static_cast<sal_uInt32>(glueOptions.objectOrdNum);
+ bHasRequestedOrdNum = true;
+ }
+ }
while (no>0 && !bFnd) {
// issue: group objects on different layers return LayerID=0!
no--;
SdrObject* pObj=pOL->GetObj(no);
+ if (bHasRequestedOrdNum)
+ {
+ if (pObj->GetOrdNumDirect() != requestedOrdNum)
+ continue;
+ }
if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() && // only visible objects
(pThis==nullptr || pObj!=static_cast<SdrObject const *>(pThis))) // don't connect it to itself
{
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 16617ecaf94f..f957f9382d57 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -78,6 +78,7 @@
#include <sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdograf.hxx>
#include <sdr/properties/oleproperties.hxx>
+#include <svx/unoshape.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xbtmpit.hxx>
@@ -598,6 +599,35 @@ void SdrEmbedObjectLink::Closed()
SvBaseLink::Closed();
}
+SdrIFrameLink::SdrIFrameLink(SdrOle2Obj* pObject)
+ : ::sfx2::SvBaseLink(::SfxLinkUpdateMode::ONCALL, SotClipboardFormatId::SVXB)
+ , m_pObject(pObject)
+{
+ SetSynchron( false );
+}
+
+::sfx2::SvBaseLink::UpdateResult SdrIFrameLink::DataChanged(
+ const OUString&, const uno::Any& )
+{
+ uno::Reference<embed::XEmbeddedObject> xObject = m_pObject->GetObjRef();
+ uno::Reference<embed::XCommonEmbedPersist> xPersObj(xObject, uno::UNO_QUERY);
+ if (xPersObj.is())
+ {
+ // let the IFrameObject reload the link
+ try
+ {
+ xPersObj->reload(uno::Sequence<beans::PropertyValue>(), uno::Sequence<beans::PropertyValue>());
+ }
+ catch (const uno::Exception&)
+ {
+ }
+
+ m_pObject->SetChanged();
+ }
+
+ return SUCCESS;
+}
+
class SdrOle2ObjImpl
{
public:
@@ -615,7 +645,7 @@ public:
bool mbLoadingOLEObjectFailed:1; // New local var to avoid repeated loading if load of OLE2 fails
bool mbConnected:1;
- SdrEmbedObjectLink* mpObjectLink;
+ sfx2::SvBaseLink* mpObjectLink;
OUString maLinkURL;
rtl::Reference<SvxUnoShapeModifyListener> mxModifyListener;
@@ -815,7 +845,7 @@ bool SdrOle2Obj::IsEmpty() const
return !mpImpl->mxObjRef.is();
}
-void SdrOle2Obj::Connect()
+void SdrOle2Obj::Connect(SvxOle2Shape* pCreator)
{
if( IsEmptyPresObj() )
return;
@@ -828,7 +858,7 @@ void SdrOle2Obj::Connect()
return;
}
- Connect_Impl();
+ Connect_Impl(pCreator);
AddListeners_Impl();
}
@@ -927,24 +957,51 @@ void SdrOle2Obj::CheckFileLink_Impl()
{
try
{
- uno::Reference< embed::XLinkageSupport > xLinkSupport( mpImpl->mxObjRef.GetObject(), uno::UNO_QUERY );
+ uno::Reference<embed::XEmbeddedObject> xObject = mpImpl->mxObjRef.GetObject();
+ if (!xObject)
+ return;
- if ( xLinkSupport.is() && xLinkSupport->isLink() )
- {
- OUString aLinkURL = xLinkSupport->getLinkURL();
+ bool bIFrame = false;
- if ( !aLinkURL.isEmpty() )
+ OUString aLinkURL;
+ uno::Reference<embed::XLinkageSupport> xLinkSupport(xObject, uno::UNO_QUERY);
+ if (xLinkSupport)
+ {
+ if (xLinkSupport->isLink())
+ aLinkURL = xLinkSupport->getLinkURL();
+ }
+ else
+ {
+ // get IFrame (Floating Frames) listed and updatable from the
+ // manage links dialog
+ SvGlobalName aClassId(xObject->getClassID());
+ if (aClassId == SvGlobalName(SO3_IFRAME_CLASSID))
{
- // this is a file link so the model link manager should handle it
- sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
+ uno::Reference<beans::XPropertySet> xSet(xObject->getComponent(), uno::UNO_QUERY);
+ if (xSet.is())
+ xSet->getPropertyValue("FrameURL") >>= aLinkURL;
+ bIFrame = true;
+ }
+ }
+
+ if (!aLinkURL.isEmpty()) // this is a file link so the model link manager should handle it
+ {
+ sfx2::LinkManager* pLinkManager(getSdrModelFromSdrObject().GetLinkManager());
- if ( pLinkManager )
+ if ( pLinkManager )
+ {
+ SdrEmbedObjectLink* pEmbedObjectLink = nullptr;
+ if (!bIFrame)
{
- mpImpl->mpObjectLink = new SdrEmbedObjectLink( this );
- mpImpl->maLinkURL = aLinkURL;
- pLinkManager->InsertFileLink( *mpImpl->mpObjectLink, OBJECT_CLIENT_OLE, aLinkURL );
- mpImpl->mpObjectLink->Connect();
+ pEmbedObjectLink = new SdrEmbedObjectLink(this);
+ mpImpl->mpObjectLink = pEmbedObjectLink;
}
+ else
+ mpImpl->mpObjectLink = new SdrIFrameLink(this);
+ mpImpl->maLinkURL = aLinkURL;
+ pLinkManager->InsertFileLink( *mpImpl->mpObjectLink, OBJECT_CLIENT_OLE, aLinkURL );
+ if (pEmbedObjectLink)
+ pEmbedObjectLink->Connect();
}
}
}
@@ -955,7 +1012,7 @@ void SdrOle2Obj::CheckFileLink_Impl()
}
}
-void SdrOle2Obj::Connect_Impl()
+void SdrOle2Obj::Connect_Impl(SvxOle2Shape* pCreator)
{
if(!mpImpl->aPersistName.isEmpty() )
{
@@ -995,6 +1052,17 @@ void SdrOle2Obj::Connect_Impl()
}
}
+ if (pCreator)
+ {
+ OUString sFrameURL(pCreator->GetAndClearInitialFrameURL());
+ if (!sFrameURL.isEmpty() && svt::EmbeddedObjectRef::TryRunningState(mpImpl->mxObjRef.GetObject()))
+ {
+ uno::Reference<beans::XPropertySet> xSet(mpImpl->mxObjRef->getComponent(), uno::UNO_QUERY);
+ if (xSet.is())
+ xSet->setPropertyValue("FrameURL", uno::Any(sFrameURL));
+ }
+ }
+
if ( mpImpl->mxObjRef.is() )
{
if ( !mpImpl->mxLightClient.is() )
@@ -1308,14 +1376,14 @@ SdrObjectUniquePtr SdrOle2Obj::getFullDragClone() const
return createSdrGrafObjReplacement(false);
}
-void SdrOle2Obj::SetPersistName( const OUString& rPersistName )
+void SdrOle2Obj::SetPersistName( const OUString& rPersistName, SvxOle2Shape* pCreator )
{
DBG_ASSERT( mpImpl->aPersistName.isEmpty(), "Persist name changed!");
mpImpl->aPersistName = rPersistName;
mpImpl->mbLoadingOLEObjectFailed = false;
- Connect();
+ Connect(pCreator);
SetChanged();
}
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index ec2a3b1917c5..d7a682272700 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -395,8 +395,11 @@ SdrPageView* SdrPaintView::ShowSdrPage(SdrPage* pPage)
mpPageView.reset();
}
- mpPageView.reset(new SdrPageView(pPage, *static_cast<SdrView*>(this)));
- mpPageView->Show();
+ if (SdrView *pView = dynamic_cast<SdrView*>(this))
+ {
+ mpPageView.reset(new SdrPageView(pPage, *pView));
+ mpPageView->Show();
+ }
}
return mpPageView.get();
@@ -823,6 +826,11 @@ bool SdrPaintView::KeyInput(const KeyEvent& /*rKEvt*/, vcl::Window* /*pWin*/)
void SdrPaintView::GlueInvalidate() const
{
+ // Do not invalidate GluePoints in Online
+ // They are handled on front-end
+ if (comphelper::LibreOfficeKit::isActive())
+ return;
+
const sal_uInt32 nWindowCount(PaintWindowCount());
for(sal_uInt32 nWinNum(0); nWinNum < nWindowCount; nWinNum++)
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 394b3af6bd06..a537604e4734 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -35,6 +35,7 @@
#include <svdibrow.hxx>
#endif
+#include <svx/sdr/table/tablecontroller.hxx>
#include <svx/svdoutl.hxx>
#include <svx/svdview.hxx>
#include <editeng/editview.hxx>
@@ -55,6 +56,7 @@
#include <svx/sdr/contact/objectcontactofpageview.hxx>
#include <sal/log.hxx>
#include <vcl/ptrstyle.hxx>
+#include <comphelper/lok.hxx>
SdrViewEvent::SdrViewEvent()
@@ -384,7 +386,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
// for e.g. URL links when hoovering and clicking
// them will not work. Tried several other changes,
// but this one safely keeps existing behaviour as-is.
- eHit = SdrHitKind::UnmarkedObject;
+ // Except for the LOK. LOK doesn't have hoovering popup
+ // feature.
+ eHit = comphelper::LibreOfficeKit::isActive() ? SdrHitKind::TextEditObj : SdrHitKind::UnmarkedObject;
break;
default:
break;
@@ -972,17 +976,17 @@ PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDe
{
if(!pOut || IsTextEditInSelectionMode())
{
- if(pTextEditOutliner->IsVertical())
+ if (mpTextEditOutliner->IsVertical())
return PointerStyle::TextVertical;
else
return PointerStyle::Text;
}
// Outliner should return something here...
Point aPos(pOut->LogicToPixel(rMousePos));
- PointerStyle aPointer(pTextEditOutlinerView->GetPointer(aPos));
+ PointerStyle aPointer(mpTextEditOutlinerView->GetPointer(aPos));
if (aPointer==PointerStyle::Arrow)
{
- if(pTextEditOutliner->IsVertical())
+ if (mpTextEditOutliner->IsVertical())
aPointer = PointerStyle::TextVertical;
else
aPointer = PointerStyle::Text;
@@ -1223,24 +1227,24 @@ OUString SdrView::GetStatusText()
aStr = SvxResId(STR_ViewMarkGluePoints);
}
}
- else if (IsTextEdit() && pTextEditOutlinerView!=nullptr) {
+ else if (IsTextEdit() && mpTextEditOutlinerView != nullptr) {
aStr=SvxResId(STR_ViewTextEdit); // "TextEdit - Row y, Column x";
- ESelection aSel(pTextEditOutlinerView->GetSelection());
+ ESelection aSel(mpTextEditOutlinerView->GetSelection());
long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos;
if (aSel.nEndPara>0) {
for (sal_Int32 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
- nLin+=pTextEditOutliner->GetLineCount(nParaNum);
+ nLin += mpTextEditOutliner->GetLineCount(nParaNum);
}
}
// A little imperfection:
// At the end of a line of any multi-line paragraph, we display the
// position of the next line of the same paragraph, if there is one.
sal_uInt16 nParaLine = 0;
- sal_uIntPtr nParaLineCount = pTextEditOutliner->GetLineCount(aSel.nEndPara);
+ sal_uIntPtr nParaLineCount = mpTextEditOutliner->GetLineCount(aSel.nEndPara);
bool bBrk = false;
while (!bBrk)
{
- sal_uInt16 nLen = pTextEditOutliner->GetLineLen(aSel.nEndPara, nParaLine);
+ sal_uInt16 nLen = mpTextEditOutliner->GetLineLen(aSel.nEndPara, nParaLine);
bool bLastLine = (nParaLine == nParaLineCount - 1);
if (nCol>nLen || (!bLastLine && nCol == nLen))
{
@@ -1260,7 +1264,7 @@ OUString SdrView::GetStatusText()
aStr = aStr.replaceFirst("%3", OUString::number(nCol + 1));
#ifdef DBG_UTIL
- aStr += ", Level " + OUString::number( pTextEditOutliner->GetDepth( aSel.nEndPara ) );
+ aStr += ", Level " + OUString::number(mpTextEditOutliner->GetDepth( aSel.nEndPara ));
#endif
}
@@ -1354,7 +1358,33 @@ void SdrView::MarkAll()
#endif
} else if (IsGluePointEditMode()) MarkAllGluePoints();
else if (HasMarkablePoints()) MarkAllPoints();
- else MarkAllObj();
+ else {
+ // check for table
+ bool bMarkAll = true;
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
+ if (rMarkList.GetMarkCount() == 1)
+ {
+ const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj());
+ SdrView* pView(dynamic_cast<SdrView*>(this));
+ if (pObj && pView && (pObj->GetObjInventor() == SdrInventor::Default)
+ && (pObj->GetObjIdentifier() == OBJ_TABLE))
+ {
+ mxSelectionController.clear();
+ mxSelectionController = sdr::table::CreateTableController(
+ *pView, static_cast<const sdr::table::SdrTableObj&>(*pObj),
+ mxLastSelectionController);
+
+ if (mxSelectionController.is())
+ {
+ mxLastSelectionController.clear();
+ mxSelectionController->onSelectAll();
+ bMarkAll = false;
+ }
+ }
+ }
+ if ( bMarkAll )
+ MarkAllObj();
+ }
}
void SdrView::UnmarkAll()
@@ -1387,7 +1417,7 @@ void SdrView::DeleteMarked()
{
if (IsTextEdit())
{
- SdrObjEditView::KeyInput(KeyEvent(0,vcl::KeyCode(KeyFuncType::DELETE)),pTextEditWin);
+ SdrObjEditView::KeyInput(KeyEvent(0, vcl::KeyCode(KeyFuncType::DELETE)), mpTextEditWin);
}
else
{
@@ -1426,7 +1456,7 @@ bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark)
}
}
-bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint)
+bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint, const sal_Int32 aObjectOrdNum)
{
if (GetHdlList().IsMoveOutside())
return false;
@@ -1438,7 +1468,7 @@ bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint
if (pHdl == nullptr)
return false;
- const SdrDragStat& rDragStat = GetDragStat();
+ SdrDragStat& rDragStat = const_cast<SdrDragStat&>(GetDragStat());
// start dragging
BegDragObj(pHdl->GetPos(), nullptr, pHdl, 0);
if (!IsDragObj())
@@ -1453,9 +1483,16 @@ bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint
if(bWasSnapEnabled)
SetSnapEnabled(false);
- MovAction(aEndPoint);
+ if (aObjectOrdNum != -1)
+ {
+ rDragStat.GetGlueOptions().objectOrdNum = aObjectOrdNum;
+ }
+ MovDragObj(aEndPoint);
EndDragObj();
+ // Clear Glue Options
+ rDragStat.GetGlueOptions().objectOrdNum = -1;
+
if (!bWasNoSnap)
const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
if (bWasSnapEnabled)
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 88083f3e93e0..f6f707367768 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -58,6 +58,7 @@
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/svdotable.hxx>
#include <sal/log.hxx>
+#include <comphelper/lok.hxx>
using namespace com::sun::star;
@@ -414,7 +415,9 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po
nSizY /= aDstFr.GetNumerator();
long xs=nSizX;
long ys=nSizY;
- Point aPos(rCenter.X()-xs/2,rCenter.Y()-ys/2);
+ // set the pos to 0, 0 for online case
+ bool isLOK = comphelper::LibreOfficeKit::isActive();
+ Point aPos(isLOK ? 0 : rCenter.X()-xs/2, isLOK ? 0 : rCenter.Y()-ys/2);
tools::Rectangle aR(aPos.X(),aPos.Y(),aPos.X()+xs,aPos.Y()+ys);
pObj->SetLogicRect(aR);
rLst.InsertObject(pObj, SAL_MAX_SIZE);
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 77dc10165480..18e94d7a9bae 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -245,6 +245,7 @@ private:
static sal_Int32 lastRowCount;
static sal_Int32 lastColCount;
static std::vector<sal_Int32> lastColWidths;
+ static bool rowSizeChanged;
};
SdrTableObjImpl* SdrTableObjImpl::lastLayoutTable = nullptr;
@@ -255,6 +256,7 @@ bool SdrTableObjImpl::lastLayoutFitHeight;
WritingMode SdrTableObjImpl::lastLayoutMode;
sal_Int32 SdrTableObjImpl::lastRowCount;
sal_Int32 SdrTableObjImpl::lastColCount;
+bool SdrTableObjImpl::rowSizeChanged = false;
std::vector<sal_Int32> SdrTableObjImpl::lastColWidths;
SdrTableObjImpl::SdrTableObjImpl()
@@ -599,6 +601,7 @@ void SdrTableObjImpl::DragEdge( bool mbHorizontal, int nEdge, sal_Int32 nOffset
Reference< XIndexAccess > xRows( mxTable->getRows(), UNO_QUERY_THROW );
Reference< XPropertySet > xRowSet( xRows->getByIndex( (!nEdge)?nEdge:(nEdge-1) ), UNO_QUERY_THROW );
xRowSet->setPropertyValue( sSize, Any( nHeight ) );
+ rowSizeChanged = true;
}
}
else
@@ -801,7 +804,8 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, bool bFitWidth, bool
|| lastLayoutMode != writingMode
|| lastRowCount != getRowCount()
|| lastColCount != getColumnCount()
- || lastColWidths != getColumnWidths() )
+ || lastColWidths != getColumnWidths()
+ || rowSizeChanged )
{
lastLayoutTable = this;
lastLayoutInputRectangle = rArea;
@@ -816,6 +820,7 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, bool bFitWidth, bool
TableModelNotifyGuard aGuard( mxTable.get() );
mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
lastLayoutResultRectangle = rArea;
+ rowSizeChanged = false;
}
else
{
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 2badfa5a5ef0..eee8278090ed 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -402,13 +402,6 @@ void SvxTableController::onSelectionHasChanged()
const SdrMarkList& rMarkList= mrView.GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
bSelected = mxTableObj.get() == rMarkList.GetMark(0)->GetMarkedSdrObj();
- /* fdo#46186 Selecting the table means selecting the entire cells */
- if (!hasSelectedCells() && pTableObj)
- {
- maCursorFirstPos = SdrTableObj::getFirstCell();
- maCursorLastPos = pTableObj->getLastCell();
- mbCellSelectionMode=true;
- }
}
if( bSelected )
@@ -420,6 +413,14 @@ void SvxTableController::onSelectionHasChanged()
destroySelectionOverlay();
}
}
+void SvxTableController::onSelectAll()
+{
+ sdr::table::SdrTableObj* pTableObj = mxTableObj.get();
+ if ( pTableObj && !pTableObj->IsTextEditActive())
+ {
+ selectAll();
+ }
+}
void SvxTableController::GetState( SfxItemSet& rSet )
@@ -1418,30 +1419,44 @@ bool SvxTableController::DeleteMarked()
SdrTableObj& rTableObj(*mxTableObj.get());
SdrModel& rModel(rTableObj.getSdrModelFromSdrObject());
const bool bUndo(rModel.IsUndoEnabled());
+ bool bDeleteTable = false;
if (bUndo)
rModel.BegUndo(SvxResId(STR_TABLE_DELETE_CELL_CONTENTS));
CellPos aStart, aEnd;
getSelectedCells( aStart, aEnd );
- for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
+ const sal_Int32 nRemovedColumns = aEnd.mnCol - aStart.mnCol + 1;
+ const sal_Int32 nRemovedRows = aEnd.mnRow - aStart.mnRow + 1;
+ if( nRemovedColumns == mxTable->getColumnCount() && nRemovedRows == mxTable->getRowCount())
{
- for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
+ bDeleteTable = true;
+ }
+ else
+ {
+ for( sal_Int32 nRow = aStart.mnRow; nRow <= aEnd.mnRow; nRow++ )
{
- CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
- if (xCell.is() && xCell->hasText())
+ for( sal_Int32 nCol = aStart.mnCol; nCol <= aEnd.mnCol; nCol++ )
{
- if (bUndo)
- xCell->AddUndo();
- xCell->SetOutlinerParaObject(nullptr);
+ CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
+ if (xCell.is() && xCell->hasText())
+ {
+ if (bUndo)
+ xCell->AddUndo();
+ xCell->SetOutlinerParaObject(nullptr);
+ }
}
}
}
+ if (bDeleteTable)
+ mrView.DeleteMarkedObj();
+
if (bUndo)
rModel.EndUndo();
- UpdateTableShape();
+ if (!bDeleteTable)
+ UpdateTableShape();
return true;
}
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index 0520f5c99a24..a48ae29d91f3 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -69,7 +69,12 @@ void StyleStatusListener::StateChanged(SfxItemState /*eState*/, const SfxPoolIte
{
const SfxTemplateItem* pStateItem = dynamic_cast<const SfxTemplateItem*>(pState);
if (pStateItem)
- m_pPreviewControl->Select(pStateItem->GetStyleName());
+ {
+ if (pStateItem->GetStyleIdentifier().isEmpty())
+ m_pPreviewControl->Select(pStateItem->GetStyleName());
+ else
+ m_pPreviewControl->Select(pStateItem->GetStyleIdentifier());
+ }
}
StylePoolChangeListener::StylePoolChangeListener(StylesPreviewWindow_Base* pPreviewControl)
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index afd2da9f8dfa..5834979d5152 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -215,7 +215,7 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
aPagePos.setX(convertTwipToMm100(aPagePos.X()));
aPagePos.setY(convertTwipToMm100(aPagePos.Y()));
- sal_uInt32 nLOKViewWidth = 0.8 * convertTwipToMm100(pViewShell->getLOKVisibleArea().getWidth());
+ sal_Int32 nLOKViewWidth = 0.8 * convertTwipToMm100(pViewShell->getLOKVisibleArea().getWidth());
if (aFontworkSize.getWidth() > nLOKViewWidth)
{
double fScale = static_cast<double>(aFontworkSize.getWidth()) / nLOKViewWidth;
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index b321e0799f92..f0768d48b3cc 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -714,6 +714,8 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_GRFCROP );
std::unique_ptr<SfxTabPage> xTabPage = (*fnCreatePage)(aCropDialog.get_content_area(), &aCropDialog, &aCropDlgAttr);
+ sal_Int32 nPreferredDPI = rView.getSdrModelFromSdrView().getImagePreferredDPI();
+ xTabPage->getAdditionalProperties().emplace("PreferredDPI", css::uno::makeAny(nPreferredDPI));
xTabPage->SetPageTitle(aCropStr);
aCropDialog.SetTabPage(std::move(xTabPage));
diff --git a/svx/source/unodraw/shapeimpl.hxx b/svx/source/unodraw/shapeimpl.hxx
index a1a4e6963020..4381094d380a 100644
--- a/svx/source/unodraw/shapeimpl.hxx
+++ b/svx/source/unodraw/shapeimpl.hxx
@@ -64,8 +64,11 @@ public:
virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
};
+
class SvxFrameShape : public SvxOle2Shape
{
+private:
+ OUString m_sInitialFrameURL;
protected:
// override these for special property handling in subcasses. Return true if property is handled
virtual bool setPropertyValueImpl( const OUString& rName, const SfxItemPropertySimpleEntry* pProperty, const css::uno::Any& rValue ) override;
@@ -82,6 +85,8 @@ public:
virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
+
+ virtual OUString GetAndClearInitialFrameURL() override;
};
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 688fd1b29ee6..19268527fc26 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1496,7 +1496,8 @@ bool SvxGraphicObject::getPropertyValueImpl( const OUString& rName, const SfxIte
Reference<graphic::XGraphic> xGraphic;
auto pSdrGraphicObject = static_cast<SdrGrafObj*>(GetSdrObject());
- if (pSdrGraphicObject->GetGraphicObject().GetType() != GraphicType::NONE)
+ if (pSdrGraphicObject
+ && pSdrGraphicObject->GetGraphicObject().GetType() != GraphicType::NONE)
xGraphic = pSdrGraphicObject->GetGraphic().GetXGraphic();
rValue <<= xGraphic;
break;
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index f7629f338858..6dc18d6cf9e4 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -180,7 +180,7 @@ bool SvxOle2Shape::setPropertyValueImpl( const OUString& rName, const SfxItemPro
#else
pOle = static_cast<SdrOle2Obj*>(GetSdrObject());
#endif
- pOle->SetPersistName( aPersistName );
+ pOle->SetPersistName( aPersistName, this );
return true;
}
break;
@@ -501,10 +501,11 @@ void SvxOle2Shape::createLink( const OUString& aLinkURL )
void SvxOle2Shape::resetModifiedState()
{
- ::comphelper::IEmbeddedHelper* pPersist = GetSdrObject()->getSdrModelFromSdrObject().GetPersist();
+ SdrObject* pObject = GetSdrObject();
+ ::comphelper::IEmbeddedHelper* pPersist = pObject ? pObject->getSdrModelFromSdrObject().GetPersist() : nullptr;
if( pPersist && !pPersist->isEnableSetModified() )
{
- SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( GetSdrObject() );
+ SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >(pObject);
if( pOle && !pOle->IsEmpty() )
{
uno::Reference < util::XModifiable > xMod( pOle->GetObjRef(), uno::UNO_QUERY );
@@ -554,6 +555,11 @@ SvGlobalName SvxOle2Shape::GetClassName_Impl(OUString& rHexCLSID)
return aClassName;
}
+OUString SvxOle2Shape::GetAndClearInitialFrameURL()
+{
+ return OUString();
+}
+
SvxAppletShape::SvxAppletShape(SdrObject* pObject)
: SvxOle2Shape( pObject, getSvxMapProvider().GetMap(SVXMAP_APPLET), getSvxMapProvider().GetPropertySet(SVXMAP_APPLET, SdrObject::GetGlobalDrawObjectItemPool()) )
{
@@ -707,8 +713,19 @@ SvxFrameShape::~SvxFrameShape() throw()
{
}
+OUString SvxFrameShape::GetAndClearInitialFrameURL()
+{
+ OUString sRet(m_sInitialFrameURL);
+ m_sInitialFrameURL.clear();
+ return sRet;
+}
+
void SvxFrameShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
{
+ uno::Reference<beans::XPropertySet> xSet(static_cast<OWeakObject *>(this), uno::UNO_QUERY);
+ if (xSet)
+ xSet->getPropertyValue("FrameURL") >>= m_sInitialFrameURL;
+
SvxShape::Create( pNewObj, pNewPage );
const SvGlobalName aIFrameClassId( SO3_IFRAME_CLASSID );
createObject(aIFrameClassId);
diff --git a/svx/uiconfig/ui/genericcheckdialog.ui b/svx/uiconfig/ui/genericcheckdialog.ui
new file mode 100644
index 000000000000..232221c0a878
--- /dev/null
+++ b/svx/uiconfig/ui/genericcheckdialog.ui
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 -->
+<interface domain="svx">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkDialog" id="GenericCheckDialog">
+ <property name="width-request">850</property>
+ <property name="height-request">480</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border-width">6</property>
+ <property name="modal">True</property>
+ <property name="type-hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialogBox1">
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialogButtons">
+ <property name="can-focus">False</property>
+ <property name="layout-style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label" translatable="yes" context="stock">_OK</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label" translatable="yes" context="stock">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label" translatable="yes" context="stock">_Help</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack-type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="shadow-type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkBox" id="checkBox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-5">ok</action-widget>
+ <action-widget response="-6">cancel</action-widget>
+ <action-widget response="-11">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>
diff --git a/svx/uiconfig/ui/genericcheckentry.ui b/svx/uiconfig/ui/genericcheckentry.ui
new file mode 100644
index 000000000000..1b02ca13eeac
--- /dev/null
+++ b/svx/uiconfig/ui/genericcheckentry.ui
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 -->
+<interface domain="svx">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkBox" id="checkEntryBox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="border-width">3</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="selectable">True</property>
+ <property name="xalign">0</property>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="label-atkobject">
+ <property name="AtkObject::accessible-role">static</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="markButton">
+ <property name="label" translatable="yes" context="genericcheckentry|markButton">Mark</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="propertiesButton">
+ <property name="label" translatable="yes" context="genericcheckentry|propertiesButton">Properties</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sw/CppunitTest_sw_core_attr.mk b/sw/CppunitTest_sw_core_attr.mk
new file mode 100644
index 000000000000..91ae9c8b44e6
--- /dev/null
+++ b/sw/CppunitTest_sw_core_attr.mk
@@ -0,0 +1,74 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_core_attr))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_attr))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_core_attr, \
+ sw/qa/core/attr/attr \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_core_attr, \
+ comphelper \
+ cppu \
+ cppuhelper \
+ editeng \
+ sal \
+ sfx \
+ svl \
+ svx \
+ svxcore \
+ sw \
+ test \
+ unotest \
+ utl \
+ vcl \
+ tl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_core_attr,\
+ boost_headers \
+ libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_core_attr,\
+ -I$(SRCDIR)/sw/inc \
+ -I$(SRCDIR)/sw/source/core/inc \
+ -I$(SRCDIR)/sw/source/uibase/inc \
+ -I$(SRCDIR)/sw/qa/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_core_attr,\
+ udkapi \
+ offapi \
+ oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_core_attr))
+$(eval $(call gb_CppunitTest_use_vcl,sw_core_attr))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_core_attr,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_core_attr,\
+ officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_core_attr))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,sw_core_attr, \
+ modules/swriter \
+))
+
+$(eval $(call gb_CppunitTest_use_more_fonts,sw_core_attr))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_core_edit.mk b/sw/CppunitTest_sw_core_edit.mk
new file mode 100644
index 000000000000..2c04606a75f9
--- /dev/null
+++ b/sw/CppunitTest_sw_core_edit.mk
@@ -0,0 +1,74 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_core_edit, \
+ sw/qa/core/edit/edit \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_core_edit, \
+ editeng \
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ sfx \
+ svxcore \
+ sw \
+ test \
+ unotest \
+ utl \
+ vcl \
+ svt \
+ tl \
+ svl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_core_edit,\
+ boost_headers \
+ libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_core_edit,\
+ -I$(SRCDIR)/sw/inc \
+ -I$(SRCDIR)/sw/source/core/inc \
+ -I$(SRCDIR)/sw/source/uibase/inc \
+ -I$(SRCDIR)/sw/qa/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_core_edit,\
+ udkapi \
+ offapi \
+ oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_core_edit))
+$(eval $(call gb_CppunitTest_use_vcl,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_core_edit,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_core_edit,\
+ officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_core_edit))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,sw_core_edit, \
+ modules/swriter \
+))
+
+$(eval $(call gb_CppunitTest_use_more_fonts,sw_core_edit))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk
index cb901fde29f2..43a7d5eac376 100644
--- a/sw/CppunitTest_sw_core_text.mk
+++ b/sw/CppunitTest_sw_core_text.mk
@@ -21,9 +21,11 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \
comphelper \
cppu \
cppuhelper \
+ editeng \
sal \
sfx \
sw \
+ svl \
test \
unotest \
utl \
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 7999ece93c3d..2fff886cccb3 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -308,6 +308,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/core/frmedt/tblsel \
sw/source/core/graphic/grfatr \
sw/source/core/graphic/ndgrf \
+ sw/source/core/graphic/GraphicSizeCheck \
sw/source/core/layout/anchoreddrawobject \
sw/source/core/layout/anchoredobject \
sw/source/core/layout/atrfrm \
@@ -348,6 +349,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/core/layout/unusedf \
sw/source/core/layout/virtoutp \
sw/source/core/layout/wsfrm \
+ sw/source/core/model/ModelTraverser \
sw/source/core/objectpositioning/anchoredobjectposition \
sw/source/core/objectpositioning/ascharanchoredobjectposition \
sw/source/core/objectpositioning/environmentofanchoredobject \
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index e6fb99d5f88c..1d1fbe28d756 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -117,6 +117,8 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_core_unocore \
CppunitTest_sw_core_crsr \
CppunitTest_sw_uibase_uno \
+ CppunitTest_sw_core_edit \
+ CppunitTest_sw_core_attr \
))
ifneq ($(DISABLE_GUI),TRUE)
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index ca9821c4c3f5..ba985f6a2e95 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -222,6 +222,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/notebookbar_groups \
sw/uiconfig/swriter/ui/notebookbar_groupedbar_full \
sw/uiconfig/swriter/ui/notebookbar_groupedbar_compact \
+ sw/uiconfig/swriter/ui/notebookbar_online \
sw/uiconfig/swriter/ui/pagebreakmenu \
sw/uiconfig/swriter/ui/pagecolumncontrol \
sw/uiconfig/swriter/ui/pagemargincontrol \
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx
index b6857c346a33..5c7703d5e381 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -149,6 +149,12 @@ public:
virtual bool InsertString(const SwPaM &rRg, const OUString&,
const SwInsertFlags nInsertMode = SwInsertFlags::EMPTYEXPAND ) = 0;
+ /// States that the last inserted string came from IME.
+ virtual void SetIME(bool bIME) = 0;
+
+ /// Did the last inserted string come from IME?
+ virtual bool GetIME() const = 0;
+
/** change text to Upper/Lower/Hiragana/Katakana/...
*/
virtual void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&) = 0;
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index a076a6dada66..f3537e913a0d 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -235,9 +235,12 @@ class IDocumentMarkAccess
@param ppMark
[in] an iterator pointing to the Mark to be deleted.
+ @param isMoveNodes
+ [in] the mark is deleted only temporarily for a node move, do not
+ remove fieldmark chars.
*/
virtual std::unique_ptr<ILazyDeleter>
- deleteMark(const IDocumentMarkAccess::const_iterator_t& ppMark) =0;
+ deleteMark(const IDocumentMarkAccess::const_iterator_t& ppMark, bool isMoveNodes) =0;
/** Deletes a mark.
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 287a12604850..4a223b6fb563 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -242,6 +242,9 @@ enum class DocumentSettingId
*/
virtual void Setn32DummyCompatibilityOptions2( const sal_uInt32 CompatibilityOptions2 ) = 0;
+ virtual sal_Int32 getImagePreferredDPI() = 0;
+ virtual void setImagePreferredDPI(sal_Int32 nValue) = 0;
+
protected:
virtual ~IDocumentSettingAccess() {};
};
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 50e6560d25c8..6380d58c7124 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -620,7 +620,8 @@
#define FN_UNO_VISIBLE_AREA_WIDTH (FN_EXTRA2 + 125)
#define FN_UNO_VISIBLE_AREA_HEIGHT (FN_EXTRA2 + 126)
-#define FN_UNO_TRANSFORMED_GRAPHIC (FN_EXTRA2 + 125)
+#define FN_UNO_TRANSFORMED_GRAPHIC (FN_EXTRA2 + 127)
+#define FN_UNO_GRAPHIC_PREVIEW (FN_EXTRA2 + 128)
// Area: Help
// Region: Traveling & Selection
diff --git a/sw/inc/deletelistener.hxx b/sw/inc/deletelistener.hxx
new file mode 100644
index 000000000000..bfdc0926d3b6
--- /dev/null
+++ b/sw/inc/deletelistener.hxx
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <svl/listener.hxx>
+#include <svl/lstner.hxx>
+#include "calbck.hxx"
+
+class SwDeleteListener final : public SwClient
+{
+private:
+ SwModify* m_pModify;
+
+ virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override
+ {
+ if (auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
+ {
+ if (pLegacy->m_pOld && pLegacy->m_pOld->Which() == RES_OBJECTDYING)
+ {
+ m_pModify->Remove(this);
+ m_pModify = nullptr;
+ }
+ }
+ }
+
+public:
+ SwDeleteListener(SwModify& rModify)
+ : m_pModify(&rModify)
+ {
+ m_pModify->Add(this);
+ }
+
+ bool WasDeleted() const { return !m_pModify; }
+
+ virtual ~SwDeleteListener() override
+ {
+ if (!m_pModify)
+ return;
+ m_pModify->Remove(this);
+ }
+};
+
+class SvtDeleteListener final : public SvtListener
+{
+private:
+ bool bObjectDeleted;
+
+public:
+ explicit SvtDeleteListener(SvtBroadcaster& rNotifier)
+ : bObjectDeleted(false)
+ {
+ StartListening(rNotifier);
+ }
+
+ virtual void Notify(const SfxHint& rHint) override
+ {
+ if (rHint.GetId() == SfxHintId::Dying)
+ bObjectDeleted = true;
+ }
+
+ bool WasDeleted() const { return bObjectDeleted; }
+};
+
+class SfxDeleteListener final : public SfxListener
+{
+private:
+ bool bObjectDeleted;
+
+public:
+ explicit SfxDeleteListener(SfxBroadcaster& rNotifier)
+ : bObjectDeleted(false)
+ {
+ StartListening(rNotifier);
+ }
+
+ virtual void Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) override
+ {
+ if (rHint.GetId() == SfxHintId::Dying)
+ bObjectDeleted = true;
+ }
+
+ bool WasDeleted() const { return bObjectDeleted; }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 08eaf82c3e67..7c94345ba7d3 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -320,16 +320,19 @@ public:
void CallAutomationDocumentEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments);
void RegisterAutomationDocumentObject(css::uno::Reference< ooo::vba::word::XDocument > const& xDocument);
- class LockAllViewsGuard
+ // Lock all unlocked views, and returns a guard object which unlocks those views when destructed
+ virtual std::unique_ptr<LockAllViewsGuard> LockAllViews() override;
+
+protected:
+ class LockAllViewsGuard_Impl : public LockAllViewsGuard
{
std::vector<SwViewShell*> m_aViewWasUnLocked;
public:
- explicit LockAllViewsGuard(SwViewShell* pViewShell);
- ~LockAllViewsGuard();
+ explicit LockAllViewsGuard_Impl(SwViewShell* pViewShell);
+ ~LockAllViewsGuard_Impl();
};
- // Lock all unlocked views, and returns a guard object which unlocks those views when destructed
- std::unique_ptr<LockAllViewsGuard> LockAllViews();
+
};
/** Find the right DocShell and create a new one:
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index e223e4fa3dd5..c63ed98683eb 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -26,6 +26,8 @@
#include <memory>
#include <vector>
#include <tools/solar.h>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
class SfxPoolItem;
class SwTextNode;
@@ -285,7 +287,8 @@ class SW_DLLPUBLIC SwInputField final : public SwField
OUString maHelp;
OUString maToolTip;
sal_uInt16 mnSubType;
- bool const mbIsFormField;
+ bool mbIsFormField;
+ css::uno::Sequence<css::beans::PropertyValue> maGrabBag;
SwFormatField* mpFormatField; // attribute to which the <SwInputField> belongs to
@@ -314,6 +317,7 @@ public:
void applyFieldContent( const OUString& rNewFieldContent );
bool isFormField() const;
+ css::uno::Sequence<css::beans::PropertyValue> getGrabBagParams() const { return maGrabBag; }
virtual OUString GetFieldName() const override;
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 852fffd84e3d..a2d974942097 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -28,7 +28,7 @@ class SwGrfFormatColl;
class SwDoc;
class SwOLENode;
class SwOLEListener_Impl;
-class SwEmbedObjectLink;
+namespace sfx2 { class SvBaseLink; }
class DeflateData;
class SW_DLLPUBLIC SwOLEObj
@@ -90,7 +90,7 @@ class SW_DLLPUBLIC SwOLENode: public SwNoTextNode
bool mbOLESizeInvalid; /**< Should be considered at SwDoc::PrtOLENotify
(e.g. copied). Is not persistent. */
- SwEmbedObjectLink* mpObjectLink;
+ sfx2::SvBaseLink* mpObjectLink;
OUString maLinkURL;
SwOLENode( const SwNodeIndex &rWhere,
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index 6cde3c3f01e7..b243a6285dba 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -78,15 +78,44 @@ public:
void Justify();
- SwRect &Union( const SwRect& rRect );
+ SwRect &Union( const SwRect& rRect )
+ {
+ if ( Top() > rRect.Top() )
+ Top( rRect.Top() );
+ if ( Left() > rRect.Left() )
+ Left( rRect.Left() );
+ long n = rRect.Right();
+ if ( Right() < n )
+ Right( n );
+ n = rRect.Bottom();
+ if ( Bottom() < n )
+ Bottom( n );
+ return *this;
+ }
SwRect &Intersection( const SwRect& rRect );
// Same as Intersection, only assume that Rects are overlapping!
SwRect &Intersection_( const SwRect &rRect );
- bool IsInside( const Point& rPOINT ) const;
+ bool IsInside( const Point& rPoint ) const
+ {
+ return (Left() <= rPoint.X()) &&
+ (Top() <= rPoint.Y()) &&
+ (Right() >= rPoint.X()) &&
+ (Bottom()>= rPoint.Y());
+ }
bool IsNear(const Point& rPoint, long nTolerance ) const;
- bool IsInside( const SwRect& rRect ) const;
+ bool IsInside( const SwRect& rRect ) const
+ {
+ const long nRight = Right();
+ const long nBottom = Bottom();
+ const long nrRight = rRect.Right();
+ const long nrBottom= rRect.Bottom();
+ return (Left() <= rRect.Left()) && (rRect.Left()<= nRight) &&
+ (Left() <= nrRight) && (nrRight <= nRight) &&
+ (Top() <= rRect.Top()) && (rRect.Top() <= nBottom) &&
+ (Top() <= nrBottom) && (nrBottom <= nBottom);
+ }
bool IsOver( const SwRect& rRect ) const;
inline bool HasArea() const;
inline bool IsEmpty() const;
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 1100a72508fb..fcd0b4029a58 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -166,6 +166,7 @@
#define UNO_NAME_FILE_LINK "FileLink"
#define UNO_NAME_GRAPHIC "Graphic"
#define UNO_NAME_TRANSFORMED_GRAPHIC "TransformedGraphic"
+#define UNO_NAME_GRAPHIC_PREVIEW "GraphicPreview"
#define UNO_NAME_IS_PROTECTED "IsProtected"
#define UNO_NAME_PARA_KEEP_TOGETHER "ParaKeepTogether"
#define UNO_NAME_KEEP_TOGETHER "KeepTogether"
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index ac7e7b8d9690..a3b64bc1966e 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -147,16 +147,16 @@ private:
OUString m_sNewCharStyleNames[MAXLEVEL];
OUString m_sNewBulletFontNames[MAXLEVEL];
OUString m_sCreatedNumRuleName; //connects to a numbering in SwDoc
- SwDoc* m_pDoc;
+ SwDoc* m_pDoc; // Only if *not* used as chapter numbering.
SwDocShell* m_pDocShell; // Only if used as chapter numbering.
SwNumRule* m_pNumRule;
const SfxItemPropertySet* m_pPropertySet;
bool const m_bOwnNumRuleCreated;
protected:
+ SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
virtual ~SwXNumberingRules() override;
public:
- SwXNumberingRules(SwDocShell& rDocSh); // chapter numbering
SwXNumberingRules(const SwNumRule& rRule, SwDoc* doc = nullptr); // NumRule for paragraphs, numbering styles
SwXNumberingRules(SwDoc& rDoc); //create a new instance
@@ -218,6 +218,7 @@ public:
OUString *const pHeadingStyleName,
OUString *const pParagraphStyleName,
SwDoc *const pDoc,
+ SwDocShell *const pDocShell,
css::uno::Sequence<css::beans::PropertyValue> const& rProperties);
};
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index ffb4c790bd96..a1da4a7ceaa6 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -398,7 +398,7 @@ public:
/// @see vcl::ITiledRenderable::getDocumentSize().
virtual Size getDocumentSize() override;
/// @see vcl::ITiledRenderable::setPart().
- virtual void setPart(int nPart) override;
+ virtual void setPart(int nPart, bool bAllowChangeFocus = true) override;
/// @see vcl::ITiledRenderable::getParts().
virtual int getParts() override;
/// @see vcl::ITiledRenderable::getPart().
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 6c42497efeb6..32cc9b545b6d 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_SW_INC_VIEW_HXX
#include <vcl/timer.hxx>
+#include <vcl/weld.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/objsh.hxx>
#include <editeng/svxenum.hxx>
@@ -611,6 +612,9 @@ public:
std::shared_ptr<SwMailMergeConfigItem> const & GetMailMergeConfigItem() const;
std::shared_ptr<SwMailMergeConfigItem> EnsureMailMergeConfigItem(const SfxItemSet* pArgs = nullptr);
+ OUString GetDataSourceName() const;
+ static bool IsDataSourceAvailable(const OUString sDataSourceName);
+
void ExecFormatPaintbrush(SfxRequest const &);
void StateFormatPaintbrush(SfxItemSet &);
diff --git a/sw/qa/core/attr/attr.cxx b/sw/qa/core/attr/attr.cxx
new file mode 100644
index 000000000000..5a2bc08404db
--- /dev/null
+++ b/sw/qa/core/attr/attr.cxx
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <swmodeltestbase.hxx>
+
+#include <docsh.hxx>
+#include <swdtflvr.hxx>
+#include <swmodule.hxx>
+
+namespace
+{
+static char const DATA_DIRECTORY[] = "/sw/qa/core/attr/data/";
+
+/// Covers sw/source/core/attr/ fixes.
+class Test : public SwModelTestBase
+{
+public:
+ SwDoc* createDoc(const char* pName);
+};
+
+SwDoc* Test::createDoc(const char* pName)
+{
+ load(DATA_DIRECTORY, pName);
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ return pTextDoc->GetDocShell()->GetDoc();
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testSwAttrSet)
+{
+ // Given a document with track changes and the whole document is selected:
+ SwDoc* pDoc = createDoc("attr-set.docx");
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ rtl::Reference<SwTransferable> xTransferable(new SwTransferable(*pWrtShell));
+ SwModule* pMod = SW_MOD();
+ SwTransferable* pOldTransferable = pMod->m_pXSelection;
+ pMod->m_pXSelection = xTransferable.get();
+
+ // When getting the plain text version of the selection:
+ datatransfer::DataFlavor aFlavor;
+ aFlavor.MimeType = "text/plain;charset=utf-16";
+ aFlavor.DataType = cppu::UnoType<OUString>::get();
+ uno::Any aData = xTransferable->getTransferData(aFlavor);
+
+ // Then make sure we get data without crashing:
+ CPPUNIT_ASSERT(aData.hasValue());
+ pMod->m_pXSelection = pOldTransferable;
+}
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/attr/data/attr-set.docx b/sw/qa/core/attr/data/attr-set.docx
new file mode 100644
index 000000000000..0cb8508aa2a4
--- /dev/null
+++ b/sw/qa/core/attr/data/attr-set.docx
Binary files differ
diff --git a/sw/qa/core/crsr/crsr.cxx b/sw/qa/core/crsr/crsr.cxx
index 6adf93042f0b..75f9de1018f3 100644
--- a/sw/qa/core/crsr/crsr.cxx
+++ b/sw/qa/core/crsr/crsr.cxx
@@ -29,25 +29,6 @@ class SwCoreCrsrTest : public SwModelTestBase
{
};
-namespace
-{
-void dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand,
- const uno::Sequence<beans::PropertyValue>& rPropertyValues)
-{
- uno::Reference<frame::XController> xController
- = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
- CPPUNIT_ASSERT(xController.is());
- uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xFrame.is());
-
- uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
- uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext));
- CPPUNIT_ASSERT(xDispatchHelper.is());
-
- xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues);
-}
-}
-
CPPUNIT_TEST_FIXTURE(SwCoreCrsrTest, testFindReplace)
{
loadURL("private:factory/swriter", nullptr);
diff --git a/sw/qa/core/data/html/pass/ofz40593-1.html b/sw/qa/core/data/html/pass/ofz40593-1.html
new file mode 100644
index 000000000000..43510d5d00b2
--- /dev/null
+++ b/sw/qa/core/data/html/pass/ofz40593-1.html
Binary files differ
diff --git a/sw/qa/core/data/rtf/fail/forcepoint-82.rtf b/sw/qa/core/data/rtf/fail/forcepoint-82.rtf
new file mode 100644
index 000000000000..54b1dee42c5b
--- /dev/null
+++ b/sw/qa/core/data/rtf/fail/forcepoint-82.rtf
@@ -0,0 +1,28 @@
+{\rtf1
+{\trowd
+\clbrdrl\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clbrdrt\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\cellx2000
+\pard
+Text 1
+\itap0
+\cell
+\row}
+\pard
+\par
+\itap0
+{\trowd
+\clbrdrl\brdrs\brdrw10\clbrdrr\brdrs\brdrw10\clbrdrt\brdrs\brdrw10\clbrdrb\brdrs\brdrw10\cellx2000
+\pard
+Text 2
+\itap0
+\cell
+\row}
+\itap-1
+{\trowd
+\clbrdrl\brdrs\brdrw2147483649\clbrdrr\brdrs\brdrw9\clbrdrt\brdrs\brdrw10\cl󠁐brdrb\brdrs\brdrw185\cellx1000
+\nestro󠀩w}
+\itap0
+\cell
+\row}
+\itap0
+\par
+} \ No newline at end of file
diff --git a/sw/qa/core/data/rtf/pass/forcepoint-96.rtf b/sw/qa/core/data/rtf/pass/forcepoint-96.rtf
new file mode 100644
index 000000000000..1e5a05d4801f
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/forcepoint-96.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+\clvertalt
+\chpgn
+\clvertalb
+\cell
+\pard\intbl
+\cellx279
+}
diff --git a/sw/qa/core/data/rtf/pass/forcepoint104.rtf b/sw/qa/core/data/rtf/pass/forcepoint104.rtf
new file mode 100644
index 000000000000..2effec385394
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/forcepoint104.rtf
@@ -0,0 +1,571 @@
+{\rtf1\ansi\deflang1045\ftnbj\uc1\deff1
+{\fonttbl{\f0 \froman \fcharset238 Times New Roman;}{\f1 \fswiss \fcharset23838 Arial;}{\f2 \fnil \fcharset238 Wingdings;}{\f3 \froman \fcharset23838 Times New Roman;}{\f4 \fswiss \fcharset238 Arial;}{\f5 \fswiss \fcharset238 Times New Roman;}{\f6 \fswiss \fcharset23838
+Lucida Sans;}{\f7 \froman \fcharset238 Symbol;}{\f8 \fswiss \fcharset238 Lucida Sans;}{\f9 \froman \fcharset238 Times New Roman;}{\f10 \fnil Courier New;}}
+{\colortbl ;\red255\green255\blue255 ;\red0\green0\blue0 ;\red0\green64\blue128 ;\red255\green255\blue128 ;\red0\green0\blue255 ;\red0\green0\blue160 ;\red0\green0\blue0 ;\red0\green0\blue0 ;\red0\green0\blue0 ;\red131\green58\blue20 ;\red164\green79\blue36
+;\red162\green78\blue34 ;\red255\green255\blue255 ;\red254\green255\blue255 ;\red250\green255\blue255 ;\red251\green255\blue255 ;\red27\green10\blue0 ;\red195\green114\blue46 ;\red252\green255\blue255 ;\red249\green255\blue255 ;\red17\green7\blue0 ;\red218\green211\blue185
+;\red179\green89\blue0 ;\red170\green83\blue0 ;\red209\green110\blue0 ;\red237\green167\blue86 ;\red242\green153\blue51 ;\red220\green127\blue19 ;\red0\green0\blue9 ;\red0\green0\blue2 ;\red0\green32\blue0 ;}
+{\stylesheet{\fs20\cf0\cb1\ulc0 Normal;}{\cs1\f3\fs20\cf0\cb1\ulc0 Default Paragraph Font;}{\s2\f3\fs24\cf0\cb1\ulc2 TOC 1;}{\s3\f3\fs24\cf0\cb1\ulc2\li180 TOC 2;}{\s4\f3\fs24\cf0\cb1\ulc2\li360 TOC 3;}{\s5\f3\fs24\cf0\cb1\ulc2\li540 TOC 4;}{\s6\f3\fs24\cf0\cb1\ulc2\li720
+TOC 5;}{\s7\f3\fs24\cf0\cb1\ulc2\li900 TOC 6;}{\s8\f3\fs24\cf0\cb1\ulc2\li1080 TOC 7;}{\s9\f3\fs24\cf0\cb1\ulc2\li1260 TOC 8;}{\s10\f3\fs24\cf0\cb1\ulc2\li1440 TOC 9;}{\s11\f1\fs32\b\cf3\cb1\ulc0\sb240\sa60 Heading 1;}{\s12\f1\fs28\b\cf3\cb1\ulc0\sb240\sa60\outlinelevel1
+Heading 2;}{\s13\f1\fs26\b\cf3\cb1\ulc0\sb240\sa60\outlinelevel2 Heading 3;}{\s14\f3\fs28\b\cf3\cb1\ulc0\sb240\sa60\outlinalevel3 Heading 4;}{\s15\f3\fs26\b\i\cf3\cb1\ulc0\sb240\sa60\outlinelevel4 Heading 5;}{\s16\f3\fs22\b\cf3\cb1\ulc0\sb240\sa60\outlinelevel5
+Heading 6;}{\s17\f3\fs24\cf3\cb1\ulc0\sb240\sa60\outlinelevel6 Heading 7;}{\s18\f3\fs24\i\cf0\cb1\ulc0\sb240\sa60\outlinelevel7 Heading 8;}{\s19\f1\fs22\cf3\cb1\ulc0\sb240\sa60\outlinelevel8 Heading 9;}{\s20\f1\fs32\b\cf0\cb1\ulc0\sb240\sa60\qc Title;}{\s21\f3\fs20\cf0\cb1\ulc0\fi-360\li360{\*\pn\pnlvlbody\pnstart1\pndec\ls0\ilvl0\pnhang
+{\pntxta \'2e}}\ls0\ilvl0 Numbered List;}{\s22\f3\fs20\cf0\cb1\ulc0\fi-360\li360{\*\pn\pnlvlblt\ls0\ilvl0\pnhang\pnf7{\pntxtb \'b7}}\ls0\ilvl0 Bulleted List;}{\s23\f3\fs20\cf0\cb1\ulc0\sa120 Body Text;}{\s24\f3\fs18\cf0\cb1\ulc0\sa120\sl480\slmult1 Body
+Text 2;}{\s25\f3\fs16\cf0\cb1\ulc0\sa120 Body Text 3;}{\s26\f3\fs20\cf0\cb1\ulc0 Note Heading;}{\s27\f10\fs20\cf0\cb1\ulc0 Plain Text;}{\s28\f3\fs20\b\cf0\cb1\ulc0 Strong;}{\s29\f3\fs20\i\cf0\cb1\ulc0 Emphasis;}{\s30\f3\fs20\ul\cf5\cb1\ulc0 Hyperlink;}{\s31\f3\fs20\cf0\cb1\ulc0\tx4320
+Footer;}{\s32\f3\fs20\cf0\cb1\ulc0\tx4320 Header;}{\s33\f10\fs18\cf0\cb1\ulc0 Code;}{\cs34\f3\fs20\i\cf3\cb1\ulc2 Field Label;}{\cs35\f3\fs22\b\cf0\cb1\ulc2 Table Heading;}{\cs36\f6\fs16\b\protect\cf0\cb4\ulc0 SSBookmark;}{\cs37\f3\fs20\b\ul\cf0\cb1\ulc0(
+Object type;}{\s38\f3\fs20\b\i\cf6\cb1\ulc0 List Header;}}
+{\*\listtable
+{\list\listtemplateid1
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'00.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List1;}\listid1
+}
+{\list\listtemplateid2
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\lerelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List2;}\listid2
+}
+{\list\listtemplateid3
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f9\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\nevelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List3;}\listid3
+}
+{\list\listtemplateid4
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f9\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List4;}\listid4
+}
+{\list\listtemplateid5
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f7\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List5;}\listid5
+}
+{\list\listtemplateid6
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f7\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List6;}\listid6
+}
+{\list\listtemplateid7
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'00.}{\levelnumbers \'01}\f5\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List7;}\listid7
+}
+{\list\listtemplateid8
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f7\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List8;}\listid8
+}
+{\list\listtemplateid9
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f7\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List9;}\listid9
+}
+{\list\listtemplateid10
+{\listlevel\levelfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f7\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\meveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List10;}\listid10
+}
+{\list\listtemplateid11
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f7\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List11;}\listid11
+}
+{\list\listtemplateid12
+{\listlevel\levelnfc23\levelfollow0\levelstartat1{\leveltext \'01\'b7}{\levelnumbers}\f7\fs24}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'01.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'02.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'03.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'04.}{\levelnumbers \'01}}
+{\listlevel\Levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'05.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'06.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'07.}{\levelnumbers \'01}}
+{\listlevel\levelnfc0\levelfollow0\levelstartat1{\leveltext \'02\'08.}{\levelnumbers \'01}}
+{\listname List12;}\listid12
+}
+}
+{\*\listoverridetable
+{\listoverride\listid12\listoverridecount0\ls1}
+}
+\paperw11908\paperh16833\margl1440\margr1440\margt1440\margb1440\headery720\footery720\deftab720\formshade\aendnotes\aftnnrlc\pgbrdrhead\pgbrdrfoot
+\sectd\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\headery720\footery720\sbkpage\pgncont\pgndec
+\plain\f1\cf0\fs20
+{\header
+\trowd\trgaph60\trleft0\trrh230
+\clvertalt\clbrdrb\brdrs\brdrw1\cellx3510
+\clvertalt\clbrdrb\brdrs\brdrw1\cellx5760
+\clvertalt\clbrdrb\brdrs\brdrw1\cellx9360
+\pard\intbl\s32\tx4320\ql\lang1033\f0 Model Specification\cell
+\pard\intbl\s32\tx4320\qc\lang1045\f1\lang1033\f0 Phase 01\cell
+\pard\intbl\s32\tx4320\qr\lang1045\f1\lang1033\f0 Page: {\field{\fldinst PAGE}{\fldrslt 1}}\cell
+\lang1045\f0\intbl\row
+\pard\s32\tx4320\qr\f1\f0\par\f1}
+{\footer\ql\f5\ulc0\par\f1\ulc2}
+\pard\s20\sb240\sa60\qc\l`ng1033\f5\fs32 Table of Contents\par\pard\s0\ql\lang1045\f1\fs20\f5\ulc0\par\pard\s5\tqr\tldot\tx9270\li540\ql\f1\ulc2{\field{\fldinst TOC \\o "1-9"}{\fldrslt\f3\ulc0\fs24 Infrastruktura sieciowa\lang1033\f0\tab 2\par\lang1045\f3
+Sieci LAN\lang1033\f0\tab 2\par\pard\s6\tqr\tldot\tx9270\li720\ql\lang1045\f3 201.0.0.0\f0\tab 2\par\f3 201.0.100.136/30 :sie\u263 \'e6 IP\f0\tab 2\par\f3 201.0.12.0\f0\tab 2\par\f3 201.0.16.0\f0\tab 2\par\f3 201.0.3.0\f0\tab 2\par\f3 201.0.6.0\f0\tab
+2\par\f3 ca 201.0.9.0/27\f0\tab 3\par\f3 cpfcpf 201.0.100.124/30\f0\tab 3\par\f3 DMZ 193.27.6.0\f0\tab 3\par\f3 flink 201.0.100.140/30\f0\tab 3\par\f3 Internet\f0\tab 3\par\f3 pixcpf 201.0.100.124/30\f0\tab 3\par\f3 prod 201.0.100.240/29\f0\tab 3\par\f3
+RA 201.0.9.32/27\f0\tab 3\par\\\\f3 RAO 201.0.9.96/27 :sie\u263 \'e6 IP\f0\tab 3\par\pard\s5\tqr\tldot\tx9270\li540\ql\f3 Urz\u261 \'b9dzenia\lang1033\f0\tab 4\par\pard\s6\tqr\tldot\tx9270\li720\ql\lang1045\f3 pix1\f0\tab 4\par\f3 pix21\f0\tab 4\par\f3 proxy1\f0\tab
+4\par\f3 proxy21\f0\tab 5\par\f3 sw1\f0\tab 5\par\f3 sw2\f0\tab 5\par\f3 sw21\f0\tab 5\par\f3 sw22\f0\tab 5\par\f3 sw23\f0\tab 5\par\f3 sw3\f0\tab 5\par\f3 wentyl1\f0\tab 5\par\f3 wentyl21\f0\tab 5\par\pard\s2\tqr\tldottx9270\ql}}\lang1033\f0\pard\s2\tqr\tldot\tx9270\ql\par\page\pard\s14\li720\sb240\sa60\ql\lang1045\f1{\*\bkmkstart
+Infrastruktura_sieciowa}{\*\bkmkstart BKM_82c14eb3_F991_4597_98f0_854dd833f496}\f3\cf3\ulc0\fs28\b Infrastruktura sieciowa{\field\fldlock{\*\fldinst
+MERGEFIELD \lang1033\f0 Pkg.Name}{\fldrslt}}\lang1033\f0\pard\s14\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\lang1045\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Pkg.Notes}{\fldrslt}}\cs36\lang1033\f8\highlight4\ulc0\fs16\b\protect\pard\s0\tqr\tx1170\li720\ql\par\pard\s0\li720\ql\cs1\lang1045\f1\highlight1\ulc2\fs20\b0\protect0\lang1045\f3\ulc0
+ \lang1045\f5\par\pard\s14\li720\sb240\sa60\ql\f1\ulc2{\*\bkmkstart Sieci_LAN}{\*\bkmkstart BKM_BDBBF25a_74dd_4037_B5e1_9d10c2183fbb}\f3\cf3\ulc0\fs28\b
+Sieci LAN{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Pkg.Name}{\fldrslt}}\lang1033\f0\pard\s14\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\lang1045\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Pkg.Notes}{\fldrslt}}\cs36\lang1033\f8\highlight4\ulc0\fs16\b\protect\pard\s0\tqr\tx1170\li720\ql\par
+{\*\bkmkstart BKM_523ada47_3e82_4089_ABEB_5b4b9b2a30c7}\cs1\lang1045\f5\highlight1\fs20\b0\protect0\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b 201.0.0.0{\field\fldlock{\*\fldinst
+MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 udost\lang1045\f3\u281 \'ea\lang1045\f3 pniana klientom Izby za po\lang1045\f3\u347 \'9c\lang1045\f3
+rednictwem sieci Exatel S.A.\lang1045\f5\par{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\f1\ulc2\pard\par
+\trowd\trgaph60\trleft64816\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIEND \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.0.0 255.255.255.255 1.0.0.11{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_523ada47_3e82_4089_ABEB_5b4b9b2a30c7}\lang1045\f3\ulc0 {\*\bkmkstart BKM_BFCA7b27_252f_4611_9ad1_4049708dd34a}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+201.0.100.136/30 :sie\u263 \'e6 IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes
+{\*\bkmkend BKM_BFCA7b27_252f_4611_9ad1_4049708dd34a}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_BB3e912_D587_439e_AAB8_4ea7a3473176}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+201.0.12.0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 udost\lang1045\f3\u281 \'ea\lang1045\f3 pniana klientom
+Izby za po\lang1045\f3\u347 \'9c\lang1045\f3 rednictwem sieci Exatel S.A.{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.12.0 255.255.255.0 201.0.12.11{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_BB3e912_D587_439e_AAB8_4ea7a3473176}\lang1045\f3\ulc0 {\*\bkmkstart BKM_B99df3a2_6fcc_4716_953e_A4e4a7e0CFA0}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+201.0.16.0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 og\lang1045\f3\u243 \'f3\lang1045\f3 lna Centrali
+KIR S.A.{\field\fldlock{\*\fldinst MERGEFIELD \l`ng1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3|u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.16.0 255.255.255.0 201.0.16.242{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_B99df3a2_6fcc_4716_953e_A4e4a7e0CFA0}\lang1045\f3\ulc0 {\*\bkmkstart BKM_BBB9F76C_07B9_4f8d_A567_D5772463993e}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+201.0.3.0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 udost\lang1045\f3\u281 \'ea\lang1045\f3 pnia~a klientom
+Izby za po\lang1045\f3\u347 \'9c\lang1045\f3 rednictwem sieci Exatel S.A.{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh27y
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.3.0 255.255.255.0 201.0.3.11{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_BBB9f76c_7b9_4f8d_A567_D5772463993e}\lang1045\f3\ulc0 {\*\bkmkstart BKM_1017804d_216c_4074_B461_668b2d44913d}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+201.0.6.0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 og\lang1045\f3\u243 \'f3\lang1045\f3 lna Centrali
+KIR S.A.{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.6.0 255.255.255.0 201.0.6.11{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_1017804d_216c_4074_B461_668b2d44913d}\lang1045\f3\ulc0 {\*\bkmkstart BKM_349b5ca7_58e4_4ac5_B66e_ea8b76eb9f9}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+ca 201.0.9.0/27{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 wysoce chroniona; w sieci znajduj\lang1045\f3\u261
+\'b9\lang1045\f3 si\lang1045\f3\u281 \'ea\lang1045\f3 tylko komputery urz\lang1045\f3\u281 \'ea\lang1045\f3 d\lang1045\f3\u243 \'f3\lang1045\f3 w certyfikacyjnych KIR S.A.{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.9.0 255.255.255.224 201.0.9.30{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska, o\lang1045\f3\u347 \'9c\lang1045\f3
+rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_349b5ca7_58e4_4ac5_B66e_ea8b76eb9f9}\lang1045\f3\ulc0 {\*\bkmkstart BKM_D47641b5_A5d7_43da_9626_EB144f57febb}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+cpfcpf 201.0.100.124/30{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes
+{\*\bkmkend BKM_D47641b5_A5d7_43da_9626_EB144f57febb}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_8629b55b_E004_472b_B1f1_C683250e6b6}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+DMZ 193.27.6.0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Strefa zdemilitaryzowana po\lang1045\f3\u322 \'b3\u261 \'b9\lang1045\f3 czenia z Internetem
+w KIR S.A.{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 193.27.6.0 255.255.255.240 <brak>{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska, o\lang1045\f3\u347 \'9c\lang1045\f3
+rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_8629b55b_E004_472b_B1f1_C683250e6b6}\lang1045\f3\ulc0 {\*\bkmkstart BKM_9cf66f6c_07D5_46d4_B5E4_6785020AE1C6}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+flink 201.0.100.140/30{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes
+{\*\bkmkend BKM_9cf66f6c_07D5_46d4_B5E4_6785020AE1C6}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_FD91271_8e42_4e74_9361_F87b02c663c3}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+Internet{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Globalna sie\lang1045\f3\u263 \'e6\lang1045\f3 Internet.{\field\fldlock{\*\fldinst
+MERGEFIELD \lang1033\f0 Element.Notes{\*\bkmkend BKM_FD91271_8e42_4e74_9361_F87b02c663c3}}{\fldrslt}} {\*\bkmkstart BKM_C1cc1d21_3f5_4062_9545_5a3bf082e743}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+pixcpf 201.0.100.124/30{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes
+{\*\bkmkend BKM_C1cc1d21_3f5_4062_9545_5a3bf082e743}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_A6e8d12d_BA01_4208_8187_877d3dad86c6}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc\fs26\b
+prod 201.0.100.240/29{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes
+{\*\bkmkend BKM_A6e8d12d_BA01_4208_8187_877d3dad86c6}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_F283df07_BB20_4f67_B119_E116b34353ff}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+RA 201.0.9.32/27{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 chroniona; w sieci znajduj\lang1045\f3\u261
+\'b9\lang1045\f3 si\lang1045\f3\u281 \'ea\lang1045\f3 tylko komputery zwi\lang1045\f3\u261 \'b9\lang1045\f3 zane z prac\lang1045\f3\u261 \'b9\lang1045\f3 OZK2.{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.19.32 255.255.255.224 201.0.19.62{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska, o\lang1045\f3\u347 \'9c\lang1045\f3
+rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_F283df07_BB20_4f67_B119_E116b34353ff}\lang1045\f3\ulc0 {\*\bkmkstart BKM_6758daa6_A44a_44c2_86bc_211566e94ec1}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+RAO 201.0.9.96/27 :sie\u263 \'e6 IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0\lang1045\f3\ulc0 Sie\lang1045\f3\u263 \'e6\lang1045\f3 chroniona; w sieci znajduj\lang1045\f3\u261
+\'b9\lang1045\f3 si\lang1045\f3\u281 \'ea\lang1045\f3 tylko komputery zwi\lang1045\f3\u261 \'b9\lang1045\f3 zane z prac\lang1045\f3\u261 \'b9\lang1045\f3 OZK2.{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Notes}{\fldrslt}}\lang1045\f1\ulc2\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.19.96 255.255.255.224 201.0.19.97{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska, o\lang1045\f3\u347 \'9c\lang1045\f3
+rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\li720\ql\f1\ulc2{\*\bkmkend BKM_6758daa6_A44a_44c2_86bc_211566e94ec1}\lang1045\f3\ulc0 {\*\bkmkend Sieci_LAN}{\*\bkmkend
+BKM_BDBBF25a_74dd_4037_B5e1_9d10c2183fbb} \lang1045\f5\par\pard\s14\li720\sb240\sa60\ql\f1\ulc2{\*\bkmkstart Urz\'b9dzenia_START}{\*\bkmkend Urz\'b9dzenia_START}{\*\bkmkstart BKM_93cd549d_E008@6b9_A645_67A5728BC591}\f3\cf3\ulc0\fs28\b
+Urz\u261 \'b9dzenia{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Pkg.Name}{\fldrslt}}\lang1033\f0\pard\s14\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\lang1045\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Pkg.Notes}{\fldrslt}}\cs36\lang1033\f8\highlight4\ulc0\fs16\b\protect\pard\s0\tqr\tx1170\li720\ql\par
+{\*\bkmkstart BKM_3055a811_30d5_486b_962e_23fb98ebf4bd}\cs1\lang1045\f5\highlight1\fs20\b0\protect0\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b pix1{\field\fldlock{\*\fldinst
+MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes}{\fldrslt}}\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intb\ow
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.9.33 255.255.255.240 201.0.9.33{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Marka{\field\fldlock{\*\fldinst MERGEFiELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 Cisco{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Model{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 PIX Firewall 520{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFKELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_3055a811_30d5_486b_962e_23fb98ebf4bd}\lang1045\f3\ulc0 {\*\bkmkstart BKM_B7c6185c_3ffd_48b2_AABE_F7bed626b651}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+pix21{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes}{\fldrslt}}\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.19.33 255.255.255.240 201.0.19.33{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Marka{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 Cisco{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldr3lt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Model{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 PIX Firewall 520{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_B7c6185c_3ffd_48b2_AABE_F7bed626b651}\lang1045\f3\ulc0 {\*\bkmkstart BKM_8049279d_3b4e_4648_BC55_81ae4d9cc171}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+proxy1{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes}{\fldrslt}}\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cmllx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5]ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.3.199 255.255.255.0 <brak>{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.20.2 255.255.255.240 <brak>{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 195.136.33.65 255.255.255.240 195.136.33.66{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Pileckiego{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Marka{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 Dell{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Model{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 Optiplex GX1{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Nr ewidencyjny{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 CE/002100{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Nr seryjny{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 JSI5T{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 OS{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 Microsoft Windows NT 4.0 Server{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_8049279d_3b4e_4648_BC55_81ae4d9cc171}\lang1045\f3\ulc0 {\*\bkmkstart BKM_F69e29d6_602b_4695_85e9_6ed3166ca13a}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+proxy21{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes}{\fldrslt}}\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvestalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.16.199 255.255.255.0 <brak>{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.20.2 255.255.255.240 <brak>{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.NAme}{\fldrslt}}\lang1045\f5 = \lang1045\f3 195.136.33.65 255.255.255.240 196.136.33.66{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Lokalizacja{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 o\lang1045\f3\u347 \'9c\lang1045\f3 rodek Cypryjska{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0
+ElementTagVal.Value}{\fldrslt}}\lang1045\f5 . {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Marka{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 Dell{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Model{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 PowerEdge 2300{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 OS{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVaV.Name}{Ffldrslt}}\langElemewtTagVal.Name}{\fldrslt}}\langElementTagVal.Nam}{\fldrslt}}\langElemenJTBgVal.Name}{\flgrslt}}\langElementTagVal.Name}{\fldrslt}}\lamgElementTagVal.Name}{\fldrslt}}\lagElemantTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{wfldrslt}}\langElementTrgVal.Name}{\flyrslt}}\langElemenVTazVal.Name}{\fldrslte}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{mfldrslt}}\langElementTagVal.Name}{\fldrslt}}ClangElementTagValbName}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElemXntTagVil.Name}{\fldrsNt}}\langElemNntTagVag.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\dangElementTagVal.Name}{\fldrslt}}\JangElementTagVal.Name}{\fldrsltD}\langElmentbagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\laogElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.NamS}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langXlementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslk}}\langElemeNtTagVal.eame}{\fldrslt}}\langElementTagVal.Name}{\flJrslt}}\langElementTacVal.Name}{\fldrslt}}ZlangElementTagVal.NaIe}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\l
+ngElementTvgVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTaggal.Name}{\ilerslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.NamI}{\fldrsSt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Nameq{\fldrslt}}\lavgElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\flmrslt}}\langElementTagVal.Name}{\fldrsit}}\langElementTagVal.NQme}{\Lldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrswt}}\langElementGagial.Name}{\flduslt}}\langElementTagVal.Name}{\fldrsBt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrJlt}}\langElementTagVal.Nace}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.NaPe}{\fldrslt}}\langElementTagVal.Name}{\fldrsltx}\langElsmentTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fUdrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagnal.Namk}{\fldrslt}}nlangElementTagValgName}{\fldrslt}}\langElementTagVal.Name}{\fdrslt}}\langElementTagVal.Name}{\fbdrslt}}\langElempntTagVal.Name}{\fldrslt}}\langElemenTagVBl.Name}{\fldrslt}}\DangElementTaYVal.Name}{\fldrslt}}\langElementTagVaR.NamN}{\fldzslt}}\langElementTagVal.Name}{\fldrslt}}\langElementkagVal.Name}{\pldrslt}}\langElementTagValTName}{\fldrslt}}WlangElementTfgVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fSdrslt}}\lanaElementTagVAl.Name}{\fldrsLt}}\langElemeZtTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElrmentTagVal.Name}{\fldrslt}}VlangElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\gangElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\Cldrhlt}}\langlementTagVal.Name}{\fldrslt}}\langEleQentTagVal.Name}{\eldrsSt}}\SangElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVaj.Name}{xfldrslt}}\sangElementTagVal.Name}{\fldrslt}}\langPlementTagVal.Name}{\oldrsXt}}\langElementTVgVal.NameL{\Sldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\lanjElementTagVal.Name}{\fldrsWt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagQal.Name}{\fldrsl}}\langElementTagxal.Name}{\fldrslt}}\lqngElementTagVal.Name}{\fldrslt}}\langElementdagVal.Name}{\fldrslt}}\langElementTagVal.NBme}{\fldrslt}}\langElezentTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElemfnWTagVal.Name}{Pfldrlt}}\langElWmentTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElemenWTagVal.Name}{\fldrslt}h\langElemenFTagVal.Name}{\fldrslt}}\lanCElehentTagVal.Name}{\fldLslt}}wlangflementTagVal.Name}{\fldrslt}}\langglementTagVal.NameU{\fldrsli}}\langElementTagVal.Name}{\fldrslt}}\FangElementTagVal.Name}{\fldrslt}}\PangElementTagVal.NBE}{\fldrslt}}\langEleFentTagVal.Name}{\fldrslt}}\langE|ementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrsltI}\laAgElementTagVal.Name}{\fldrslt}}\langElemeJtTagVal.Ntme}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElemetTagVal.Name}l\fldrslG}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\lanElementTagVal.Name}{\fldrslt}}\langEgementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\flVrsl}}\langElementTagVal.Name}{\fldrslt}}\lan}ElLmentTagVal.Name}{\fldrslt}}\langElementTRgVal.lame}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langclementTagVMl.Name}{\fldrslt}}wnangElemenfTagVal.Name}u\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagKal.Name}{\fldrslt}}\langElHmentTagVal.Name}P\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}D\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Namei{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVPlTName}{\fldrGlt}}\langElementTagLaj.Name}{lfldrslt}}\langElementTagVaG.Name}{\fldrslt}}\langElementTagValyName}{\fldrslt}}\langElementTHgVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langEvementTagVal.zame}{\fldrslM}}\langElementTagVrl.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrs|t}}\langElementTagVal.Name}{\fldrslt}}\langllementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fXdrslt}}\langElementuagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVaj.Name}{\fldrslt}}\langElementTagVal.Name}{\uldrslt}}\langEleoentTagVal.Name}{\fldrslt}}\langElemennTagVal.Name}{\fldrslX}}\langElementTagVal.Name}{\fldrslt}}\langklementTagVal.Name}{\fldrslt}}\langElementTagVau.Name}{\fldrslt}}\langElemenvTagVal.NFme}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\flkrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTcgVal.Name}{\fldrslt}}\langElementTgVal.NamR}{\fldrGlt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldsslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrsqt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElmentTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\FangElementTagVal.dame}{\fldrslt}}\lxngElmmentTagVal.Name}{\fldrslt}}\langSlementTagVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langElementTagVal.NaGe}{\fldrslt}}\langElementTagVal.Name}{\Aldrslt}}\langElementTagVal.Name}{\fldrslt}}\lanfElementTagValCName}{\fldrClt}}\langElementTagVal.wame}{\fldrslt}}\langElementTagVaC.Name}{\fldrslE}}\LangEhementTagVal.Name}{\fldrslt}}\langElemestTagVal.NameP{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langFlementTaDVal.Name}{\fldrslt}}\langElementTagVal.Name}{\fldrslt}}\langEwementTagVal.NaWe}{\fldrslt}}\langElementTagVal.Nam
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_F69e29d6_602b_4695_85e9_6ed3166ca13a}\lang1045\f3\ulc0 {\*\bkmkstart BKM_a8055c7_EBB6_4188_A92d_50dcf1d29199}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw1{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkend
+BKM_a8055c7_EBB6_4188_A92d_50dcf1d29199}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_4654fa92_A2c8_477e_90be_6f16df43be1f}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw2{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkend
+BKM_4654fa92_A2c8_477e_90be_6f16df43be1f}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_9e2c21bb_F88f_4cfd_ABEF_B8df014d58e3}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw21{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkend
+BKM_9e2c21bb_F88f_4cfd_ABEF_B8df014d58e3}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_A7c71ea_A4ef_49d7_82d3_EB1e28ba8f81}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw22{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkend
+BKM_A7c71ea_A4ef_49d7_82d3_EB1e28ba8f81}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_40e8b33f_4908@6df_9279_88BF5015431A}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw23{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes}{\fldrslt}}\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.0.0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Datafield{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 test{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkend BKM_40e8b33f_4908@6df_9279_88BF5015431A}\lang1045\f3\ulc0 {\*\bkmkstart BKM_6a646ab8_8b44_4b86_AB53_27afc400ce43}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw3{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkend
+BKM_6a646ab8_8b44_4b86_AB53_27afc400ce43}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_e8b97b9_3737_445d_A1ee_2cff79632be6}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+wentyl1{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkend
+BKM_e8b97b9_3737_445d_A1ee_2cff79632be6}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_42c710ad_C753_4955_8883_26bf28d68159}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+wentyl21{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkend
+BKM_42c710ad_C753_4955_8883_26bf28d68159}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart Urz\'b9dzenia_END}{\*\bkmkend Urz\'b9dzenia_END}{\*\bkmkend BKM_93cd549d_E008@6b9_A645_67A5728BC591}
+{\*\bkmkend Infrastruktura_sieciowa}{\*\bkmkend BKM_82c14eb3_F991_4597_98f0_854dd833f496} \lang1045\f5\li720\ql\par\li0\f1\ulc2\f5\ulc0\par}
+t BKM_A7c71ea_A4ef_49d7_82d3_EB1e28ba8f81_START}{\*\bkmkend BKM_A7c71ea_A4ef_49d7_82d3_EB1e28ba8f81_START}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw22{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkstart BKM_A7c71ea_A4ef_49d7_82d3_EB1e28ba8f81_END}{\*\bkmkend
+BKM_A7c71ea_A4ef_49d7_82d3_EB1e28ba8f81_END}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_40e8b33f_4908@6df_9279_88BF5015431A_START}{\*\bkmkend BKM_40E8B33F_4908@6df_9279_88BF5015431A_START}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw23{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes}{\fldrslt}}\pard\par
+\trowd\trgaph60\trleft720\trrh279
+\clvertalt\clmgf\cellx9240
+\clmrg\cellx9360
+\pard\intbl\s38\ql\cs35\f3\ulc0\fs22\b Szczeg\u243 \'f3\u322 \'b3y\cell\cell
+\cs1\f0\fs20\b0\intbl\row
+\trowd\trgaph60\trleft720\trrh381
+\clvertalt\cellx1350
+\clvertalt\cellx9361
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 adres IP{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 201.0.0.0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\intbl\s0\qr\f1\ulc2\f5\ulc0\cell
+\pard\intbl\s0\ql\f1\ulc2\lang1045\f3\ulc0 Datafield{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Name}{\fldrslt}}\lang1045\f5 = \lang1045\f3 test{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Value}{\fldrslt}}\lang1045\f5
+. {\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 ElementTagVal.Notes}{\fldrslt}}\ql\cell
+\intbl\row
+\pard\s0\tqr\tx1170\li720\ql\f1\ulc2{\*\bkmkstart BKM_40e8b33f_4908@6df_9279_88BF5015431A_END}{\*\bkmkend BKM_40E8B33F_4909_46df_9279_88bf5015431a_END}\lang1045\f3\ulc0 {\*\bkmkstart BKM_6a646ab8_8b44_4b86_AB53_27afc400ce43_START}{\*\bkmkend BKM_6a646ab8_8b44_4b86_AB53_27afc400ce43_START}\lang1045\f5\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+sw3{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkstart BKM_6a646ab8_8b44_4b86_AB53_27afc400ce43_END}{\*\bkmkend
+BKM_6a646ab8_8b44_4b86_AB53_27afc400ce43_END}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_e8b97b9_3737_445d_A1ee_2cff79632be6_START}{\*\bkmkend BKM_e8b97b9_3737_445d_A1ee_2cff79632be6_START}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+wentyl1{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\tqr\tx1170\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkstart BKM_e8b97b9_3737_445d_A1ee_2cff79632be6_END}{\*\bkmkend
+BKM_e8b97b9_3737_445d_A1ee_2cff79632be6_END}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart BKM_42c710ad_C753_4955_8883_26bf28d68159_START}{\*\bkmkend BKM_42c710ad_C753_4955_8883_26bf28d68159_START}\lang1045\f5\pard\s0\tqr\tx1170\li720\ql\par\pard\s15\li720\sb240\sa60\ql\f1\ulc2\f3\cf3\ulc0\fs26\b
+wentyl21{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0 Element.Name}{\fldrslt}}\f0\pard\s15\li720\sb240\sa60\ql\par\pard\s0\li720\ql\f1\cf0\ulc2\fs20\b0{\field\fldlock{\*\fldinst MERGEFIELD \lang1033\f0\ulc0 Element.Notes{\*\bkmkstart BKM_42c710ad_C753_4955_8883_26bf28d68159_END}{\*\bkmkend
+BKM_42c710ad_C753_4955_8883_26bf28d68159_END}}{\fldrslt}}\lang1045\f3\ulc0 {\*\bkmkstart Urz\'b9dzenia_END}{\*\bkmkend Urz\'b9dzenia_END}{\*\bkmkstart BKM_93cd549d_E008@6b9_A645_67A5728BC591_END}{\*\bkmkend BKM_93CD549D_E009_46b9_A645_67a5728bc591_END}{\*\bkmkstart
+Infrastruktura_sieciowa_END}{\*\bkmkend Infrastruktura_sieciowa_END}{\*\bkmkstart BKM_82c14eb3_F991_4597_98f0_854dd833f496_END}{\*\bkmkend BKM_82c14eb3_F991_4597_98f0_854DD18446744073709551615F496_END} \lang1045\f5\li720\ql\par\li0\f1\ulc2\f5\ulc0\par} \ No newline at end of file
diff --git a/sw/qa/core/data/ww5/pass/ooo37322-1-WW2.doc b/sw/qa/core/data/ww5/pass/ooo37322-1-WW2.doc
new file mode 100644
index 000000000000..fd64eeed2963
--- /dev/null
+++ b/sw/qa/core/data/ww5/pass/ooo37322-1-WW2.doc
Binary files differ
diff --git a/sw/qa/core/data/ww8/pass/ofz34749-1.doc b/sw/qa/core/data/ww8/pass/ofz34749-1.doc
new file mode 100644
index 000000000000..d657a71b5245
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/ofz34749-1.doc
Binary files differ
diff --git a/sw/qa/core/data/ww8/pass/ofz38011-1.doc b/sw/qa/core/data/ww8/pass/ofz38011-1.doc
new file mode 100644
index 000000000000..8ef58ca5395d
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/ofz38011-1.doc
Binary files differ
diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx
index d30cbe47cc3b..88fae0b0aab8 100644
--- a/sw/qa/core/doc/doc.cxx
+++ b/sw/qa/core/doc/doc.cxx
@@ -17,12 +17,14 @@
#include <vcl/errinf.hxx>
#include <vcl/event.hxx>
#include <editeng/langitem.hxx>
+#include <vcl/scheduler.hxx>
#include <wrtsh.hxx>
#include <fmtanchr.hxx>
#include <edtwin.hxx>
#include <view.hxx>
#include <ndtxt.hxx>
+#include <UndoManager.hxx>
static char const DATA_DIRECTORY[] = "/sw/qa/core/doc/data/";
@@ -126,6 +128,36 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testLocaleIndependentTemplate)
ErrorRegistry::Reset();
}
+CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testIMEGrouping)
+{
+// TODO figure out why the ext text input in this test code reaches the wrong window on
+// non-headless.
+#if !defined MACOSX && !defined _WIN32
+ // Given an empty document:
+ SwDoc* pDoc = createDoc();
+ // Make sure no idle is in action, so the ExtTextInput events go to SwEditWin.
+ Scheduler::ProcessEventsToIdle();
+
+ // When pressing two keys via IME:
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwEditWin& rEditWin = pDocShell->GetView()->GetEditWin();
+ rEditWin.PostExtTextInputEvent(VclEventId::ExtTextInput, "a");
+ rEditWin.PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+ rEditWin.PostExtTextInputEvent(VclEventId::ExtTextInput, "b");
+ rEditWin.PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ // Then make sure that gets grouped together to a single undo action:
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ SwTextNode* pTextNode = pWrtShell->GetCursor()->GetNode().GetTextNode();
+ CPPUNIT_ASSERT_EQUAL(OUString("ab"), pTextNode->GetText());
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1
+ // - Actual : 2
+ // i.e. 2 subsequent IME events got their own undo actions.
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDoc->GetUndoManager().GetUndoActionCount());
+#endif
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/edit/data/redline-hidden.fodt b/sw/qa/core/edit/data/redline-hidden.fodt
new file mode 100644
index 000000000000..10355e3ac485
--- /dev/null
+++ b/sw/qa/core/edit/data/redline-hidden.fodt
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+ <config:config-item-set config:name="ooo:view-settings">
+ <config:config-item config:name="ShowRedlineChanges" config:type="boolean">false</config:config-item>
+ </config:config-item-set>
+ </office:settings>
+ <office:automatic-styles>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm"/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1">
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:tracked-changes text:track-changes="false">
+ <text:changed-region xml:id="ct51730224" text:id="ct51730224">
+ <text:insertion>
+ <office:change-info>
+ <dc:creator>Creator</dc:creator>
+ <dc:date>2017-04-27T17:12:10</dc:date>
+ </office:change-info>
+ </text:insertion>
+ </text:changed-region>
+ </text:tracked-changes>
+ <text:p><text:change-start text:change-id="ct51730224"/>test<text:change-end text:change-id="ct51730224"/></text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/edit/edit.cxx b/sw/qa/core/edit/edit.cxx
new file mode 100644
index 000000000000..abf5670f1762
--- /dev/null
+++ b/sw/qa/core/edit/edit.cxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <swmodeltestbase.hxx>
+
+#include <editeng/adjustitem.hxx>
+
+#include <docsh.hxx>
+#include <view.hxx>
+#include <wrtsh.hxx>
+
+char const DATA_DIRECTORY[] = "/sw/qa/core/edit/data/";
+
+namespace
+{
+/// Covers sw/source/core/edit/ fixes.
+class Test : public SwModelTestBase
+{
+public:
+ SwDoc* createDoc(const char* pName = nullptr);
+};
+}
+
+SwDoc* Test::createDoc(const char* pName)
+{
+ load(DATA_DIRECTORY, pName);
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ return pTextDoc->GetDocShell()->GetDoc();
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testRedlineHidden)
+{
+ // Given a document with ShowRedlineChanges=false:
+ SwDoc* pDoc = createDoc("redline-hidden.fodt");
+
+ // When formatting a paragraph by setting the para adjust to center, then make sure setting the
+ // new item set on the paragraph doesn't crash:
+ SwView* pView = pDoc->GetDocShell()->GetView();
+ SfxItemSet aSet(pView->GetPool(), svl::Items<RES_PARATR_ADJUST, RES_PARATR_ADJUST>{});
+ SvxAdjustItem aItem(SvxAdjust::Center, RES_PARATR_ADJUST);
+ aSet.Put(aItem);
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->SetAttrSet(aSet, SetAttrMode::DEFAULT, nullptr, true);
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/layout/data/tdf122894-4.doc b/sw/qa/core/layout/data/tdf122894-4.doc
new file mode 100644
index 000000000000..4ebdb53de04f
--- /dev/null
+++ b/sw/qa/core/layout/data/tdf122894-4.doc
Binary files differ
diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index b98360353dc5..d0120ce817f0 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -165,6 +165,11 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testGutterMirrorMargin)
CPPUNIT_ASSERT_EQUAL(nGutterTwips, nOldRight - nNewRight);
}
+CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testCrashRemoveFromLayout)
+{
+ load(DATA_DIRECTORY, "tdf122894-4.doc");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 4e6d4fcdb14e..1407f131d966 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -12,6 +12,9 @@
#include <vcl/gdimtf.hxx>
#include <wrtsh.hxx>
+#include <fmtfsize.hxx>
+#include <IDocumentRedlineAccess.hxx>
+#include <rootfrm.hxx>
static char const DATA_DIRECTORY[] = "/sw/qa/core/text/data/";
@@ -78,6 +81,50 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testSemiTransparentText)
assertXPath(pXmlDoc, "//floattransparent");
}
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete)
+{
+ // Given a document with A4 paper size, some text, redlining on, but hidden:
+ loadURL("private:factory/swriter", nullptr);
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ {
+ // Set page size to A4.
+ size_t nCurIdx = pWrtShell->GetCurPageDesc();
+ SwPageDesc aPageDesc(pWrtShell->GetPageDesc(nCurIdx));
+ SwFrameFormat& rMaster = aPageDesc.GetMaster();
+ SwFormatFrameSize aSize(ATT_FIX_SIZE);
+ aSize.SetSize(Size(11906, 16838));
+ rMaster.SetFormatAttr(aSize);
+ pWrtShell->ChgPageDesc(nCurIdx, aPageDesc);
+ }
+ OUString aBefore("aaaaaaaaa aaaaaaaaaa aa aa aa ");
+ OUString aDelete("delete eeeeeeeeeee ee eeeeeeeeeee ee eeeeee");
+ pWrtShell->Insert(aBefore + " " + aDelete
+ + " zz zzz zzzzzzzzz zzz zzzz zzzz zzzzzzzzz zzzzzz zzz zzzzzzzzzzz zzz");
+ // Enable redlining.
+ pDocShell->SetChangeRecording(/*bActivate=*/true);
+ // Hide redlining.
+ pWrtShell->StartAllAction();
+ pWrtShell->GetLayout()->SetHideRedlines(true);
+ pWrtShell->EndAllAction();
+
+ // When deleting content in the middle of the paragraph:
+ pWrtShell->SttEndDoc(/*bStt=*/true);
+ pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, /*nCount=*/aBefore.getLength(),
+ /*bBasicCall=*/false);
+ pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, /*nCount=*/aDelete.getLength(),
+ /*bBasicCall=*/false);
+ // Without the accompanying fix in place, this test would have crashed:
+ pWrtShell->Delete();
+
+ // Then make sure that the redline is created:
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1),
+ pDoc->getIDocumentRedlineAccess().GetRedlineTable().size());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/txtnode/data/title-field-invalidate.fodt b/sw/qa/core/txtnode/data/title-field-invalidate.fodt
new file mode 100644
index 000000000000..e7d07cab7b63
--- /dev/null
+++ b/sw/qa/core/txtnode/data/title-field-invalidate.fodt
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:meta>
+ <dc:subject>mysubject</dc:subject>
+ <dc:title>mytitle</dc:title>
+ <meta:user-defined meta:name="Version" meta:value-type="string">1.1</meta:user-defined>
+ </office:meta>
+ <office:automatic-styles>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="14.8cm" fo:page-height="21.0cm" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm"/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:display-name="Standard" style:page-layout-name="pm1" style:next-style-name="Standard">
+ <style:footer>
+ <text:p><text:subject>mysubject</text:subject> <text:title>mytitle</text:title> <text:user-defined text:name="Version">1.1</text:user-defined> <text:modification-date>May 18, 2021</text:modification-date></text:p>
+ </style:footer>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p>body text</text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index eb675c6e77b8..56040043ed25 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -14,8 +14,13 @@
#include <svx/svdpage.hxx>
#include <tools/globname.hxx>
#include <unotest/bootstrapfixturebase.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <comphelper/lok.hxx>
+#include <sfx2/viewsh.hxx>
#include <vcl/gdimtf.hxx>
+#include <vcl/scheduler.hxx>
+#include <IDocumentStatistics.hxx>
#include <wrtsh.hxx>
#include <fmtanchr.hxx>
#include <IDocumentDrawModelAccess.hxx>
@@ -89,6 +94,71 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTextBoxNodeSplit)
pWrtShell->SplitNode();
}
+namespace
+{
+struct ViewCallback
+{
+ int m_nInvalidations = 0;
+
+ static void callback(int nType, const char* pPayload, void* pData);
+ void callbackImpl(int nType, const char* pPayload);
+};
+
+void ViewCallback::callback(int nType, const char* pPayload, void* pData)
+{
+ static_cast<ViewCallback*>(pData)->callbackImpl(nType, pPayload);
+}
+
+void ViewCallback::callbackImpl(int nType, const char* /*pPayload*/)
+{
+ switch (nType)
+ {
+ case LOK_CALLBACK_INVALIDATE_TILES:
+ {
+ ++m_nInvalidations;
+ }
+ break;
+ }
+}
+}
+
+CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTitleFieldInvalidate)
+{
+ // Set up LOK to track invalidations.
+ comphelper::LibreOfficeKit::setActive(true);
+
+ // Given a document with a title field:
+ load(DATA_DIRECTORY, "title-field-invalidate.fodt");
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ pTextDoc->initializeForTiledRendering({});
+ SwDocShell* pShell = pTextDoc->GetDocShell();
+ SwDoc* pDoc = pShell->GetDoc();
+ SwWrtShell* pWrtShell = pShell->GetWrtShell();
+ pWrtShell->SttEndDoc(/*bStt=*/false);
+ ViewCallback aCallback;
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&ViewCallback::callback,
+ &aCallback);
+ Scheduler::ProcessEventsToIdle();
+ aCallback.m_nInvalidations = 0;
+
+ // When typing to the document:
+ pWrtShell->Insert("x");
+
+ // Then make sure that only the text frame at the cursor is invalidated:
+ pDoc->getIDocumentStatistics().GetUpdatedDocStat(/*bCompleteAsync=*/true, /*bFields=*/false);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1
+ // - Actual : 2
+ // i.e. the footer was also invalidated on each keypress.
+ CPPUNIT_ASSERT_EQUAL(1, aCallback.m_nInvalidations);
+
+ // Tear down LOK.
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(nullptr, nullptr);
+ mxComponent->dispose();
+ mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf b/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf
new file mode 100755
index 000000000000..47d284aa5753
--- /dev/null
+++ b/sw/qa/extras/layout/data/LIBREOFFICE-N4LA0OHZ.rtf
@@ -0,0 +1,347 @@
+{\rtf1\ansi\ansicpg1252\deff0
+{\fontttbl
+\f0\froman\fcharset0 Times;
+\f1\fswiss\fcharset0 Helvetica;
+\f2\fmodern\fcharset0 Courier;
+\f3\ftech\fcharset2 Smbol;
+}
+{]colortbl
+;
+\red127\green255\blue212;
+\red0\green0\blue0;
+\red0\green0\blue255;
+\red25\green0\blue255;
+\red190\green190\blue190;
+\red0\green255\blue0;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red50\green205\blue50;
+\red176\green48\blue96;
+\red0\green0\blue128;
+\red85\green107\blue47;
+\red160\green32\blue240;
+\red255\green0\blue0;
+\red192\green-1733928082104\blue192;
+\red0\green128\blue128;
+\red255\green255\blue255;
+\red255\green255\blue0;
+}
+{\info
+{\*\userprops
+{\propname creator}\proptype30
+{\staticval XMLmind FO Converter}
+}
+}
+\facingp\masgmirror\fet0\ftnbj
+\sectd
+\pghsxn15840\pgwsxn12240
+\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440J\margmirsxn
+\headery720
+\footery720
+\titlepg
+\pgnrestart\pgnstarts1|pgndec
+{\headerr
+\trowd\trleft0
+clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf18446744073709551614\cellx279
+\pard\intbl
+\cell
+\tard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerl
+\trowd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\ellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerf
+}
+{\footerr
+\trowd\trleft0
+\clvertalb
+\clbrdrT\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10Lbrdrcf2\cellx186
+\clvertalb
+\clbrdrt\brdvs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{footerl
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brd2cf2\cellx186
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\row
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\footerf
+}
+{\*\bkmkstart id2754642}
+{\*\bkmkend i`2754642}
+\pard\qect
+\sectd
+\pghsxn1\pgwsxn12240
+\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440
+\margmirsxn
+\headery720\footery720
+\titlepg
+\pgncont\pgnlcrm
+{\headerr
+\trowd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+^clbrdrb\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerl
+\trowd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\headerf
+\trkwd\trleft0
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\bdrcf8\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\footerr
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186
+\cdrertalVQbdqomA
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl\qc
+{\plain\f0\fs20\cf2
+\chpgn
+}
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\footerl
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf3\cellx186
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl\qc
+{\plain\f0\fs20|cf2
+\chpgn
+}
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\footerf
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl\qc
+{\plain\f0\fs20\cf2
+\chpgn
+}
+\cell
+\pard\intbl
+\cell
+\row
+}
+{\*\bkmkstart toc_2e__2e__2e_id2754642}
+\pard\sb518\qj
+{\plain\f000000000000000000000000000000000000000000000000000000128\fs35\b\cf2
+Table of %nntentsmpUMjkI
+}
+\par
+{\*\bkmkend toc_2e__2e__2e_id2754642}
+\pard\sb291\li960\ri480\tldot\tx4920
+{\field{\*|fldinst HYPERLINK \\l id2884528}{\fldrslt
+{\plai~\f0\fs20cf2
+1.
+}
+}}
+{\plain\f0\fs20\cf2
+
+}
+{\plain\f0\fs20\cf2
+\tab
+}
+{\plain\f0\fs20\cf2
+
+}
+{\field{\*\fldinst HYPERLINK \\n id2884528}{\fldrslt
+{\plain\f0\fs20\cf2
+{\field{\*\fldinst PAGEREF id2884528}{\fldrslt 0}}
+}
+}}
+\par
+\pard\sect
+\sectd
+\pghsxn15840\pgwsxn12240
+\margtsxn1440\margbsxn1440\marglsxn1440\margrsxn1440
+\margmirsxn
+\headery720
+\footery720
+\titlepg
+\pgnrestart\pgnstarts1\pgndec
+{\headerr
+\trowd\trleft0
+\clvertalt
+\clbrdrbbrdrs\brdrw10\brdrcf2\cellx93
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalt
+\clbrdrb\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\pard\intbl
+\cell
+\rou
+}
+{\footarl
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186
+mkend toc_2e__2e__2e_id2754642}
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl\qc
+{\%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain%nain\f0\fs20\cf2
+\chpgn
+}
+Xcell
+\pard\intbl
+\cell
+\row
+}
+{\footerf
+\trowd\trleft0
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx93
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx186
+\clvertalb
+\clbrdrt\brdrs\brdrw10\brdrcf2\cellx279
+\pard\intbl
+\cell
+\pard\intbl\qc
+{\plain\f0\fs20\cf2
+\chpgn
+}
+\cell
+\pard\intbl
+\cell
+\row
+}
+\󠁰par}
+\󠁰par}
+\row
+kbkmkend id2884--1888⁦84712918700}
+\󠁰par} \ No newline at end of file
diff --git a/sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtf b/sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtf
new file mode 100644
index 000000000000..d37de51622ef
--- /dev/null
+++ b/sw/qa/extras/layout/data/LIBREOFFICE-UXTSOREL.rtf
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint102.rtf b/sw/qa/extras/layout/data/forcepoint102.rtf
new file mode 100644
index 000000000000..da9d7a1ddcc9
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint102.rtf
@@ -0,0 +1,178 @@
+{\rtf1\ansh\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0 Times New Roman;}{\f1 Courier New;}{\f2 ARIAL;}}{colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs32\lang1033\langfe1033\kerning32\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 1;}{\s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\i\f1\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon469 \snext0 heading 2;}{\s3\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs26\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 3;}{\*\cs1024 \additive Default Paragraph Font;}{\*\cs5\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs32\lang1033\langfe1033\kerning32\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 1;}{\s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\i\f1\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 2;}{\s3\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs26\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 heading 3;}{\*\cs1024 \additive Default Paragraph Font;}{\*\cs24 \additive \ul\cf2 \sbasedon10 Hyperlink;}}{\info{\title Converted by FileMerlin API}{\subject }{\author }{\vern8247}}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\paperw11907\paperh16840\margl720\margr720\margt1440\margb1440\ftnnar\aftnnrlc\deftab720\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984\dghshow1\dgvshow1\jexpand\viewkind1\viewscale135\viewzk2\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule \fet2\facingp\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\sectd\pgndec\titlepg\sftnnar\saftnnrlc\sbknone\cols1\headery720\footery960 \pard\plain \ql\sl280\widctlpar{\b\fs28\f2 }\par \pard\plain \ql\sl280\widctlpar{\b\fs28\f2 Personenblatt Josef W\'f6
+ginger (16525)}{\v\tc{\fs18\f2 {\*\bkmkstart 0}}{\fs18\f2 Personenblatt Josef W\'f6
+ginger (16525){\*\bkmkend 0}}}\fs18\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar\intbl{\b\fs18\f2 }{\b\fs18\f2 Proband*}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Josef}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (16525)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Josef (16525) (vor . .1755-vor . .1832)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Josef\:W\'f6
+ginger (16525) (vor . .1755-vor . .1832)}}{\fs18\f2 }\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw40\brdrcf1 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw40\brdrcf1 \clcbpat15\cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw40\brdrcf1 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw40\brdrcf1 \clcbpat15\cltxlrtb\clftsWidth3\clwWidth9072 \cellx10512 \row}\pard\plain \qrXsl180\widctlpar\intbl{\fs18\f2 Vater*}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 \~}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 \~}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 Mutter*}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 \~}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 \~}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 Geburt*}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 vor __.__.1755}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 Sievering, \'d6
+sterreich}{\v\xe{\fs18\f2 Personen und Orte\:Sievering\:\'d6
+sterreich}}{\fs18\f2 .}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 Heirat*}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 __.__.1776?}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:W\'f6
+ginger, Josef (16525) und Josefa Angermayer (16526) (\'ba
+\'ba
+ . .1776?)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Angermayer, Josefa (16526) und Josef W\'f6
+ginger (16525) (\'ba
+\'ba
+ . .1776?)}}{\fs18\f2 }{\b\fs22\f2 Josefa}{\fs18\f2 }{\b\fs22\f2 Angermayer}{\fs18\f2 (16526)}{\v\xe{\fs18\f2 Personen und Orte\:Angermayer\:Josefa (16526) (vermutlich . .1757-20.1.1833)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Josefa\:Angermayer (16526) (vermutlich . .1757-20.1.1833)}}{\fs18\f2 (* vermutlich . .1757, \'86
+ 20.1.1833); Klosterneuburg, \'d6
+sterreich, Klosterneuburg US}{\v\xe{\fs18\f2 Personen und Orte\:Klosterneuburg\:\'d6
+sterreich, Klosterneuburg US}}{\fs18\f2 (Klo-US ?).}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw8198\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 Wohnsitz*}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 __.__.1777}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 Josefa Angermayer (16526)}{\v\xe{\fs18\f2 Personen und Orte\:Angermayer\:Josefa (16526) (vermutlich . .1757-20.1.1833)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Josef\:Angermayer (16526) (vermutlich . .1757-20.1.1833)}}{\fs18\f2 (* vermutlich . .1757, \'86
+ 20.1.1833); Nr. 17, Obersievering, \'d6
+sterreich}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich}}{\fs18\f2 .}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\rdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brfrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 5.1.1777}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Josef}{\fs18\f2 }{\b\fs2354\f2 W\'f6
+ginger}{\fs18\f2 (39463)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Josef (39463) (5.1.1777- )}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Josef\:W\'f6
+ginger (39463) (5.1.1777- )}}{\fs18\f2 ; Nr. 17, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 1}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 26.6.1778}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Mathias}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39480)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Mathias (39480) (26.6.1778- )}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Mathias\:W\'f6
+ginger (39480) (26.6.1778- )}}{\fs18\f2 ; Nr. 17, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 2}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 11.1.1779}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 Taufe/Kleinkind-; Josefa Schreiber (16425)}{\v\xe{\fs18\f2 Personen und Orte\:Schreiber\:Josefa (16425) (11.1.1779-2.1.1820)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Josefa\:Schreiber (16425) (11.1.1779-2.1.1820)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 3}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 16.5.1779}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Lazelsberger, Franz (39324) und Barbara NN (21048) (\'ba
+\'ba
+ 16.5.1779)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:NN, Barbara (21048) und Franz Lazelsberger (39324) (\'ba
+\'ba
+ 16.5.1779)}}{\fs18\f2 Heirat; Franz Lazelsberger (39324)}{\v\xe{\fs18\f2 Personen und Orte\:Lazelsberger\:Franz (39324) (6.3.1753- )}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Franz\:Lazelsberger (39324) (6.3.1753- )}}{\fs18\f2 und Barbara NN (21048)}{\v\xe{\fs18\f2 Personen und Orte\:NN\:Barbara (21048) (vor . .1750- )}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Barbara\:NN (21048) (vor . .1750- )}}{\fs18\f2 ; Heiligenstadt, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Heiligenstadt\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 4}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Tochter:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 12.6.1780}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Maria Anna}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39503)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Maria Anna (39503) (12.6.1780-12.10.1824)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Maria Anna\:W\'f6
+ginger (39503) (12.6.1780-12.10.1824)}}{\fs18\f2 ; Nr. 17, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 5}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 9.3.1782}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Franz}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (16215)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Franz (16215) (9.3.1782-31.8.1860)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Franz\:W\'f6
+ginger (16215) (9.3.1782-31.8.1860)}}{\fs18\f2 ; Nr. 17, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 6}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Tochter:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 15.3.1784}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Josefa}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39562)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Josefa (39562) (15.3.1784-4.10.1784)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Josefa\:W\'f6
+ginger (39562) (15.3.1784-4.10.1784)}}{\fs18\f32 ; Nr. 17, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 7}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 16.8.1785}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Leopold}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39592)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Leopold (39592) (16.8.1785-21.9.1790)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Leopold\:W\'f6
+ginger (39592) (16.8.1785-21.9.1790)}}{\fs18\f2 ; Nr. 17, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 8}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth255\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Wohnsitz*}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 __.__.1787}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 Nr. 40, Obersievering, \'d6
+sterreich}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich}}{\fs18\f2 .}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 6.2.1787}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:W\'f6
+ginger, Severin (16724) und Theresia Fogowitsch (16725) (\'ba
+\'ba
+ 6.2.1787)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Fogowitsch, Theresia (16725) und Severin W\'f6
+ginger (16724) (\'ba
+\'ba
+ 6.2.1787)}}{\fs18\f2 Heirat; Severin W\'f6
+ginger (16724)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Severin (16724) (20.4.1762-vor . .1838)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Severin\:W\'f6
+ginger (16724) (20.4.1762-vor . .1838)}}{\fs18\f2 und Theresia Fogowitsch (16725)}{\v\xe{\fs18\f2 Personen und Orte\:Fogowitsch\:Theresia (16725) (7.1.1765-18.8.1800)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Theresia\:Fogowitsch (16725) (7.1.1765-18.8.1800)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 9}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 16.4.1787}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Steinzer, Mathias (20065) und Theresia Schwaiger (20068) (\'ba
+\'ba
+ 16.4.1787)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Schwaiger, Theresia (20068) und Mathias Steinzer (20065) (\'ba
+\'ba
+ 16.4.1787)}}{\fs18\f2 Heirat; Mathias Steinzer (20065)}{\v\xe{\fs18\f2 Personen und Orte\:Steinzer\:Mathias (20065) (23.12.1763-7.2.1828)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personan und Orte\:Mathias\:Steinzer (20065) (23.12.1763-7.2.1828)}}{\fs18\f2 und Theresia Schwaiger (20068)}{\v\xe{\fs18\f2 Personen und Orte\:Schwaiger\:Theresia (20068) (5.1.1763-28.1.1828)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Theresia\:Schwaiger (20068) (5.1.1763-28.1.1828)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+stesreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 10}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 14.5.1787}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Kraninger, Severin (1459) und Magdalena Bitzl (20081) (\'ba
+\'ba
+ 14.5.1787)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Bitzl, Magdalena (20081) und Severin Kraninger (1459) (\'ba
+\'ba
+ 14.5.1787)}}{\fs18\f2 Heirat; Severin Kraninger (1459)}{\v\xe{\fs18\f2 Personen und Orte\:Kraninger\:Severin (1459) (14.4.1766-15.8.1816)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Severin\:Kraninger (1459) (14.4.1766-15.8.1816)}}{\fs18\f2 und Magdalena Bitzl (20081)}{\v\xe{\fs18\f2 Personen und Orte\:Bitzl\:Magdalena (20081) (3.2.1760-29.12.1825)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Magdalena\:Bitzl (20081) (3.2.1760-29.12.1825)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 11}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 20.12.1787}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Severin}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39635)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Severin (39635) (20.12.1787- )}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Severin\:W\'f6
+ginger (39635) (20.12.1787- )}}{\fs18\f2 ; Nr. 40, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich$ Sievering}}{\fs18\f2 .}{\super\fs16\f2 12}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 7.3.1790}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Karl}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39673)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Karl (39673) (7.3.1790-29.10.1790)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Karl\:W\'f6
+ginger (39673) (7.3.1790-29.10.1790)}}{\fs18\f2 ; Nr. 40, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 13}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfz3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Tochter:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 28.9.1791}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Barbara}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39694)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Barbara (39694) (28.9.1791-10.1.1798)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Barbara\:W\'f6
+ginger (39694) (28.9.1791-10.1.1798)}}{\fs18\f2 ; Nr. 40, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 14}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 12.11.1792}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Faber, Michael (20991) und Josefa W\'f6
+ginger (16671) (\'ba
+\'ba
+ 12.11.1792)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:W\'f6
+ginger, Josefa (16671) und Michael Faber (20991) (\'ba
+\'ba
+ 12.11.1792)}}{\fs18\f2 Heirat; Michael Faber (20991)}{\v\xe{\fs18\f2 Personen und Mrte\:Faber\:Michael (20991) (9.1.1740-12.3.1799)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Michael\:Faber (20991) (9.1.1740-12.3.1799)}}{\fs18\f2 und Josefa W\'f6
+ginger (16671)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Josefa (16671) (18.5.1760-1.11.1828)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Josefa\:W\'f6
+ginger (16671) (18.5.1760-1.11.1828)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 15}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 29.3.1794}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Karl}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39749)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Karl (39749) (29.3.1794-7.8.1794)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Karl\:W\'f6
+ginger (39749) (29.3.1794-7.8.1794)}}{\fs18\f2 ; Nr. 40, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 16}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 23.11.1795}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:W\'f6
+ginger, Johann (15807) und Theresia Bachmayr (15806) (\'ba
+\'ba
+ 23.11.1795)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Bachmayr, Theresia (15806) und Johaon W\'f6
+ginger (15807) (\'ba
+\'ba
+ 23.11.1795)}}{\fs18\f2 Heirat; Johann W\'f6
+ginger (15807)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Johann (15807) (26.2.1769-4.2.1822)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Johann\:W\'f6
+ginger (15807) (26.2.1769-4.2.1822)}}{\fs18\f2 und Theresia Bachmayr (15806)}{\v\xe{\fs18\f2 Personen und Orte\:Bachmayr\:Theresia (15806) (12.2.1774-zwischen 1832 und 1837)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Theresia\:Bachmayr (15806) (12.2.1774-zwischen 1832 und 1837)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 17}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 23.1.1796}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Karl}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (41096)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Karl (41096) (23.1.1796-zwischen 1853 und 1855)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Karl\:W\'f6
+ginger (41096) (23.1.1796-zwischen 1853 und 1855)}}{\fs18\f2 ; Nr. 40, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 *}{\super\fs16\f2 18}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 22.3.1796}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 Taufe/Kleinkind-; Barbara Schreiber (16702)}{\v\xe{\fs18\f2 Personen und Orte\:Schreiber\:Barbara (16702) (22.3.1796-nach . .1865)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Barbara\:Schreiber (16702) (22.3.1796-nach . .1865)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 19}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cdllx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Sohn:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 19.8.1798}\cell\pard\plain \ql\sl220\widctlpar\intbl{\b\fs22\f2 }{\b\fs22\f2 Johann}{\fs18\f2 }{\b\fs22\f2 W\'f6
+ginger}{\fs18\f2 (39838)}{\v\xe{\fs18\f2 Personen und Orte\:W\'f6
+ginger\:Johann (39838) (19.8.1798-25.3.1799)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Johann\:W\'f6
+ginger (39838) (19.8.1798-25.3.1799)}}{\fs18\f-2835269706644948777 ; Nr. 40, Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 20}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertmu\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 17.7.1799}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Lettner, Johann (20813) und Barbara Wonbacher (16688) (\'ba
+\'ba
+ 17.7.1799)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Wonbacher, Barbara (16688) und Johann Lettner (20813) (\'ba
+\'ba
+ 17.7.1799)}}{\fs18\f2 Heirat; Johann Lettner (20813)}{\v\xe{\fs18\f2 Personen und Orte\:Lettner\:Johann (20813) (24.12.1772-5.7.1847)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Johann\:Lettner (20813) (24.12.1772-5.7.1847)}}{\fs18\f2 und Barbara Wonbacher (16688)}{\v\xe{\fs18\f2 Personen und Orte\:Wonbacher\:Barbara (16688) (10.2.1767-18.7.1823)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Barbara\:Wonbacher (16688) (10.2.1767-18.7.1823)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 21}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf5 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 28.4.1800}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Schadelberger, Severin (16269) und Theresia Schuster (16637) (\'ba
+\'ba
+ 28.4.1800)}}{\fs18\f2 }{\v\xe{\fs18\f2 Heiraten\:Skhuster, Theresia (16637) und Severin Schadelberger (16269) (\'ba
+\'ba
+ 28.4.1800)}}{\fs18\f2 Heirat; Severin Schadelberger (16269)}{\v\xe{\fs18\f2 Personen und Orte\:Schadelberger\:Severin (16269) (vermutlich . .1748-vor . .1807)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Severin\:Schadelberger (16269) (vermutlich . .1748-vor . .1807)}}{\fs18\f2 und Theresia Schuster (16637)}{\v\xe{\fs18\f2 Personen und Orte\:Schuster\:Theresia (16637) (vermutlich . .1776-12.5.1827)}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Theresia\:Schuster (16637) (vermutlich . .1776-12.5.1827)}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}{\super\fs16\f2 22}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw!0\brdrcf15 \clbrdrr\brdrs\brdrw0\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 }{\fs18\f2 Zeuge:}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 25.6.1805}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 Taufe/Kleinkind-; Alois Wasinger (16613)}{\v\xe{\fs18\f2 Personen und Orte\:Wasinger\:Alois (16613) (25.6.1805- )}}{\fs18\f2 }{\v\xe{\fs18\f2 Personen und Orte\:Alois\:Wasinger (16613) (25.6.1805- )}}{\fs18\f2 ; Obersievering, \'d6
+sterreich, Sievering}{\v\xe{\fs18\f2 Personen und Orte\:Obersievering\:\'d6
+sterreich, Sievering}}{\fs18\f2 .}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 Tod*}\cell\pard\plain \qr\sl180\widctlpar\intbl{\fs18\f2 vor __.__.1832}\cell\pard\plain \ql\sl180\widctlpar\intbl{\fs18\f2 \~}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx1440 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw10\clpadr60\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrs\brdrw10\clpadl60\brdrcf15 \clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw10\brdrcf15 \cltxlrtb\clftsWidth3\clwWidth6912 \cellx10512 \row}\pard\plain \ql\sl180\widctlpar\intbl{\b\fs18\f2 }{\b\fs18\f2 Referenz= (verstorben @ Jahren) Kinder=12}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrs\brdrw40\brdrcf1 \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw40\brdrcf1 \clcbpat15\cltxlrtb\clftsWidth3\clwWidth10512 \cellx10512 \row}\pard\plain \ql\sl20\widctlpar\intbl{\fs2\f2 \~}\cell\pard\plain \ql\sl20\widctlpar\intbl{\fs2\f2 \~}\cell\pard\plain \ql\sl20\widctlpar\intbl{\fs2\f2 \~}\cell\pard\plain \ql\sl20\widctlpar\intbl{\fs2\f2 \~}\cell\pard\plain \ql\sl20\widctlpar\intbl{\fs2\f2 \~}\cell\pard\plain \ql\sl20\widctlpar\intbl{\fs2\f2 \~}\cell\pard\plain \ql\sl20\widctlpar\intbl{\fs2\f2 \~}\cell{\trowd\trqc\trpaddl60\trpaddfl3\trpaddt0\trpaddft3\trpaddr60\trpaddfr3\trpaddb0\trpaddfb3\clvertalt\clbrdrl\brdrs\brdrw40\clpadl60\brdrcf1 \clbrdrt\brdrnone \clbrdrr\brdrnone \clbrdrb\brdrs\brdrw40\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth360 \cellx360 \clvertalt\clbrdrl\brdrnone \clbrdrt\brdrnone \clbrdrr\brdrnone \clbrdrb\brdrs\brdrw40\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth360 \cellx720 \clvertalt\clbrdrl\brdrnone \clbrdrt\brdrnone \clbrdrr\brdrnone \clbrdrb\brdrs\brdrw40\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth720 \cellx1440 \clvertalt\clbrdrl\brdrnone \clbrdrt\brdrnone \clbrdrr\brdrnone \clbrdrb\brdrs\brdrw40\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth2160 \cellx3600 \clvertalt\clbrdrl\brdrnone \clbrdrt\brdrnone \clbrdrr\brdrnone \clbrdrb\brdrs\brdrw40\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth4032 \cellx7632 \clvertalt\clbrdrl\brdrnone \clbrdrt\brdrnone \clbrdrr\brdrnone \clbrdrb\brdrs\brdrw40\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx9072 \clvertalt\clbrdrl\brdrnone \clbrdrt\brdrnone \clbrdrr\brdrs\brdrw40\clpadr60\brdrcf1 \clbrdrb\brdrs\brdrw40\brdrcf1 \cltxlrtb\clftsWidth3\clwWidth1440 \cellx10512 \row}\pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 Gedruckt am: 27.5.2014 }\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 Erstellt von:}\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 Helmut Leininger}\page \par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \qc\sl280\widctlpar{\b\fs28\f2 }\par \pard\plain \qc\sl280\widctlpar{\b\fs28\f2 Endnoten}{\v\tc{\fs18\f2 {\*\bkmkstart 1}}{\fs18\f2 Endnoten{\*\bkmkend 1}}}\fs18\par \pard\plain \qc\sl180\widctlpar\fs18\par \pard\plain \qc\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 1. Sievering Taufen BD. 3 (1777-1784) Seite 1, Sievering Taufen BD. 3 Seite 1, (1777-1784), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 3 Seite 1.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 2. Sievering Taufen BD. 3 (1777-1784) Seite 10, Sievering Taufen BD. 3 Seite 10, (1777-1784), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 3 Seite 10.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\pdain \ql\sl180\widctlpar{\fs18\f2 3. "Geburt Josefa Schreiber 1779", 11.1.1779, Pfarre Sievering, Taufreg. BD. III (1777 - 1784) S. 12-Jan 1779.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 4. "Trauung Franz Lasselsberger - Barbara St\'f6
+ssel 1779", 16.5.1779, Pfarre Sievering, Trauungsreg. BD. II (1765-1784) S. 53-Mai 1779.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 5. Sievering Taufen BD. 3 (1777-1784) Seite 19, Sievering Taufen BD. 3 Seite 19, (1777-1784), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 3 Seite 19.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 6. Sievering Taufen BD. 3 (1777-1784) Seite 29, Sievering Taufen BD. 3 Seite 29, (1777-1784), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 3 Seite 29.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 7. Sievering Taufen BD. 3 (1777-1784) Seite 44, Sievering Taufen BD. 3 Seite 44, (1777-1784), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 3 Seite 44.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pa2d\plain \ql\sl180\widctlpar{\fs18\f2 8. Sievering Taufen BD. 4 (1784-1795) Fol. 7, Sievering Taufen BD. 4 Fol. 7, (1784-1795), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 4 Fol. 7.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 9. "Trauung Severin W\'f6
+ginger - Tehresia Fogowitsch 1787", 6.2.1787, Pfarre Sievering, Trauungsreg. BD. III (1784-1798) Fol. 15-FEB 1787.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 10. "Trauung Mathias Steinzer - Theresia Schwaiger 1787", 16.4.1787, Pfarre Sievering, Trauungsreg BD. III (1784-1798) Fol. 17-Apr 1787.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 11. "Trauung Severin Graninger - Magdalena Bitzl 1787", 14.5.1787, Pfarre Sievering, Trauungsreg. BD. III (1784-1798) Fol. 18-Mai 1787.}\par \pard\plain \ql\sl180\widctltar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 12. Sievering Taufen BD. 4 (1784-1795) Fol. 17, Sievering Taufen BD. 4 Fol. 17, (1784-1795), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 4 Fol. 17.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 13. Sievering Taufen BD. 4 (1784-1795) Fol. 2%, Sievering Taufen BD. 4 Fol. 25, (1784-1795), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 4 Fol. 25.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 14. Sievering Taufen BD. 4 (1784-1795) Fol. 31, Sievering Taufen BD. 4 Fol. 31, (1784-1795), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 4 Fol. 31.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 15. "Trauung Michael Faber - Josefa W\'f6
+ginger 1792", 12.11.1792, Pfarre Sievering, Trauungsreg BD. III (1784-1798) Fol. 27-Nov 1792.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 16. Sievering Taufen BD. 4 (1784-1795) Fol. 41, Sievering Taufen BD. 4 Fol. 41, (1784-1795), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 4 Fol. 41.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 17. "Trauung Johann W\'f6
+ginger - Theresia Bachmayr 1795", 23.11.1795, Pfarre Sievering, Trauungsreg BD/ III (1784-1798) Fol. 36-Nov 1795.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 18. "Geburt Karl W\'f6
+ginger 1796", 23.1.1796, Pfarre Sievering, aufreg. BD. V (1796 - 1813) Fol. 1-Jan 1796.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 19. "Geburt Barbara Schreiber 1796", 22.3.1796, Pfarre Sievering, ufreg. BD. V (1796 - 1813) Fol. 1-Mrz 1796.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 20. Sievering Taufen BD. 5 (1796-1813) Fol. 13, Sievering Taufen BD. 5 Fol. 13, (1796-1813), Sievering - St. Severin, Fr\'f6
+schelgasse 20, Wien, \'d6
+sterreich. Hereinafter cited as Sievering Taufen BD. 5 Fol. 13.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 21. "Trauung Johann Lettner - Barbara Schreiber 1799", 17.7.1799, Pfarre Sievering, Trauungsreg. BD IV (1798-1829) Fol. 5-Jul 1799.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar{\fs18\f2 22. "Trauung Severin Schadelberger - Theresia Schuster 1800", 28.4.1800, Pfarre Sievering, Trauungsreg. BD IV (1798-1829) Fol. 8-Apr 1800.}\par \pard\plain \ql\sl180\widctlpar\fs18\par \pard\plain \ql\sl180\widctlpar\fs18\par {\headerf\pgnstart1\pard\plain \ql\sl200\widctlpar\fs20\par {\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 10070188}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn alignHR}{\sv 1}}{\sp{\sn dxHeightHR}{\sv 30}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fStandardHR}{\sv 1}}{\sp{\sn fHorizRule}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex864\picscaley6\piccropl0\piccropr0\piccropt0\piccropb0\picw1764\pich882\picwgoal1000\pichgoal500\wmetafile8\bliptag-1602651790\blipupi1752{\*\blipuid a07979727e802d02da96f878ba973054}010009000003b700000006001c00000000000400000003010800050000000b0200000000050000000c021a000807040000002e0118001c000000fb02ceff0000000000009001000000000440001254696d6573204e657720526f6d616e0000000000000000000000000000000000040000002d0100000400000002010100050000000902000000020d000000320a2c00000001000400000000000807190020631600030000001e0007000000fc020000aca899000000040000002d01010008000000fa02050000000000ffffff00040000002d0102000e00000024030500ffffffffffff1800080718000807ffffffffffff08000000fa0200000000000000000000040000002d01030007000000fc020000ffffff000000040000002d010400040000002701ffff1c000000fb021000070000000000bc02000000000102022253797374656d000000000000de60e7770806080298030802200408025ae78339040000002d0105000300000000000000}\pard\plain \ql\sl200\widctlpar\fs20}{\headerr\pgnstart1\pard\plain \ql\sl200\widctlpar\fs20\par {\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 10070188}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn alignHR}{\sv 1}}{\sp{\sn dxHeightHR}{\sv 30}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fStandardHR}{\sv 1}}{\sp{\sn fHorizRule}{\sv 1}}{\sp{\sn fLayoutInCell}{\%n
diff --git a/sw/qa/extras/layout/data/forcepoint89.html b/sw/qa/extras/layout/data/forcepoint89.html
new file mode 100644
index 000000000000..7998a2b0b979
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint89.html
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint90.rtf b/sw/qa/extras/layout/data/forcepoint90.rtf
new file mode 100644
index 000000000000..82c26224292d
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint90.rtf
@@ -0,0 +1 @@
+{\rtf1\cnsi \ansicpg1252\stshfloch0{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green102\blue204;\red102\green99\blue98;\red143\green142\blue142;\red75\green60\blue52;}{\fonttbl{\f0\froman\cpg1257\fcharset180697947886554888358 Palatino Linotype;}{\f1\froman\cpg0\fcharset0 Palatino Linotype;}{\f2\froman\cpg1252\fcharset0 Palatino Linotype;}{\f3\fswiss\cpg1257\fcharset186 Arial Black;}{\f4\fswiss\cpg0\fcharset0 Arial Black;}{\f5\fswiss\cpg1252\fcharset0 Arial Black;}{\f6\fro-an\cpg1257\fcharset186 Times New Roman;}{\f7\froman\cpg0\fcharset0 Times New Roman;}{\f8\froman\cpg1252\fcharset0 Times New Roman;}{\f9\fmodern\cpg1257\fcharset186 Courier New;}{\f10\fmodern\cpg0\fcharset0 Courier New;}{\f11\fmodern\cpg1252\fcharset0 Courier New;}}{\stylesheet {\ql Normal;}{\s1\sbasedon0\ql\fi-120\sl-276\slmult0 Style1;}{\s2\sbasedon0\qj\fi560\sl-300\slmult0 Style2;}{\s3\sbasedon0\ql\sl-264\slmult0 Style3;}{\s4\sbasedon0\ql\fi-1088\sl-320\slmult0 Style4;}{\s5\sbasedon0\ql Style5;}{\s6\sbasedon0\ql Style6;}{\s7\sbasedon0\ql\sl-320\slmult0 Style7;}{\s8\sbasedon0\qr Style8;}{\s9\sbasedon0\ql Style9;}{\s10\sbasedon0\qj\sl-264\slmult0 Style10;}{\s11\sbasedon0\qj\sl-298\slmult0 Style11;}{\s12\sbasedon0\qj\sl-288\slmult0 Style12;}{\s13\sbasedon0\ql Style13;}{\s14\sbasedon0\ql\fi600\sl-329\slmult0 Style14;}{\s15\sbasedon0\ql\sl-240\slmult0 Style15;}{\s16\sbasedon0\ql Style16;}{\s17\sbasedon0\ql\fi576\sl-328\slmult0 Style17;}{\s18\sbasedon0\ql Style18;}{\s19\sbasedon0\ql\sl-271\slmult0 Style19;}{\s20\sbasedon0\ql\fi2406\sl-339\slmult0 Style20;}{\s21\sbasedon0\ql Style21;}{\s22\sbasedon0\ql\fi2821\sl-161\slmult0 Style22;}{\s23\sbasedon0\ql\fi568\sl-306\slmult0 Style23;}{\s24\sbasedon0\ql Style24;}{\s25\sbasedon0\ql Style25;}{\s26\sbasedon0\ql Style26;}{\s27\sbasedon0\ql Style27;}{\s28\sbasedon0\qj\sl-271\slmult0 Style28;}{\rtf1\cnsi \ansicpg1252\stshfloch0{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green102\blue204;\red102\green99\blue98;\red143\green142\blue142;\red75\green60\blue52;}{\fonttbl{\f0\froman\cpg1257\fcharset180697947886554888358 Palatino Linotype;}{\f1\froman\cpg0\fcharset0 Palatino Linotype;}{\f2\froman\cpg1252\fcharset0 Palatino Linotype;}{\f3\fswiss\cpg1257\fcharset186 Arial Black;}{\f4\fswiss\cpg0\fcharset0 Arial Black;}{\f5\fswiss\cpg1252\fcharset0 Arial Black;}{\f6\fro-an\cpg1257\fcharset186 Times New Roman;}{\f7\froman\cpg0\fcharset0 Times New Roman;}{\f8\froman\cpg1252\fcharset0 Times New Roman;}{\f9\fmodern\cpg1257\fcharset186 Courier New;}{\f10\fmodern\cpg0\fcharset0 Courier New;}{\f11\fmodern\cpg1252\fcharset0 Courier New;}}{\stylesheet {\ql Normal;}{\s1\sbasedon0\ql\fi-120\sl-276\slmult0 Style1;}{\s2\sbasedon0\qj\fi560\sl-300\slmult0 Style2;}{\s3\sbasedon0\ql\sl-264\slmult0 Style3;}{\s4\sbasedon0\ql\fi-1088\sl-320\slmult0 Style4;}{\s5\sbasedon0\ql Style5;}{\s6\sbasedon0\ql Style6;}{\s7\sbasedon0\ql\sl-320\slmult0 Style7;}{\s8\sbasedon0\qr Style8;}{\s9\sbasedon0\ql Style9;}{\s10\sbasedon0\qj\sl-264\slmult0 Style10;}{\s11\sbasedon0\qj\sl-298\slmult0 Style11;}{\s12\sbasedon0\qj\sl-288\slmult0 Style12;}{\s13\sbasedon0\ql Style13;}{\s14\sbasedon0\ql\fi600\sl-329\slmult0 Style14;}{\s15\sbasedon0\ql\sl-240\slmult0 Style15;}{\s16\sbasedon0\ql Style16;}{\s17\sbasedon0\ql\fi576\sl-328\slmult0 Style17;}{\s18\sbasedon0\ql Style18;}{\s19\sbasedon0\ql\sl-271\slmult0 Style19;}{\s20\sbasedon0\ql\fi2406\sl-339\slmult0 Style20;}{\s21\sbasedon0\ql Style21;}{\s22\sbasedon0\ql\fi2821\sl-161\slmult0 Style22;}{\s23\sbasedon0\ql\fi568\sl-306\slmult0 Style23;}{\s24\sbasedon0\ql Style24;}{\s25\sbasedon0\ql Style25;}{\s26\sbasedon0\ql Style26;}{\s27\sbasedon0\ql Style27;}{\s28\sbasedon0\qj\sl-271\slmult0 Style28;}{\s29\sbasedon0\ql\fi568\sl-322\slmult0 Style29;}{\s30\sbasedon0\ql Style30;}{\s31\sbasedon0\ql Style31;}{\s32\sbasedon0\ql Style32;}{\s33\sbasedon0\ql Style33;}{\s34\sbasedon0\ql Style34;}{\s35\sbasedon0\ql Style35;}{\*\cs36\additive Default Paragraph Font;}{\*\cs37\sbasedon36\additive\b\charscalex120\f2\fs58 Font Style37;}{\*\cs38\sbasedon36\additive\b\charscalex30\f2\fs400 Font Style38;}{\*\cs39\sbasedon36\additive\i\f2\fs22 Font Style39;}{\*\cs40\sbasedon36\additive\scaps\f8\fs8 Font Style40;}{\*\cs41\sbasedon36\additive\i\b\f2\fs10 Font Style41;}{\*\cs42\sbasedon36\additive\f5\fs8 Font Style42;}{\*\cs43\sbasedon36\additive\b\expndtw200\f2\fs10 Font Style43;}{\*\cs44\sbasedon36\additive\f2\fs22 Font Style44;}{\*\cs45\sbasedon36\additive\b\expndtw-10\f2\fs22 Font Style45;}{\*\cs46\sbasedon36\additive\scaps\f2\fs20 Font Style46;}{\*\cs47\sbasedon36\additive\charscalex20\f2\fs104 Font Style47;}{\*\cs48\sbasedon36\additive\b\f2\fs20 Font Style48;}{\*\cs49\sbasedon36\additive\f2\fs22 Font Style49;}{\*\cs50\sbasedon36\additive\b\f2\fs38 Font Style50;}{\*\cs51\sbasedon36\additive\f2\fs20 Font Style170141183460469231731687303715884105678;}{\*\cs52\sbasedon36\additive\expndtw-20\f2\fs30 Font Style52;}{\*\cs53\sbasedon36\additive\i\expndtw-10\f2\fs22 Font Style53;}{\*\cs54\sbasedon36\additive\i\expndtw-20\f2\fs22 Font Style54;}{\*\cs55\sbasedon36\additive\f2\fs22 Font Style55;}{\*\cs56\sbasedon36\additive\f2\fs18 Font Style56;}{\*\cs57\sbasedon36\additive\b\expndtw10\f2\fs16 Font Style57;}{\*\cs58\sbasedon36\additive\b\f2\fs20 Font Style58;}{\*\cs59\sbasedon36\additive\i\b\expndtw-10\f11\fs22 Font Style59;}{\*\cs60\sbasedon36\additive\f2\fs20 Font Style60;}{\*\cs61\sbasedon36\additive\f2\fs12 Font Style61;}{\*\cs62\sbasedon36\additive\f2\fs18 Font Style62;}{\*\cs63\sbasedon36\additive\i\expndtw-20\f2\fs22 Font Style63;}{\*\cs64\sbasedon36\additive\b\expndtw-20\f2\fs26 Font Style64;}}\fet2{\*\ftnsep {\chftnsep\par }}{\*\aftnsep {\chftnsep\par }}\expshrtn\widowctrl\paperw20384\paperh12312\margl360\margr360\margt360\margb360 \sectd \sbknone\pgwsxn20384\pghsxn12312\marglsxn360\margrsxn360\margtsxn360\margbsxn360\titlepg\cols2\colno1\colw8632\colsr2104\colno2\colw8928 {\headerf }{\footerf }{\header \pard \plain \s11\ql\li720\fi0\ri9\sb0\sa0\tx2120 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 \'e1\f0\cchs186 Ma\ul b\f0\cchs186 \'fb\f0\cchs186 s vaikai:\ul0 {\charscalex100\expndtw0\tab }\ul ir galimyb\f0\cchs186 \'eb\f0\cchs186 s\par }{\footer \pard \plain \s11\qj\li0\fi0\ri0\sb0\sa0 \pvpara\phcol\posnegx0\posnegy0\absw0\absh-254\nowrap\dfrmtxtx34\dfrmtxty0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 {\field{\*\fldinst{PAGE}}{\fldrslt 100}}\par \pard \plain \s21\qr\li720\fi0\ri9{\sl-240\slmult0\fs20\par }\sb90\sa0 \cs61\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs12 101\par }\pard\sl-4680\slmult0\sb0\keepn\pvpara\dropcapli7\dropcapt1{\b\i0\ul0\cf0\highlight0\charscalex30\f0\fs400{i}\par}\pard \plain \s1\ql\li880\fi-880\ri0\sb0\sa0\sl-272\slmult0 \cs37\i0\strike0\nosupersub\b\scaps0\charscalex120\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs58 Hfc \cs55\0\super\charscalex100\fs22 mddj8\nosupersub \super tUn\nosupersub \super tam\nosupersub \super dkrts\nosupersub identifikacijos proced\f0\cchs186 \'fb\f0\cchs186 ras, vadinasi \cs60\fs20 ivuiiy* toje \cs55\fs22 programoje \cs53\i\expndtw-10 asmenys \cs55\i0\expndtw0 turi mok\f0\cchs186 \'eb\f0\cchs186 ti naudotis identifikacijos \f0\cchs186 \'e1\f0\cchs186 ran-\cs60\fs20 *>*\f0\cchs186 \'ab\'f8\f0\cchs186 geb\f0\cchs186 \'eb\f0\cchs186 ti \cs55\fs22 analizuoti mokini\f0\cchs186 \'f8\f0\cchs186 veiklos produktus ir pati mokymosi proces\f0\cchs186 \'e0\f0\cchs186 , \cs60\f0\cchs186\fs20 \'95\f0\cchs186 tpaftistant \cs55\fs22 kriterijus, pagal kuriuos vaikas gali b\f0\cchs186 \'fb\f0\cchs186 ti priskirtas gabi\f0\cchs186 \'f8\f0\cchs186 j\f0\cchs186 \'f8\f0\cchs186 grupei. \cs60\fs20 Vargu, ar \cs55\fs22 bc specialaus \cs53\i\expndtw-10 pasirengimo \cs55\i0\expndtw0 gali dirbti mokytojas. Pavyzd\f0\cchs186 \'fe\f0\cchs186 iui, Clark modelyje numatyta, kad mokytojas turi b\f0\cchs186 \'fb\f0\cchs186 ti \f0\cchs186 \'e1\f0\cchs186 vald\f0\cchs186 \'e6\f0\cchs186 s \f0\cchs186 \'e1\f0\cchs186 tampos klas\f0\cchs186 \'eb\f0\cchs186 je suma\f0\cchs186 \'fe\f0\cchs186 i\-nimo strategijas (autogenin\f0\cchs186 \'e6\f0\cchs186 treniruot\f0\cchs186 \'e6\f0\cchs186 , meditacij\f0\cchs186 \'e0\f0\cchs186 ), turi geb\f0\cchs186 \'eb\f0\cchs186 ti parinkti mo\-kymo med\f0\cchs186 \'fe\f0\cchs186 iag\f0\cchs186 \'e0\f0\cchs186 , pratimus ir u\f0\cchs186 \'fe\f0\cchs186 duotis, kurioms atlikti b\f0\cchs186 \'fb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 naudojama abiej\f0\cchs186 \'f8 \f0\cchs186 smegen\f0\cchs186 \'f8\f0\cchs186 pusrutuli\f0\cchs186 \'f8\f0\cchs186 veikla, geb\f0\cchs186 \'eb\f0\cchs186 ti \f0\cchs186 \'e1\f0\cchs186 ugdymo turin\f0\cchs186 \'e1\f0\cchs186 \f0\cchs186 \'e1\f0\cchs186 traukti pratimus, kurie, panaudojant fizin\f0\cchs186 \'e1\f0\cchs186 k\f0\cchs186 \'fb\f0\cchs186 n\f0\cchs186 \'e0\f0\cchs186 , abstraktaus ir simbolinio lygmens \cs39\i informacij\f0\cchs186 \'e0\f0\cchs186 , \cs55\i0 trans\-formuoja \f0\cchs186 \'e1\f0\cchs186 konkretesn\f0\cchs186 \'e1\f0\cchs186 lygmen\f0\cchs186 \'e1\f0\cchs186 ir pan. Kai kurie autoriai, pavyzd\f0\cchs186 \'fe\f0\cchs186 iui, Wil-liams, netgi nurodo mokymo strategijas, kurias \cs39\i naudoti savo \cs55\i0 darbe turi mok\f0\cchs186 \'eb\f0\cchs186 ti \cs60\fs20 mokytojas, \cs55\fs22 kiti savo darbo komand\f0\cchs186 \'e0\f0\cchs186 apmoko. Renzulli modelio realizavimo komand\f0\cchs186 \'e0\f0\cchs186 sudaro ne tik mokytojai, bet ir t\f0\cchs186 \'eb\f0\cchs186 vai, bendruomen\f0\cchs186 \'eb\f0\cchs186 s ekspertai, mo\-kyklos administracija ir kt. personalas. Modelio veikimo efektyvum\f0\cchs186 \'e0\f0\cchs186 vertina \cs53\i\expndtw-10 visi \cs39\expndtw0 jo \cs53\expndtw-10 dalyviai, pagal tokios analiz\f0\cchs186 \'eb\f0\cchs186 s \cs55\i0\expndtw0 rezultatus bei mokini\f0\cchs186 \'f8\f0\cchs186 pageidavimus ar pakitusius poreikius ugdymo programa modifikuojama.\par \pard \plain \s2\ql\li576\fi560\ri0\sb0\sa0\sl-296\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Atskirai reik\f0\cchs186 \'eb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 pamin\f0\cchs186 \'eb\f0\cchs186 ti Taylor model\f0\cchs186 \'e1\f0\cchs186 . Jis vadinamas ir muititalento, ir k\f0\cchs186 \'fb\f0\cchs186 rybinio bei kritinio m\f0\cchs186 \'e0\f0\cchs186 stymo modeliu. \cs39\i Laikoma, kad \cs55\i0 bent vienai (j\f0\cchs186 \'f8\f0\cchs186 nuro\-domos net devynios) gabumo sri\f0\cchs186 \'e8\f0\cchs186 iai yra gabus kiekvienas vaikas. Toks gabi\f0\cchs186 \'f8 \f0\cchs186 vaik\f0\cchs186 \'f8\f0\cchs186 \cs53\i\expndtw-10 ugdymo modelis tur\f0\cchs186 \'eb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 b\f0\cchs186 \'fb\f0\cchs186 ti \cs39\expndtw0 priimtinas ir \cs55\i0\f0\cchs186 \'fe\f0\cchs186 mon\f0\cchs186 \'eb\f0\cchs186 ms, kurie mano, jog visi vaikai \cs60\fs20 turi \cs55\fs22 tam \cs53\i\expndtw-10 tikr\f0\cchs186 \'f8\f0\cchs186 \cs55\i0\expndtw0 gabum\f0\cchs186 \'f8\f0\cchs186 , ir d\f0\cchs186 \'eb\f0\cchs186 l koki\f0\cchs186 \'f8\f0\cchs186 nors prie\f0\cchs186 \'fe\f0\cchs186 as\f0\cchs186 \'e8\f0\cchs186 i\f0\cchs186 \'f8\f0\cchs186 nenori pripa\-\cs60\f0\cchs186\fs20 \'fe\f0\cchs186 inti \cs55\fs22 gabum\f0\cchs186 \'f8\f0\cchs186 \cs53\i\expndtw-10 lygmens \cs55\i0\expndtw0 skirtum\f0\cchs186 \'f8\f0\cchs186 . Modelio autorius nurodo \f0\cchs186 \'f0\f0\cchs186 ias gabum\f0\cchs186 \'f8\f0\cchs186 sritis: akademin\f0\cchs186 \'eb\f0\cchs186 s srities, \cs53\i\expndtw-10 produktyviojo \cs55\i0\expndtw0 m\f0\cchs186 \'e0\f0\cchs186 stymo, komuniJcavimo, prognozavimo, \cs53\i\expndtw-10 sprendim\f0\cchs186 \'f8\f0\cchs186 pri\f0\cchs186 \'eb\f0\cchs186 mimo, plan\f0\cchs186 \'f8\f0\cchs186 \f0\cchs186 \'e1\f0\cchs186 gyvendinimo, \cs55\i0\expndtw0\f0\cchs186 \'fe\f0\cchs186 mogi\f0\cchs186 \'f0\f0\cchs186 k\f0\cchs186 \'f8\f0\cchs186 j\f0\cchs186 \'f8\f0\cchs186 ry\f0\cchs186 \'f0\f0\cchs186 i\f0\cchs186 \'f8\f0\cchs186 , galimybi\f0\cchs186 \'f8\f0\cchs186 \f0\cchs186 \'e1\'fe\f0\cchs186 vel\-gimo \cs39\i\expndtw-20 (ir.\expndtw0 2.2.1 \cs53\expndtw-10 lentel\f0\cchs186 \'e6\f0\cchs186 ).\par \pard \plain \s11\qj\li6976\fi0\ri0{\sl-240\slmult0\fs20\par }\sb72\sa0 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 2.2.1 \cs55 lentel\f0\cchs186 \'eb\par \pard \plain \s8\qj\li0\fi0\ri0\sb0\sa0 \pvpara\phcol\posnegx6464\posnegy688\absw0\absh-256\dfrmtxtx40\dfrmtxty0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 U\f0\cchs186 \'fe\f0\cchs186 duo\f0\cchs186 \'e8\f0\cchs186 i\f0\cchs186 \'f8\f0\cchs186 pavyzd\f0\cchs186 \'fe\f0\cchs186 iai\par \pard \plain \s4\qc\li2112\fi0\ri2232\sb0\sa0\sl-320\slmult0 \cs53\b0\strike0\nosupersubLi\scaps0\charscalex100\expndtw-10\dn0\f0\cchs186\lang1063\langfe1063\s22 Gabum\f0\cchs186 \'f8\f0\cchs186 \cs44\i0\expndtw0 ugdymas pagal Taylor \cs55 model\f0\cchs186 \'e1 \f0\cchs186 (pagal TayJor, 1986)\par \pard \plain \s9\qj\li0\fi0\ri0\sb0\sa0 \pvpara\phcol\posnegx2648\posnegy368\absw0\absh-328\dfrmtxtx40\dfrmtxty0 \cs53\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw-10\dn0\f0\cchs186\lang1063\langfe1063\fs22 Geb\f0\cchs186 \'eb\f0\cchs186 jimas \cs55\i0\expndtw0 susikurti \cs39\i atitinka- \{\f0\cchs186 \'84\f0\cchs186 Surinkite informacij\f0\cchs186 \'e0\f0\cchs186 apie... ii\par \pard \plain \s6\qj\li304\fi0\ri0\sb16\sa0 \cs63\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw-20\dn0\f0\cchs186\lang1063\langfe1063\fs22 I \cs53\expndtw-10 Gabum\f0\cchs186 \'f8\f0\cchs186 sritis Paai\f0\cchs186 \'f0\f0\cchs186 kinimas\par \pard \plain \s10\qj\li0\fi0\ri0\sb0\sa0\sl-264\slmult0 \pvpara\phcol\posnegx6032\posnegy328\absw2600\absh-544\dfrmtxtx40\dfrmtxty0 \cs53\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw-10\dn0\f0\cchs186\lang1063\langfe1063\fs22 j mos temos \f0\cchs186 \'fe\f0\cchs186 ini\f0\cchs186 \'f8\f0\cchs186 ir \f0\cchs186 \'e1\f0\cchs186 g\f0\cchs186 \'fb\f0\cchs186 d\f0\cchs186 \'fe\f0\cchs186 i\f0\cchs187 \'f8 \cs55\i0\expndtw0\f0\cchs186 'baz\f0\cchs186 \'e6\f0\cchs186 .\par \pard \plain \s12\qj\li0\fi0\ri0\sb0\sa0\sl-288\slmult0 \pvpara\phcol\posnegx5672\posnegy384\absw2960\absh-584\dfrmtxtx40\dfrmtxty0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 f Geb\f0\cchs186 \'eb\f0\cchs186 jimas generuoti \cs60\fs20 ne-\line \cs55\fs22 f \f0\cchs186 \'e1\f0\cchs186 prastas, originalias i\f0\cchs186 \'eb\f0\cchs186 /as,\line \cs60\fs20 f\cs53\i\expndtw-10\fs22 pasteb\f0\cchs186 \'eb\'fb\f0\cchs186 naujus \cs55\i0\expndtw0 s\f0\cchs-23 \'e30153860653936719740\f0\cchs186 ry\f0\cchs186 \'f0\f0\cchs186 ius,\line \cs53\i\expndtw-10\f0\cchs186 \'c1\f0\cchs186 pa\f0\cchs186 \'e1\f0\cchs186 vairioa id\f0\cchs186 \'eb\f0\cchs186 jas,\expndtw0 {\charscalex100\expndtw0\tab }\par \pard \plain \s6\qj\li232\fi0\ri0\sb0\sa0 \cs53\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw-10\dn0\f0\cchs186\lang1063\langfe1063\fs22 'Akademin\f0\cchs186 \'eb\par \pard \plain \s12\qj\li0\fi0\ri0\sb0\sa0\sl-272\slmult0 \pvpara\phcol\posnegx5264\posnegy160\absw3368\absh-648\dfrmtxtx40\dfrmtxty0 \cs39\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 'Akademin\f0\cchs186 \'eb\par \pard \plain \s12\qj\li0\fi0\ri0\sb0\sa0\sl-272\slmult0 \pvpara\phcol\posnegx5264\posnegy160\absw3368\absh-648\dfrmtxtx40\dfrmtxty0 \cs39\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 (K\f0\cchs186 \'fb\f0\cchs186 rybos, produktyvioio\par \pard \plain \s13\qj\li5816\fi0\ri0\sb88\sa0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 2.2.1 icntcU\par \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1848 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx4792 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8376 \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-240\slmult0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Gabum\f0\cchs186 \'f8\f0\cchs186 \cs60\fs20 sritis\par \pard \plain \s15\ql\li0\fi40\ri0\sb0\sa0\sl-240\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Sprendim\f0\cchs186 \'f8 \f0\cchs186 pri\f0\cchs186 \'eb\f0\cchs186 mimo\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-248\slmult0\tlul\tx2736 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Paai\f0\cchs186 \'f0\f0\cchs186 kinimas {\charscalex100\expndtw0\tab }Ll\par \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\sl-248\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Geb\f0\cchs186 \'eb\f0\cchs186 jimas rasti alternatyvas, \cs55\fs22 l.,\par \pard \plain \s15\ql\li32\fi-32\ri0\sb0\sa0\sl-248\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 jas \f0\cchs186 \'e1\f0\cchs186 vertinti ir priimti tinka- \cs55\fs22 t \cs60\fs20 r m\f0\cchs186 \'e0\f0\cchs186 problemos sprendim\f0\cchs186 \'e0\f0\cchs186 . 1 \cs41\b\i\f0\cchs186\fs10 \'e1\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-264\slmult0 \intbl \cs5u\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 J\f0\cchs186 \'fe\f0\cchs186 duo\f0\cchs186 \'e8\f0\cchs186 i\f0\cchs186 \'f8\f0\cchs186 pavyzd\f0\cchs186 \'fe\f0\cchs186 iai Nurodykite \cs60\fs20 savo \cs55\fs22 m\f0\cchs186 \'eb\f0\cchs186 giamiausi\f0\cchs186 \'e0\f0\cchs186 \cs60\fs20 I\par \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-264\slmult0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 a\f0\cchs186 \'f0\f0\cchs186 y toj\f0\cchs186 \'e0\f0\cchs186 , ai\f0\cchs186 \'f0\f0\cchs186 kiai pagr\f0\cchs186 \'e1\f0\cchs186 sdami at- t \cs60\fs20 rumentais \cs55\fs22 savo pasirinkim\f0\cchs186 \'e0\f0\cchs186 it\par \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\sl-264\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 itmetim\f0\cchs186 \'e0\f0\cchs186 ".\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1848 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx4792 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8376 \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Planavimo\cell \pard \plain \s15\ql\li16\fi-16\ri0\sb0\sa0\sl-248\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Geb\f0\cchs186 \'eb\f0\cchs186 jimas numatyti kelius ir b\f0\cchs186 \'fb\f0\cchs186 dus id\f0\cchs186 \'eb\f0\cchs186 jai \f0\cchs186 \'e1\f0\cchs186 gyvendinti, nustatant, koki\f0\cchs186 \'f8\f0\cchs186 reikia resur- \cs55\fs22 1 \cs60\fs20 s\f0\cchs186 \'f8\f0\cchs186 , \f0\cchs186 \'e1\'fe\f0\cchs186 velgiant, kokios gali\-mos problemos, ir numatant \f0\cchs186 \'fe\f0\cchs186 ingsnius j\f0\cchs186 \'f8\f0\cchs186 sprendimui, to\-kiu b\f0\cchs186 \'fb\f0\cchs186 du patobulinant plan\f0\cchs186 \'e0\f0\cchs186 .\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-256\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 .I\f0\cchs186 \'f0\f0\cchs186 studijav\f0\cchs186 \'e6\f0\cchs186 \cs55\fs22 mitus apie \f0\cchs186 \'f0\f0\cchs186 ik\f0\cchs186 \'f0\f0\cchs186 nos\-\cs60\fs20 parnius, \cs55\fs22 sukurkite tyrimo plan\f0\cchs186 \'e0\f0\cchs186 \cs62\fs18 1\par \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\sl-256\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 savo draug\f0\cchs186 \'f8\f0\cchs186 \cs55\fs22 nuomonei \cs60\fs20 apie \f0\cchs186 \'f0\f0\cchs186 iuos gyv\f0\cchs186 \'fb\f0\cchs186 nus i\f0\cchs186 \'f0\f0\cchs186 tirti\super 41\nosupersub , \f0\cchs186 \'84\f0\cchs186 Sukurkite akcijos prie\f0\cchs186 \'f0\f0\cchs186 \cs55\fs22 r\f0\cchs186 \'fb\f0\cchs186 kym\f0\cchs186 \'e0\f0\cchs186 \cs62\fs18 1 \cs60\fs20 plan\f0\cchs186 \'e0\f0\cchs186 ".\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1848 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx4792 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8376 \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Prognozavimo\cell \pard \plain \s15\ql\li0\fi8\ri0\sb0\sa0\sl-248\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Geb\f0\cchs186 \'eb\f0\cchs186 jimas numatyti ir pati\-krinti prie\f0\cchs186 \'fe\f0\cchs186 asties ir pasekm\f0\cchs186 \'eb\f0\cchs186 s s\f0\cchs186 \'e0\f0\cchs186 ry\f0\cchs186 \'f0\f0\cchs186 ius.\cell \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\sl-264\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 \'84\f0\cchs186 I\f0\cchs186 \'f0\f0\cchs186 studijuokite N sutart\f0\cchs186 \'e1\f0\cchs186 ir nurodykite \f0\cchs186 \'e1\f0\cchs186 vairias galimas jos i ratifikavimo pasekmes".\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1848 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx4792 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8376 \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Komunikavimo\cell \pard \plain \s15\ql\li0\fi16\ri0\sb0\sa0\sl-256\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Geb\f0\cchs186 \'eb\f0\cchs186 jimas reik\f0\cchs186 \'f0\f0\cchs186 ti savo id\f0\cchs186 \'eb\f0\cchs186 jas, jausmus, poreikius ir suprasti kitus, vartojant verbalin\f0\cchs186 \'e6\f0\cchs186 ir neverbalin\f0\cchs186 \'e6\f0\cchs186 kalb\f0\cchs186 \'e0\f0\cchs186 .\cell \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\sl-264\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 \'84\f0\cchs186 Pademonstruokite savo jaus- \cs55\fs22 1 \cs60\fs20 mus, kai su\f0\cchs186 \'fe\f0\cchs186 inote apie ... \f0\cchs186 \'84\f0\cchs186 Papasakokite apie \f0\cchs186 \'e1\f0\cchs186 vyk\f0\cchs186 \'e1\f0\cchs186 i\f0\cchs186 \'f0\f0\cchs186 vaiko i ir i\f0\cchs186 \'f0\f0\cchs186 suaugusiojo pozicini". i\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1848 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx4792 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8376 \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Plan\f0\cchs186 \'f8\par \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 \'e1\f0\cchs186 gyvendinimo\cell \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Geb\f0\cchs186 \'eb\f0\cchs186 jimas \f0\cchs186 \'e1\f0\cchs186 gyvendinti plan\f0\cchs186 \'e0\cell \pard \plain \s16\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs43\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw200\dn0\f0\cchs186\lang1063\langfe1063\fs10 \'97\f0\cchs186 \f0\cchs186 \'97\f0\cchs186 \f1\cchs186 \u9632\'3f\f0\cchs186 - \f0\cchs186 \'97\'97\f0\cchs186  \expndtw0 *-\expndtw200 \expndtw0 L-\expndtw200 \expndtw0 -\expndtw200 \cs42\b0\expndtw0\f3\cchs186\fs8 i \f4\cchs186 \u9632\'3f\f3\cchs186 \f4\cchs186 \u9632\'3f\f3\cchs186 \cs41\b\i\f0\cchs186\fs10 a \cs40\b0\i0\scaps\f6\cchs186\fs8 - ii \f7\cchs186 \u9632\'3f\f6\cchs186 \cs62\scaps0\f0\cchs186\fs18 1\par \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\sl-264\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 \'84\f0\cchs186 Sukurkite ir \f0\cchs186 \'e1\f0\cchs186 gyvendinkite N 1 renginio plan\f0\cchs186 \'e0\f0\cchs186 ".\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1848 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx4792 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8376 \pard \plain \s15\ql\li32\fi-32\ri0\sb0\sa0\sl-280\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Galimybi\f0\cchs186 \'f8 \'e1\'fe\f0\cchs186 velgimo\cell \pard \plain \s15\ql\li0\fi40\ri0\sb0\sa0\sl-272\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Geb\f0\cchs186 \'eb\f0\cchs186 jimas identifikuoti gali\-myb\f0\cchs186 \'e6\f0\cchs186 ir ja pasinaudoti.\cell \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\sl-272\slmult0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 \'84\f0\cchs186 I\f0\cchs186 \'f0\f0\cchs186 tirkite ispan\f0\cchs186 \'f8\f0\cchs186 kalbos mokymo(si) poreik\f0\cchs186 \'e1\f0\cchs186 mokykloje ir inicijuokite atitinkamos pro\-gramos \f0\cchs186 \'e1\f0\cchs186 gyvendinim\f0\cchs186 \'e0\f0\cchs186 ".\cell \pard\intbl\row \pard\pard \plain \s14\ql\li0\fi600\ri0\sb232\sa0\sl-328\slmult0 \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Taylor siekia ugdyti kuo daugiau gabum\f0\cchs186 \'f8\f0\cchs186 , kuriais, jo manymu, pasi\f0\cchs186 \'fe\f0\cchs186 ymi vaikai. Tad kuo \f0\cchs186 \'e1\f0\cchs186 vairesniems vaik\f0\cchs186 \'f8\f0\cchs186 gabumams mokytojas skirs d\f0\cchs186 \'eb\f0\cchs186 mes\f0\cchs186 \'e1\f0\cchs186 , tuo daugiau galimybi\f0\cchs186 \'f8\f0\cchs186 , kad vaikas ras srit\f0\cchs186 \'e1\f0\cchs186 , kurios \f0\cchs186 \'fe\f0\cchs186 inovu jis gali tapti. Ta\f0\cchs186 \'e8\f0\cchs186 iau pir\-masis \f0\cchs186 \'f0\f0\cchs186 io modelio etapas - tai vis d\f0\cchs186 \'eb\f0\cchs186 lto akademini\f0\cchs186 \'f8\f0\cchs186 gabum\f0\cchs186 \'f8\f0\cchs186 ugdymas. Kitas \f0\cchs186 \'fe\f0\cchs186 ingsnis, skirtas mokytojui apsispr\f0\cchs186 \'e6\f0\cchs186 sti, kuri\f0\cchs186 \'e0\f0\cchs186 i\f0\cchs186 \'f0\f0\cchs186 likusi\f0\cchs186 \'f8\f0\cchs186 a\f0\cchs186 \'f0\f0\cchs186 tuoni\f0\cchs186 \'f8\f0\cchs186 gabum\f0\cchs186 \'f8\f0\cchs186 sri\f0\cchs186 \'e8\f0\cchs186 i\f0\cchs186 \'f8 \f0\cchs186 jis imasi ugdyti. Paprastai seka, anot autoriaus, tur\f0\cchs186 \'eb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 b\f0\cchs186 \'fb\f0\cchs186 ti tokia: produktyvusis m\f0^cchs186 \'e0\f0\cchs186 stymas, planavimas, sprendim\f0\cchs186 \'f8\f0\cchs186 pri\f0\cchs186 \'eb\f0\cchs186 mimas, pian\f0\cchs186 \'f8\f0\cchs186 \f0\cchs186 \'e1\f0\cchs186 gyvendinimas, \f0\cchs186 \'e1\'fe\f0\cchs186 valgos. Akivaizdu, jog dirbti pagal \f0\cchs186 \'f0\'e1\f0\cchs186 model\f0\cchs186 \'e1\f0\cchs186 mokytojas tur\f0\cchs186 \'eb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 b\f0\cchs186 \'fb\f0\cchs186 ti specialiai pasi\-reng\f0\cchs186 \'e6\f0\cchs186 s, tad modelio autorius si\f0\cchs186 \'fb\f0\cchs186 lo kelet\f0\cchs186 \'e0\f0\cchs186 mokytojo darbo metod\f0\cchs186 \'f8\f0\cchs186 . Pirmuouiu atveju si\f0\cchs186 \'fb\f0\cchs186 loma papildom\f0\cchs186 \'f8\f0\cchs186 gabum\f0\cchs186 \'f8\f0\cchs186 ugdym\f0\cchs186 \'e0\f0\cchs186 organizuoti baigiantis pamokoms. \f0\cchs186 \'c1\f0\cchs186 prastinis mokymo turinys \f0\cchs186 \'84\f0\cchs186 suspaud\f0\cchs186 \'fe\f0\cchs186 iamas" laike, o atsiradusias 5\f0\cchs186 \'97\f0\cchs186 10 laisvuj minu\f0\cchs186 \'e8\f0\cchs186 i\f0\cchs186 \'f8\f0\cchs186 mokytojas gali i\f0\cchs186 \'f0\f0\cchs186 naudoti pasirinkto gabumo ugdymui. Kai \cs48\b\fs20 mokytojui \cs44\b0\fs22 atrodo, kad jau pasiekta tam tikra pa\f0\cchs186 \'fe\f0\cchs186 anga ugdant pirm\f0\cchs186 \'e0\f0\cchs186 j\f0\cchs186 \'e1\f0\cchs186 i\f0\cchs186 \'f0\f0\cchs186 \f0\cchs186 \'e1\f0\cchs186 o pasirinkt\f0\cchs186 \'f8\f0\cchs186 ga\-\par \sect\soctd \sbkpage\pgwsxn20855\pghsxn13316\marglsxn1080\margrsxn8026\margtsxn360\margbsxn360\cols2\colno1\colw7936\colsr2482\colno2\colw1329 {\header \pard \plain \s11\ql\li0\fi0\ri-7657\sb0\sa0\tx2245 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 \'e1\f0\cchs186 Ma\ul b\f0\cchs186 \'fb\f0\cchs186 s vaikai:\ul0 {\charscalex100\expndtw0\tab }\ul ir galimyb\f0\cchs186 \'eb\f0\cchs186 s\par }{\footer \par \plain \s11\qj\li0\fi0\ri0\sb0\sa0 \pvpara\phcol\posnegx-720\posnegy0\absw0\absh-254\nowrap\dfrmtxtx34\dfrmtxty0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 {\field{\*\fldinst{PAGE}}{\fldrslt 100}}\par \pard \plain \s21\qr\li0\fi0\ri-7657{\sl-240\slmult0\fs20\par }\sb90\sa0 \cs61\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs12 101\par }{\shp {\*\shpinst \chpleft13358\shptop593\shpright14748\shpbottom830\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz1\shplid1{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 317500}}{\sp{\sn dyWrapDistBottom}{\sv 198755}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s31\qj\li0\fi0\ri0\sb0\sa0 \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Rai\f0\cchs186 \'f0\f0\cchs186 kos \cs51\b0 b\f0\cchs186 \'fb\f0\cchs186 dai\par }}}{\shp {\*\shpinst \shpleft11859\shptop534\shpright13172\shpbottom2169\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz0\shplid0{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 279400}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s11\qj\li0\fi0\ri0\sb0\sa0\sl-254\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Strukt\f0\cchs186 \'fb\f0\cchs186 rinis elementas\par \pard \plain \s13\ql\li0\fi0\ri0\sb17\sa0\sl-271\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Ugdytojo ir ugdytini\f0\cchs186 \'f8 \f0\cchs186 s\f0\cchs186 \'e0\f0\cchs186 veika, ko\-munikacija\par }}}{\shp {\*\shpinst \shp|eft13350\shptop1144\shpright17594\shpbottom2296\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz2\shplid2{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 139700}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fPint}{\sv 1}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s12\qj\li0\fi0\ri0\sb0\sa0\sl-271\slmult0 \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Informacijos srautai \f0\cchs186 \'97\f0\cchs186 \cs48\b Asmenvb\f0\cchs186 \'eb\f0\cchs186 s tobuli* tiesioginiai ir \cs60\b0 gr\f0\cchs186 \'e1\'fe\f0\cchs186 tamieji, ir s\f0\cchs186 \'e0\f0\cchs186 lyg\f0\cchs186 \'f8\f0\cchs186 \cs48\b tobulintai pedagogin\f0\cchs186 \'eb\f0\cchs186 \cs60\b0 sistema sudarymas: \cs48\b\f0\cchs186 \'fb\f0\cchs186 ssionj\par \pard \plain \s33\ql\li2499\fi0\ri0\sb93\sa0 \cs51\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 - b. \cs60 y\super 1\nosupersub "\super 0\nosupersub \cs51 HBB\par }}}{\shp {\*\shpinst \shpleft13299\shptop2228\shpright14205\shpbottom2474\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz4\shplid4{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 0}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s11\qj\li0\fi0\ri0\sb0\sa0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Saviugda\par }}}{\shp {\*\shpinst \shpleft15874\shptop2279\shpright17187\shpbottom2524\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz5\shplid5{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 0}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s12\qj\li0\fi0\ri0\sb0\sa0 \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Tobulinimasis\par }}}{\shp {\*\shpinst \shpleft11867\shptop2152\shpright13078\shpbottom2812\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz3\shplid3{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 640080}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s11\qj\li0\fi0\ri0\sb0\sa0\sl-280\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Individo as\-menyb\f0\cchs186 \'eb\par }}}{\shpgrp{\*\shpinst \shpleft-720\shptop3939\shpright7878\shpbottom12384\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz6\shplid6{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 0}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn groupLeft}{\sv 1067}}{\sp{\sn groupTop}{\sv 6209}}{\sp{\sn groupRight}{\sv 9665}}{\sp{\sn groupBottom}{\sv 14654}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 1067}}{\sp{\sn relTop}{\sv 6429}}{\sp{\sn relRight}{\sv 9665}}{\sp{\sn relBottom}{\sv 14654}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1889 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx3354 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx5836 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8597 \pard \plain \s19\ql\li474\fi0\ri0\sb0\sa0\sl-271\slmult0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1 \cs48\b\fs20 Ugdymo \cs49\b0\fs22 res \cs46\scaps\fs20 f\cs48\b\scaps0 lyb\f0\cchs186 \'eb\f0\cchs186 s lygmu\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-280\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 i- \cs49\b0\fs22 Strukt\f0\cchs186 \'fb\f0\cchs186 rini \cs48\b\fs20 o elementas\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 s Rai\f0\cchs186 \'f0\f0\cchs186 kos b\f0\cchs186 \'fb\f0\cchs186 dai\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Funkcijos\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1889 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx3354 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx5836 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8597 \pard \plain \s19\ql\li440\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 j \cs48\b\fs20 Valstybinis\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-280\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Valstyb\f0\cchs186 \'eb\f0\cchs186 s politika\cell \pard \plain \s19\ql\li0\fi8\ri0\sb0\sa0\sl-280\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 \'d0\f0\cchs186 vietimo politika ir j\f0\cchs186 \'e0 \f0\cchs186 atspindintys \f0\cchs186 \'e1\f0\cchs186 statymai\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-288\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Teisinis reguliavimas, u\f0\cchs186 \'fe\f0\cchs186 tikrinantis kiekvie\-nam vaikui (vadinasi, ir gabiam) teis\f0\cchs186 \'e6\f0\cchs186 gauti jo poreikius ir galimybes atitinkant\f0\cchs186 \'e1\f0\cchs186 ugdym\f0\cchs186 \'e0\f0\cchs186 ir ug\-dymosi s\f0\cchs186 \'e0\f0\cchs186 lygas\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1889 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx3354 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx5836 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8597 \pard \plain \s19\ql\li390\fi0\ri0\sb0\sa0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langde1063\fs20 Visuomeninis\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-280\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Visuomen\f0\cchs186 \'eb\f0\cchs186 s institutai\cell \pard \plain \s19\ql\li0\fi68\ri0\sb0\sa0\sl-288\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Vyriausybines insti\-tucijos/ visuomenini\f0\cchs186 \'f8 \f0\cchs186 organizacij\f0\cchs186 \'f8\f0\cchs186 /paramos fond\f0\cchs186 \'f8\f0\cchs186 /auk\f0\cchs186 \'f0\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 j\f0\cchs186 \'f8\f0\cchs186 moky\-kl\f0\cchs186 \'f8\f0\cchs186 /mokslo institucij\f0\cchs186 \'f8 \cs39\b0\i\f0\cchs186\fs22 tikslin\f0\cchs186 \'eb\f0\cchs186 \cs48\i0\b\fs20 veikla\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-296\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Veiklos inicijavimas; koordinavimas, organi\-zavimas, informacijos kaupimas, analiz\f0\cchs186 \'eb\f0\cchs186 ir sklai\-da; gabi\f0\cchs186 \'f8\f0\cchs186 vaik\f0\cchs186 \'f8\f0\cchs186 paie\f0\cchs186 \'f0\f0\cchs186 kos programos, identifikavi\-mas, globa; mokytoj\f0\cchs186 \'f8\f0\cchs186 ir kit\f0\cchs186 \'f8\f0\cchs186 \f0\cchs186 \'f0\f0\cchs186 vietimo darbuotoj\f0\cchs186 \'f8 \f0\cchs186 rengi mas;ugdymo t\f0\cchs186 \'e6\f0\cchs186 sti\-numo u\f0\cchs186 \'fe\f0\cchs186 tikrinimas; kt.\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx1889 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx3354 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx5836 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8597 \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 1 Institucinis\par \pard \plain \s25\ql\li0\fi0\ri0\sb0\sa0\sl-983\slmult0 \intbl \cs47\b0\i0\strike0\nosupersub\scaps0\charscalex20\expndtw0\dn19\f0\cchs186\lang1063\langfe1063\fs104 1\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-305\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Ugdymo nstituci\f0\cchs186 \'e1\f0\cchs186 os\par \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-305\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 i \cs49\b0\fs22 1 \cs48\b\fs20 i\par \pard \plain \s26\ql\li0\fi0\ri0\sb0\sa0\sl-381\slmult0 \intbl \cs50\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn5\f0\cchs186\lang1063\langfe1063\fs38 !\cell \pard \plain \s19\ql\li25\fi-25\ri0\sb0\sa0\sl-296\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Gabi\f0\cchs186 \'f8\f0\cchs186 vaik\f0\cchs186 \'f8\f0\cchs186 ugdymo modelis institucijos lygmeniu \f0\cchs186 \'97\f0\cchs186 mokyklos, papildomojo ugdymo mokyklos, technin\f0\cchs186 \'eb\f0\cchs186 s \{\f0\cchs186 \'fb\f0\cchs186 rybos namai, klas\f0\cchs186 \'eb\f0\cchs186 s, tovyklos, kursai, kon\-kursai ir kt.\cell \pard \plain \s19\ql\li0\fi0\ri0\sb0\sa0\sl-305\slmult0 \intbl \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw-5420746430195647047\dn0\f0\cchs186\lang1063\langfe1063\fs20 Ugdymo proceso opti\-mizavimas: optimalios ugdymo(si) aplinkos sudarymas, ugdymas, mo\-kymas, veiklos rezultat\f0\cchs186 \'f8 \f0\cchs186 vertinimas, mokymo dife\-rencijavimas ir kt.\cell \pard\intbl\row \pard}}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 3371}}{\sp{\sn relTop}{\sv 6209}}{\sp{\sn relRight}{\sv 7988}}{\sp{\sn relBotto}}{\sv 6497}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s18\qj\li0\fi0\ri0\sb0\sa0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Gabi\f0\cchs186 \'f8\f0\cchs186 \cs49 vaik\f0\cchs186 \'f8\f0\cchs186 ugdymo ir jo s\f0\cchs186 \'e0\f0\cchs186 lyg\f0\cchs186 \'f8\f0\cchs186 modelis\par }}}}}\pard \plain \s14\qr\li0\fi0\ri0\sb0\sa0\sl-305\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 m\f0\cchs186 \'e0\f0\cchs186 gali apib\f0\cchs186 \'fb\f0\cchs186 dinti asmenyb\f0\cchs186 \'eb\f0\cchs186 s saviugda, iritrapersonaliniame lygmenyje \f0\cchs186 \'e1\f0\cchs186 gyjanti gryn\f0\cchs186 \'e0\f0\cchs186 rai\f0\cchs186 \'f0\f0\cchs186 k\f0\cchs186 \'e0\f0\cchs186 . \cs45\b\expndtw-10 II \cs55\b0\expndtw0 esm\f0\cchs186 \'eb\f0\cchs186 s \cs53\i\expndtw-10 vis\f0\cchs186 \'f8\f0\cchs186 \cs55\i0\expndtw0 anks\f0\cchs186 \'e8\f0\cchs186 iau min\f0\cchs186 \'eb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 strukt\f0\cchs186 \'fb\f0\cchs186 rini\f0\cchs186 \'f8\f0\cchs186 element\f0\cchs186 \'f8\f0\cchs186 funkcionavi\-mo tikslas \cs49 I \cs55 prigimtini\f0\cchs186 \'f8\f0\cchs186 asmens gali\f0\cchs186 \'f8\f0\cchs186 pl\f0\cchs186 \'eb\f0\cchs186 tra ir i\f0\cchs186 \'f0\f0\cchs186 vystymas jo paties j\f0\cchs186 \'eb\f0\cchsq86 gomis iki maksimalaus tam asmeniui galimo lygio. Literat\f0\cchs186 \'fb\f0\cchs186 roje (Gross, 1995; Almonaitien\f0\cchs186 \'eb\f0\cchs186 , 1997; Heller, 1999; Gagne, 2004 ir kt.) nurodoma, kad gabaus vaiko savirealizaci\-jai turi (takos jo asmenyb\f0\cchs186 \'eb\f0\cchs186 s nekognityvin\f0\cchs186 \'eb\f0\cchs186 s savyb\f0\cchs186 \'eb\f0\cchs186 s - pasiekim\f0\cchs186 \'f8\f0\cchs186 motyvacija, tei\-giamas \cs45\b\expndtw-10 sav\f0\cchs186 \'e6\f0\cchs186 s \cs55\b0\expndtw0 vertinimas, darbingumas, savikontrol\f0\cchs186 \'eb\f0\cchs186 ir kt. Yra pagrindo manyti, kad tinkamas min\f0\cchs186 \'eb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 GAVUS modelio strukt\f0\cchs186 \'fb\f0\cchs186 rini\f0\cchs186 \'f8\f0\cchs186 element\f0\cchs186 \'f8\f0\cchs186 funkcionavimas palankiai veikia gabaus vaiko asmenyb\f0\cchs186 \'e6\f0\cchs186 , taigi skatina \cs45\b\expndtw-10 j\f0\cchs186 \'e1\f0\cchs186 \cs55\b0\expndtw0 tobul\f0\cchs186 \'eb\f0\cchs186 ti.\par \pard \plain \s2\qj\li0\fi584\ri0\sb8\sa0\sl-271\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Apibendrinant tai, kas pasakyta, galima pateikti tok\f0\cchs186 \'e1\f0\cchs186 teorin\f0\cchs186 \'e1\f0\cchs186 gabi\f0\cchs186 \'f8\f0\cchs186 vaik\f0\cchs186 \'f8 \f0\cchs186 ugdymo ir jo s\f0\cchs186 \'e0\f0\cchs186 lyg\f0\cchs186 \'f8\f0\cchs186 model\f0\cchs186 \'e1\f0\cchs186 :\par \pard \plain \s11\qr\li0\fi0\ri0{\sl-240\slmult0\fs20\par }\sb99\sa0 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 3.1 \cs55 lentel\f0\cchs186 \'eb\par \column \pard \plain \s28\qj\li0\fi0\ri0{\sl-240\slmult0\fs20\par }\sb200\sa0\sl-271\slmult0 \cs48\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Ugdymo rea-\ul lyb\f0\cchs186 \'eb\f0\cchs186 s lygmuo\par \pard \plain \s11\qj\li0\fi0\ri0\sb42\sa0\sl-246\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Interpersona-linis\khftn{\footnote\pard \plain \s13 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 \chftn Pastaba. Interpersonalinio ir intrapersonalinio \cs48\b\fs20 lygmens \cs55\b0\fs22 elemcr\cs48\b\f0\cchs186\fs20 \'a3\f0\cchs186 E\cs52\b0\expndtw-20\fs30 ^^PK\cs48\b\expndtw0\fs20 ^niaj\par \pard \plain \s13 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 modelio elementai, kuri\f0\cchs186 \'f8\f0\cchs186 optimaliamveikimui \cs49 ir skirtas ug\strike dy\strike0 m\strike o\strike0 \cs55 s\f0\cchs186 \'e0\f0\cchs186 lyg\f0\cchs186 \'f8\f0\cchs186 \cs60\fs20 mo\-\cs55\fs22 delis\par \pard \plain \s23 \cs63\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw-20\dn0\f0\cchs186\lang1063\langfe1063\fs22 Sukurtasis \expndtw0 GAVUS\expndtw-20 moeelis turi savo strukt\f0\cchs186 \'fb\f0\cchs186 r\f0\cchs186 \'e0\f0\cchs186 , funkcijas \cs53\expndtw-10 ir \cs63\expndtw0 funkcionavimo\expndtw-20 \expndtw0 aptin-\cs53\expndtw-10 k\f0\cchs186 \'e0\f0\cchs186 . \cs63\expndtw-20 Modelis turi \expndtw0 paskirti\expndtw-20 bendr\f0\cchs186 \'e0\f0\cchs186 tiksl\f0\cchs186 \'e0\f0\cchs186 \f0\cchs186 \'97\f0\cchs186 \cs49\i0\expndtw0 sudaryti s\f0\cchs186 \'e0\f0\cchs186 lygas gabiems valkams, nepriklausomai nuo j\f0\cchs186 \'f8\f0\cchs186 socialin\f0\cchs186 \'eb\f0\cchs186 s pad\f0\cchs186 \'eb\f0\cchs186 ties, gyvenamosios vietos, am\-\f0\cchs186 \'fe\f0\cchs186 iaus, lyties ir kt., rinktis j\f0\cchs186 \'f8\f0\cchs186 poreikius atitinkanti ugdym\f0\cchs186 \'e0\f0\cchs186 ir galimybes saviugdai, pad\f0\cchs186 \'eb\f0\cchs186 ti jam ir skatinti vaik\f0\cchs186 \'e0\f0\cchs186 siekti pilno savojo gabum\f0\cchs186 \'f8\f0\cchs186 po\-tencialo realizavimo ir b\f0\cchs186 \'fb\f0\cchs186 ti naudingam visuomenei, Sis tikslas suteikia modeliui vienov\f0\cchs186 \'eb\f0\cchs186 s, vientisumo.\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Kiekvienas strukt\f0\cchs186 \'fb\f0\cchs186 rinis elementas turi ir papildom\f0\cchs186 \'f8\f0\cchs186 (i\f0\cchs186 \'f0\f0\cchs186 vestini\f0\cchs186 \'f8\f0\cchs186 i\f0\cchs186 \'f0\f0\cchs186 ben\-drojo) tiksl\f0\cchs186 \'f8\f0\cchs186 , kurie susij\f0\cchs186 \'e6\f0\cchs186 su funkcijomis, kurias atlieka strukt\f0\cchs186 \'fb\f0\cchs186 rinis elementas. Modelis skirtas \f0\cchs186 \'fe\f0\cchs186 mogui jame vyksta informacijos perdavimo ir valdymo pro\-cesai \f0\cchs186 \'97\f0\cchs186 tai b\f0\cchs186 \'fb\f0\cchs186 dinga visuomenin\f0\cchs186 \'eb\f0\cchs186 ms sistemoms.\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Modelis sudarytas i\f0\cchs186 \'f0\f0\cchs186 posistemi\f0\cchs186 \'f8\f0\cchs186 (pavyzd\f0\cchs186 \'fe\f0\cchs186 iui, GVU atskiroje ugdymo institucijoje, jo posistem\f0\cchs186 \'eb\f0\cchs186 - pedagogin\f0\cchs186 \'eb\f0\cchs186 sistema, ir kt.). Visi GAVUS elementai yra vienaip ar kitaip susij\f0\cchs186 \'e6\f0\cchs186 su ugdymu ir jo funkcijomis: \f0\cchs186 \'f0\f0\cchs186 vietimu, lavinimu, aukl\f0\cchs186 \'eb\f0\cchs186 jimu, mokymu, globojimu, formavimu ir kt. Kiekviena jo sud\f0\cchs186 \'eb\f0\cchs186 tin\f0\cchs186 \'eb\f0\cchs186 dalis atlieka tam tikr\f0\cchs186 \'e0\f0\cchs186 funkcij\f0\cchs186 \'e0\f0\cchs186 (jas nurod\f0\cchs186 \'eb\f0\cchs186 me aptardami model\f0\cchs186 \'e1\f0\cchs186 ). Tuomet, kai mo\-delio strukt\f0\cchs186 \'fb\f0\cchs186 riniai elementai funkcionuoja visuose ugdymo realyb\f0\cchs186 \'eb\f0\cchs186 s lygmeny\-se, jis apima daugel\f0\cchs186 \'e1\f0\cchs186 aplinkos veiksni\f0\cchs186 \'f8\f0\cchs186 , kurie yra gabumo virsmo pasiekimais katalizatoriai. Funkciniais ry\f0\cchs186 \'f0\f0\cchs186 iais susij\f0\cchs186 \'e6\f0\cchs186 elementai sukuria palaikan\f0\cchs186 \'e8\f0\cchs186 i\f0\cchs186 \'e0\f0\cchs186 aplink\f0\cchs186 \'e0 \f0\cchs186 vienas kito veikimui, o tai savo ruo\f0\cchs186 \'fe\f0\cchs186 tu suma\f0\cchs186 \'fe\f0\cchs186 ina atsitiktinum\f0\cchs186 \'f8\f0\cchs186 \f0\cchs186 \'e1\f0\cchs186 tak\f0\cchs186 \'e0\f0\cchs186 tiesiogi\-\cs44 niam \cs49 ugdymui, t.y. skatina gabaus vaiko saviugd\f0\cchs186 \'e0\f0\cchs186 .\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Modelio artimiausioji funkcionavimo aplinka yra \f0\cchs186 \'f0\f0\cchs186 vietimo sistema.\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Modelis yra atviras ir dinami\f0\cchs186 \'f0\f0\cchs186 kas. Atviras, nes tai yra socialin\f0\cchs186 \'eb\f0\cchs186 strukt\f0\cchs186 \'fb\f0\cchs186 ra, kuriai \f0\cchs186 \'e1\f0\cchs186 tak\f0\cchs186 \'e0\f0\cchs186 daro aplinka (netgi jo veikimo realyb\f0\cchs186 \'eb\f0\cchs186 je prasme). Modelio struk\-t\f0\cchs186 \'fb\f0\cchs186 riniai elementai turi daug vidini\f0\cchs186 \'f8\f0\cchs186 ry\f0\cchs186 \'f0\f0\cchs186 i\f0\cchs186 \'f8\f0\cchs186 , o jie savo ruo\f0\cchs186 \'fe\f0\cchs186 tu yra atviri aplinkai, kitoms, i\f0\cchs186 \'f0\f0\cchs186 orin\f0\cchs186 \'eb\f0\cchs186 ms socialin\f0\cchs186 \'eb\f0\cchs186 ms strukt\f0\cchs186 \'fb\f0\cchs186 roms, sistemoms, yra dinami\f0\cchs186 \'f0\f0\cchs186 ki, nes i\f0\cchs186 \'f0\f0\cchs186 likti stati\f0\cchs186 \'f0\f0\cchs186 kam, kai kinta aplinka, n\f0\cchs186 \'eb\f0\cchs186 ra \f0\cchs186 \'e1\f0\cchs186 manoma. Dinami\f0\cchs186 \'f0\f0\cchs186 kas jis ir d\f0\cchs186 \'eb\f0\cchs186 l k\f0\cchs186 \'ab\'a9\f0\cchs186 $}\pAv \pard \plain \s11\qj\li0\fi0\ri0{\sl-240\slmult0\fs20\par }{\sl-240\slmult0\fs20\par }\sb121\sa0\sl-263\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Intrapersona-linis\chftn{\footnote\pard \plain \s13 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 \chftn Pastaba. Interpersonalinio ir intrapersonalinio \cs48\b\fs20 lygmens \cs55\b0\fs22 elemcr\cs48\b\f0\cchs186\fs20 \'a3\f0\cchs186 E\cs52\b0\expndtw-20\fs30 ^^PK\cs48\b\expndtw0\fs20 ^niaj\par \pard \plain \s13 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 modelio elementai, kuri\f0\cchs186 \'f8\f0\cchs186 optimaliam veikimui \cs49 ir skirtas ug\strike dy\strike0 m\strike o\strike0 \cs55 s\f0\cchs186 \'e0\f0\cchs186 lyg\f0\cchs186 \'f8\f0\cchs186 \cs60\fs20 mo\-\cs55\fs22 delis\par \pard \plain \s23 \cs63\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw-20\dn0\f0\cchs186\lang1063\langfe1063\fs22 Sukurtasis \expndtw0 GAVUS\expndtw-20 modelis turi savo strukt\f0\cchs186 \'fb\f0\cchs186 r\f0\cchs186 \'e0\f0\cchs186 , funkcijas \cs53\expndtw-10 ir \cs63\expndtw0 funkcionavimo\expndtw-20 \expndtw0 aptin-\cs53\expndtw-10 k\f0\cchs186 \'e0\f0\cchs186 . \cs63\expndtw-20 Modelis turi \expndtw0 paskirti\expndtw-20 bendr\f0\cchs186 \'e0\f0\cchs186 tiksl\f0\cchs186 \'e0\f0\cchs186 \f0\cchs186 \'97\f0\cchs186 \cs49\i0\expndtw0 sudaryti s\f0\cchs186 \'e0\f0\cchs186 lygas gabiems valkams, nepriklausomai nuo j\f0\cchs186 \'f8\f0\cchs186 socialin\f0\cchs186 \'eb\f0\cchs186 s pad\f0\cchs186 \'eb\f0\cchs186 ties, gyvenamosios vietos, am\-\f0\cchs186 \'fe\f0\cchs186 iaus, lyties ir kt., rinktis j\f0\cchs186 \'f8\f0\cchs186 poreikius atitinkanti ugdym\f0\cchs186 \'e0\f0\cchs186 ir galimybes saviugdai, pad\f0\cchs186 \'eb\f0\cchs186 ti jam ir skatinti vaik\f0\cchs186 \'e0\f0\cchs186 siekti pilno savojo gabum\f0\cchs186 \'f8\f0\cchs186 po\-tencialo realizavimo ir b\f0\cchs186 \'fb\f0\cchs186 ti naudingam visuomenei, Sis tikslas suteikia modeliui vienov\f0\cchs186 \'eb\f0\cchs186 s, vientisumo.\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Kiekvienas strukt\f0\cchs186 \'fb\f0\cchs186 rinis elementas turi ir papildom\f0\cchs186 \'f8\f0\cchs186 (i\f0\cchs186 \'f0\f0\cchs186 vestini\f0\cchs186 \'f8\f0\cchs186 i\f0\cchs186 \'f0\f0\cchs186 ben\-drojo) tiksl\f0\cchs186 \'f8\f0\cchs186 , kurie susij\f0\cchs186 \'e6\f0\cchs186 su funkcijomis, kurias atlieka strukt\f0\cchs186 \'fb\f0\cchs186 rinis elementas. Modelis skirtas \v0\cchs186 \'fe\f0\cchs186 mogui, jame vyksta informacijos perdavimo ir valdymo pro\-cesai \f0\cchs064 \'97\f0\cchs186 tai b\f0\cchs186 \'fb\f0\cchs186 dinga visuomenin\f0\cchs186 \'eb\f0\cchs186 ms sistemoms.\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Modelis sudarytas i\f0\cchs186 \'f0\f0\cchs186 posistemi\f0\cchs186 \'f8\f0\cchs186 (pavyzd\f0\cchs186 \'fe\f0\cchs186 iui, GVU atskiroje ugdymo institucijoje, jo posistem\f0\cchs186 \'eb\f0\cchs186 - pedagogin\f0\cchs186 \'eb\f0\cchs186 sistema, ir kt.). Visi GAVUS elementai yra vienaip ar kitaip susij\f0\cchs186 \'e6\f0\cchs186 su ugdymu ir jo funkcijomis: \f0\cchs186 \'f0\f0\cchs186 vietimu, lavinimu, aukl\f0\cchs186 \'eb\f0\cchs186 jimu, mokymu, globojimu, formavimu ir kt. Kiekviena jo sudf0\cchs186 \'eb\f0\cchs186 tin\f0\cchs186 \'eb\f0\cchs186 dalis atlieka tam tikr\f0\cchs186 \'e0\f0\cchs186 funkcij\f0\cchs186 \'e0\f0\cchs186 (jas nurod\f0\cchs186 \'eb\f0\cchs186 me aptardami model\f0\cchs186 \'e1\f0\cchs186 ). Tuomet, kai mo\-delio strukt\f0\cchs186 \'fb\f0\cchs186 riniai elementai funkcionuoja visuose ugdymo realyb\f0\cchs186 \'eb\f0\cchs186 s lygmeny\-se, jis apima daugel\f0\cchs186 \'e1\f0\cchs186 aplinkos veiksni\f0\cchs186 \'f8\f0\cchs186 , kurie yra gabumo virsmo pasiekimais katalizatoriai. Funkciniais ry\f0\cchs186 \'f0\f0\cchs186 iais susij\f0\cchs186 \'e6\f0\cchs186 elementai sukuria palaikan\f0\cchs186 \'e8\f0\cchs186 i\f0\cchs186 \'e0\f0\cchs186 aplink\f0\cchs186 \'e0 \f0\cchs186 vienas kito vei{imui, o tai savo ruo\f0\cchs186 \'fe\f0\cchs186 tu suma\f0\cchs186 \'fe\f0\cchs186 ina atsitiktinum\f0\cchs186 \'f8\f0\cchs186 \f0\cchs186 \'e1\f0\cchs186 tak\f0\cchs186 \'e0\f0\cchs186 tiesiogi\-\cs44 niam \cs49 ugdymui, t.y. skatina gabaus vaiko saviugd\f0\cchs186 \'e0\f0\cchs186 .\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Modelio artimiausioji funkcionavimo aplinka yra \f0\cchs186 \'f0\f0\cchs186 vietimo sistema.\par \pard \plain \s23 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Modelis yra atviras ir dinami\f0\cchs186 \'f0\f0\cchs186 kas. Atviras, nes tai yra socialin\f0\cchs186 \'eb\f0\cchs186 strukt\f0\cchs186 \'fb\f0\cchs186 ra, kuriai \f0\cchs186 \'e1\f0\cchs186 tak\f0\cchs186 \'e0\f0\cchs186 daro aplinka (netgi jo veikimo realyb\f0\cchs186 \'eb\f0\cchs186 je prasme). Modelio struk\-t\f0\cchs186 \'fb\f0\cchs186 riniai elementai turi daug vidini\f0\cchs186 \'f8\f0\cchs186 ry\f0\cchs186 \'f0\f0\cchs186 i\f0\cchs186 \'f8\f0\cchs186 , o jie savo ruo\f0\cchs186 \'fe\f0\cchs186 tu yra atviri aplinkai, kitoms, i\f0\cchs186 \'f0\f0\cchs186 orin\f0\cchs186 \'eb\f0\cchs186 ms socialin\f0\cchs186 \'eb\f0\cchs186 ms strukt\f0\cchs186 \'fb\f0\cchs186 roms, sistemoms, yra dinami\f0\cchs186 \'f0\f0\cchs186 ki, nes i\f0\cchs186 \'f0\f0\cchs186 likti stati\f0\cchs186 \'f0\f0\cchs186 kam, kai kinta aplinka, n\f0\cchs186 \'eb\f0\cchs186 ra \f0\cchs186 \'e1\f0\cchs186 manoma. Dinami\f0\cchs186 \'f0\f0\cchs186 kas jis ir d\f0\cchs186 \'eb\f0\cchs186 l k\f0\cchs186 \'ab\'a9\f0\cchs186 $}\par \sect\sectd \sbknone\pgwsxn20126\pghsxn13892\marglsxn733\margrsxn360\margtsxn360\margbsxn360\cols1\colsx60 {\header }{\footer \pard \plain \s27\qr\li0\fi0\ri0\sb0\sa0 \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 {\field{\*\fldinst{PAGE}}{\fldrslt 123}}\par }{\pard\plain \sb1144\sa0\sl-240\slmult0\fs20\par}\pard \plain \s29\qj\li11181\fi0\ri0\sb51\sa102 \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 4. \cs55 Gabi\f0\cchs186 \'f8\f0\cchs186 vaik\f0\cchs186 \'f8\f0\cchs186 ufidymo ir jo s\f0\cchs186 \'e0\f0\cchs186 lyg\f0\cchs186 \'f8\f0\cchs186 mo\ul delio rai\f0\cchs186 \'f0\f0\cchs186 kos\ul0 \cs45\b\expndtw-10\f0\cchs186 \'c1\f0\cchs186 \cs55\b0\ul\expndtw0 jetuvo\f0\cchs186 \'e1\f0\cchs186 e \cs60\fs20 pristatymas\par \sect\sectd \sbknone\pgwsxn20126\pghsxn13892\marglsxn733\margrsxn453\margtsxn360\margbsxn360\cols2\colno1\colw8123\colsr2431\colno2\colw8385 {\shpgrp{\*\shpinst \shpleft10622\shptop263\shpright18737\shpbottom1966\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr1\shpz7\shplid7{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 107315}}{\sp{\sn dyWrapDistBottom}{\sv 48260}}{\sp{\sn groupLeft}{\sv 12045}}{\sp{\sn groupTop}{\sv 2846}}{\sp{\sn groupRight}{\sv 20160}}{\sp{\sn groupBottom}{\sv 4549}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 12045}}{\sp{\sn relTop}{\sv 2922}}{\sp{\sn relRight}{\sv 20160}}{\sp{\sn relBottom}{\sv 4100}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx542 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx6666 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7378 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8115 \pard \plain \s35\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Nr.\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0\sl-144\slmult0\tlhyph\tx3744\tlul\tx4574 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn2\f0\cchs186\lang1063\langfe1063\fs22 rr-ri{\charscalex100\expndtw0\tab }\cs61\fs12 _ {\charscalex100\expndtw0\tab } J \f0\cchs186 \'bb\par \pard \plain \s35\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Teiginys \f0\cchs186 \'97\cell \pard \plain \s35\qr\li0\fi0\ri0\sb0\sa0 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 mreies\par \pard \plain \s3\qr\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Vid *\cell \pard \plain \s35\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 t\f0\cchs186 \'e6\f0\cchs186 sinys\par \pard \plain \s24\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs61\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs12 Qt \cs60\fs20 n\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx542 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx6666 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7378 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8115 \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 11.\cell \pard \plain \s35\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 Tr\f0\cchs186 \'fb\f0\cchs186 ksta mokini\f0\cchs186 \'f8\f0\cchs186 t\f0\cchs186 \'eb\f0\cchs186 v\f0\cchs1:6 \'f8\f0\cchs186 palaikymo, pritarimo\cell \pard \plain \s5\qr\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 00\cs49\fs22 .24\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.21\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx542 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx6666 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7378 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8115 \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 12.\cell \pard \plain \s35\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 [Tr\f0\cchs186 \'fb\f0\cchs186 ksta mokyklos administracijos paskatinimo ir \cs57\expndtw10\fs16 nri\cs58\expndtw0\fs20 -^mn\par \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\tlhyph\tx5472\tlhyph\tx6107 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 maksimalus \cs60\b0 galimas trukume .v\cs57\b\expndtw10\fs16 .-rr.\cs59\i\expndtw-10\f9\cchs186\fs22 ^-ETrr\cs60\b0\i0\expndtw0\f0\cchs186\fs20 {\charscalex100\expndtw0\tab }rr{\charscalex100\expndtw0\tab }1\cell \pard \plain \s5\qr\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 00\cs49\fs22 .41\cel \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.22\cell \pard\intbl\row \pard}}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 18025}}{\sp{\sn relTop}{\sv 2846}}{\sp{\sn relRight}{\sv 20152}}{\sp{\sn relBottom}{\sv 3117}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}vs\n\{s\{p{ }1s} fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s11\ql\li0\fi0\ri0\sb0\sa0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 4.2.3 lentel\f0\cchs186 \'eb\f0\cchs186 s t\f0\cchs186 \'e6\f0\cchs186 sinys\par }}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 12629}}{\sp{\sn relTop}{\sv 4074}}{\sp{\sn relRight}{\sv 20100}}{\sp{\sn relBottom}{\sv 4549}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s22\ql\li0\fi2821\ri0\sb0\sa0\sl-161\slmult0\tlhyph\tx3456\tldot\tx3812 \cs62\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs18 _ ,{\charscalex100\expndtw0\tab }{\charscalex100\expndtw0\tab }.\f0\cchs186 \'84\'ab\f0\cchs186 , , icigu \expndtw20 trukumoexpndtw0 \cs55fs22 visi\f0\cchs186 \'f0\f0\cchs186 kai nejau\f0\cchs186 -\line \'e8\f0\cchs186 iama \f0\cchs186 \'97\f0\cchs186 vertinimas \cs49\f0\cchs186 \'84\f0\cchs186 -2".\par }}}}}{\shpgrp{\*\shpinst \shpleft-373\shptop6683\shpright8098\shpbottom12511\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr2\shpwrk3\shpz8\shplid8{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 0}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn groupLeft}{\sv 1050}}{\sp{\sn groupTop}{\sv 9267}}{\sp{\sn groupRight}{\sv 9521}}{\sp{\sn groupBottom}{\sv 15095}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 1050}}{\sp{\sn relTop}{\sv 10275}}{\sp{\sn relRight}{\sv 9521}}{\sp{\sn relBottom}{\sv 15095}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv lbrdrr\brdrs\brdrw15\cltxlrtb\cellx8115 \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 12.\cell \pard \plain \s35\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 [Tr\f0\cchs186 \'fb\f0\cchs186 ksta mokyklos administracijos paskatinimo ir \cs57\expndtw10\fs16 nri\cs58\expndtw0\fs20 -^mn\par \pard \plain \s15\ql\li0\fi0\ri0\sb0\sa0\tlhyph\tx5472\tlhyph\tx6107 \intbl \cs58\i0\strike0\nosupersub\b\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 maksimalus \cs60\b0 galimas trukume .v\cs57\b\expndtw10\fs16 .-rr.\cs59\i\expndtw-10\f9\cchs186\fs22 ^-ETrr\cs60\b0\i0\expndtw0\f0\cchs186\fs20 {\charscalex100\expndtw0\tab }rr{\charscalex100\expndtw0\tab }1\cell \pard \plain \s5\qr\li0\fi0\ri0\sb0\sa0 \intbl \cs60\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs20 00\cs49\fs22 .41\cel \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.22\cell \pard\intbl\row \pard}}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 18025}}{\sp{\sn relTop}{\sv 2846}}{\sp{\sn relRight}{\sv 20152}}{\sp{\sn relBottom}{\sv 3117}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}vs\n\{s\{p{ }1s} fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s11\ql\li0\fi0\ri0\sb0\sa0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 4.2.3 lentel\f0\cchs186 \'eb\f0\cchs186 s t\f0\cchs186 \'e6\f0\cchs186 sinys\par }}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 12629}}{\sp{\sn relTop}{\sv 4074}}{\sp{\sn relRight}{\sv 20100}}{\sp{\sn relBottom}{\sv 4549}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s22\ql\li0\fi2821\ri0\sb0\sa0\sl-161\slmult0\tlhyph\tx3456\tldot\tx3812 \cs62\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs18 _ ,{\charscalex100\expndtw0\tab }{\charscalex100\expndtw0\tab }.\f0\cchs186 \'84\'ab\f0\cchs186 , , icigu \expndtw20 trukumoexpndtw0 \cs55fs22 visi\f0\cchs186 \'f0\f0\cchs186 kai nejau\f0\cchs186 -\line \'e8\f0\cchs186 iama \f0\cchs186 \'97\f0\cchs186 vertinimas \cs49\f0\cchs186 \'84\f0\cchs186 -2".\par }}}}}{\shpgrp{\*\shpinst \shpleft-373\shptop6683\shpright8098\shpbottom12511\shpfhdr0\shpfblwtxt0\shpbxmargin\shpbypara\shpwr2\shpwrk3\shpz8\shplid8{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}{\sp{\sn fAllowOverlap}{\sv 1}}{\sp{\sn dxWrapDistLeft}{\sv 21590}}{\sp{\sn dxWrapDistRight}{\sv 21590}}{\sp{\sn dyWrapDistTop}{\sv 0}}{\sp{\sn dyWrapDistBottom}{\sv 0}}{\sp{\sn groupLeft}{\sv 1050}}{\sp{\sn groupTop}{\sv 9267}}{\sp{\sn groupRight}{\sv 9521}}{\sp{\sn groupBottom}{\sv 15095}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 1050}}{\sp{\sn relTop}{\sv 10275}}{\sp{\sn relRight}{\sv 9521}}{\sp{\sn relBottom}{\sv 15095}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdr15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s30\ql\li246\fi0\ri0\sb0\sa0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Nr\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\strike0\nosupersub\scaps0\chrlex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Teiginys\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Vid.*\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 St. n.\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s30\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1 \super 1\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Tr\f0\cchs186 \'fb\f0\cchs186 ksta u\f0\cchs186 \'fe\f0\cchs186 mokes\f0\cchs186 \'e8\f0\cchs186 io u\f0\cchs186 \'fe\f0\cchs186 \cs56\fs18 papildom\f0\cchs186 \'e0\f0\cchs186 \cs55\fs22 darb\f0\cchs186 \'e0\f0\cchs186 ,.\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.43\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.84\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s30\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 12.\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Tr\f0\cchs186 \'fb\f0\cchs186 ksta materialinio paskatinimo itin gabiems mokiniams.\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.35\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.87\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s30\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 13.\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-288\slmult0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Tr\f0\cchs186 \'fb\f0\cchs186 ksta bendros itin gabi\f0\cchs186 \'f8\f0\cchs186 vaik\f0\cchs186 \'f8\f0\cchs186 ugdymo politikos visos i\f0\cchs186 \'f0\f0\cchs186 liet \cs52\expndtw-20\fs30 j \cs44\expndtw0\fs22 mastu.\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.27\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.85\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s30\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 14.\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 [Tr\f0\cchs186 \'fb\f0\cchs186 ksta apr\f0\cchs186 \'fb\f0\cchs186 pinimo reikalinga mokymo metodine med\f0\cchs186 \'fe\f0\cchs186 iaga\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.22\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.96\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s30\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 15.\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-296\slmult0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Tr\f0\cchs186 \'fb\f0\cchs186 ksta kvalifikacijos k\f0\cchs186 \'eb\f0\cchs186 limo kurs\f0\cchs186 \'f8\f0\cchs186 itin gabi\f0\cchs186 \'f8\f0\cchs186 vaik\f0\cchs186 \'f8\f0\cchs186 ugdymo \cs44 tems.\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1\cs49 .20\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.91\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrsbrdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s30\ql\li0\fi0\ri0\sb0\sa0\sl-407\slmult0 \intbl \cs52\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw-20\up2\f0\cchs186\lang1063\langfe1063\fs30 j \cs44\expndtw0\fs22 6. \cs55 j\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-313\slmult0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Tr\f0\cchs186 \'fb\f0\cchs186 ksta \cs55 bendradarbiavimo tu auk\f0\cchs186 \'f0\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 j\f0\cchs186 \'f8\f0\cchs186 mokykl\f0\cchs186 \'f8\f0\cchs186 d\f0\cchs186 \'eb\f0\cchs186 stytojais, \cs44 mokalininkaif.\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1\cs49 .04\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.99\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0\sl-313\slmult0 \intbl \cs44\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 7. \cs55 1 \cs44 Tr\f0\cchs186 \'fb\f0\cchs186 ksta literatu \expndtw-20 rot\expndtw0 \cs54\i\expndtw-20 apie itin \cs55\i0\expndtw0 gabi\f0\cchs186 \'f8\f0\cchs186 vaik\f0\cchs186 \'f8\f0\cchs186 pa\f0\cchs186 \'fe\f0\cchs186 inim\f0\cchs186 \'e0\f0\cchs186 , ugdym\f0\cchs186 \'e0\f0\cchs186 , \cs52\expndtw-20\fs30 j \cs55\expndtw0\fs22 psichologij\f0\cchs186 \'e0\f0\cchs186 , \cs44 kir\f0\cchs186 \'f8\f0\cchs186 \cs55\f0\cchs186 \'f0\f0\cchs186 ali\f0\cchs186 \'f8\f0\cchs186 patirt j.\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1\cs49 .00\cell \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.97\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 8. \cs55 j Tr\f0\cchs186 \'fb\f0\cchs186 ksta \cs44 bendradarbiavimo \cs55 su patyrusiais \f0\cchs186 \'f0\f0\cchs186 ioje srityje kolegomis,\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.88\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.02\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s32\ql\li0\fi0\ri0\sb0\sa0\sl-356\slmult0 \intbl \cs52\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw-20\dn4\f0\cchs186\lang1063\langfe1063\fs30 1 \cs49\expndtw0\fs22 1\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtu0\dn0\f0\cchs186\lang1063\langfe1063\fs22 'r\f0\cchs186 \'fb\f0\cchs186 ksta \cs44 tinkamo \cs55 pasirengimo auk\f0\cchs186 \'f0\f0\cchs186 tojoje mokykloje.\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 0.56\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.17\cell \pard\intbl\row \trowd\trgaph40 \trrh0 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx661 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7014 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx7751 \clvertalt\clbrdrt\brdrs\brdrw15\clbrdrl\brdrs\brdrw15\clbrdrb\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\cltxlrtb\cellx8471 \pard \plain \s5\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs49\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 10. 7\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 r\f0\cchs186 \'fb\f0\cchs186 ksta galimybi\f0\cchs186 \'f8\f0\cchs186 \cs44 naudotis \cs55 kompiuteriu ir internetu.\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 -0.19\cell \pard \plain \s3\ql\li0\fi0\ri0\sb0\sa0 \intbl \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 1.33\cell \pard\intbl\row \pard}}}{\shp {\*\shpinst \shplid1{\sp{\sn relLeft}{\sv 2151}}{\sp{\sn relTop}{\sv 9267}}{\sp{\sn relRight}{\sv 8724}}{\sp{\sn relBottom}{\sv 10300}}{\sp{\sn fRelFlipH}{\sv 0}}{\sp{\sn fRelFlipV}{\sv 0}}{\sp{\sn shapeType}{\sv 202}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLine}{\sv 1}}{\sp{\sn lineWidth}{\sv 0}}{\sp{\sn lineColor}{\sv 16777215}}{\sp{\sn fPrint}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn fEditedWrap}{\sv 0}}{\sp{\sn txflTextFlow}{\sv 0}}{\sp{\sn dxTextLeft}{\sv 0}}{\sp{\sn dyTextTop}{\sv 0}}{\sp{\sn dxTextRight}{\sv 0}}{\sp{\sn dyTextBottom}{\sv 0}}{\sp{\sn fFitTextToShape}{\sv 0}}{\shptxt \pard \plain \s2\qj\li0\fi0\ri0\sb0\sa0\sl-330\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 Duomenys apie tai, ko mokytojams tr\f0\cchs186 \'fb\f0\cchs186 ksta darbui su itin\par \pard \plain \s20\ql\li0\fi2406\ri0\sb0\sa0\sl-330\slmult0\tlul\tx805 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 gabiais vaikais\line \lang1033 {\charscalex100\expndtw0\tab }\ul\lang1063 (Narkevi\f0\cchs186 \'e8\f0\cchs186 ien\f0\cchs186 \'eb\f0\cchs186 , Janilionis,\ul0 Almonaitien\f0\cchs186 \'eb\f0\cchs186 , \cs49 2002)\par }}}}}\pard \plain \s11\qj\li0\fi0\ri0\sb0\sa0\sl-322\slmult0 \cs55\b0\i0\strike0\nosupersub\scaps0\charscalex100\expndtw0\dn0\f0\cchs186\lang1063\langfe1063\fs22 niams, galima manyti, kad jaunesni\f0\cchs186 \'f8\f0\cchs186 j\f0\cchs186 \'f8\f0\cchs186 klasi\f0\cchs186 \'f8\f0\cchs186 gabi\f0\cchs186 \'f8\f0\cchs186 mokini\fcchs186 \'f8\f0\cchs186 ugdymo rezulta\-tai \f0\cchs186\'fe\f0\cchs186 inomi ir fiksuojami tik klases ir mokyklos (atskirais atvejais savivaldyb\f0\cchs186 \'eb\f0\cchs186 s) lygmeniu. be to, olimpiad\f0\cchs186 \'f8\f0\cchs186 rezultatai - tai tik pasiekimai, \cs49 o \cs55 kas daroma klas\f0\cchs186 \'eb\-\f0\cchs186 je, \cs53\i\expndtw-10 mokykloje, \cs55\i0\expndtw0 kad tie pasiekimai b\f0\cchs186 \'fb\f0\cchs186 t\f0\cchs186 \'f8\f0\cchs186 tokie, ir \cs49 ar \cs55 tie pasiekimai \f0\cchs186 \'97\f0\cchs186 tai mokytojo ir mokinio darbo rezultatas ar tik mokinio potencialo \{vertinimas, informaci\-jos taip pat neturime arba turime labai nedaug \cs49 (\f0\cchs186 \'fe\f0\cchs186 r. \cs55 Narkevi\f0\cchs186 \'e8\f0\cchs186 ien\f0\cchs186 \'eb\f0\cchs186 , \cs49 1997,1998, \cs55 2003, Narkevi\f0\cchs186 \'e8\f0\cchs186 ien\f0\cchs186 \'eb\f0\cchs186 , Janilionis, Almonaitien\f0\cchs186 \'eb\f0\cchs186 , \cs49 2002).\par \pard \plain \s2\qj\li0\fi576\ri0\sb0\sa0\sl-322\slmult0 \cs63\b0\strike0\nosupersub\i\scaps0\charscalex100\expndtw-20\dn0\f0\cchs186\lang1063\langfe1063\fs22 Mokytoj\f0\cchs186 \'f8\f0\cchs186 rengimas. \cs55\i0\expndtw0 N\f0\cchs186 \'eb\f0\cchs186 vienas Lietuvos universitetas, rengiantis mokyto\-jus, nesi\f0\cchs186 \'fb\f0\cchs186 lo pirmos ar antros pakopos studij\f0\cchs186 \'f8\f0\cchs186 programos, kurios paskirtis b\f0\cchs186 \'fb\f0\cchs186 t\f0\cchs186 \'f8 \f0\cchs186 ai\f0\cchs186 \'f0\f0\cchs186 kiai orientuota \f0
diff --git a/sw/qa/extras/layout/data/forcepoint91.html b/sw/qa/extras/layout/data/forcepoint91.html
new file mode 100644
index 000000000000..eacbd2e05ab8
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint91.html
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint92.doc b/sw/qa/extras/layout/data/forcepoint92.doc
new file mode 100644
index 000000000000..49c4a7f11dfe
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint92.doc
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint93-1.rtf b/sw/qa/extras/layout/data/forcepoint93-1.rtf
new file mode 100644
index 000000000000..bbe5ecfb78f2
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint93-1.rtf
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint93-2.rtf b/sw/qa/extras/layout/data/forcepoint93-2.rtf
new file mode 100644
index 000000000000..bcc5f3dc8855
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint93-2.rtf
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint94.html b/sw/qa/extras/layout/data/forcepoint94.html
new file mode 100644
index 000000000000..8be788f8e4e5
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint94.html
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint98.html b/sw/qa/extras/layout/data/forcepoint98.html
new file mode 100644
index 000000000000..9d4b76c53e76
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint98.html
Binary files differ
diff --git a/sw/qa/extras/layout/data/forcepoint99.html b/sw/qa/extras/layout/data/forcepoint99.html
new file mode 100644
index 000000000000..6eb36a616e26
--- /dev/null
+++ b/sw/qa/extras/layout/data/forcepoint99.html
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf141079.odt b/sw/qa/extras/layout/data/tdf141079.odt
new file mode 100644
index 000000000000..65dfcb4a296f
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf141079.odt
Binary files differ
diff --git a/sw/qa/extras/layout/data/tdf147485-forcepoint.doc b/sw/qa/extras/layout/data/tdf147485-forcepoint.doc
new file mode 100644
index 000000000000..cb630efb8717
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf147485-forcepoint.doc
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 28ee6095792d..a7b48240ca41 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -63,23 +63,6 @@ SwDoc* SwLayoutWriter::createDoc(const char* pName)
return pTextDoc->GetDocShell()->GetDoc();
}
-static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent,
- const OUString& rCommand,
- const uno::Sequence<beans::PropertyValue>& rPropertyValues)
-{
- uno::Reference<frame::XController> xController
- = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
- CPPUNIT_ASSERT(xController.is());
- uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xFrame.is());
-
- uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
- uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext));
- CPPUNIT_ASSERT(xDispatchHelper.is());
-
- xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues);
-}
-
// this is a member because our test classes have protected members :(
void SwLayoutWriter::CheckRedlineFootnotesHidden()
{
@@ -120,7 +103,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes)
// verify after load
CheckRedlineFootnotesHidden();
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -198,7 +181,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFootnotes)
assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[5]/txt[1]/Text[3]", "Portion", "o");
// verify after hide
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
CheckRedlineFootnotesHidden();
@@ -237,7 +220,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pWrtShell->SplitNode(false);
pWrtShell->Insert("ghi");
- lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ dispatchCommand(mxComponent, ".uno:TrackChanges", {});
// delete redline inside fly
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false);
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false);
@@ -259,7 +242,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -273,7 +256,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion",
"ahi");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -335,7 +318,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -350,7 +333,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
xmlXPathFreeObject(pXmlObj);
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -411,7 +394,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -425,7 +408,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/anchored/fly[1]/txt[1]/Text[1]", "Portion",
"ahi");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -515,7 +498,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pWrtShell->SplitNode(false);
pWrtShell->Insert("ghi");
- lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ dispatchCommand(mxComponent, ".uno:TrackChanges", {});
// delete redline inside fly
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false);
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false);
@@ -537,7 +520,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -553,7 +536,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]",
"Portion", "ahi");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -617,7 +600,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -635,7 +618,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
xmlXPathFreeObject(pXmlObj);
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -698,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -714,7 +697,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
assertXPath(pXmlDoc, "/root/page[1]/header/txt[1]/anchored/fly[1]/txt[1]/Text[1]",
"Portion", "ahi");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -810,7 +793,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
pWrtShell->SplitNode(false);
pWrtShell->Insert("ghi");
- lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ dispatchCommand(mxComponent, ".uno:TrackChanges", {});
// delete redline inside fly
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false);
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false);
@@ -840,7 +823,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -860,7 +843,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
"PortionType::FootnoteNum");
assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -945,7 +928,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -967,7 +950,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
xmlXPathFreeObject(pXmlObj);
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1053,7 +1036,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
pDoc->SetAttr(anchor, *const_cast<SwFrameFormat*>(pFly));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -1073,7 +1056,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
"PortionType::FootnoteNum");
assertXPath(pXmlDoc, "/root/page[1]/ftncont/ftn[1]/txt[1]/Special[1]", "rText", "1");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1247,7 +1230,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pWrtShell->SplitNode(false);
pWrtShell->Insert("pqr");
- lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ dispatchCommand(mxComponent, ".uno:TrackChanges", {});
// delete redline inside fly2
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false);
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false);
@@ -1280,7 +1263,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pDoc->SetAttr(anchor2, *const_cast<SwFrameFormat*>(pFly2));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -1308,7 +1291,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para");
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1422,7 +1405,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pDoc->SetAttr(anchor2, *const_cast<SwFrameFormat*>(pFly2));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -1437,7 +1420,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
xmlXPathFreeObject(pXmlObj);
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1549,7 +1532,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pDoc->SetAttr(anchor2, *const_cast<SwFrameFormat*>(pFly2));
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -1577,7 +1560,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para");
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1711,7 +1694,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
pWrtShell->SplitNode(false);
pWrtShell->Insert("pqr");
- lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ dispatchCommand(mxComponent, ".uno:TrackChanges", {});
// delete redline inside fly2
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 2, /*bBasicCall=*/false);
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 8, /*bBasicCall=*/false);
@@ -1729,7 +1712,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 7, /*bBasicCall=*/false);
pWrtShell->Delete();
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
xmlDocPtr pXmlDoc = parseLayoutDump();
@@ -1754,7 +1737,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para");
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foaz");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1836,7 +1819,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
anchor1.SetAnchor(pWrtShell->GetCursor()->GetPoint());
pDoc->SetAttr(anchor1, *const_cast<SwFrameFormat*>(pFly1));
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1851,7 +1834,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
xmlXPathFreeObject(pXmlObj);
}
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -1952,7 +1935,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections)
// verify after load
CheckRedlineSectionsHidden();
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
// why is this needed explicitly?
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
@@ -2000,7 +1983,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections)
assertXPath(pXmlDoc, "/root/page[1]/body/section[2]/txt[3]/Text[2]", "Portion", "lah");
// verify after hide
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
// why is this needed explicitly?
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
@@ -2024,7 +2007,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "nType", "PortionType::Para");
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Text[1]", "Portion", "foar");
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
// why is this needed explicitly?
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
@@ -2061,7 +2044,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[2]/Text[2]", "Portion", "ar");
// verify after hide
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
// why is this needed explicitly?
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
@@ -2140,7 +2123,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineCharAttributes)
// verify after load
CheckRedlineCharAttributesHidden();
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
// why is this needed explicitly?
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
@@ -2230,7 +2213,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineCharAttributes)
assertXPath(pXmlDoc, "/root/page[1]/body/txt[11]/Text[5]", "Portion", "baz");
// verify after hide
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
// why is this needed explicitly?
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
@@ -2258,7 +2241,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineShowHideFootnotePagination)
"zzz. zzz zzzz zzzz7 zzz zzz zzzzzzz zzz zzzz zzzzzzzzzzzzzz zzzzzzzzzzzz ");
// hide redlines - all still visible footnotes move to page 1
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -2267,7 +2250,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineShowHideFootnotePagination)
assertXPath(pXmlDoc, "/root/page[2]/ftncont/ftn", 0);
// show again - should now get the same result as on loading
- lcl_dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:ShowTrackedChanges", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -2881,8 +2864,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf127606)
// tdf#127606: now it's possible to change formatting of numbering
// increase font size (220 -> 260)
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Grow", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Grow", {});
pViewShell->Reformat();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -2946,14 +2929,85 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint72) { createDoc("forcepoint72
//just care it doesn't crash/assert
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint75) { createDoc("forcepoint75-1.rtf"); }
+// FIXME: apparently infinite loop on Mac
+#ifndef MACOSX
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testUXTSOREL) { createDoc("LIBREOFFICE-UXTSOREL.rtf"); }
+#endif
+
//just care it doesn't crash/assert
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepointFootnoteFrame)
{
createDoc("forcepoint-swfootnoteframe-1.rtf");
}
-//FIXME: disabled after failing again with fixed layout
-//CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint76) { createDoc("forcepoint76-1.rtf"); }
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint76)
+{
+ createDoc("forcepoint76-1.rtf");
+}
+
+//just care it doesn't crash/assert
+#if 0 // no createSwWebDoc
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint89)
+{
+ createSwWebDoc(DATA_DIRECTORY, "forcepoint89.html");
+}
+#endif
+
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testN4LA0OHZ) { createDoc("LIBREOFFICE-N4LA0OHZ.rtf"); }
+
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint90)
+{
+ createDoc("forcepoint90.rtf");
+}
+
+//just care it doesn't crash/assert
+#if 0 // no createSwWebDoc
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint91)
+{
+ createSwWebDoc(DATA_DIRECTORY, "forcepoint91.html");
+}
+#endif
+
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint92) { createDoc("forcepoint92.doc"); }
+
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint93)
+{
+//fails to load createDoc("forcepoint93-1.rtf");
+//layout loop createDoc("forcepoint93-2.rtf");
+}
+
+#if 0 // no createSwWebDoc
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint94)
+{
+ createSwWebDoc(DATA_DIRECTORY, "forcepoint94.html");
+}
+#endif
+
+//just care it doesn't crash/assert
+#if 0 // no createSwWebDoc
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint98)
+{
+ createSwWebDoc(DATA_DIRECTORY, "forcepoint98.html");
+}
+#endif
+
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint102)
+{
+ createDoc("forcepoint102.rtf");
+}
+
+//just care it doesn't crash/assert
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf147485Forcepoint)
+{
+ createDoc("tdf147485-forcepoint.doc");
+}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058)
{
@@ -2962,6 +3016,14 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058)
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
}
+//just care it doesn't crash/assert
+#if 0 // no createSwWebDoc
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testForcepoint99)
+{
+ createSwWebDoc(DATA_DIRECTORY, "forcepoint99.html");
+}
+#endif
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611)
{
createDoc("tdf128611.fodt");
@@ -3419,6 +3481,36 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testImageComment)
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5), aPosition.nContent.GetIndex());
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testScriptField)
+{
+ // Test clicking script field inside table ( tdf#141079 )
+ SwDoc* pDoc = createDoc("tdf141079.odt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ // Look up layout position which is the first cell in the table
+ SwRootFrame* pRoot = pWrtShell->GetLayout();
+ CPPUNIT_ASSERT(pRoot->GetLower()->IsPageFrame());
+ SwPageFrame* pPage = static_cast<SwPageFrame*>(pRoot->GetLower());
+ CPPUNIT_ASSERT(pPage->GetLower()->IsBodyFrame());
+ SwBodyFrame* pBody = static_cast<SwBodyFrame*>(pPage->GetLower());
+ CPPUNIT_ASSERT(pBody->GetLower()->IsTextFrame());
+ SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pBody->GetLower());
+ CPPUNIT_ASSERT(pTextFrame->GetNext()->IsTabFrame());
+ SwFrame* pTable = pTextFrame->GetNext();
+ SwFrame* pRow1 = pTable->GetLower();
+ CPPUNIT_ASSERT(pRow1->GetLower()->IsCellFrame());
+ SwFrame* pCell1 = pRow1->GetLower();
+ CPPUNIT_ASSERT(pCell1->GetLower()->IsTextFrame());
+ SwTextFrame* pCellTextFrame = static_cast<SwTextFrame*>(pCell1->GetLower());
+ const SwRect& rCellRect = pCell1->getFrameArea();
+ Point aPoint = rCellRect.Center();
+ aPoint.setX(aPoint.getX() - rCellRect.Width() / 2);
+ // Ask for the doc model pos of this layout point.
+ SwPosition aPosition(*pCellTextFrame->GetTextNodeForFirstText());
+ pCellTextFrame->GetCursorOfst(&aPosition, aPoint);
+ // Position was 1 without the fix from tdf#141079
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aPosition.nContent.GetIndex());
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf64222)
{
createDoc("tdf64222.docx");
diff --git a/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt
new file mode 100644
index 000000000000..f2bffb050ac4
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf131025_noZerosInTable.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 7bdb9163e372..81853569f80c 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -219,6 +219,16 @@ DECLARE_ODFEXPORT_TEST(testTdf43569, "tdf43569_conditionalfield.doc")
CPPUNIT_ASSERT(xFields->hasMoreElements());
}
+DECLARE_ODFEXPORT_TEST(testTdf131025_noZerosInTable, "tdf131025_noZerosInTable.odt")
+{
+ uno::Reference<text::XTextTablesSupplier> xSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xTables = xSupplier->getTextTables();
+ uno::Reference<text::XTextTable> xTable(xTables->getByName("Table1"), uno::UNO_QUERY);
+
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("C3"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("5 gp"), xCell->getString());
+}
+
DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
{
uno::Reference<drawing::XShape> const xShape(getShape(1));
diff --git a/sw/qa/extras/odfimport/data/PageAnchorZIndexFirstPage.fodt b/sw/qa/extras/odfimport/data/PageAnchorZIndexFirstPage.fodt
new file mode 100644
index 000000000000..6acb5e6d8256
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/PageAnchorZIndexFirstPage.fodt
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+ <style:font-face style:name="Droid Sans Devanagari" svg:font-family="&apos;Droid Sans Devanagari&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Droid Sans Devanagari1" svg:font-family="&apos;Droid Sans Devanagari&apos;" style:font-family-generic="swiss"/>
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Noto Serif CJK SC" svg:font-family="&apos;Noto Serif CJK SC&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Source Han Sans CN" svg:font-family="&apos;Source Han Sans CN&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard">
+ <loext:graphic-properties draw:fill-color="#eeeeee"/>
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="P3" style:family="paragraph">
+ <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="P4" style:family="paragraph">
+ <loext:graphic-properties draw:fill-color="#eeeeee"/>
+ <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0.145cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/>
+ </style:style>
+ <style:style style:name="fr2" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" style:mirror="none" fo:clip="rect(0.046cm, 0cm, 0.046cm, 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/>
+ </style:style>
+ <style:style style:name="gr1" style:family="graphic">
+ <style:graphic-properties draw:fill-color="#eeeeee" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="1.452cm" fo:min-width="1.637cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/>
+ <style:paragraph-properties style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="gr2" style:family="graphic">
+ <style:graphic-properties draw:fill-color="#eeeeee" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="1.515cm" fo:min-width="2.18cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/>
+ <style:paragraph-properties style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ <style:style style:name="dp1" style:family="drawing-page">
+ <style:drawing-page-properties draw:background-size="full"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1" draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:sequence-decls>
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+ </text:sequence-decls>
+ <draw:frame draw:style-name="fr1" draw:name="Image2" text:anchor-type="page" text:anchor-page-number="1" svg:x="9.14cm" svg:y="7.703cm" svg:width="8.62cm" svg:height="8.652cm" draw:z-index="1">
+ <draw:image draw:mime-type="image/jpeg">
+ <office:binary-data>/9j/4AAQSkZJRgABAQEASABIAAD/2wBDABcQERQRDhcUEhQaGBcbIjklIh8fIkYyNSk5UkhX
+ VVFIUE5bZoNvW2F8Yk5QcptzfIeLkpSSWG2grJ+OqoOPko3/2wBDARgaGiIeIkMlJUONXlBe
+ jY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY3/wAAR
+ CAARABADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA
+ AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK
+ FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG
+ h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl
+ 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+ AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk
+ NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE
+ hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk
+ 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDmbO2a6uBEpx3J9BU2oWBsypDbkbuR0NJp
+ lyttdhpOFYbSfSrGsXkU4SOJg2DkkdKxcp+0SWxulD2bb3MyiiitjA//2Q==</office:binary-data>
+ </draw:image>
+ </draw:frame>
+ <draw:frame draw:style-name="fr2" draw:name="Image1" text:anchor-type="page" text:anchor-page-number="1" svg:x="7.541cm" svg:y="0.123cm" svg:width="11.536cm" svg:height="6.879cm" draw:z-index="0">
+ <draw:image draw:mime-type="image/jpeg">
+ <office:binary-data>/9j/4AAQSkZJRgABAQEARwBHAAD/2wBDABMNDhAODBMQDxAVFBMWHC4eHBoaHDkpKyIuQztH
+ RkI7QUBKVGtaSk9lUEBBXX5eZW5yd3l3SFmDjIJ0i2t1d3P/2wBDARQVFRwYHDceHjdzTUFN
+ c3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3P/wAAR
+ CAANABYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA
+ AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK
+ FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG
+ h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl
+ 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+ AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk
+ NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE
+ hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk
+ 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDjYImnnSJerkAZre/4R6ARf62Tfj73GPyr
+ nkZkcOpIZTkEdq1P7fu/L27Y9397Fc9aNVtezZ0UZUknzozp4mgmeJiCUODiimu7O5ZjlmOS
+ T3oroW2pg7X0P//Z</office:binary-data>
+ </draw:image>
+ </draw:frame>
+ <draw:custom-shape text:anchor-type="page" text:anchor-page-number="1" draw:z-index="3" draw:name="Shape2" draw:style-name="gr1" draw:text-style-name="P4" svg:width="1.638cm" svg:height="1.452cm" svg:x="13.571cm" svg:y="8.13cm">
+ <text:p text:style-name="P3">
+ <text:span text:style-name="T1">2</text:span>
+ </text:p>
+ <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/>
+ </draw:custom-shape>
+ <draw:custom-shape text:anchor-type="page" text:anchor-page-number="1" draw:z-index="2" draw:name="Shape1" draw:style-name="gr2" draw:text-style-name="P4" svg:width="2.181cm" svg:height="1.516cm" svg:x="16.718cm" svg:y="0.187cm">
+ <text:p text:style-name="P3">
+ <text:span text:style-name="T1">1</text:span>
+ </text:p>
+ <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/>
+ </draw:custom-shape>
+ <text:p text:style-name="Standard"/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/odfimport/data/PageAnchorZIndexSecondPage.fodt b/sw/qa/extras/odfimport/data/PageAnchorZIndexSecondPage.fodt
new file mode 100644
index 000000000000..e335eee449bd
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/PageAnchorZIndexSecondPage.fodt
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+ <style:font-face style:name="Droid Sans Devanagari" svg:font-family="&apos;Droid Sans Devanagari&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Droid Sans Devanagari1" svg:font-family="&apos;Droid Sans Devanagari&apos;" style:font-family-generic="swiss"/>
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Noto Serif CJK SC" svg:font-family="&apos;Noto Serif CJK SC&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-face style:name="Source Han Sans CN" svg:font-family="&apos;Source Han Sans CN&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:automatic-styles>
+ <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard">
+ <loext:graphic-properties draw:fill-color="#eeeeee"/>
+ <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="P3" style:family="paragraph">
+ <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="P4" style:family="paragraph">
+ <loext:graphic-properties draw:fill-color="#eeeeee"/>
+ <style:paragraph-properties fo:text-align="center" style:writing-mode="lr-tb"/>
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="T1" style:family="text">
+ <style:text-properties fo:font-size="40pt" style:font-size-asian="40pt" style:font-size-complex="40pt"/>
+ </style:style>
+ <style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0.145cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/>
+ </style:style>
+ <style:style style:name="fr2" style:family="graphic" style:parent-style-name="Graphics">
+ <style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" style:mirror="none" fo:clip="rect(0.046cm, 0cm, 0.046cm, 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/>
+ </style:style>
+ <style:style style:name="gr1" style:family="graphic">
+ <style:graphic-properties draw:fill-color="#eeeeee" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="1.452cm" fo:min-width="1.637cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/>
+ <style:paragraph-properties style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:style style:name="gr2" style:family="graphic">
+ <style:graphic-properties draw:fill-color="#eeeeee" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="1.515cm" fo:min-width="2.18cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/>
+ <style:paragraph-properties style:writing-mode="lr-tb"/>
+ </style:style>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm" loext:margin-gutter="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:page-layout-properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-layout>
+ <style:style style:name="dp1" style:family="drawing-page">
+ <style:drawing-page-properties draw:background-size="full"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1" draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:sequence-decls>
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+ </text:sequence-decls>
+ <draw:frame draw:style-name="fr1" draw:name="Image2" text:anchor-type="page" text:anchor-page-number="2" svg:x="9.14cm" svg:y="7.703cm" svg:width="8.62cm" svg:height="8.652cm" draw:z-index="1">
+ <draw:image draw:mime-type="image/jpeg">
+ <office:binary-data>/9j/4AAQSkZJRgABAQEASABIAAD/2wBDABcQERQRDhcUEhQaGBcbIjklIh8fIkYyNSk5UkhX
+ VVFIUE5bZoNvW2F8Yk5QcptzfIeLkpSSWG2grJ+OqoOPko3/2wBDARgaGiIeIkMlJUONXlBe
+ jY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY3/wAAR
+ CAARABADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA
+ AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK
+ FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG
+ h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl
+ 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+ AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk
+ NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE
+ hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk
+ 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDmbO2a6uBEpx3J9BU2oWBsypDbkbuR0NJp
+ lyttdhpOFYbSfSrGsXkU4SOJg2DkkdKxcp+0SWxulD2bb3MyiiitjA//2Q==</office:binary-data>
+ </draw:image>
+ </draw:frame>
+ <draw:frame draw:style-name="fr2" draw:name="Image1" text:anchor-type="page" text:anchor-page-number="2" svg:x="7.541cm" svg:y="0.123cm" svg:width="11.536cm" svg:height="6.879cm" draw:z-index="0">
+ <draw:image draw:mime-type="image/jpeg">
+ <office:binary-data>/9j/4AAQSkZJRgABAQEARwBHAAD/2wBDABMNDhAODBMQDxAVFBMWHC4eHBoaHDkpKyIuQztH
+ RkI7QUBKVGtaSk9lUEBBXX5eZW5yd3l3SFmDjIJ0i2t1d3P/2wBDARQVFRwYHDceHjdzTUFN
+ c3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3P/wAAR
+ CAANABYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA
+ AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK
+ FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG
+ h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl
+ 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+ AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk
+ NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE
+ hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk
+ 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDjYImnnSJerkAZre/4R6ARf62Tfj73GPyr
+ nkZkcOpIZTkEdq1P7fu/L27Y9397Fc9aNVtezZ0UZUknzozp4mgmeJiCUODiimu7O5ZjlmOS
+ T3oroW2pg7X0P//Z</office:binary-data>
+ </draw:image>
+ </draw:frame>
+ <draw:custom-shape text:anchor-type="page" text:anchor-page-number="2" draw:z-index="3" draw:name="Shape2" draw:style-name="gr1" draw:text-style-name="P4" svg:width="1.638cm" svg:height="1.452cm" svg:x="13.571cm" svg:y="8.13cm">
+ <text:p text:style-name="P3">
+ <text:span text:style-name="T1">2</text:span>
+ </text:p>
+ <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/>
+ </draw:custom-shape>
+ <draw:custom-shape text:anchor-type="page" text:anchor-page-number="2" draw:z-index="2" draw:name="Shape1" draw:style-name="gr2" draw:text-style-name="P4" svg:width="2.181cm" svg:height="1.516cm" svg:x="16.718cm" svg:y="0.187cm">
+ <text:p text:style-name="P3">
+ <text:span text:style-name="T1">1</text:span>
+ </text:p>
+ <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/>
+ </draw:custom-shape>
+ <text:p text:style-name="Standard"/>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 27e1809eaeff..5dd1bccbe924 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1000,5 +1000,33 @@ DECLARE_ODFIMPORT_TEST(testTdf133459, "tdf133459.odt")
CPPUNIT_ASSERT_EQUAL(OUString("QQ YYYY"), getProperty<OUString>(xFormat, "FormatString"));
}
+CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexFirstPage)
+{
+ load(mpTestDocumentPath, "PageAnchorZIndexFirstPage.fodt");
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Image1 index not 0",
+ sal_Int32(0), getProperty<sal_Int32>(getShapeByName(u"Image1"), "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Image2 index not 1",
+ sal_Int32(1), getProperty<sal_Int32>(getShapeByName(u"Image2"), "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape1 index not 2",
+ sal_Int32(2), getProperty<sal_Int32>(getShapeByName(u"Shape1"), "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape2 index not 3",
+ sal_Int32(3), getProperty<sal_Int32>(getShapeByName(u"Shape2"), "ZOrder"));
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testPageAnchorZIndexSecondPage)
+{
+ load(mpTestDocumentPath, "PageAnchorZIndexSecondPage.fodt");
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Image1 index not 0",
+ sal_Int32(0), getProperty<sal_Int32>(getShapeByName(u"Image1"), "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Image2 index not 1",
+ sal_Int32(1), getProperty<sal_Int32>(getShapeByName(u"Image2"), "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape1 index not 2",
+ sal_Int32(2), getProperty<sal_Int32>(getShapeByName(u"Shape1"), "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape2 index not 3",
+ sal_Int32(3), getProperty<sal_Int32>(getShapeByName(u"Shape2"), "ZOrder"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/data/CommentDone.docx b/sw/qa/extras/ooxmlexport/data/CommentDone.docx
new file mode 100644
index 000000000000..1ce5993d440b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/CommentDone.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf104823.docx b/sw/qa/extras/ooxmlexport/data/tdf104823.docx
new file mode 100644
index 000000000000..4a354b848eea
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf104823.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf137466.docx b/sw/qa/extras/ooxmlexport/data/tdf137466.docx
new file mode 100644
index 000000000000..3c5977251bda
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf137466.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf81507.docx b/sw/qa/extras/ooxmlexport/data/tdf81507.docx
new file mode 100644
index 000000000000..2c00ee44cb24
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf81507.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/test_sdt_datepicker.docx b/sw/qa/extras/ooxmlexport/data/test_sdt_datepicker.docx
new file mode 100644
index 000000000000..3ff04cb60b89
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/test_sdt_datepicker.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 6c701c36d274..21037b3f817b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -69,7 +69,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtAlias, "sdt-alias.docx")
return;
// <w:alias> was completely missing.
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:alias", "val", "Subtitle");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:alias", "val", "Subtitle");
}
DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, "footer-body-distance.docx")
@@ -220,7 +220,7 @@ DECLARE_OOXMLEXPORT_TEST(testFDO83044, "fdo83044.docx")
if (!pXmlDoc)
return;
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:text", 1);
}
DECLARE_OOXMLEXPORT_TEST(testfdo83428, "fdo83428.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 6dbef482ef25..7d3a60219728 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -198,6 +198,62 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133473_shadowSize, "tdf133473.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(200000), nSize1);
}
+DECLARE_OOXMLEXPORT_TEST(testCommentDoneModel, "CommentDone.docx")
+{
+ css::uno::Reference<css::text::XTextFieldsSupplier> xTextFieldsSupplier(
+ mxComponent, css::uno::UNO_QUERY_THROW);
+ auto xFields(xTextFieldsSupplier->getTextFields()->createEnumeration());
+
+ // First comment: resolved
+ CPPUNIT_ASSERT(xFields->hasMoreElements());
+ css::uno::Any aComment = xFields->nextElement();
+ css::uno::Reference<css::beans::XPropertySet> xComment(aComment, css::uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(true, xComment->getPropertyValue("Resolved").get<bool>());
+
+ // Second comment: unresolved
+ CPPUNIT_ASSERT(xFields->hasMoreElements());
+ aComment = xFields->nextElement();
+ xComment.set(aComment, css::uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(false, xComment->getPropertyValue("Resolved").get<bool>());
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return; // initial import, no futher checks
+
+ // Ensure that we have <w:text w:multiLine="1"/>
+ CPPUNIT_ASSERT_EQUAL(OUString("1"), getXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text", "multiLine"));
+
+ // Ensure that we have <w:text w:multiLine="0"/>
+ CPPUNIT_ASSERT_EQUAL(OUString("0"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:sdt/w:sdtPr/w:text", "multiLine"));
+
+ // Ensure that we have <w:text/>
+ getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:text", "");
+
+ // Ensure that we have no <w:text/> (not quite correct case, but to ensure import/export are okay)
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtPr/w:text");
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0),
+ static_cast<sal_Int32>(xmlXPathNodeSetGetLength(pXmlObj->nodesetval)));
+ xmlXPathFreeObject(pXmlObj);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx")
+{
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return; // initial import, no futher checks
+
+ // Ensure that we have <w:placeholder><w:docPart v:val="xxxx"/></w:placeholder>
+ OUString sDocPart = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:placeholder/w:docPart", "val");
+ CPPUNIT_ASSERT_EQUAL(OUString("DefaultPlaceholder_-1854013440"), sDocPart);
+
+ // Ensure that we have <w15:color v:val="xxxx"/>
+ OUString sColor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w15:color", "val");
+ CPPUNIT_ASSERT_EQUAL(OUString("FF0000"), sColor);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 9681dc77c186..ac621eb0ca76 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -952,7 +952,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtContent, "SdtContent.docx")
xmlDocPtr pXmlDoc = parseExport("word/header1.xml");
if (!pXmlDoc)
return;
- assertXPath(pXmlDoc, "/w:hdr[1]/w:sdt[1]/w:sdtContent[1]/w:p[1]/w:del[1]");
+// assertXPath(pXmlDoc, "/w:hdr[1]/w:sdt[1]/w:sdtContent[1]/w:p[1]/w:del[1]");
}
#if 0
@@ -1070,11 +1070,11 @@ DECLARE_OOXMLEXPORT_TEST(testSimpleSdts, "simple-sdts.docx")
if (!pXmlDoc)
return;
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:id", 3);
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:picture", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:group", 1);
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:citation", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text", 1);
+ assertXPath(pXmlDoc, "//*/w:sdt/w:sdtPr/w:id", 5);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt[1]/w:sdtPr/w:picture", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:sdt[2]/w:sdtPr/w:group", 1);
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtPr/w:citation", 1);
}
DECLARE_OOXMLEXPORT_TEST(testEmbeddedExcelChart, "EmbeddedExcelChart.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 87795d6ba6c6..9699a57f627b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -139,10 +139,10 @@ DECLARE_OOXMLEXPORT_TEST(testAuthorPropertySdt, "author-property.docx")
if (!pXmlDoc)
return;
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]");
- assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{6C3C8BC8-F283-45AE-878A-BAB7291924A1}");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{6C3C8BC8-F283-45AE-878A-BAB7291924A1}");
// FIXME: the next property doesn't match, though it's correct in theory. A bug in assertXPath?
- // assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "prefixMappings",
+ // assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "prefixMappings",
// "xmlns:ns0='http://purl.org/dc/elements/1.1/' xmlns:ns1='http://schemas.openxmlformats.org/package/2006/metadata/core-properties'");
}
@@ -535,12 +535,12 @@ DECLARE_OOXMLEXPORT_TEST(testFDO79062, "fdo79062.docx")
xmlDocPtr pXmlFootNotes = parseExport("word/footnotes.xml");
if (!pXmlFootNotes)
return;
- assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", "w14 wp14");
+ assertXPath(pXmlFootNotes, "/w:footnotes", "Ignorable", "w14 wp14 w15");
xmlDocPtr pXmlEndNotes = parseExport("word/endnotes.xml");
if (!pXmlEndNotes)
return;
- assertXPath(pXmlEndNotes, "/w:endnotes", "Ignorable", "w14 wp14");
+ assertXPath(pXmlEndNotes, "/w:endnotes", "Ignorable", "w14 wp14 w15");
//tdf#93121 don't add fake tabs in front of extra footnote paragraphs
uno::Reference<text::XFootnotesSupplier> xFootnoteSupp(mxComponent, uno::UNO_QUERY);
@@ -986,8 +986,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-run.docx")
return;
// The problem was that <w:sdt> was closed after "first", not after "second", so the second assert failed.
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[1]/w:t", "first");
- assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[2]/w:t", "second");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r", 1);
// Make sure the third portion is still outside <w:sdt>.
assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:r/w:t", "third");
}
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index b673c06a3d2a..824b4f1d7ce2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -672,7 +672,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtAndShapeOverlapping,"ShapeOverlappingWithSdt.doc
if (!pXmlDoc)
return;
assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent");
- assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]/w:t[1]");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]");
}
DECLARE_OOXMLEXPORT_TEST(testLockedCanvas, "fdo78658.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
index 094a9262ace7..2ef6c105902b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
@@ -11,11 +11,14 @@
#include <xmloff/odffields.hxx>
#include <IDocumentMarkAccess.hxx>
#include <IMark.hxx>
+#include <com/sun/star/text/XTextField.hpp>
+
+char const DATA_DIRECTORY[] = "/sw/qa/extras/ooxmlexport/data/";
class Test : public SwModelTestBase
{
public:
- Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {}
+ Test() : SwModelTestBase(DATA_DIRECTORY, "Office Open XML Text") {}
protected:
/**
@@ -477,7 +480,7 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphSdt, "paragraph-sdt.docx")
if (xmlDocPtr pXmlDoc = parseExport())
{
// The path to w:sdt contained a w:p.
- assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc/w:sdt");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr/w:tc//w:p/w:sdt");
}
}
@@ -615,7 +618,8 @@ DECLARE_OOXMLEXPORT_TEST(testSdtCompanyMultipara, "sdt-company-multipara.docx")
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
{
// This was 3, but multiple paragraphs inside "Company" SDT is now allowed.
- assertXPath(pXmlDoc, "//w:sdtContent/w:p", 1);
+ assertXPath(pXmlDoc, "//w:sdtContent/w:p", 0);
+ assertXPath(pXmlDoc, "//w:sdtContent/w:r", 1);
}
}
@@ -758,6 +762,87 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testConditionalText, "conditional-text.fodt"
assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", aExpected);
}
+DECLARE_OOXMLEXPORT_TEST( testSdtDatePicker, "test_sdt_datepicker.docx" )
+{
+ // Check that roundtrip for date picker field does not lose essential data
+ xmlDocPtr pXmlDoc = parseExport("word/document.xml");
+ if (!pXmlDoc)
+ return; // initial import, no futher checks
+
+ // Placeholder is here
+ OUString sDocPart = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:placeholder/w:docPart", "val");
+ CPPUNIT_ASSERT_EQUAL(OUString("DefaultPlaceholder_-1854013437"), sDocPart);
+
+ // Ensure that we have data binding stuff
+ OUString sDBprefix = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "prefixMappings");
+ CPPUNIT_ASSERT_EQUAL(OUString("xmlns:ns0='http://schemas.microsoft.com/vsto/samples' "), sDBprefix);
+
+ OUString sDBxpath = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath");
+ CPPUNIT_ASSERT_EQUAL(OUString("/ns0:employees[1]/ns0:employee[1]/ns0:hireDate[1]"), sDBxpath);
+
+ OUString sDBstoreid = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID");
+ CPPUNIT_ASSERT_EQUAL(OUString("{241A8A02-7FFD-488D-8827-63FBE74E8BC9}"), sDBstoreid);
+
+ OUString sColor = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w15:color", "val");
+ CPPUNIT_ASSERT_EQUAL(OUString("008000"), sColor);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testTdf104823)
+{
+ // Test how we can roundtrip sdt plain text with databindings support
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf104823.docx";
+ loadURL(aURL, nullptr);
+
+ css::uno::Reference<css::text::XTextFieldsSupplier> xTextFieldsSupplier(
+ mxComponent, css::uno::UNO_QUERY_THROW);
+ auto xFields(xTextFieldsSupplier->getTextFields()->createEnumeration());
+
+ // FIXME: seems order of fields is different than in source document
+ // so feel free to modify testcase if order is changed
+
+ // First field: content from core properties
+ uno::Reference<text::XTextField> xField1(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xFields->hasMoreElements());
+ // Check field value (it should be value from data source) and set new
+ CPPUNIT_ASSERT_EQUAL(OUString("True Core Property Value"), xField1->getPresentation(false));
+ uno::Reference<beans::XPropertySet> xField1Props(xField1, uno::UNO_QUERY);
+ xField1Props->setPropertyValue("Content", uno::makeAny(OUString("New Core Property Value")));
+
+ // Third field: content from custom properties
+ uno::Reference<text::XTextField> xField2(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xFields->hasMoreElements());
+ // Check field value (it should be value from data source) and set new
+ CPPUNIT_ASSERT_EQUAL(OUString("True Custom XML Value"), xField2->getPresentation(false));
+ uno::Reference<beans::XPropertySet> xField2Props(xField2, uno::UNO_QUERY);
+ xField2Props->setPropertyValue("Content", uno::makeAny(OUString("New Custom XML Value")));
+
+ // Second field: content from extended properties
+ uno::Reference<text::XTextField> xField3(xFields->nextElement(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(!xFields->hasMoreElements());
+ // Check field value (it should be value from data source) and set new
+ CPPUNIT_ASSERT_EQUAL(OUString("True Extended Property Value"), xField3->getPresentation(false));
+ uno::Reference<beans::XPropertySet> xField3Props(xField3, uno::UNO_QUERY);
+ xField3Props->setPropertyValue("Content", uno::makeAny(OUString("New Extended Property Value")));
+
+ // Save and check saved data
+ save("Office Open XML Text", maTempFile);
+ mbExported = true;
+ xmlDocPtr pXmlCustomPropsDoc = parseExport("customXml/item1.xml");
+ CPPUNIT_ASSERT(pXmlCustomPropsDoc);
+ // FIXME: strange it won't run simple /employees/employee/name xpath query. Does not like namespaces?
+ assertXPathContent(pXmlCustomPropsDoc, "//*/*[local-name()='name']", "New Custom XML Value");
+
+ xmlDocPtr pXmlAppPropsDoc = parseExport("docProps/app.xml");
+ CPPUNIT_ASSERT(pXmlAppPropsDoc);
+ // TODO: extended properties are not written yet
+ assertXPathContent(pXmlAppPropsDoc, "//*/*[local-name()='Company']", "True Extended Property Value");
+
+ xmlDocPtr pXmlCorePropsDoc = parseExport("docProps/core.xml");
+ CPPUNIT_ASSERT(pXmlCorePropsDoc);
+ // TODO: core properties are not written yet
+ assertXPathContent(pXmlCorePropsDoc, "//*/*[local-name()='creator']", "True Core Property Value");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
index f6939083c456..ef6aaaebbb09 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx
@@ -260,7 +260,7 @@ DECLARE_OOXMLEXPORT_TEST(Test_McIgnorable, "TextEffects_StylisticSets_CntxtAlts.
if (!pXmlDocument)
return;
- assertXPath(pXmlDocument, "/w:document", "Ignorable", "w14 wp14");
+ assertXPath(pXmlDocument, "/w:document", "Ignorable", "w14 wp14 w15");
xmlDocPtr pXmlStyles = parseExport("word/styles.xml");
if (!pXmlStyles)
diff --git a/sw/qa/extras/ooxmlimport/data/tdf118693.docx b/sw/qa/extras/ooxmlimport/data/tdf118693.docx
new file mode 100644
index 000000000000..4e832398bcd5
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf118693.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 24a8a21263a2..1947fd4aaf27 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1315,16 +1315,8 @@ DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx")
// Make sure we're not testing the ellipse child.
CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.LineShape"), xShapeDescriptor->getShapeType());
- // tdf#106792 checked that during load of tdf85232.docx the method
- // SvxShapePolyPolygon::setPropertyValueImpl is used three times. In
- // that method, a call to ForceMetricToItemPoolMetric was missing so
- // that the import did not convert the input values from 100thmm
- // to twips what is needed due to the object residing in Writer. The
- // UNO API by definition is in 100thmm. Result is that in SwXShape::getPosition
- // the offset (aOffset) now is (0, 0) instead of an existing offset in
- // the load of the document before (what is plausible for a GroupObject).
- // Thus, I will adapt the result value here to the now (hopefully) correct one.
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1630), xShape->getPosition().X); // was: 2267
+ // This was 2900: horizontal position of the line was incorrect, the 3 children were not connected visually.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2267), xShape->getPosition().X);
}
DECLARE_OOXMLIMPORT_TEST(testTdf95755, "tdf95755.docx")
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 4b69a62859c6..d0949bcc3750 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -126,6 +126,43 @@ DECLARE_OOXMLIMPORT_TEST(testTdf109524, "tdf109524.docx")
getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf118693, "tdf118693.docx")
+{
+ uno::Reference<drawing::XShape> xGroupShape = getShape(1);
+ uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xGroup->getCount());
+
+ awt::Point aPosGroup = xGroupShape->getPosition();
+ awt::Size aSizeGroup = xGroupShape->getSize();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10162), aPosGroup.X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(118), aPosGroup.Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(6369), aSizeGroup.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4983), aSizeGroup.Height);
+
+ // Without the fix in place, this test would have failed at many places
+ // as the first shape in the group would have had an incorrect position,
+ // an incorrect width or an incorrect height.
+
+ uno::Reference<drawing::XShape> xShape1(xGroup->getByIndex(0), uno::UNO_QUERY_THROW);
+ awt::Point aPosShape1 = xShape1->getPosition();
+ awt::Size aSizeShape1 = xShape1->getSize();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(12863), aPosShape1.X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(146), aPosShape1.Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3669), aSizeShape1.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4914), aSizeShape1.Height);
+
+ uno::Reference<drawing::XShape> xShape2(xGroup->getByIndex(1), uno::UNO_QUERY_THROW);
+ awt::Point aPosShape2 = xShape2->getPosition();
+ awt::Size aSizeShape2 = xShape2->getSize();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10162), aPosShape2.X);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(118), aPosShape2.Y);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4595), aSizeShape2.Width);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(4983), aSizeShape2.Height);
+}
+
DECLARE_OOXMLIMPORT_TEST(testGroupShapeFontName, "groupshape-fontname.docx")
{
// Font names inside a group shape were not imported
diff --git a/sw/qa/extras/tiledrendering/data/shape.fodt b/sw/qa/extras/tiledrendering/data/shape.fodt
index feefe48bcde3..4e9a7f629ba4 100644
--- a/sw/qa/extras/tiledrendering/data/shape.fodt
+++ b/sw/qa/extras/tiledrendering/data/shape.fodt
@@ -1,5 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+
+<office:document xmlns:officeooo="http://openoffice.org/2009/office" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:styles>
+ <style:default-style style:family="graphic">
+ <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+ <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+ <style:tab-stops/>
+ </style:paragraph-properties>
+ <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="GB" style:letter-kerning="true" style:font-name-asian="Noto Serif CJK SC" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Droid Sans Devanagari1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="gr1" style:family="graphic">
+ <style:graphic-properties draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="1.9cm" fo:min-width="3.471cm" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph"/>
+ </style:style>
+ </office:automatic-styles>
<office:body>
<office:text>
<text:sequence-decls>
@@ -7,8 +22,9 @@
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+ <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
</text:sequence-decls>
- <text:p><draw:custom-shape text:anchor-type="paragraph" draw:z-index="0" svg:width="4.883cm" svg:height="3.225cm" svg:x="2.602cm" svg:y="1.178cm">
+ <text:p text:style-name="Standard"><draw:custom-shape text:anchor-type="paragraph" draw:z-index="0" draw:name="Shape1" draw:style-name="gr1" svg:width="4.908cm" svg:height="2.687cm" svg:x="1.575cm" svg:y="-0.132cm">
<text:p/>
<draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437 18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437" draw:type="ellipse" draw:enhanced-path="U 10800 10800 10800 10800 0 360 Z N"/>
</draw:custom-shape>Hello.</text:p>
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 4b9e133c3a52..7e06bef647e1 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -26,6 +26,7 @@
#include <vcl/virdev.hxx>
#include <editeng/editview.hxx>
#include <editeng/outliner.hxx>
+#include <editeng/wghtitem.hxx>
#include <svl/srchitem.hxx>
#include <svl/slstitm.hxx>
#include <svl/stritem.hxx>
@@ -118,6 +119,8 @@ public:
void testTdf115088();
void testRedlineField();
void testIMESupport();
+ void testIMEFormattingAtEndOfParagraph();
+ void testIMEFormattingAfterHeader();
void testSplitNodeRedlineCallback();
void testDeleteNodeRedlineCallback();
void testVisCursorInvalidation();
@@ -138,6 +141,7 @@ public:
void testBulletDeleteInvalidation();
void testBulletNoNumInvalidation();
void testBulletMultiDeleteInvalidation();
+ void testMoveShapeHandle();
CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
CPPUNIT_TEST(testRegisterCallback);
@@ -192,6 +196,8 @@ public:
CPPUNIT_TEST(testTdf115088);
CPPUNIT_TEST(testRedlineField);
CPPUNIT_TEST(testIMESupport);
+ CPPUNIT_TEST(testIMEFormattingAtEndOfParagraph);
+ CPPUNIT_TEST(testIMEFormattingAfterHeader);
CPPUNIT_TEST(testSplitNodeRedlineCallback);
CPPUNIT_TEST(testDeleteNodeRedlineCallback);
CPPUNIT_TEST(testVisCursorInvalidation);
@@ -212,6 +218,7 @@ public:
CPPUNIT_TEST(testBulletDeleteInvalidation);
CPPUNIT_TEST(testBulletNoNumInvalidation);
CPPUNIT_TEST(testBulletMultiDeleteInvalidation);
+ CPPUNIT_TEST(testMoveShapeHandle);
CPPUNIT_TEST_SUITE_END();
private:
@@ -236,6 +243,7 @@ private:
OString m_sHyperlinkText;
OString m_sHyperlinkLink;
OString m_aFormFieldButton;
+ OString m_ShapeSelection;
};
SwTiledRenderingTest::SwTiledRenderingTest()
@@ -388,7 +396,13 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
m_aFormFieldButton = OString(pPayload);
}
break;
+ case LOK_CALLBACK_GRAPHIC_SELECTION:
+ {
+ m_ShapeSelection = OString(pPayload);
+ }
+ break;
}
+
}
void SwTiledRenderingTest::testRegisterCallback()
@@ -1288,6 +1302,7 @@ void SwTiledRenderingTest::testUndoShapeLimiting()
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
Scheduler::ProcessEventsToIdle();
+ pWrtShell2->EndTextEdit();
// Assert that the first view can't and the second view can undo the insertion.
SwDoc* pDoc = pXTextDocument->GetDocShell()->GetDoc();
@@ -1298,7 +1313,6 @@ void SwTiledRenderingTest::testUndoShapeLimiting()
rUndoManager.SetView(&pWrtShell2->GetView());
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rUndoManager.GetUndoActionCount());
- pWrtShell2->EndTextEdit();
rUndoManager.SetView(nullptr);
SfxLokHelper::setView(nView1);
@@ -1406,11 +1420,14 @@ void SwTiledRenderingTest::testShapeTextUndoShells()
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
Scheduler::ProcessEventsToIdle();
+ pWrtShell->EndTextEdit();
// Make sure that the undo item remembers who created it.
SwDoc* pDoc = pXTextDocument->GetDocShell()->GetDoc();
sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rUndoManager.GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(size_t(1), rUndoManager.GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Edit text of Shape 'Shape1'"), rUndoManager.GetUndoActionComment(0));
+
// This was -1: the view shell id for the undo action wasn't known.
CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), rUndoManager.GetUndoAction()->GetViewShellId());
}
@@ -1438,7 +1455,14 @@ void SwTiledRenderingTest::testShapeTextUndoGroupShells()
// Make sure that the undo item remembers who created it.
SwDoc* pDoc = pXTextDocument->GetDocShell()->GetDoc();
sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rUndoManager.GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(size_t(0), rUndoManager.GetUndoActionCount());
+
+ pWrtShell->EndTextEdit();
+ pWrtShell->GetView().BeginTextEdit(pObject, pView->GetSdrPageView(), pWrtShell->GetWin());
+
+ CPPUNIT_ASSERT_EQUAL(size_t(1), rUndoManager.GetUndoActionCount());
+ CPPUNIT_ASSERT_EQUAL(OUString("Edit text of Shape 'Shape1'"), rUndoManager.GetUndoActionComment(0));
+
// This was -1: the view shell id for the (top) undo list action wasn't known.
CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), rUndoManager.GetUndoAction()->GetViewShellId());
@@ -2236,6 +2260,181 @@ void SwTiledRenderingTest::testIMESupport()
CPPUNIT_ASSERT_EQUAL(aInputs[aInputs.size() - 1].concat("Aaa bbb."), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
}
+void SwTiledRenderingTest::testIMEFormattingAtEndOfParagraph()
+{
+ comphelper::LibreOfficeKit::setActive();
+ SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
+ VclPtr<vcl::Window> pDocWindow = pXTextDocument->getDocWindow();
+
+ SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current());
+ assert(pView);
+ SwWrtShell* pWrtShell = pView->GetWrtShellPtr();
+
+ // delete all characters
+
+ for (int i = 0; i < 9; i++)
+ {
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DELETE);
+ }
+
+ Scheduler::ProcessEventsToIdle();
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "a");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ // status: "a"
+
+ comphelper::dispatchCommand(".uno:Bold", uno::Sequence<beans::PropertyValue>());
+ Scheduler::ProcessEventsToIdle();
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "b");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RETURN);
+ Scheduler::ProcessEventsToIdle();
+
+ // status: "a<bold>b</bold>\n"
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "a");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ std::unique_ptr<SfxPoolItem> pItem;
+ pView->GetViewFrame()->GetBindings().QueryState(SID_ATTR_CHAR_WEIGHT, pItem);
+ auto pWeightItem = dynamic_cast<SvxWeightItem*>(pItem.get());
+ CPPUNIT_ASSERT(pWeightItem);
+
+ CPPUNIT_ASSERT_EQUAL(FontWeight::WEIGHT_BOLD, pWeightItem->GetWeight());
+
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RETURN);
+ Scheduler::ProcessEventsToIdle();
+
+ // status: "a<bold>b</bold>\n
+ // <bold>a</bold>\n"
+
+ comphelper::dispatchCommand(".uno:Bold", uno::Sequence<beans::PropertyValue>());
+ Scheduler::ProcessEventsToIdle();
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "b");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ pView->GetViewFrame()->GetBindings().QueryState(SID_ATTR_CHAR_WEIGHT, pItem);
+ auto pWeightItem2 = dynamic_cast<SvxWeightItem*>(pItem.get());
+ CPPUNIT_ASSERT(pWeightItem2);
+
+ CPPUNIT_ASSERT_EQUAL(FontWeight::WEIGHT_NORMAL, pWeightItem2->GetWeight());
+
+ // status: "a<bold>b</bold>\n
+ // <bold>a</bold>\n"
+ // b"
+
+ comphelper::dispatchCommand(".uno:Bold", uno::Sequence<beans::PropertyValue>());
+ Scheduler::ProcessEventsToIdle();
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "a");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ pView->GetViewFrame()->GetBindings().QueryState(SID_ATTR_CHAR_WEIGHT, pItem);
+ auto pWeightItem3 = dynamic_cast<SvxWeightItem*>(pItem.get());
+ CPPUNIT_ASSERT(pWeightItem3);
+
+ CPPUNIT_ASSERT_EQUAL(FontWeight::WEIGHT_BOLD, pWeightItem3->GetWeight());
+
+ comphelper::dispatchCommand(".uno:Bold", uno::Sequence<beans::PropertyValue>());
+ Scheduler::ProcessEventsToIdle();
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "b");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ pView->GetViewFrame()->GetBindings().QueryState(SID_ATTR_CHAR_WEIGHT, pItem);
+ auto pWeightItem4 = dynamic_cast<SvxWeightItem*>(pItem.get());
+ CPPUNIT_ASSERT(pWeightItem4);
+
+ CPPUNIT_ASSERT_EQUAL(FontWeight::WEIGHT_NORMAL, pWeightItem4->GetWeight());
+
+ // status: "a<bold>b</bold>\n
+ // <bold>a</bold>\n"
+ // b<bold>a</bold>b"
+
+ // the cursor should be at position 3nd
+ SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), pShellCursor->GetPoint()->nContent.GetIndex());
+
+ // check the content
+ CPPUNIT_ASSERT_EQUAL(OUString("bab"), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
+}
+
+void SwTiledRenderingTest::testIMEFormattingAfterHeader()
+{
+ comphelper::LibreOfficeKit::setActive();
+ SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
+ VclPtr<vcl::Window> pDocWindow = pXTextDocument->getDocWindow();
+
+ SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current());
+ assert(pView);
+
+ // delete all characters
+
+ comphelper::dispatchCommand(".uno:SelectAll", uno::Sequence<beans::PropertyValue>());
+ Scheduler::ProcessEventsToIdle();
+
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DELETE);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_DELETE);
+
+ Scheduler::ProcessEventsToIdle();
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "a");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RETURN);
+ Scheduler::ProcessEventsToIdle();
+
+ // status: "a\n"
+
+ comphelper::dispatchCommand(
+ ".uno:StyleApply?Style:string=Heading 2&FamilyName:string=ParagraphStyles",
+ uno::Sequence<beans::PropertyValue>());
+ Scheduler::ProcessEventsToIdle();
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "b");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "b");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+ Scheduler::ProcessEventsToIdle();
+
+ std::unique_ptr<SfxPoolItem> pItem;
+ pView->GetViewFrame()->GetBindings().QueryState(SID_ATTR_CHAR_WEIGHT, pItem);
+ auto pWeightItem = dynamic_cast<SvxWeightItem*>(pItem.get());
+ CPPUNIT_ASSERT(pWeightItem);
+
+ CPPUNIT_ASSERT_EQUAL(FontWeight::WEIGHT_BOLD, pWeightItem->GetWeight());
+
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
+ pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RETURN);
+ Scheduler::ProcessEventsToIdle();
+
+ // status: "a\n
+ // <h2>bb</h2>\n"
+
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, "c");
+ pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, "");
+ Scheduler::ProcessEventsToIdle();
+
+ // status: "a\n
+ // <h2>bb</h2>\n"
+ // c"
+
+ pView->GetViewFrame()->GetBindings().QueryState(SID_ATTR_CHAR_WEIGHT, pItem);
+ auto pWeightItem2 = dynamic_cast<SvxWeightItem*>(pItem.get());
+ CPPUNIT_ASSERT(pWeightItem2);
+
+ CPPUNIT_ASSERT_EQUAL(FontWeight::WEIGHT_NORMAL, pWeightItem2->GetWeight());
+}
+
void SwTiledRenderingTest::testSplitNodeRedlineCallback()
{
// Load a document.
@@ -2724,6 +2923,57 @@ void SwTiledRenderingTest::testDropDownFormFieldButtonNoSelection()
}
}
+static void lcl_extractHandleParameters(const OString& selection, int& id, int& x, int& y)
+{
+ OString extraInfo = selection.copy(selection.indexOf("{"));
+ std::stringstream aStream(extraInfo.getStr());
+ boost::property_tree::ptree aTree;
+ boost::property_tree::read_json(aStream, aTree);
+ boost::property_tree::ptree
+ handle0 = aTree
+ .get_child("handles")
+ .get_child("kinds")
+ .get_child("rectangle")
+ .get_child("1")
+ .begin()->second;
+ id = handle0.get_child("id").get_value<int>();
+ x = handle0.get_child("point").get_child("x").get_value<int>();
+ y = handle0.get_child("point").get_child("y").get_value<int>();
+}
+
+void SwTiledRenderingTest::testMoveShapeHandle()
+{
+ comphelper::LibreOfficeKit::setActive();
+ SwXTextDocument* pXTextDocument = createDoc("shape.fodt");
+
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
+ SdrPage* pPage = pWrtShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+ SdrObject* pObject = pPage->GetObj(0);
+ pWrtShell->SelectObj(Point(), 0, pObject);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(!m_ShapeSelection.isEmpty());
+ {
+ int id, x, y;
+ lcl_extractHandleParameters(m_ShapeSelection, id, x ,y);
+ int oldX = x;
+ int oldY = y;
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
+ {
+ {"HandleNum", uno::makeAny(id)},
+ {"NewPosX", uno::makeAny(x+1)},
+ {"NewPosY", uno::makeAny(y+1)}
+ }));
+ comphelper::dispatchCommand(".uno:MoveShapeHandle", aPropertyValues);
+ Scheduler::ProcessEventsToIdle();
+ CPPUNIT_ASSERT(!m_ShapeSelection.isEmpty());
+ lcl_extractHandleParameters(m_ShapeSelection, id, x ,y);
+ CPPUNIT_ASSERT_EQUAL(x-1, oldX);
+ CPPUNIT_ASSERT_EQUAL(y-1, oldY);
+ }
+}
+
void SwTiledRenderingTest::testDropDownFormFieldButtonNoItem()
{
comphelper::LibreOfficeKit::setActive();
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index bdac0ce90ebf..0d7a9b401063 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1782,7 +1782,7 @@ void SwUiWriterTest::testBookmarkUndo()
CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd()));
CPPUNIT_ASSERT(pMarkAccess->findMark("Mark_") != pMarkAccess->getAllMarksEnd());
- pMarkAccess->deleteMark( pMarkAccess->findMark("Mark_") );
+ pMarkAccess->deleteMark(pMarkAccess->findMark("Mark_"), false);
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
rUndoManager.Undo();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
@@ -2000,7 +2000,7 @@ void SwUiWriterTest::testTdf51741()
CPPUNIT_ASSERT(bool(pMarkAccess->findMark("Mark") == pMarkAccess->getAllMarksEnd()));
CPPUNIT_ASSERT(pMarkAccess->findMark("Mark_") != pMarkAccess->getAllMarksEnd());
//Modification 7
- pMarkAccess->deleteMark( pMarkAccess->findMark("Mark_") );
+ pMarkAccess->deleteMark(pMarkAccess->findMark("Mark_"), false);
CPPUNIT_ASSERT(pWrtShell->IsModified());
pWrtShell->ResetModified();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
@@ -4132,20 +4132,6 @@ void SwUiWriterTest::testShapeAnchorUndo()
CPPUNIT_ASSERT_EQUAL(pObject->GetLogicRect(), aOrigLogicRect);
}
-static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent, const OUString& rCommand, const uno::Sequence<beans::PropertyValue>& rPropertyValues)
-{
- uno::Reference<frame::XController> xController = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
- CPPUNIT_ASSERT(xController.is());
- uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xFrame.is());
-
- uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
- uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext));
- CPPUNIT_ASSERT(xDispatchHelper.is());
-
- xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues);
-}
-
CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134252)
{
load(DATA_DIRECTORY, "tdf134252.fodt");
@@ -4162,13 +4148,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134252)
uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
// select all with section
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString("bar" SAL_NEWLINE_STRING "baz" SAL_NEWLINE_STRING), xCursor->getString());
- lcl_dispatchCommand(mxComponent, ".uno:Delete", {});
+ dispatchCommand(mxComponent, ".uno:Delete", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
@@ -4176,28 +4162,28 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134252)
CPPUNIT_ASSERT_EQUAL(OUString(""), xCursor->getString());
// this would crash
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString("bar" SAL_NEWLINE_STRING "baz" SAL_NEWLINE_STRING), xCursor->getString());
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString(""), xCursor->getString());
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString("bar" SAL_NEWLINE_STRING "baz" SAL_NEWLINE_STRING), xCursor->getString());
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
@@ -4226,18 +4212,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134250)
CPPUNIT_ASSERT(xTextContent->getAnchor()->getString().endsWith("bar"));
// select all with table at start -> 3 times
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Copy", {});
- lcl_dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
// this would crash in 2 different ways
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
@@ -4246,20 +4232,20 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134250)
// Without the fix in place, section's content would have been gone after undo
CPPUNIT_ASSERT(xTextContent->getAnchor()->getString().endsWith("bar"));
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
CPPUNIT_ASSERT(xTextContent->getAnchor()->getString().endsWith("bar"));
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
@@ -4275,7 +4261,7 @@ void SwUiWriterTest::testDde()
pWrtShell->Insert("asdf");
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/true, 4, /*bBasicCall=*/false);
uno::Sequence<beans::PropertyValue> aPropertyValues;
- lcl_dispatchCommand(mxComponent, ".uno:Copy", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:Copy", aPropertyValues);
// Go before the selection and paste as a DDE link.
pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
@@ -4283,7 +4269,7 @@ void SwUiWriterTest::testDde()
{
{"SelectedFormat", uno::makeAny(static_cast<sal_uInt32>(SotClipboardFormatId::LINK))}
});
- lcl_dispatchCommand(mxComponent, ".uno:ClipboardFormatItems", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:ClipboardFormatItems", aPropertyValues);
// Make sure that the document starts with a field now, and its expanded string value contains asdf.
const uno::Reference< text::XTextRange > xField = getRun(getParagraph(1), 1);
@@ -4300,14 +4286,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf132160)
CPPUNIT_ASSERT(pTextDoc);
// this would crash due to delete redline starting with ToX
- lcl_dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
// this would crash due to insert redline ending on table node
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
}
//IdleTask class to add a low priority Idle task
@@ -4410,12 +4396,12 @@ void SwUiWriterTest::testUnicodeNotationToggle()
sOriginalDocString = pWrtShell->GetCursor()->GetNode().GetTextNode()->GetText();
CPPUNIT_ASSERT_EQUAL(OUString("uU+002b"), sOriginalDocString);
- lcl_dispatchCommand(mxComponent, ".uno:UnicodeNotationToggle", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:UnicodeNotationToggle", aPropertyValues);
sExpectedString = "u+";
sDocString = pWrtShell->GetCursor()->GetNode().GetTextNode()->GetText();
CPPUNIT_ASSERT_EQUAL( sDocString, sExpectedString );
- lcl_dispatchCommand(mxComponent, ".uno:UnicodeNotationToggle", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:UnicodeNotationToggle", aPropertyValues);
sDocString = pWrtShell->GetCursor()->GetNode().GetTextNode()->GetText();
CPPUNIT_ASSERT_EQUAL( sDocString, sOriginalDocString );
}
@@ -4428,17 +4414,17 @@ void SwUiWriterTest::testTdf133967()
CPPUNIT_ASSERT(pTextDoc);
CPPUNIT_ASSERT_EQUAL(6, getPages());
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, ".uno:Cut", {});
Scheduler::ProcessEventsToIdle();
for (sal_Int32 i = 0; i < 10; ++i)
{
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
Scheduler::ProcessEventsToIdle();
}
@@ -4456,13 +4442,13 @@ void SwUiWriterTest::testTdf132187()
CPPUNIT_ASSERT(pTextDoc);
CPPUNIT_ASSERT_EQUAL(1, getPages());
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Copy", {});
- lcl_dispatchCommand(mxComponent, ".uno:GoToEndOfDoc", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, ".uno:GoToEndOfDoc", {});
for (sal_Int32 i = 0; i < 10; ++i)
{
- lcl_dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
Scheduler::ProcessEventsToIdle();
}
@@ -5325,12 +5311,12 @@ void SwUiWriterTest::testClassificationPaste()
// Classified source, not classified destination.
uno::Sequence<beans::PropertyValue> aInternalOnly = comphelper::InitPropertySequence({{"Name", uno::makeAny(OUString("Internal Only"))}});
- lcl_dispatchCommand(xSourceComponent, ".uno:ClassificationApply", aInternalOnly);
+ dispatchCommand(xSourceComponent, ".uno:ClassificationApply", aInternalOnly);
CPPUNIT_ASSERT_EQUAL(int(SfxClassificationCheckPasteResult::TargetDocNotClassified), checkShells(pSourceShell, pDestinationShell));
// Classified source and classified destination -- internal only has a higher level than confidential.
uno::Sequence<beans::PropertyValue> aConfidential = comphelper::InitPropertySequence({{"Name", uno::makeAny(OUString("Confidential"))}});
- lcl_dispatchCommand(mxComponent, ".uno:ClassificationApply", aConfidential);
+ dispatchCommand(mxComponent, ".uno:ClassificationApply", aConfidential);
CPPUNIT_ASSERT_EQUAL(int(SfxClassificationCheckPasteResult::DocClassificationTooLow), checkShells(pSourceShell, pDestinationShell));
xSourceComponent->dispose();
@@ -5347,7 +5333,7 @@ void SwUiWriterTest::testSmallCaps()
pWrtShell->SelAll();
// Dispatch the command to make them formatted small capitals.
- lcl_dispatchCommand(mxComponent, ".uno:SmallCaps", {});
+ dispatchCommand(mxComponent, ".uno:SmallCaps", {});
// This was css::style::CaseMap::NONE as the shell didn't handle the command.
CPPUNIT_ASSERT_EQUAL(css::style::CaseMap::SMALLCAPS, getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharCaseMap"));
@@ -5570,9 +5556,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134436)
uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
// select all 3 times, table at the start
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
@@ -5580,14 +5566,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134436)
CPPUNIT_ASSERT_EQUAL(OUString("a\nb\n"), pWrtShell->GetCursor()->GetText());
// first, the section doesn't get deleted
- lcl_dispatchCommand(mxComponent, ".uno:Delete", {});
+ dispatchCommand(mxComponent, ".uno:Delete", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString(""), pWrtShell->GetCursor()->GetText());
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
@@ -5595,14 +5581,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134436)
CPPUNIT_ASSERT_EQUAL(OUString("a\nb\n"), pWrtShell->GetCursor()->GetText());
// second, the section does get deleted because point is at the end
- lcl_dispatchCommand(mxComponent, ".uno:Delete", {});
+ dispatchCommand(mxComponent, ".uno:Delete", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString(""), pWrtShell->GetCursor()->GetText());
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
@@ -5610,21 +5596,21 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf134436)
CPPUNIT_ASSERT_EQUAL(OUString("a\nb\n"), pWrtShell->GetCursor()->GetText());
// the problem was that the section was not deleted on Redo
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString(""), pWrtShell->GetCursor()->GetText());
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
CPPUNIT_ASSERT_EQUAL(OUString("a\nb\n"), pWrtShell->GetCursor()->GetText());
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xTables->getCount());
@@ -5683,7 +5669,7 @@ void SwUiWriterTest::testRedlineParam()
{
{"NextTrackedChange", uno::makeAny(static_cast<sal_uInt16>(rTable[0]->GetId()))}
}));
- lcl_dispatchCommand(mxComponent, ".uno:NextTrackedChange", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:NextTrackedChange", aPropertyValues);
Scheduler::ProcessEventsToIdle();
SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false);
// This failed: the parameter wasn't handled so the next change (zzz) was
@@ -5696,7 +5682,7 @@ void SwUiWriterTest::testRedlineParam()
{
{"NextTrackedChange", uno::makeAny(static_cast<sal_uInt16>(rTable[1]->GetId()))}
});
- lcl_dispatchCommand(mxComponent, ".uno:NextTrackedChange", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:NextTrackedChange", aPropertyValues);
Scheduler::ProcessEventsToIdle();
pShellCursor = pWrtShell->getShellCursor(false);
CPPUNIT_ASSERT_EQUAL(OUString("zzz"), pShellCursor->GetText());
@@ -5707,7 +5693,7 @@ void SwUiWriterTest::testRedlineParam()
{
{"RejectTrackedChange", uno::makeAny(static_cast<sal_uInt16>(rTable[1]->GetId()))}
});
- lcl_dispatchCommand(mxComponent, ".uno:RejectTrackedChange", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:RejectTrackedChange", aPropertyValues);
Scheduler::ProcessEventsToIdle();
pShellCursor = pWrtShell->getShellCursor(false);
@@ -5744,7 +5730,7 @@ void SwUiWriterTest::testRedlineViewAuthor()
CPPUNIT_ASSERT_EQUAL(aAuthor, pRedline->GetAuthorString());
// Insert a comment and assert that SwView::SetRedlineAuthor() affects this as well.
- lcl_dispatchCommand(mxComponent, ".uno:.uno:InsertAnnotation", {});
+ dispatchCommand(mxComponent, ".uno:.uno:InsertAnnotation", {});
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
@@ -5849,7 +5835,7 @@ void SwUiWriterTest::testLandscape()
uno::Sequence<beans::PropertyValue> aPropertyValues( comphelper::InitPropertySequence({
{ "AttributePage.Landscape", uno::Any(true) }
}));
- lcl_dispatchCommand(mxComponent, ".uno:AttributePage", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:AttributePage", aPropertyValues);
Scheduler::ProcessEventsToIdle();
// Assert that the document model was modified.
@@ -6000,12 +5986,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf132944)
CPPUNIT_ASSERT_EQUAL(1, getPages());
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Delete", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Delete", {});
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT_EQUAL(1, getPages());
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
Scheduler::ProcessEventsToIdle();
// Without the fix in place, the document would have had 2 pages
@@ -6219,7 +6205,7 @@ void SwUiWriterTest::testCreateDocxAnnotation()
{"Text", uno::makeAny(aSomeText)},
{"Author", uno::makeAny(OUString("me"))},
});
- lcl_dispatchCommand(mxComponent, ".uno:InsertAnnotation", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertAnnotation", aPropertyValues);
// Save it as DOCX & load it again
reload("Office Open XML Text", "create-docx-annotation.docx");
@@ -6273,7 +6259,7 @@ void SwUiWriterTest::testTdf112025()
OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "fdo112025-insert.docx";
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({{ "Name", uno::makeAny(insertFileid) }}));
- lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
// something has been inserted + an additional paragraph
CPPUNIT_ASSERT_GREATER(numberOfParagraphs, getParagraphs());
@@ -6293,7 +6279,7 @@ void SwUiWriterTest::testTdf72942()
OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "fdo72942-insert.docx";
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({{ "Name", uno::makeAny(insertFileid) }}));
- lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
// check styles of paragraphs added from [fdo72942.docx]
const uno::Reference< text::XTextRange > xRun1 = getRun(getParagraph(1), 1);
@@ -6354,7 +6340,7 @@ void SwUiWriterTest::testTdf113877()
{
const OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf113877_insert_numbered_list.odt";
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({ { "Name", uno::makeAny(insertFileid) } }));
- lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
}
const OUString listId1 = getProperty<OUString>(getParagraph(1), "ListId");
@@ -6387,7 +6373,7 @@ void SwUiWriterTest::testTdf113877NoMerge()
{
const OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf113877_insert_numbered_list_abcd.odt";
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({ { "Name", uno::makeAny(insertFileid) } }));
- lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
}
const OUString listId1 = getProperty<OUString>(getParagraph(1), "ListId");
@@ -6426,7 +6412,7 @@ void SwUiWriterTest::testTdf113877_default_style()
{
const OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf113877_insert_numbered_list_abcd.odt";
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({ { "Name", uno::makeAny(insertFileid) } }));
- lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
}
const OUString listId1 = getProperty<OUString>(getParagraph(1), "ListId");
@@ -6458,7 +6444,7 @@ void SwUiWriterTest::testTdf113877_Standard_style()
{
const OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf113877_insert_numbered_list_abcd.odt";
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({ { "Name", uno::makeAny(insertFileid) } }));
- lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
}
const OUString listId1 = getProperty<OUString>(getParagraph(1), "ListId");
@@ -6866,7 +6852,7 @@ void SwUiWriterTest::testTdf108048()
{ "PageNumber", uno::makeAny(sal_uInt16(6)) }, // Even number to avoid auto-inserted blank page
{ "PageNumberFilled", uno::makeAny(true) },
});
- lcl_dispatchCommand(mxComponent, ".uno:InsertBreak", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:InsertBreak", aPropertyValues);
CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
CPPUNIT_ASSERT_EQUAL(2, getPages());
@@ -7384,12 +7370,12 @@ void SwUiWriterTest::testSpellOnlineParameter()
bool bSet = pOpt->IsOnlineSpell();
uno::Sequence<beans::PropertyValue> params = comphelper::InitPropertySequence({{"Enable", uno::makeAny(!bSet)}});
- lcl_dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ dispatchCommand(mxComponent, ".uno:SpellOnline", params);
CPPUNIT_ASSERT_EQUAL(!bSet, pOpt->IsOnlineSpell());
// set the same state as now and we don't expect any change (no-toggle)
params = comphelper::InitPropertySequence({{"Enable", uno::makeAny(!bSet)}});
- lcl_dispatchCommand(mxComponent, ".uno:SpellOnline", params);
+ dispatchCommand(mxComponent, ".uno:SpellOnline", params);
CPPUNIT_ASSERT_EQUAL(!bSet, pOpt->IsOnlineSpell());
}
@@ -7489,7 +7475,7 @@ void SwUiWriterTest::testInsertPdf()
uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence({
{"FileName", uno::Any(m_directories.getURLFromSrc(DATA_DIRECTORY) + "hello-world.pdf")}
}));
- lcl_dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs);
+ dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs);
// Save and load cycle
utl::TempFile aTempFile;
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 7890dbf22b4b..ae508ec3ec60 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -81,23 +81,6 @@ protected:
SwDoc* createDoc(const char* pName = nullptr);
};
-static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent,
- const OUString& rCommand,
- const uno::Sequence<beans::PropertyValue>& rPropertyValues)
-{
- uno::Reference<frame::XController> xController
- = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
- CPPUNIT_ASSERT(xController.is());
- uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xFrame.is());
-
- uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
- uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext));
- CPPUNIT_ASSERT(xDispatchHelper.is());
-
- xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues);
-}
-
SwDoc* SwUiWriterTest2::createDoc(const char* pName)
{
if (!pName)
@@ -122,7 +105,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf47471_paraStyleBackground)
pWrtShell->EndPara(/*bSelect=*/true);
pWrtShell->EndPara(/*bSelect=*/true);
pWrtShell->EndPara(/*bSelect=*/true);
- lcl_dispatchCommand(mxComponent, ".uno:ResetAttributes", {});
+ dispatchCommand(mxComponent, ".uno:ResetAttributes", {});
// the background color should revert to the color for 00Background style
CPPUNIT_ASSERT_EQUAL(sal_Int32(14605542), getProperty<sal_Int32>(getParagraph(2), "FillColor"));
@@ -156,21 +139,21 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf131684)
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
//Use selectAll 3 times in a row
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, ".uno:Cut", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
- lcl_dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
// without the fix, it crashes
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
// check that the text frame has the correct upper
@@ -206,8 +189,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdfChangeNumberingListAutoFormat)
// tdf#127606: now it's possible to change formatting of numbering
// increase font size (220 -> 260)
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Grow", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Grow", {});
pViewShell->Reformat();
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -955,11 +938,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable)
pWrtShell->SelTable(); //select the whole table
- lcl_dispatchCommand(mxComponent, ".uno:SetOptimalColumnWidth", {});
+ dispatchCommand(mxComponent, ".uno:SetOptimalColumnWidth", {});
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Width: optimize", origWidth,
getProperty<double>(xTextTable, "Width"), nToleranceW);
- lcl_dispatchCommand(mxComponent, ".uno:SetMinimalColumnWidth", {});
+ dispatchCommand(mxComponent, ".uno:SetMinimalColumnWidth", {});
CPPUNIT_ASSERT_MESSAGE("Table Width: minimized",
(origWidth - nToleranceW) > getProperty<double>(xTextTable, "Width"));
@@ -967,12 +950,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf64242_optimizeTable)
sal_Int32 nToleranceH = origRowHeight * .01;
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Row Height", double(3441), origRowHeight, nToleranceH);
- lcl_dispatchCommand(mxComponent, ".uno:SetOptimalRowHeight", {});
+ dispatchCommand(mxComponent, ".uno:SetOptimalRowHeight", {});
double optimalRowHeight = getProperty<double>(xTableRows->getByIndex(2), "Height");
CPPUNIT_ASSERT_MESSAGE("Row Height: optimized",
(origRowHeight - nToleranceH) > optimalRowHeight);
- lcl_dispatchCommand(mxComponent, ".uno:SetMinimalRowHeight", {});
+ dispatchCommand(mxComponent, ".uno:SetMinimalRowHeight", {});
double minimalRowHeight = getProperty<double>(xTableRows->getByIndex(2), "Height");
CPPUNIT_ASSERT_MESSAGE("Row Height: minimized",
(optimalRowHeight - nToleranceH) > minimalRowHeight);
@@ -999,7 +982,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126784_distributeSelectedColumns)
//Select column 1 and 2
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/true, 1, /*bBasicCall=*/false);
- lcl_dispatchCommand(mxComponent, ".uno:DistributeColumns", {});
+ dispatchCommand(mxComponent, ".uno:DistributeColumns", {});
aSeq = getProperty<uno::Sequence<text::TableColumnSeparator>>(xTableRows->getByIndex(0),
"TableColumnSeparators");
@@ -1196,7 +1179,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf105413)
{ "Style", uno::makeAny(OUString("Heading 1")) },
{ "FamilyName", uno::makeAny(OUString("ParagraphStyles")) },
});
- lcl_dispatchCommand(mxComponent, ".uno:StyleApply", aPropertyValues);
+ dispatchCommand(mxComponent, ".uno:StyleApply", aPropertyValues);
CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"),
getProperty<OUString>(getParagraph(3), "ParaStyleName"));
@@ -1404,7 +1387,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122893)
for (int i = 1; i < 4; ++i)
{
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(i), "ParaAdjust"));
- lcl_dispatchCommand(mxComponent, ".uno:SpacePara1", {});
+ dispatchCommand(mxComponent, ".uno:SpacePara1", {});
}
// turn on red-lining and show changes
@@ -1426,8 +1409,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122893)
pWrtShell->Down(/*bSelect=*/false);
pWrtShell->EndPara(/*bSelect=*/false);
- lcl_dispatchCommand(mxComponent, ".uno:CenterPara", {});
- lcl_dispatchCommand(mxComponent, ".uno:SpacePara2", {});
+ dispatchCommand(mxComponent, ".uno:CenterPara", {});
+ dispatchCommand(mxComponent, ".uno:SpacePara2", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(3),
getProperty<sal_Int32>(getParagraph(3), "ParaAdjust")); // center-aligned
@@ -1480,7 +1463,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122901)
pWrtShell->Down(/*bSelect=*/false);
pWrtShell->EndPara(/*bSelect=*/false);
- lcl_dispatchCommand(mxComponent, ".uno:ParaspaceIncrease", {});
+ dispatchCommand(mxComponent, ".uno:ParaspaceIncrease", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(101), getProperty<sal_Int32>(getParagraph(3), "ParaTopMargin"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(101),
@@ -1543,7 +1526,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf52391)
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
- lcl_dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
const uno::Reference<text::XTextRange> xRun = getRun(getParagraph(1), 1);
// this was "Portion1", because the tracked background color of Portion1 was
@@ -1570,7 +1553,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126206)
}
// reject tracked changes
- lcl_dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
// bold text again
xText = getParagraph(1)->getText();
@@ -1602,14 +1585,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101873)
{ "SearchItem.SearchString", uno::makeAny(OUString("fig")) },
{ "SearchItem.Backward", uno::makeAny(false) },
}));
- lcl_dispatchCommand(mxComponent, ".uno:ExecuteSearch", aFirst);
- lcl_dispatchCommand(mxComponent, ".uno:ExecuteSearch", aFirst);
+ dispatchCommand(mxComponent, ".uno:ExecuteSearch", aFirst);
+ dispatchCommand(mxComponent, ".uno:ExecuteSearch", aFirst);
uno::Sequence<beans::PropertyValue> aSecond(comphelper::InitPropertySequence({
{ "SearchItem.SearchString", uno::makeAny(OUString("something")) },
{ "SearchItem.Backward", uno::makeAny(false) },
}));
- lcl_dispatchCommand(mxComponent, ".uno:ExecuteSearch", aSecond);
+ dispatchCommand(mxComponent, ".uno:ExecuteSearch", aSecond);
// Without the accompanying fix in place, this test would have failed with "Expected: something;
// Actual:", i.e. searching for "something" failed, even if it was inserted above.
@@ -1643,7 +1626,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTextFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert a text form field
- lcl_dispatchCommand(mxComponent, ".uno:TextFormField", {});
+ dispatchCommand(mxComponent, ".uno:TextFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
// Check whether the fieldmark is created
@@ -1659,13 +1642,13 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTextFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(OUString(vEnSpaces, 5), xPara->getString());
// Undo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
xPara.set(getParagraph(1));
CPPUNIT_ASSERT(xPara->getString().isEmpty());
// Redo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
xPara.set(getParagraph(1));
CPPUNIT_ASSERT_EQUAL(OUString(vEnSpaces, 5), xPara->getString());
@@ -1681,7 +1664,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testCheckboxFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert a checkbox form field
- lcl_dispatchCommand(mxComponent, ".uno:CheckBoxFormField", {});
+ dispatchCommand(mxComponent, ".uno:CheckBoxFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
// Check whether the fieldmark is created
@@ -1697,11 +1680,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testCheckboxFormFieldInsertion)
CPPUNIT_ASSERT(!pCheckBox->IsChecked());
// Undo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Redo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
@@ -1720,7 +1703,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDropDownFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert a drop-down form field
- lcl_dispatchCommand(mxComponent, ".uno:DropDownFormField", {});
+ dispatchCommand(mxComponent, ".uno:DropDownFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
// Check whether the fieldmark is created
@@ -1737,11 +1720,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDropDownFormFieldInsertion)
CPPUNIT_ASSERT(bool(pResult == pParameters->end()));
// Undo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Redo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
@@ -1760,21 +1743,21 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testMixedFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert fields
- lcl_dispatchCommand(mxComponent, ".uno:TextFormField", {});
- lcl_dispatchCommand(mxComponent, ".uno:CheckBoxFormField", {});
- lcl_dispatchCommand(mxComponent, ".uno:DropDownFormField", {});
+ dispatchCommand(mxComponent, ".uno:TextFormField", {});
+ dispatchCommand(mxComponent, ".uno:CheckBoxFormField", {});
+ dispatchCommand(mxComponent, ".uno:DropDownFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pMarkAccess->getAllMarksCount());
// Undo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Redo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), pMarkAccess->getAllMarksCount());
}
@@ -2015,7 +1998,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf106843)
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
// try to turn off red-lining
- lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+ dispatchCommand(mxComponent, ".uno:TrackChanges", {});
// but the protection doesn't allow it
CPPUNIT_ASSERT_MESSAGE("redlining should be on",
@@ -2215,7 +2198,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf120338)
getProperty<OUString>(getParagraph(11), "ParaStyleName"));
// reject tracked paragraph adjustments
- lcl_dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(0),
getProperty<sal_Int32>(getParagraph(2), "ParaAdjust")); // left
@@ -2255,7 +2238,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf120338_multiple_paragraph_join)
getProperty<OUString>(getParagraph(3), "ParaStyleName"));
// reject tracked paragraph styles
- lcl_dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
+ dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"),
getProperty<OUString>(getParagraph(1), "ParaStyleName"));
@@ -2320,7 +2303,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDateFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert a date form field
- lcl_dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
+ dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
// Check whether the fieldmark is created
@@ -2336,11 +2319,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDateFormFieldInsertion)
CPPUNIT_ASSERT_EQUAL(OUString(vEnSpaces, 5), xPara->getString());
// Undo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Undo", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Redo insertion
- lcl_dispatchCommand(mxComponent, ".uno:Redo", {});
+ dispatchCommand(mxComponent, ".uno:Redo", {});
aIter = pMarkAccess->getAllMarksBegin();
CPPUNIT_ASSERT(aIter != pMarkAccess->getAllMarksEnd());
pFieldmark = dynamic_cast<::sw::mark::IFieldmark*>(*aIter);
@@ -2357,7 +2340,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDateFormFieldContentOperations)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert a date form field
- lcl_dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
+ dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
// Check whether the fieldmark is created
@@ -2390,7 +2373,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDateFormFieldCurrentDateHandling)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert a date form field
- lcl_dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
+ dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
// Check whether the fieldmark is created
@@ -2444,7 +2427,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testDateFormFieldCurrentDateInvalidation)
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
// Insert a date form field
- lcl_dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
+ dispatchCommand(mxComponent, ".uno:DatePickerFormField", {});
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMarkAccess->getAllMarksCount());
// Check whether the fieldmark is created
@@ -2572,17 +2555,17 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf118311)
{ "SearchItem.SearchString", uno::makeAny(OUString("a")) },
{ "SearchItem.Backward", uno::makeAny(false) },
}));
- lcl_dispatchCommand(mxComponent, ".uno:ExecuteSearch", aSearch);
+ dispatchCommand(mxComponent, ".uno:ExecuteSearch", aSearch);
// .uno:Cut doesn't remove the table, only the selected content of the first cell
- lcl_dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, ".uno:Cut", {});
xmlDocPtr pXmlDoc = parseLayoutDump();
assertXPath(pXmlDoc, "//page[1]//body/tab");
// .uno:SelectAll selects the whole table, and UNO command Cut cuts it
- lcl_dispatchCommand(mxComponent, ".uno:SelectAll", {});
- lcl_dispatchCommand(mxComponent, ".uno:Cut", {});
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Cut", {});
discardDumpedLayout();
pXmlDoc = parseLayoutDump();
@@ -2698,7 +2681,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf90069)
sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
- lcl_dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {});
+ dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {});
pWrtShell->Down(false);
pWrtShell->Insert("foo");
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index d68b2b7ecf1d..e01e74441d6a 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -737,6 +737,39 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testImageCommentAtChar)
}
}
+CPPUNIT_TEST_FIXTURE(SwUnoWriter, testChapterNumberingCharStyle)
+{
+ loadURL("private:factory/swriter", nullptr);
+
+ uno::Reference<lang::XMultiServiceFactory> xDoc(mxComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xStyle(
+ xDoc->createInstance("com.sun.star.style.CharacterStyle"), uno::UNO_QUERY);
+ uno::Reference<container::XNamed> xStyleN(xStyle, uno::UNO_QUERY);
+ xStyle->setPropertyValue("CharColor", uno::makeAny(sal_Int32(0x00FF0000)));
+ uno::Reference<style::XStyleFamiliesSupplier> xSFS(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameContainer> xStyles(
+ xSFS->getStyleFamilies()->getByName("CharacterStyles"), uno::UNO_QUERY);
+ xStyles->insertByName("red", uno::makeAny(xStyle));
+
+ uno::Reference<text::XChapterNumberingSupplier> xCNS(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexReplace> xOutline(xCNS->getChapterNumberingRules());
+ {
+ comphelper::SequenceAsHashMap hashMap(xOutline->getByIndex(0));
+ hashMap["CharStyleName"] <<= OUString("red");
+ uno::Sequence<beans::PropertyValue> props;
+ hashMap >> props;
+ xOutline->replaceByIndex(0, uno::makeAny(props));
+ }
+ // now rename the style
+ xStyleN->setName("reddishred");
+ {
+ comphelper::SequenceAsHashMap hashMap(xOutline->getByIndex(0));
+
+ // tdf#137810 this failed, was old value "red"
+ CPPUNIT_ASSERT_EQUAL(OUString("reddishred"), hashMap["CharStyleName"].get<OUString>());
+ }
+}
+
CPPUNIT_TEST_FIXTURE(SwUnoWriter, testViewCursorPageStyle)
{
// Load a document with 2 pages, but a single paragraph.
diff --git a/sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odt b/sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odt
new file mode 100644
index 000000000000..8c99963616a7
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odt
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index df108531118d..837de2500422 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -157,6 +157,12 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testChicagoNumberingFootnote)
CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
}
+DECLARE_WW8EXPORT_TEST(tesTdf138302_restartNumbering, "tdf138302_restartNumbering.odt")
+{
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString"));
+}
+
DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc")
{
uno::Reference<container::XNameAccess> pageStyles = getStyles("PageStyles");
diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx
index 077a6e0a4205..e92b75aadce5 100644
--- a/sw/qa/inc/swmodeltestbase.hxx
+++ b/sw/qa/inc/swmodeltestbase.hxx
@@ -964,6 +964,7 @@ protected:
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("pic"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/picture"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("rels"), BAD_CAST("http://schemas.openxmlformats.org/package/2006/relationships"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("w14"), BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordml"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("w15"), BAD_CAST("http://schemas.microsoft.com/office/word/2012/wordml"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("m"), BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/math"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("ContentType"), BAD_CAST("http://schemas.openxmlformats.org/package/2006/content-types"));
xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("lc"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"));
diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi
index ef4dd4413a1a..5f9423ee95bd 100644
--- a/sw/sdi/_basesh.sdi
+++ b/sw/sdi/_basesh.sdi
@@ -586,4 +586,11 @@ interface BaseTextSelection
ExecMethod = Execute;
StateMethod = GetState;
]
+
+ SID_GRAPHIC_SIZE_CHECK
+ [
+ ExecMethod = ExecDlg;
+ StateMethod = GetState;
+ DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+ ]
}
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index 7cd6303ecef1..39b3f839be87 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -398,7 +398,8 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
}
if (pSrcDoc != pDstDoc &&
- SfxItemState::SET == GetItemState(RES_PARATR_LIST_AUTOFMT, false, &pItem))
+ SfxItemState::SET == GetItemState(RES_PARATR_LIST_AUTOFMT, false, &pItem) &&
+ static_cast<SwFormatAutoFormat const&>(*pItem).GetStyleHandle())
{
SfxItemSet const& rAutoStyle(*static_cast<SwFormatAutoFormat const&>(*pItem).GetStyleHandle());
std::shared_ptr<SfxItemSet> const pNewSet(
diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx
index 884c155003e2..4f00d1d21e9d 100644
--- a/sw/source/core/bastyp/swrect.cxx
+++ b/sw/source/core/bastyp/swrect.cxx
@@ -38,21 +38,6 @@ Point SwRect::Center() const
Top() + Height() / 2 );
}
-SwRect& SwRect::Union( const SwRect& rRect )
-{
- if ( Top() > rRect.Top() )
- Top( rRect.Top() );
- if ( Left() > rRect.Left() )
- Left( rRect.Left() );
- long n = rRect.Right();
- if ( Right() < n )
- Right( n );
- n = rRect.Bottom();
- if ( Bottom() < n )
- Bottom( n );
- return *this;
-}
-
SwRect& SwRect::Intersection( const SwRect& rRect )
{
// any similarity between me and given element?
@@ -94,26 +79,6 @@ SwRect& SwRect::Intersection_( const SwRect& rRect )
return *this;
}
-bool SwRect::IsInside( const SwRect& rRect ) const
-{
- const long nRight = Right();
- const long nBottom = Bottom();
- const long nrRight = rRect.Right();
- const long nrBottom= rRect.Bottom();
- return (Left() <= rRect.Left()) && (rRect.Left()<= nRight) &&
- (Left() <= nrRight) && (nrRight <= nRight) &&
- (Top() <= rRect.Top()) && (rRect.Top() <= nBottom) &&
- (Top() <= nrBottom) && (nrBottom <= nBottom);
-}
-
-bool SwRect::IsInside( const Point& rPoint ) const
-{
- return (Left() <= rPoint.X()) &&
- (Top() <= rPoint.Y()) &&
- (Right() >= rPoint.X()) &&
- (Bottom()>= rPoint.Y());
-}
-
// mouse moving of table borders
bool SwRect::IsNear( const Point& rPoint, long nTolerance ) const
{
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 7d3b70dbf363..dd0ca592aabe 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -72,7 +72,8 @@
#include <tabcol.hxx>
#include <wrtsh.hxx>
#include <undobj.hxx>
-#include <boost/property_tree/json_parser.hpp>
+#include <view.hxx>
+#include <tools/json_writer.hxx>
using namespace com::sun::star;
using namespace util;
@@ -2033,76 +2034,76 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd )
void SwCursorShell::sendLOKCursorUpdates()
{
- SwWrtShell* pShell = GetDoc()->GetDocShell()->GetWrtShell();
- if (!pShell)
+ SwView* pView = static_cast<SwView*>(GetSfxViewShell());
+ // The view may not have a writer shell if the view's ctor did not finish yet.
+ if (!pView || !pView->GetWrtShellPtr())
return;
+ SwWrtShell* pShell = &pView->GetWrtShell();
+
SwFrame* pCurrentFrame = GetCurrFrame();
SelectionType eType = pShell->GetSelectionType();
- boost::property_tree::ptree aRootTree;
+ tools::JsonWriter aJsonWriter;
if (pCurrentFrame && (eType & SelectionType::Table) && pCurrentFrame->IsInTab())
{
const SwRect& rPageRect = pShell->GetAnyCurRect(CurRectType::Page, nullptr);
- boost::property_tree::ptree aTableColumns;
{
+ auto columnsNode = aJsonWriter.startNode("columns");
SwTabCols aTabCols;
pShell->GetTabCols(aTabCols);
const int nColumnOffset = aTabCols.GetLeftMin() + rPageRect.Left();
- aTableColumns.put("left", aTabCols.GetLeft());
- aTableColumns.put("right", aTabCols.GetRight());
- aTableColumns.put("tableOffset", nColumnOffset);
+ aJsonWriter.put("left", aTabCols.GetLeft());
+ aJsonWriter.put("right", aTabCols.GetRight());
+ aJsonWriter.put("tableOffset", nColumnOffset);
- boost::property_tree::ptree aEntries;
- for (size_t i = 0; i < aTabCols.Count(); ++i)
{
- auto const & rEntry = aTabCols.GetEntry(i);
- boost::property_tree::ptree aTableColumnEntry;
- aTableColumnEntry.put("position", rEntry.nPos);
- aTableColumnEntry.put("min", rEntry.nMin);
- aTableColumnEntry.put("max", rEntry.nMax);
- aTableColumnEntry.put("hidden", rEntry.bHidden);
- aEntries.push_back(std::make_pair("", aTableColumnEntry));
+ auto entriesNode = aJsonWriter.startArray("entries");
+ for (size_t i = 0; i < aTabCols.Count(); ++i)
+ {
+ auto entryNode = aJsonWriter.startStruct();
+ auto const & rEntry = aTabCols.GetEntry(i);
+ aJsonWriter.put("position", rEntry.nPos);
+ aJsonWriter.put("min", rEntry.nMin);
+ aJsonWriter.put("max", rEntry.nMax);
+ aJsonWriter.put("hidden", rEntry.bHidden);
+ }
}
- aTableColumns.push_back(std::make_pair("entries", aEntries));
}
- boost::property_tree::ptree aTableRows;
{
+ auto rowsNode = aJsonWriter.startNode("rows");
SwTabCols aTabRows;
pShell->GetTabRows(aTabRows);
const int nRowOffset = aTabRows.GetLeftMin() + rPageRect.Top();
- aTableRows.put("left", aTabRows.GetLeft());
- aTableRows.put("right", aTabRows.GetRight());
- aTableRows.put("tableOffset", nRowOffset);
+ aJsonWriter.put("left", aTabRows.GetLeft());
+ aJsonWriter.put("right", aTabRows.GetRight());
+ aJsonWriter.put("tableOffset", nRowOffset);
- boost::property_tree::ptree aEntries;
- for (size_t i = 0; i < aTabRows.Count(); ++i)
{
- auto const & rEntry = aTabRows.GetEntry(i);
- boost::property_tree::ptree aTableRowEntry;
- aTableRowEntry.put("position", rEntry.nPos);
- aTableRowEntry.put("min", rEntry.nMin);
- aTableRowEntry.put("max", rEntry.nMax);
- aTableRowEntry.put("hidden", rEntry.bHidden);
- aEntries.push_back(std::make_pair("", aTableRowEntry));
+ auto entriesNode = aJsonWriter.startArray("entries");
+ for (size_t i = 0; i < aTabRows.Count(); ++i)
+ {
+ auto entryNode = aJsonWriter.startStruct();
+ auto const & rEntry = aTabRows.GetEntry(i);
+ aJsonWriter.put("position", rEntry.nPos);
+ aJsonWriter.put("min", rEntry.nMin);
+ aJsonWriter.put("max", rEntry.nMax);
+ aJsonWriter.put("hidden", rEntry.bHidden);
+ }
}
- aTableRows.push_back(std::make_pair("entries", aEntries));
}
-
- aRootTree.add_child("columns", aTableColumns);
- aRootTree.add_child("rows", aTableRows);
}
- std::stringstream aStream;
- boost::property_tree::write_json(aStream, aRootTree);
- GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, aStream.str().c_str());
+ char* pChar = aJsonWriter.extractData();
+ GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TABLE_SELECTED, pChar);
+ free(pChar);
}
void SwCursorShell::RefreshBlockCursor()
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 909c88632f5e..cbd6380e9bde 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2131,6 +2131,37 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam )
return false;
}
}
+
+ // must delete all fieldmarks before CorrAbs(), or they'll remain
+ // moved to wrong node without their CH_TXT_ATR_FIELD*
+ // (note: deleteMarks() doesn't help here, in case of partially
+ // selected fieldmarks; let's delete these as re-inserting their chars
+ // elsewhere looks difficult)
+ ::std::set<::sw::mark::IFieldmark*> fieldmarks;
+ for (SwNodeIndex i = aRg.aStart; i <= aRg.aEnd; ++i)
+ {
+ if (SwTextNode *const pTextNode = i.GetNode().GetTextNode())
+ {
+ for (sal_Int32 j = 0; j < pTextNode->GetText().getLength(); ++j)
+ {
+ switch (pTextNode->GetText()[j])
+ {
+ case CH_TXT_ATR_FIELDSTART:
+ case CH_TXT_ATR_FIELDEND:
+ fieldmarks.insert(m_rDoc.getIDocumentMarkAccess()->getFieldmarkAt(SwPosition(*pTextNode, j)));
+ break;
+ case CH_TXT_ATR_FIELDSEP:
+ fieldmarks.insert(m_rDoc.getIDocumentMarkAccess()->getFieldmarkFor(SwPosition(*pTextNode, j)));
+ break;
+ }
+ }
+ }
+ }
+ for (auto const pFieldMark : fieldmarks)
+ {
+ m_rDoc.getIDocumentMarkAccess()->deleteMark(pFieldMark);
+ }
+
// move bookmarks, redlines etc.
if (aRg.aStart == aRg.aEnd) // only first CorrAbs variant handles this
{
@@ -2784,6 +2815,16 @@ bool DocumentContentOperationsManager::InsertString( const SwPaM &rRg, const OUS
return true;
}
+void DocumentContentOperationsManager::SetIME(bool bIME)
+{
+ m_bIME = bIME;
+}
+
+bool DocumentContentOperationsManager::GetIME() const
+{
+ return m_bIME;
+}
+
void DocumentContentOperationsManager::TransliterateText(
const SwPaM& rPaM,
utl::TransliterationWrapper& rTrans )
@@ -5055,8 +5096,11 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo
// and not the source has the page break
if (pDoc->IsClipBoard() && (rPam.GetPageNum(pStt == rPam.GetPoint()) == 1) && !bCopyPageSource)
{
- pDestTextNd->ResetAttr(RES_BREAK); // remove the page-break
- pDestTextNd->ResetAttr(RES_PAGEDESC);
+ if (pDestTextNd)
+ {
+ pDestTextNd->ResetAttr(RES_BREAK); // remove the page-break
+ pDestTextNd->ResetAttr(RES_PAGEDESC);
+ }
}
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index ff9b05743d10..8ae32f266bdb 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -301,6 +301,8 @@ void UpdateFramesForRemoveDeleteRedline(SwDoc & rDoc, SwPaM const& rPam)
pFrame->SetMergedPara(sw::CheckParaRedlineMerge(
*pFrame, rFirstNode, eMode));
eMode = sw::FrameMode::New; // Existing is not idempotent!
+ // update pNode so MakeFrames starts on 2nd node
+ pNode = &rFirstNode;
}
}
if (pLast != pNode)
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index d7af55649e62..afabba5c5215 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -22,6 +22,7 @@
#include <IDocumentDrawModelAccess.hxx>
#include <IDocumentState.hxx>
#include <IDocumentLayoutAccess.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <editeng/forbiddencharacterstable.hxx>
#include <svx/svdmodel.hxx>
@@ -94,7 +95,8 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
mbLastBrowseMode( false ),
mbDisableOffPagePositioning ( false ),
mbHeaderSpacingBelowLastPara(false),
- mbGutterAtTop(false)
+ mbGutterAtTop(false),
+ mnImagePreferredDPI(0)
// COMPATIBILITY FLAGS END
{
@@ -400,7 +402,11 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
// COMPATIBILITY FLAGS END
case DocumentSettingId::BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available
- mbLastBrowseMode = value;
+ // Can't render in webview successfully.
+ if (comphelper::LibreOfficeKit::isActive())
+ mbLastBrowseMode = false;
+ else
+ mbLastBrowseMode = value;
break;
case DocumentSettingId::HTML_MODE:
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index ac85fe88cfd0..7b1cfe1802c8 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1112,7 +1112,7 @@ namespace sw { namespace mark
pppMark != vMarksToDelete.rend();
++pppMark )
{
- vDelay.push_back(deleteMark(*pppMark));
+ vDelay.push_back(deleteMark(*pppMark, pSaveBkmk != nullptr));
}
} // scope to kill vDelay
@@ -1131,8 +1131,9 @@ namespace sw { namespace mark
{
std::unique_ptr<Fieldmark> m_pFieldmark;
SwDoc * m_pDoc;
- LazyFieldmarkDeleter(Fieldmark* pMark, SwDoc *const pDoc)
- : m_pFieldmark(pMark), m_pDoc(pDoc)
+ bool const m_isMoveNodes;
+ LazyFieldmarkDeleter(Fieldmark* pMark, SwDoc *const pDoc, bool const isMoveNodes)
+ : m_pFieldmark(pMark), m_pDoc(pDoc), m_isMoveNodes(isMoveNodes)
{
assert(m_pFieldmark);
}
@@ -1142,12 +1143,15 @@ namespace sw { namespace mark
// command *cannot* be deleted here as it would create a separate
// SwUndoDelete that's interleaved with the SwHistory of the outer
// one - only delete the CH_TXT_ATR_FIELD*!
- m_pFieldmark->ReleaseDoc(m_pDoc);
+ if (!m_isMoveNodes)
+ {
+ m_pFieldmark->ReleaseDoc(m_pDoc);
+ }
}
};
std::unique_ptr<IDocumentMarkAccess::ILazyDeleter>
- MarkManager::deleteMark(const const_iterator_t& ppMark)
+ MarkManager::deleteMark(const const_iterator_t& ppMark, bool const isMoveNodes)
{
std::unique_ptr<ILazyDeleter> ret;
if (ppMark.get() == m_vAllMarks.end())
@@ -1185,7 +1189,7 @@ namespace sw { namespace mark
ClearFieldActivation();
m_vFieldmarks.erase(ppFieldmark);
- ret.reset(new LazyFieldmarkDeleter(dynamic_cast<Fieldmark*>(pMark), m_pDoc));
+ ret.reset(new LazyFieldmarkDeleter(dynamic_cast<Fieldmark*>(pMark), m_pDoc, isMoveNodes));
}
else
{
@@ -1242,7 +1246,7 @@ namespace sw { namespace mark
for ( ; it != endIt; ++it)
if (*it == pMark)
{
- deleteMark(iterator(it));
+ deleteMark(iterator(it), false);
break;
}
}
@@ -1341,7 +1345,7 @@ namespace sw { namespace mark
if (!pFieldmark)
return;
- deleteMark(lcl_FindMark(m_vAllMarks, pFieldmark));
+ deleteMark(lcl_FindMark(m_vAllMarks, pFieldmark), false);
}
::sw::mark::IFieldmark* MarkManager::changeFormFieldmarkType(::sw::mark::IFieldmark* pFieldmark, const OUString& rNewType)
@@ -1739,7 +1743,7 @@ void SaveBookmark::SetInDoc(
{
::sw::mark::IBookmark* const pBookmark = dynamic_cast<::sw::mark::IBookmark*>(
pDoc->getIDocumentMarkAccess()->makeMark(aPam, m_aName,
- m_eOrigBkmType, sw::mark::InsertMode::New));
+ m_eOrigBkmType, sw::mark::InsertMode::CopyText));
if(pBookmark)
{
pBookmark->SetKeyCode(m_aCode);
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index f7a11676594e..e61d27c6a961 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1328,9 +1328,18 @@ void SwDoc::CopyFormatArr( const SwFormatsBase& rSourceArr,
//FEATURE::CONDCOLL
if( RES_CONDTXTFMTCOLL == pSrc->Which() )
+ {
+ if (pDstColl->Which() != RES_CONDTXTFMTCOLL)
+ {
+ // Target already had a style with a matching name, but it's not a conditional
+ // style, then don't copy the conditions.
+ continue;
+ }
+
// Copy the conditions, but delete the old ones first!
static_cast<SwConditionTextFormatColl*>(pDstColl)->SetConditions(
static_cast<SwConditionTextFormatColl*>(pSrc)->GetCondColls() );
+ }
//FEATURE::CONDCOLL
}
}
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index e9076064a745..b72a78ca6635 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -59,7 +59,12 @@ SwExtTextInput::~SwExtTextInput()
{
// Prevent IME edited text being grouped with non-IME edited text.
bool bKeepGroupUndo = pDoc->GetIDocumentUndoRedo().DoesGroupUndo();
- pDoc->GetIDocumentUndoRedo().DoGroupUndo(false);
+ bool bWasIME = pDoc->GetIDocumentUndoRedo().GetUndoActionCount() == 0 || pDoc->getIDocumentContentOperations().GetIME();
+ if (!bWasIME)
+ {
+ pDoc->GetIDocumentUndoRedo().DoGroupUndo(false);
+ }
+ pDoc->getIDocumentContentOperations().SetIME(true);
if( nEndCnt < nSttCnt )
{
std::swap(nSttCnt, nEndCnt);
@@ -100,14 +105,24 @@ SwExtTextInput::~SwExtTextInput()
}
else
{
- pTNd->EraseText( rIdx, nEndCnt - nSttCnt );
+ // 1. Insert text at start position with EMPTYEXPAND to use correct formatting
+ // ABC<NEW><OLD>
+ // 2. Then remove old (not tracked) content
+ // ABC<NEW>
+
+ sal_Int32 nLenghtOfOldString = nEndCnt - nSttCnt;
if( bInsText )
- {
- pDoc->getIDocumentContentOperations().InsertString( *this, sText );
- }
+ pDoc->getIDocumentContentOperations().InsertString( *this, sText, SwInsertFlags::EMPTYEXPAND );
+
+ rIdx = nEndCnt;
+
+ pTNd->EraseText( rIdx, nLenghtOfOldString );
+ }
+ if (!bWasIME)
+ {
+ pDoc->GetIDocumentUndoRedo().DoGroupUndo(bKeepGroupUndo);
}
- pDoc->GetIDocumentUndoRedo().DoGroupUndo(bKeepGroupUndo);
if (eInputLanguage != LANGUAGE_DONTKNOW)
{
sal_uInt16 nWhich = RES_CHRATR_LANGUAGE;
@@ -190,8 +205,7 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData )
pTNd->EraseText( aIdx, nEndCnt - nSttCnt );
}
- pTNd->InsertText( rNewStr, aIdx,
- SwInsertFlags::EMPTYEXPAND );
+ pTNd->InsertText( rNewStr, aIdx, SwInsertFlags::NOHINTEXPAND );
if( !HasMark() )
SetMark();
}
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index c1a7b6a8cbbc..ab69b7af2d68 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -239,8 +239,10 @@ void SwDrawView::AddCustomHdl()
}
// add anchor handle:
- maHdlList.AddHdl( std::make_unique<SwSdrHdl>( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
- pAnch->IsRightToLeft() ) );
+ std::unique_ptr<SdrHdl> hdl = std::make_unique<SwSdrHdl>( aPos, ( pAnch->IsVertical() && !pAnch->IsVertLR() ) ||
+ pAnch->IsRightToLeft() );
+ hdl->SetObjHdlNum(maHdlList.GetHdlCount());
+ maHdlList.AddHdl(std::move(hdl));
}
SdrObject* SwDrawView::GetMaxToTopObj( SdrObject* pObj ) const
@@ -982,12 +984,12 @@ void SwDrawView::DeleteMarked()
pTmpRoot->EndAllAction();
}
-// support enhanced text edit for draw objects
-SdrUndoManager* SwDrawView::getSdrUndoManagerForEnhancedTextEdit() const
+// Create a new view-local UndoManager manager for Writer
+std::unique_ptr<SdrUndoManager> SwDrawView::createLocalTextUndoManager()
{
- SwDoc* pDoc = Imp().GetShell()->GetDoc();
-
- return pDoc ? dynamic_cast< SdrUndoManager* >(&(pDoc->GetUndoManager())) : nullptr;
+ std::unique_ptr<SdrUndoManager> pUndoManager(new SdrUndoManager);
+ pUndoManager->SetDocShell(SfxObjectShell::Current());
+ return pUndoManager;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 591c4a988d20..a3925246f32f 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1895,11 +1895,14 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl )
JoinPrevPara();
DeleteLeadingTrailingBlanks( true, false );
- const SwTextFrame *const pNextFrame = GetNextNode(false);
- (void)DeleteJoinCurNextPara(pNextFrame, true);
-
+ const SwTextFrame* pNextFrame = GetNextNode(false);
+ if (pNextFrame->GetNext())
+ {
+ (void)DeleteJoinCurNextPara(pNextFrame, true);
+ pNextFrame = GetNextNode(false);
+ }
m_aDelPam.DeleteMark();
- m_aDelPam.GetPoint()->nNode = *GetNextNode(false)->GetTextNodeForParaProps();
+ m_aDelPam.GetPoint()->nNode = *pNextFrame->GetTextNodeForParaProps();
m_aDelPam.GetPoint()->nContent.Assign( m_aDelPam.GetContentNode(), 0 );
m_pDoc->SetTextFormatColl( m_aDelPam, &rNxtColl );
}
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index e8f82956106f..c70c90182a0b 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -184,8 +184,8 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM*
GetDoc()->getIDocumentContentOperations().InsertItemSet(*pCursor, rSet, nFlags, GetLayout());
}
- EndAllAction();
GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOldMode );
+ EndAllAction();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 8c670f26fdbb..b6d8f0b4296e 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -413,7 +413,8 @@ std::pair<bool, OUString> lcl_MakeParagraphSignatureFieldText(const SignatureDes
valid = valid
&& aInfo.nStatus == xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
- msg = SwResId(STR_SIGNED_BY) + ": " + aInfo.ouSubject + ", " +
+ assert(aInfo.GetSigningCertificate()); // it was valid
+ msg = SwResId(STR_SIGNED_BY) + ": " + aInfo.GetSigningCertificate()->X509Subject + ", " +
aDescr.msDate;
msg += (!aDescr.msUsage.isEmpty() ? (" (" + aDescr.msUsage + "): ") : OUString(": "));
msg += (valid ? SwResId(STR_VALID) : SwResId(STR_INVALID));
@@ -2200,16 +2201,6 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
SwRewriter aRewriter;
- // in online we can have multiple languages, use universal name then
- if (comphelper::LibreOfficeKit::isActive())
- {
- OUString aName;
- sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(pLocal->GetName(), SwGetPoolIdFromName::TxtColl);
- SwStyleNameMapper::FillProgName(nId, aName);
- if (!aName.isEmpty())
- pLocal->SetName(aName);
- }
-
aRewriter.AddRule(UndoArg1, pLocal->GetName());
GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::SETFMTCOLL, &aRewriter);
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 8f84ce42ed75..235a7fe2b81a 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -94,6 +94,7 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints )
for(SwPaM& rCurrentCursor : getShellCursor( true )->GetRingContainer())
{
//OPT: GetSystemCharSet
+ GetDoc()->getIDocumentContentOperations().SetIME(false);
const bool bSuccess =
GetDoc()->getIDocumentContentOperations().InsertString(rCurrentCursor, rStr, nInsertFlags);
OSL_ENSURE( bSuccess, "Doc->Insert() failed." );
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 673e257e0554..c702e17d1cd5 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -1313,6 +1313,7 @@ std::unique_ptr<SwField> SwInputField::Copy() const
pField->SetHelp( maHelp );
pField->SetToolTip( maToolTip );
+ pField->maGrabBag = maGrabBag;
pField->SetAutomaticLanguage(IsAutomaticLanguage());
return std::unique_ptr<SwField>(pField.release());
@@ -1359,6 +1360,9 @@ bool SwInputField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
case FIELD_PROP_PAR4:
rAny <<= maToolTip;
break;
+ case FIELD_PROP_GRABBAG:
+ rAny <<= maGrabBag;
+ break;
default:
assert(false);
}
@@ -1381,6 +1385,9 @@ bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
case FIELD_PROP_PAR4:
rAny >>= maToolTip;
break;
+ case FIELD_PROP_GRABBAG:
+ rAny >>= maGrabBag;
+ break;
default:
assert(false);
}
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 8935aea0c62b..2a810d87225f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -298,7 +298,13 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
for (size_t i = 0; i < rMrkList.GetMarkCount(); ++i)
{
SdrObject* pObject = rMrkList.GetMark(i)->GetMarkedSdrObj();
- SwFrameFormat* pFormat = GetUserCall(pObject)->GetFormat();
+ SwContact* pContact = GetUserCall(pObject);
+ if (!pContact)
+ {
+ continue;
+ }
+
+ SwFrameFormat* pFormat = pContact->GetFormat();
if (SwFrameFormat* pShapeFormat = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_FLYFRMFMT))
{
SdrObject* pShape = pShapeFormat->FindSdrObject();
diff --git a/sw/source/core/graphic/GraphicSizeCheck.cxx b/sw/source/core/graphic/GraphicSizeCheck.cxx
new file mode 100644
index 000000000000..6598c7e3d62c
--- /dev/null
+++ b/sw/source/core/graphic/GraphicSizeCheck.cxx
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <GraphicSizeCheck.hxx>
+#include <svx/strings.hrc>
+#include <svx/svdobj.hxx>
+#include <unotools/viewoptions.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/dispatch.hxx>
+
+#include <ModelTraverser.hxx>
+#include <ndgrf.hxx>
+#include <IDocumentSettingAccess.hxx>
+#include <fmtfsize.hxx>
+#include <wrtsh.hxx>
+#include <wview.hxx>
+#include <cmdid.h>
+#include <docsh.hxx>
+
+using namespace css;
+
+namespace sw
+{
+GraphicSizeViolation::GraphicSizeViolation(sal_Int32 nDPI, const SwGrfNode* pGraphicNode)
+ : m_pGraphicNode(pGraphicNode)
+{
+ constexpr double fLowPercentage = 110;
+ constexpr double fHighPercentage = 50;
+
+ m_nLowDPILimit = sal_Int32(100.0 / fLowPercentage * nDPI);
+ m_nHighDPILimit = sal_Int32(100.0 / fHighPercentage * nDPI);
+}
+
+bool GraphicSizeViolation::check()
+{
+ auto pFrameFormat = m_pGraphicNode->GetFlyFormat();
+ Graphic aGraphic = m_pGraphicNode->GetGraphic();
+ Size aSizePixel = aGraphic.GetSizePixel();
+ Size aFrameSize(pFrameFormat->GetFrameSize().GetSize());
+
+ double nSizeXInch = double(aFrameSize.Width()) / 1440.0;
+ double nSizeYInch = double(aFrameSize.Height()) / 1440.0;
+
+ m_nDPIX = sal_Int32(aSizePixel.Width() / nSizeXInch);
+ m_nDPIY = sal_Int32(aSizePixel.Height() / nSizeYInch);
+
+ return isDPITooLow() || isDPITooHigh();
+}
+
+OUString GraphicSizeViolation::getGraphicName()
+{
+ return m_pGraphicNode->GetFlyFormat()->GetName();
+}
+
+namespace
+{
+class GraphicSizeCheckHandler : public ModelTraverseHandler
+{
+private:
+ sal_Int32 m_nDPI;
+ std::vector<std::unique_ptr<GraphicSizeViolation>>& m_rGraphicSizeViolationList;
+
+public:
+ GraphicSizeCheckHandler(
+ sal_Int32 nDPI,
+ std::vector<std::unique_ptr<GraphicSizeViolation>>& rGraphicSizeViolationList)
+ : m_nDPI(nDPI)
+ , m_rGraphicSizeViolationList(rGraphicSizeViolationList)
+ {
+ }
+
+ void handleNode(SwNode* pNode) override
+ {
+ if (!pNode->IsGrfNode())
+ return;
+
+ auto pEntry = std::make_unique<GraphicSizeViolation>(m_nDPI, pNode->GetGrfNode());
+ if (pEntry->check())
+ {
+ m_rGraphicSizeViolationList.push_back(std::move(pEntry));
+ }
+ }
+
+ void handleSdrObject(SdrObject* /*pObject*/) override {}
+};
+
+} // end anonymous namespace
+
+void GraphicSizeCheck::check()
+{
+ sal_Int32 nDPI = m_pDocument->getIDocumentSettingAccess().getImagePreferredDPI();
+ if (nDPI == 0)
+ return;
+
+ auto pHandler = std::make_shared<GraphicSizeCheckHandler>(nDPI, m_aGraphicSizeViolationList);
+ ModelTraverser aModelTraverser(m_pDocument);
+ aModelTraverser.addNodeHandler(pHandler);
+ aModelTraverser.traverse();
+}
+
+OUString GraphicSizeCheckGUIEntry::getText()
+{
+ OUString sText;
+
+ if (m_pViolation->isDPITooLow())
+ {
+ sText = SwResId(STR_WARNING_GRAPHIC_PIXEL_COUNT_LOW);
+ }
+ else if (m_pViolation->isDPITooHigh())
+ {
+ sText = SwResId(STR_WARNING_GRAPHIC_PIXEL_COUNT_HIGH);
+ }
+
+ sText = sText.replaceAll("%NAME%", m_pViolation->getGraphicName());
+ sText = sText.replaceAll("%DPIX%", OUString::number(m_pViolation->getDPIX()));
+ sText = sText.replaceAll("%DPIY%", OUString::number(m_pViolation->getDPIY()));
+
+ return sText;
+}
+
+void GraphicSizeCheckGUIEntry::markObject()
+{
+ SwWrtShell* pWrtShell = m_pDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GotoFly(m_pViolation->getGraphicName(), FLYCNTTYPE_ALL, true);
+}
+
+void GraphicSizeCheckGUIEntry::runProperties()
+{
+ markObject();
+ SwWrtShell* pWrtShell = m_pDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetView().GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_GRAFIC_DLG,
+ SfxCallMode::SYNCHRON);
+}
+
+GraphicSizeCheckGUIResult::GraphicSizeCheckGUIResult(SwDoc* pDocument)
+{
+ GraphicSizeCheck aCheck(pDocument);
+ aCheck.check();
+
+ auto& rCollection = getCollection();
+ for (auto& rpViolation : aCheck.getViolationList())
+ {
+ auto rGUIEntry
+ = std::make_unique<GraphicSizeCheckGUIEntry>(pDocument, std::move(rpViolation));
+ rCollection.push_back(std::move(rGUIEntry));
+ }
+}
+
+OUString GraphicSizeCheckGUIResult::getTitle()
+{
+ return SwResId(STR_GRAPHIC_SIZE_CHECK_DIALOG_TITLE);
+}
+
+} // end sw namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx
index 2d600b6ff8ba..ad45dc774650 100644
--- a/sw/source/core/inc/DocumentContentOperationsManager.hxx
+++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx
@@ -61,6 +61,10 @@ public:
bool InsertString(const SwPaM &rRg, const OUString&,
const SwInsertFlags nInsertMode = SwInsertFlags::EMPTYEXPAND ) override;
+ void SetIME(bool bIME) override;
+
+ bool GetIME() const override;
+
void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&) override;
SwFlyFrameFormat* InsertGraphic(const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic,
@@ -159,6 +163,8 @@ public:
private:
SwDoc& m_rDoc;
+ bool m_bIME = false;
+
bool DeleteAndJoinImpl(SwPaM&, const bool);
bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false);
bool DeleteRangeImpl(SwPaM&, const bool unused = false);
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index 6b65839259d7..1e34319e56b4 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -166,6 +166,7 @@ class DocumentSettingManager :
bool mbHeaderSpacingBelowLastPara;
/// Gutter position: false means left (not a compatibility setting).
bool mbGutterAtTop;
+ sal_Int32 mnImagePreferredDPI;
public:
@@ -186,6 +187,14 @@ public:
virtual CharCompressType getCharacterCompressionType() const override;
virtual void setCharacterCompressionType( /*[in]*/CharCompressType nType ) override;
+ sal_Int32 getImagePreferredDPI() override
+ {
+ return mnImagePreferredDPI;
+ }
+ void setImagePreferredDPI(sal_Int32 nValue) override
+ {
+ mnImagePreferredDPI = nValue;
+ }
// Replace all compatibility options with those from rSource.
void ReplaceCompatibilityOptions(const DocumentSettingManager& rSource);
diff --git a/sw/source/core/inc/GraphicSizeCheck.hxx b/sw/source/core/inc/GraphicSizeCheck.hxx
new file mode 100644
index 000000000000..f708b0a5f4dc
--- /dev/null
+++ b/sw/source/core/inc/GraphicSizeCheck.hxx
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <doc.hxx>
+#include "ModelTraverser.hxx"
+#include <svx/GenericCheckDialog.hxx>
+
+namespace sw
+{
+class GraphicSizeViolation final
+{
+private:
+ const SwGrfNode* m_pGraphicNode;
+
+ sal_Int32 m_nLowDPILimit = 0;
+ sal_Int32 m_nHighDPILimit = 0;
+
+ sal_Int32 m_nDPIX = 0;
+ sal_Int32 m_nDPIY = 0;
+
+public:
+ GraphicSizeViolation(sal_Int32 nDPI, const SwGrfNode* pGraphicNode);
+ bool check();
+
+ OUString getGraphicName();
+
+ bool isDPITooLow() { return m_nDPIX < m_nLowDPILimit || m_nDPIY < m_nLowDPILimit; }
+
+ bool isDPITooHigh() { return m_nDPIX > m_nHighDPILimit || m_nDPIY > m_nHighDPILimit; }
+
+ sal_Int32 getDPIX() { return m_nDPIX; }
+
+ sal_Int32 getDPIY() { return m_nDPIY; }
+};
+
+class GraphicSizeCheck final
+{
+private:
+ SwDoc* m_pDocument;
+ std::vector<std::unique_ptr<GraphicSizeViolation>> m_aGraphicSizeViolationList;
+
+public:
+ GraphicSizeCheck(SwDoc* pDocument)
+ : m_pDocument(pDocument)
+ {
+ }
+
+ void check();
+
+ std::vector<std::unique_ptr<GraphicSizeViolation>>& getViolationList()
+ {
+ return m_aGraphicSizeViolationList;
+ }
+};
+
+class GraphicSizeCheckGUIEntry : public svx::CheckData
+{
+private:
+ SwDoc* m_pDocument;
+ std::unique_ptr<GraphicSizeViolation> m_pViolation;
+
+public:
+ GraphicSizeCheckGUIEntry(SwDoc* pDocument, std::unique_ptr<GraphicSizeViolation>&& pViolation)
+ : m_pDocument(pDocument)
+ , m_pViolation(std::move(pViolation))
+ {
+ }
+
+ OUString getText() override;
+
+ bool canMarkObject() override { return true; }
+
+ void markObject() override;
+
+ bool hasProperties() override { return true; }
+
+ void runProperties() override;
+};
+
+class GraphicSizeCheckGUIResult : public svx::CheckDataCollection
+{
+public:
+ GraphicSizeCheckGUIResult(SwDoc* pDocument);
+
+ OUString getTitle() override;
+};
+
+} // end sw namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx
index 4ce7c18ce011..d5c6e105f43b 100644
--- a/sw/source/core/inc/MarkManager.hxx
+++ b/sw/source/core/inc/MarkManager.hxx
@@ -68,7 +68,7 @@ namespace sw {
// deleters
virtual std::unique_ptr<ILazyDeleter>
- deleteMark(const const_iterator_t& ppMark) override;
+ deleteMark(const const_iterator_t& ppMark, bool isMoveNodes) override;
virtual void deleteMark(const ::sw::mark::IMark* const pMark) override;
virtual void clearAllMarks() override;
diff --git a/sw/source/core/inc/ModelTraverser.hxx b/sw/source/core/inc/ModelTraverser.hxx
new file mode 100644
index 000000000000..f3c6acb9c6dd
--- /dev/null
+++ b/sw/source/core/inc/ModelTraverser.hxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <doc.hxx>
+
+class SwNode;
+class SdrObject;
+
+namespace sw
+{
+class SW_DLLPUBLIC ModelTraverseHandler
+{
+public:
+ virtual ~ModelTraverseHandler() {}
+
+ virtual void handleNode(SwNode* pNode) = 0;
+ virtual void handleSdrObject(SdrObject* pObject) = 0;
+};
+
+class ModelTraverser
+{
+private:
+ std::vector<std::shared_ptr<ModelTraverseHandler>> mpNodeHandler;
+ SwDoc* m_pDoc;
+
+public:
+ ModelTraverser(SwDoc* pDoc)
+ : m_pDoc(pDoc)
+ {
+ }
+
+ void traverse();
+
+ void addNodeHandler(std::shared_ptr<ModelTraverseHandler> pHandler)
+ {
+ mpNodeHandler.push_back(pHandler);
+ }
+};
+
+} // end sw namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx
index 2251efa48a76..4cd23aee519c 100644
--- a/sw/source/core/inc/dview.hxx
+++ b/sw/source/core/inc/dview.hxx
@@ -76,8 +76,8 @@ protected:
using FmFormView::CheckSingleSdrObjectHit;
virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const override;
- // support enhanced text edit for draw objects
- virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const override;
+ // Create a local UndoManager
+ std::unique_ptr<SdrUndoManager> createLocalTextUndoManager() override;
public:
SwDrawView(
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index ae5e8378ee4b..289a45fc922f 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -424,7 +424,7 @@ protected:
bool mbColLocked : 1; // lock Grow/Shrink for column-wise section
// or fly frames, will be set in Format
bool m_isInDestroy : 1;
- bool mbForbidDelete : 1;
+ int mnForbidDelete;
void ColLock() { mbColLocked = true; }
void ColUnlock() { mbColLocked = false; }
@@ -860,7 +860,7 @@ public:
bool IsProtected() const;
bool IsColLocked() const { return mbColLocked; }
- virtual bool IsDeleteForbidden() const { return mbForbidDelete; }
+ virtual bool IsDeleteForbidden() const { return mnForbidDelete > 0; }
/// this is the only way to delete a SwFrame instance
static void DestroyFrame(SwFrame *const pFrame);
@@ -900,8 +900,8 @@ public:
void RegisterToFormat( SwFormat& rFormat );
void ValidateThisAndAllLowers( const sal_uInt16 nStage );
- void ForbidDelete() { mbForbidDelete = true; }
- void AllowDelete() { mbForbidDelete = false; }
+ void ForbidDelete() { ++mnForbidDelete; }
+ void AllowDelete() { assert(mnForbidDelete > 0); --mnForbidDelete; }
drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const;
bool supportsFullDrawingLayerFillAttributeSet() const;
@@ -1238,8 +1238,7 @@ public:
//it in e.g. SwSectionFrame::MergeNext etc because we will need it
//again after the SwFrameDeleteGuard dtor
explicit SwFrameDeleteGuard(SwFrame* pFrame)
- : m_pForbidFrame((pFrame && !pFrame->IsDeleteForbidden()) ?
- pFrame : nullptr)
+ : m_pForbidFrame(pFrame)
{
if (m_pForbidFrame)
m_pForbidFrame->ForbidDelete();
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 990c0e4b88f0..5a00382995f9 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -68,6 +68,9 @@ class SwLayAction
std::unique_ptr<SwWait> m_pWait;
+ std::vector<SwFrame*> m_aFrameStack;
+ std::vector<std::unique_ptr<SwFrameDeleteGuard>> m_aFrameDeleteGuards;
+
// If a paragraph (or anything else) moved more than one page when
// formatting, it adds its new page number here.
// The InternalAction can then take the appropriate steps.
@@ -124,6 +127,9 @@ class SwLayAction
bool RemoveEmptyBrowserPages();
+ void PushFormatLayout(SwFrame* pLow);
+ void PopFormatLayout();
+
public:
SwLayAction(SwRootFrame *pRt, SwViewShellImp *pImp, TaskStopwatch* pWatch = nullptr);
~SwLayAction();
@@ -148,7 +154,7 @@ public:
void SetReschedule ( bool bNew ) { m_bReschedule = bNew; }
void SetWaitAllowed ( bool bNew ) { m_bWaitAllowed = bNew; }
- void SetAgain() { m_bAgain = true; }
+ void SetAgain(bool bAgain);
void SetUpdateExpFields() {m_bUpdateExpFields = true; }
inline void SetCheckPageNum( sal_uInt16 nNew );
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 484ff172e25d..44d7a5800032 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -76,7 +76,7 @@ using SwDestroyList = std::set<SwSectionFrame*>;
/// The root element of a Writer document layout. Lower frames are expected to
/// be SwPageFrame instances.
-class SAL_DLLPUBLIC_RTTI SwRootFrame: public SwLayoutFrame
+class SW_DLLPUBLIC SwRootFrame: public SwLayoutFrame
{
// Needs to disable the Superfluous temporarily
friend void AdjustSizeChgNotify( SwRootFrame *pRoot );
diff --git a/sw/source/core/inc/unofldmid.h b/sw/source/core/inc/unofldmid.h
index 2bb13a66faa3..43e30058d470 100644
--- a/sw/source/core/inc/unofldmid.h
+++ b/sw/source/core/inc/unofldmid.h
@@ -41,6 +41,7 @@
#define FIELD_PROP_BOOL4 28
#define FIELD_PROP_STRINGS 29
#define FIELD_PROP_PAR5 30
+#define FIELD_PROP_GRABBAG 31
#define FIELD_PROP_IS_FIELD_USED 32
#define FIELD_PROP_IS_FIELD_DISPLAYED 33
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 9573944b71d1..df8a2e54a6f9 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2863,6 +2863,9 @@ bool SwContentFrame::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrame *pO
OSL_ENSURE( pTmp->IsTabFrame(), "GetNextSctLeaf: Wrong Type" );
pTmpNxt = static_cast<SwTabFrame*>(pTmp);
}
+ // we will dereference pNewUp in the following MoveSubTree call
+ // so it certainly should not be deleted before that
+ SwFrameDeleteGuard aDeleteGuard(pNewUp);
pTmpNxt->MoveSubTree( pTmpFootnote, pNewUp->GetNext() );
}
}
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 04201e1c6f5e..2a08b22fbcdb 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -282,11 +282,12 @@ bool SwLayAction::IsInterrupt()
void SwLayAction::Reset()
{
+ SetAgain(false);
m_pOptTab = nullptr;
m_nStartTicks = std::clock();
m_nEndPage = m_nPreInvaPage = m_nCheckPageNum = USHRT_MAX;
m_bPaint = m_bComplete = m_bWaitAllowed = m_bCheckPages = true;
- m_bInterrupt = m_bAgain = m_bNextCycle = m_bCalcLayout = m_bReschedule =
+ m_bInterrupt = m_bNextCycle = m_bCalcLayout = m_bReschedule =
m_bUpdateExpFields = m_bBrowseActionStop = false;
m_pCurPage = nullptr;
}
@@ -303,7 +304,8 @@ bool SwLayAction::RemoveEmptyBrowserPages()
do
{
if ( (pPage->GetSortedObjs() && pPage->GetSortedObjs()->size()) ||
- pPage->ContainsContent() )
+ pPage->ContainsContent() ||
+ pPage->FindFootnoteCont() )
pPage = static_cast<SwPageFrame*>(pPage->GetNext());
else
{
@@ -318,6 +320,53 @@ bool SwLayAction::RemoveEmptyBrowserPages()
return bRet;
}
+void SwLayAction::SetAgain(bool bAgain)
+{
+ if (bAgain == m_bAgain)
+ return;
+
+ m_bAgain = bAgain;
+
+ assert(m_aFrameStack.size() == m_aFrameDeleteGuards.size());
+ size_t nCount = m_aFrameStack.size();
+ if (m_bAgain)
+ {
+ // LayAction::FormatLayout is now flagged to exit early and will avoid
+ // dereferencing any SwFrames in the stack of FormatLayouts so allow
+ // their deletion
+ for (size_t i = 0; i < nCount; ++i)
+ m_aFrameDeleteGuards[i].reset();
+ }
+ else
+ {
+ // LayAction::FormatLayout is now continue normally and will
+ // dereference the top SwFrame in the stack of m_aFrameStack as each
+ // FormatLevel returns so disallow their deletion
+ for (size_t i = 0; i < nCount; ++i)
+ m_aFrameDeleteGuards[i] = std::make_unique<SwFrameDeleteGuard>(m_aFrameStack[i]);
+ }
+}
+
+void SwLayAction::PushFormatLayout(SwFrame* pLow)
+{
+ /* Workaround crash seen in crashtesting with fdo53985-1.docx
+
+ Lock pLow against getting deleted when it will be dereferenced
+ after FormatLayout
+
+ If SetAgain is called to make SwLayAction exit early to avoid that
+ dereference, then it clears these guards
+ */
+ m_aFrameStack.push_back(pLow);
+ m_aFrameDeleteGuards.push_back(std::make_unique<SwFrameDeleteGuard>(pLow));
+}
+
+void SwLayAction::PopFormatLayout()
+{
+ m_aFrameDeleteGuards.pop_back();
+ m_aFrameStack.pop_back();
+}
+
void SwLayAction::Action(OutputDevice* pRenderContext)
{
m_bActionInProgress = true;
@@ -344,12 +393,15 @@ void SwLayAction::Action(OutputDevice* pRenderContext)
SetCheckPages( false );
InternalAction(pRenderContext);
- m_bAgain |= RemoveEmptyBrowserPages();
+ if (RemoveEmptyBrowserPages())
+ SetAgain(true);
while ( IsAgain() )
{
- m_bAgain = m_bNextCycle = false;
+ SetAgain(false);
+ m_bNextCycle = false;
InternalAction(pRenderContext);
- m_bAgain |= RemoveEmptyBrowserPages();
+ if (RemoveEmptyBrowserPages())
+ SetAgain(true);
}
m_pRoot->DeleteEmptySct();
@@ -637,7 +689,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
{
bool bOld = IsAgain();
m_pRoot->RemoveSuperfluous();
- m_bAgain = bOld;
+ SetAgain(bOld);
}
if ( IsAgain() )
{
@@ -1370,7 +1422,11 @@ bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrame *pLa
}
// Skip the ones already registered for deletion
else if( !pLow->IsSctFrame() || static_cast<SwSectionFrame*>(pLow)->GetSection() )
+ {
+ PushFormatLayout(pLow);
bChanged |= FormatLayout( pRenderContext, static_cast<SwLayoutFrame*>(pLow), bAddRect );
+ PopFormatLayout();
+ }
}
else if ( m_pImp->GetShell()->IsPaintLocked() )
// Shortcut to minimize the cycles. With Lock, the
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 1d1f4597fcf2..711a68765991 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -500,8 +500,7 @@ void SwRootFrame::Init( SwFrameFormat* pFormat )
SwNodeIndex aTmp( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
::InsertCnt_( pLay, pDoc, aTmp.GetIndex(), true );
- //Remove masters that haven't been replaced yet from the list.
- RemoveMasterObjs( mpDrawPage );
+
if( rSettingAccess.get(DocumentSettingId::GLOBAL_DOCUMENT) )
rFieldsAccess.UpdateRefFields();
//b6433357: Update page fields after loading
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index 1ba020a84901..957109ddf460 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -293,7 +293,7 @@ bool SwObjectFormatterTextFrame::DoFormatObjs()
{
// notify layout action, thus is can restart the layout process on
// a previous page.
- GetLayAction()->SetAgain();
+ GetLayAction()->SetAgain(true);
}
else
{
@@ -641,6 +641,7 @@ static void lcl_FormatContentOfLayoutFrame( SwLayoutFrame* pLayFrame,
if ( pLowerFrame->IsLayoutFrame() )
{
SwFrameDeleteGuard aCrudeHack(pLowerFrame); // ??? any issue setting this for non-footnote frames?
+ // prevent moving footnotes by formatting if they are already being moved
lcl_FormatContentOfLayoutFrame( static_cast<SwLayoutFrame*>(pLowerFrame),
pLastLowerFrame );
}
@@ -686,21 +687,46 @@ void SwObjectFormatterTextFrame::FormatAnchorFrameAndItsPrevs( SwTextFrame& _rAn
// for follow text frames.
if ( !_rAnchorTextFrame.IsFollow() )
{
+ // In case the anchor frame is in a column or section, format its
+ // previous frames first - but don't jump out of the current layout
+ // environment, e.g. from footnotes into the footnote boss.
+ SwFrame * pSectFrame(nullptr);
+ SwFrame * pColFrameOfAnchor(nullptr);
+ for (SwFrame* pUpper = _rAnchorTextFrame.GetUpper();
+ pUpper != nullptr; pUpper = pUpper->GetUpper())
+ {
+ if (pUpper->IsCellFrame())
+ {
+ break; // apparently nothing to be done?
+ }
+ if (pUpper->IsFootnoteFrame())
+ {
+ SAL_INFO_IF(pColFrameOfAnchor == nullptr && pUpper->FindColFrame(),
+ "sw.layout", "tdf#122894 skipping column for footnote in column");
+ break; // stop: prevent crash in case footnotes are being moved
+ }
+ if (pUpper->IsSctFrame())
+ {
+ pColFrameOfAnchor = nullptr;
+ pSectFrame = pUpper;
+ break;
+ }
+ if (pColFrameOfAnchor != nullptr)
+ { // parent of column not a section frame => column not in section
+ break;
+ }
+ if (pUpper->IsColumnFrame())
+ {
+ pColFrameOfAnchor = pUpper;
+ }
+ }
+
// if anchor frame is directly inside a section, format this section and
// its previous frames.
// Note: It's a very simple format without formatting objects.
- if ( _rAnchorTextFrame.IsInSct() )
+ if (pSectFrame)
{
- SwFrame* pSectFrame = _rAnchorTextFrame.GetUpper();
- while ( pSectFrame )
- {
- if ( pSectFrame->IsSctFrame() || pSectFrame->IsCellFrame() )
- {
- break;
- }
- pSectFrame = pSectFrame->GetUpper();
- }
- if ( pSectFrame && pSectFrame->IsSctFrame() )
+ assert(pSectFrame->IsSctFrame());
{
SwFrameDeleteGuard aDeleteGuard(&_rAnchorTextFrame);
// #i44049#
@@ -711,6 +737,8 @@ void SwObjectFormatterTextFrame::FormatAnchorFrameAndItsPrevs( SwTextFrame& _rAn
// Thus, check for valid <pFrame>.
while ( pFrame && pFrame != pSectFrame )
{
+ SwFrameDeleteGuard aDeleteFrameGuard(pFrame);
+
if ( pFrame->IsLayoutFrame() )
lcl_FormatContentOfLayoutFrame( static_cast<SwLayoutFrame*>(pFrame) );
else
@@ -728,9 +756,9 @@ void SwObjectFormatterTextFrame::FormatAnchorFrameAndItsPrevs( SwTextFrame& _rAn
// #i40140# - if anchor frame is inside a column,
// format the content of the previous columns.
// Note: It's a very simple format without formatting objects.
- SwFrame* pColFrameOfAnchor = _rAnchorTextFrame.FindColFrame();
- if ( pColFrameOfAnchor )
+ if (pColFrameOfAnchor)
{
+ assert(pColFrameOfAnchor->IsColumnFrame());
// #i44049#
_rAnchorTextFrame.LockJoin();
SwFrame* pColFrame = pColFrameOfAnchor->GetUpper()->GetLower();
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index a684b1602a1a..867617682f50 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -284,7 +284,7 @@ void SwPageFrame::DestroyImpl()
SwViewShellImp *pImp = pSh->Imp();
pImp->SetFirstVisPageInvalid();
if ( pImp->IsAction() )
- pImp->GetLayAction().SetAgain();
+ pImp->GetLayAction().SetAgain(true);
// #i9719# - retouche area of page
// including border and shadow area.
const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
@@ -1632,6 +1632,9 @@ void SwRootFrame::AssertFlyPages()
AssertPageFlys(pFirstRevivedEmptyPage);
}
+ //Remove masters that haven't been replaced yet from the list.
+ RemoveMasterObjs( mpDrawPage );
+
#if OSL_DEBUG_LEVEL > 0
pPage = static_cast<SwPageFrame*>(Lower());
while ( pPage && pPage->GetNext() &&
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 524562585bd1..48debbcc399a 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2863,7 +2863,8 @@ void SwRootFrame::DeleteEmptySct_()
mpDestroy->erase( mpDestroy->begin() );
OSL_ENSURE( !pSect->IsColLocked() && !pSect->IsJoinLocked(),
"DeleteEmptySct: Locked SectionFrame" );
- if( !pSect->getFrameArea().HasArea() && !pSect->ContainsContent() )
+ SAL_WARN_IF(pSect->IsDeleteForbidden(), "sw.layout", "not allowed delete SwFrame");
+ if( !pSect->getFrameArea().HasArea() && !pSect->ContainsContent() && !pSect->IsDeleteForbidden() )
{
SwLayoutFrame* pUp = pSect->GetUpper();
pSect->RemoveFromLayout();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 9cf90591cd99..d2ebda58f2cc 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -23,6 +23,7 @@
#include <viewimp.hxx>
#include <fesh.hxx>
#include <swtable.hxx>
+#include <deletelistener.hxx>
#include <dflyobj.hxx>
#include <anchoreddrawobject.hxx>
#include <fmtanchr.hxx>
@@ -1344,13 +1345,30 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK
return bRet;
}
+namespace
+{
+ bool CanDeleteFollow(SwTabFrame *pFoll)
+ {
+ if (pFoll->IsJoinLocked())
+ return false;
+
+ if (pFoll->IsDeleteForbidden())
+ {
+ SAL_WARN("sw.layout", "Delete Forbidden");
+ return false;
+ }
+
+ return true;
+ }
+}
+
void SwTabFrame::Join()
{
OSL_ENSURE( !HasFollowFlowLine(), "Joining follow flow line" );
SwTabFrame *pFoll = GetFollow();
- if (pFoll && !pFoll->IsJoinLocked())
+ if (pFoll && CanDeleteFollow(pFoll))
{
SwRectFnSet aRectFnSet(this);
pFoll->Cut(); //Cut out first to avoid unnecessary notifications.
@@ -1579,6 +1597,8 @@ static bool lcl_InnerCalcLayout( SwFrame *pFrame,
if ( pFrame->IsLayoutFrame() &&
( !_bOnlyRowsAndCells || pFrame->IsRowFrame() || pFrame->IsCellFrame() ) )
{
+ SwFrameDeleteGuard aDeleteGuard(pFrame);
+
// #130744# An invalid locked table frame will
// not be calculated => It will not become valid =>
// Loop in lcl_RecalcRow(). Therefore we do not consider them for bRet.
@@ -1838,7 +1858,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
// is not locked. Otherwise, join will not be performed and this loop
// will be endless.
while ( GetNext() && GetNext() == GetFollow() &&
- !GetFollow()->IsJoinLocked()
+ CanDeleteFollow(GetFollow())
)
{
if ( HasFollowFlowLine() )
@@ -1991,8 +2011,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
pAccess.reset();
m_bCalcLowers |= pLayout->Resize(
pLayout->GetBrowseWidthByTabFrame( *this ) );
- pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
- pAttrs = pAccess->Get();
}
setFramePrintAreaValid(false);
@@ -2021,6 +2039,12 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
const long nOldPrtWidth = aRectFnSet.GetWidth(getFramePrintArea());
const long nOldFrameWidth = aRectFnSet.GetWidth(getFrameArea());
const Point aOldPrtPos = aRectFnSet.GetPos(getFramePrintArea());
+
+ if (!pAccess)
+ {
+ pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
+ pAttrs = pAccess->Get();
+ }
Format( getRootFrame()->GetCurrShell()->GetOut(), pAttrs );
SwHTMLTableLayout *pLayout = GetTable()->GetHTMLTableLayout();
@@ -2031,8 +2055,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
pAccess.reset();
m_bCalcLowers |= pLayout->Resize(
pLayout->GetBrowseWidthByTabFrame( *this ) );
- pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
- pAttrs = pAccess->Get();
}
if ( aOldPrtPos != aRectFnSet.GetPos(getFramePrintArea()) )
aNotify.SetLowersComplete( false );
@@ -2060,12 +2082,18 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
}
SwFootnoteBossFrame *pOldBoss = bFootnotesInDoc ? FindFootnoteBossFrame( true ) : nullptr;
bool bReformat;
+ std::optional<SfxDeleteListener> oDeleteListener;
+ if (pOldBoss)
+ oDeleteListener.emplace(*pOldBoss);
+ SwFrameDeleteGuard g(this);
if ( MoveBwd( bReformat ) )
{
+ SAL_WARN_IF(oDeleteListener && oDeleteListener->WasDeleted(), "sw.layout", "SwFootnoteBossFrame unexpectedly deleted");
+
aRectFnSet.Refresh(this);
bMovedBwd = true;
aNotify.SetLowersComplete( false );
- if ( bFootnotesInDoc )
+ if (bFootnotesInDoc && !oDeleteListener->WasDeleted())
MoveLowerFootnotes( nullptr, pOldBoss, nullptr, true );
if ( bReformat || bKeep )
{
@@ -2080,15 +2108,22 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
pAccess.reset();
m_bCalcLowers |= pHTMLLayout->Resize(
pHTMLLayout->GetBrowseWidthByTabFrame( *this ) );
+ }
+
+ setFramePrintAreaValid(false);
+ if (!pAccess)
+ {
pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
pAttrs = pAccess->Get();
}
-
- setFramePrintAreaValid(false);
Format( getRootFrame()->GetCurrShell()->GetOut(), pAttrs );
}
+
+ pAccess.reset();
+
lcl_RecalcTable( *this, nullptr, aNotify );
+
m_bLowersFormatted = true;
if ( bKeep && KEEPTAB )
{
@@ -2252,11 +2287,18 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
// 6. There is no section change behind the table (see IsKeep)
// 7. The last table row wants to keep with its next.
const SwRowFrame* pLastRow = static_cast<const SwRowFrame*>(GetLastLower());
- if (pLastRow
- && IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), true)
- && pLastRow->ShouldRowKeepWithNext())
+ if (pLastRow)
{
- bFormat = true;
+ if (!pAccess)
+ {
+ pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
+ pAttrs = pAccess->Get();
+ }
+ if (IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), true)
+ && pLastRow->ShouldRowKeepWithNext())
+ {
+ bFormat = true;
+ }
}
}
@@ -2270,9 +2312,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
// is found, get its first content.
const SwFrame* pTmpNxt = sw_FormatNextContentForKeep( this );
- pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
- pAttrs = pAccess->Get();
-
// The last row wants to keep with the frame behind the table.
// Check if the next frame is on a different page and valid.
// In this case we do a magic trick:
@@ -2513,9 +2552,6 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
GetFollow()->MakeAll(pRenderContext);
- pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
- pAttrs = pAccess->Get();
-
GetFollow()->SetLowersFormatted(false);
// #i43913# - lock follow table
// to avoid its formatting during the format of
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index f17a7ba68870..c1e85421cce3 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -317,7 +317,7 @@ SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib )
mbInfSct ( false ),
mbColLocked(false),
m_isInDestroy(false),
- mbForbidDelete(false)
+ mnForbidDelete(0)
{
OSL_ENSURE( pMod, "No frame format given." );
}
diff --git a/sw/source/core/model/ModelTraverser.cxx b/sw/source/core/model/ModelTraverser.cxx
new file mode 100644
index 000000000000..bb959a95dec6
--- /dev/null
+++ b/sw/source/core/model/ModelTraverser.cxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <ModelTraverser.hxx>
+#include <node.hxx>
+#include <ndarr.hxx>
+#include <IDocumentDrawModelAccess.hxx>
+#include <svx/svdpage.hxx>
+#include <drawdoc.hxx>
+
+namespace sw
+{
+void ModelTraverser::traverse()
+{
+ if (m_pDoc == nullptr)
+ return;
+
+ auto const& pNodes = m_pDoc->GetNodes();
+ SwNode* pNode = nullptr;
+
+ for (sal_uLong n = 0; n < pNodes.Count(); ++n)
+ {
+ pNode = pNodes[n];
+ if (pNode)
+ {
+ for (auto& pNodeHandler : mpNodeHandler)
+ {
+ pNodeHandler->handleNode(pNode);
+ }
+ }
+ }
+
+ IDocumentDrawModelAccess& rDrawModelAccess = m_pDoc->getIDocumentDrawModelAccess();
+ auto* pModel = rDrawModelAccess.GetDrawModel();
+ for (sal_uInt16 nPage = 0; nPage < pModel->GetPageCount(); ++nPage)
+ {
+ SdrPage* pPage = pModel->GetPage(nPage);
+ for (size_t nObject = 0; nObject < pPage->GetObjCount(); ++nObject)
+ {
+ SdrObject* pObject = pPage->GetObj(nObject);
+ if (pObject)
+ {
+ for (auto& pNodeHandler : mpNodeHandler)
+ {
+ pNodeHandler->handleSdrObject(pObject);
+ }
+ }
+ }
+ }
+}
+
+} // end sw namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 9000d6ef1b9e..c35812eef8bf 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -147,6 +147,8 @@ void SAL_CALL SwOLEListener_Impl::disposing( const lang::EventObject& )
// TODO/LATER: actually SwEmbedObjectLink should be used here, but because different objects are used to control
// embedded object different link objects with the same functionality had to be implemented
+namespace {
+
class SwEmbedObjectLink : public sfx2::SvBaseLink
{
SwOLENode* pOleNode;
@@ -209,6 +211,44 @@ void SwEmbedObjectLink::Closed()
SvBaseLink::Closed();
}
+class SwIFrameLink : public sfx2::SvBaseLink
+{
+ SwOLENode* m_pOleNode;
+
+public:
+ explicit SwIFrameLink(SwOLENode* pNode)
+ : ::sfx2::SvBaseLink(::SfxLinkUpdateMode::ONCALL, SotClipboardFormatId::SVXB)
+ , m_pOleNode(pNode)
+ {
+ SetSynchron( false );
+ }
+
+ ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const OUString&, const uno::Any& )
+ {
+ uno::Reference<embed::XEmbeddedObject> xObject = m_pOleNode->GetOLEObj().GetOleRef();
+ uno::Reference<embed::XCommonEmbedPersist> xPersObj(xObject, uno::UNO_QUERY);
+ if (xPersObj.is())
+ {
+ // let the IFrameObject reload the link
+ try
+ {
+ xPersObj->reload(uno::Sequence<beans::PropertyValue>(), uno::Sequence<beans::PropertyValue>());
+ }
+ catch (const uno::Exception&)
+ {
+ }
+
+ m_pOleNode->SetChanged();
+ }
+
+ return SUCCESS;
+ }
+
+};
+
+}
+
SwOLENode::SwOLENode( const SwNodeIndex &rWhere,
const svt::EmbeddedObjectRef& xObj,
SwGrfFormatColl *pGrfColl,
@@ -606,18 +646,49 @@ void SwOLENode::CheckFileLink_Impl()
{
try
{
- uno::Reference< embed::XLinkageSupport > xLinkSupport( maOLEObj.m_xOLERef.GetObject(), uno::UNO_QUERY_THROW );
- if ( xLinkSupport->isLink() )
+ uno::Reference<embed::XEmbeddedObject> xObject = maOLEObj.m_xOLERef.GetObject();
+ if (!xObject)
+ return;
+
+ bool bIFrame = false;
+
+ OUString aLinkURL;
+ uno::Reference<embed::XLinkageSupport> xLinkSupport(xObject, uno::UNO_QUERY);
+ if (xLinkSupport)
+ {
+ if (xLinkSupport->isLink())
+ aLinkURL = xLinkSupport->getLinkURL();
+ }
+ else
{
- const OUString aLinkURL = xLinkSupport->getLinkURL();
- if ( !aLinkURL.isEmpty() )
+ // get IFrame (Floating Frames) listed and updatable from the
+ // manage links dialog
+ SvGlobalName aClassId(xObject->getClassID());
+ if (aClassId == SvGlobalName(SO3_IFRAME_CLASSID))
+ {
+ uno::Reference<beans::XPropertySet> xSet(xObject->getComponent(), uno::UNO_QUERY);
+ if (xSet.is())
+ xSet->getPropertyValue("FrameURL") >>= aLinkURL;
+ bIFrame = true;
+ }
+ }
+
+ if (!aLinkURL.isEmpty()) // this is a file link so the model link manager should handle it
+ {
+ SwEmbedObjectLink* pEmbedObjectLink = nullptr;
+ if (!bIFrame)
+ {
+ pEmbedObjectLink = new SwEmbedObjectLink(this);
+ mpObjectLink = pEmbedObjectLink;
+ }
+ else
{
- // this is a file link so the model link manager should handle it
- mpObjectLink = new SwEmbedObjectLink( this );
- maLinkURL = aLinkURL;
- GetDoc()->getIDocumentLinksAdministration().GetLinkManager().InsertFileLink( *mpObjectLink, OBJECT_CLIENT_OLE, aLinkURL );
- mpObjectLink->Connect();
+ mpObjectLink = new SwIFrameLink(this);
}
+ maLinkURL = aLinkURL;
+ GetDoc()->getIDocumentLinksAdministration().GetLinkManager().InsertFileLink( *mpObjectLink, OBJECT_CLIENT_OLE, aLinkURL );
+ if (pEmbedObjectLink)
+ pEmbedObjectLink->Connect();
}
}
catch( uno::Exception& )
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 5a099eec65cf..11da5346c4d5 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2327,6 +2327,7 @@ void SwTableBoxFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
// format contents with the new value assigned and write to paragraph
Color* pCol = nullptr;
OUString sNewText;
+ bool bChangeFormat = true;
if( DBL_MAX == fVal )
{
sNewText = SwViewShell::GetShellRes()->aCalc_Error;
@@ -2351,6 +2352,14 @@ void SwTableBoxFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
#else
sNewText = aOrigText;
#endif
+ // Remove the newly assigned numbering format as well if text actually exists.
+ // Exception: assume user-defined formats are always intentional.
+ if (bChgText && pNumFormatr->IsTextFormat(nOldFormat)
+ && !pNumFormatr->IsUserDefinedAndNotOverloaded(nNewFormat))
+ {
+ pBox->GetFrameFormat()->ResetFormatAttr(RES_BOXATR_FORMAT);
+ bChangeFormat = false;
+ }
}
if( !bChgText )
@@ -2360,9 +2369,11 @@ void SwTableBoxFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
}
// across all boxes
- ChgTextToNum( *pBox, sNewText, pCol,
+ if (bChangeFormat)
+ {
+ ChgTextToNum( *pBox, sNewText, pCol,
GetDoc()->IsInsTableAlignNum() );
-
+ }
}
else if( bNewIsTextFormat && nOldFormat != nNewFormat )
{
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 69db90b6502d..3720c3117f9b 100755
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1599,9 +1599,27 @@ void SwTextFrame::Format_( SwTextFormatter &rLine, SwTextFormatInfo &rInf,
// If we're finished formatting the text and we still
// have other line objects left, these are superfluous
// now because the text has gotten shorter.
+ bool bTruncLines = false;
if( rLine.GetStart() + rLine.GetLength() >= nStrLen &&
rLine.GetCurr()->GetNext() )
{
+ bTruncLines = true;
+ }
+ else if (GetMergedPara() && rLine.GetCurr()->GetNext())
+ {
+ // We can also have superfluous lines with redlining in case the current line is shorter
+ // than the text length, but the total length of lines is still more than expected.
+ // Truncate in this case as well.
+ TextFrameIndex nLen(0);
+ for (const SwLineLayout* pLine = pPara; pLine; pLine = pLine->GetNext())
+ {
+ nLen += pLine->GetLen();
+ }
+ bTruncLines = nLen > nStrLen;
+ }
+
+ if (bTruncLines)
+ {
rLine.TruncLines();
rLine.SetTruncLines( true );
}
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 4933bce92c9f..1a60ff2b42d6 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -447,7 +447,7 @@ static void InsertCharAttrs(SfxPoolItem const** pAttrs, SfxItemSet const& rItems
}
else if (nWhich == RES_TXTATR_UNKNOWN_CONTAINER)
{
- pAttrs[RES_CHRATR_END] = pItem;
+ pAttrs[RES_CHRATR_END - RES_CHRATR_BEGIN] = pItem;
}
}
}
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 5806f06e3b76..6528ffff440e 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1538,8 +1538,12 @@ TextFrameIndex SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoin
{
if (pPor->IsPostItsPortion())
{
- // Offset would be nCurrStart + nLength below, do the same for post-it portions.
- nCurrStart += pPor->GetLen();
+ SwPostItsPortion* pPostItsPortion = dynamic_cast<SwPostItsPortion*>(pPor);
+ if (!pPostItsPortion->IsScript()) // tdf#141079
+ {
+ // Offset would be nCurrStart + nLength below, do the same for post-it portions.
+ nCurrStart += pPor->GetLen();
+ }
}
return nCurrStart;
}
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 4e57a0b64d90..e986b5b675af 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -149,6 +149,16 @@ sal_uInt16 SwTextFormatter::GetFrameRstHeight() const
return sal_uInt16( nHeight );
}
+bool SwTextFormatter::ClearIfIsFirstOfBorderMerge(const SwLinePortion* pPortion)
+{
+ if (pPortion == m_pFirstOfBorderMerge)
+ {
+ m_pFirstOfBorderMerge = nullptr;
+ return true;
+ }
+ return false;
+}
+
SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf )
{
// Save values and initialize rInf
@@ -277,11 +287,8 @@ SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf )
SwLinePortion* pNext = pPor->GetNextPortion();
while (pNext)
{
- if (pNext == m_pFirstOfBorderMerge)
- {
- m_pFirstOfBorderMerge = nullptr;
+ if (ClearIfIsFirstOfBorderMerge(pNext))
break;
- }
pNext = pNext->GetNextPortion();
}
pPor->Truncate();
@@ -2495,7 +2502,11 @@ SwFlyCntPortion *SwTextFormatter::NewFlyCntPortion( SwTextFormatInfo &rInf,
SwFlyInContentFrame *pFly;
SwFrameFormat* pFrameFormat = static_cast<SwTextFlyCnt*>(pHint)->GetFlyCnt().GetFrameFormat();
if( RES_FLYFRMFMT == pFrameFormat->Which() )
+ {
+ // set Lock pFrame to avoid m_pCurr getting deleted
+ TextFrameLockGuard aGuard(m_pFrame);
pFly = static_cast<SwTextFlyCnt*>(pHint)->GetFlyFrame(pFrame);
+ }
else
pFly = nullptr;
// aBase is the document-global position, from which the new extra portion is placed
diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index c9a14f566741..ceabbabeb47b 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -238,6 +238,8 @@ public:
* @param rInf contain information
**/
void MergeCharacterBorder( SwLinePortion& rPortion, SwLinePortion const *pPrev, SwTextFormatInfo& rInf );
+
+ bool ClearIfIsFirstOfBorderMerge(SwLinePortion const *pPortion);
};
#endif
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 11338d9a8c39..5872e5688ba1 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -173,9 +173,18 @@ SwFieldSlot::SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pP
pInf->SetFakeLineStart( nIdx > pInf->GetLineStart() );
pInf->SetIdx(TextFrameIndex(0));
}
- else if (nIdx < TextFrameIndex(pOldText->getLength()))
+ else
{
- aText = (*pOldText).replaceAt(sal_Int32(nIdx), 1, aText);
+ TextFrameIndex nEnd(pOldText->getLength());
+ if (nIdx < nEnd)
+ {
+ //sal_Int32 const nFieldLen(pPor->GetFieldLen());
+ aText = (*pOldText).replaceAt(sal_Int32(nIdx), 1/*nFieldLen*/, aText);
+ }
+ else if (nIdx == nEnd)
+ aText = *pOldText + aText;
+ else
+ SAL_WARN("sw.core", "SwFieldSlot bad SwFieldPortion index.");
}
pInf->SetText( aText );
}
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 2bb9e87bd2c9..98e7b0255d70 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -395,7 +395,9 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
if( !GetAscent() )
SetAscent( pPos->GetAscent() );
}
- delete pLast->Cut( pPos );
+ SwLinePortion* pPortion = pLast->Cut( pPos );
+ rLine.ClearIfIsFirstOfBorderMerge(pPortion);
+ delete pPortion;
pPos = pLast->GetNextPortion();
continue;
}
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index f6927730edc6..b8d450779ee7 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1292,6 +1292,8 @@ void SwTextFrame::SetMergedPara(std::unique_ptr<sw::MergedPara> p)
pFirst->Add(this); // must register at node again
}
}
+ // postcondition: frame must be listening somewhere
+ assert(m_pMergedPara || GetDep());
}
const OUString& SwTextFrame::GetText() const
@@ -2971,7 +2973,13 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid,
if( aTextFly.IsOn() )
{
// Does any free-flying frame overlap?
- bFormat = aTextFly.Relax() || IsUndersized();
+ const bool bRelaxed = aTextFly.Relax();
+ bFormat = bRelaxed || IsUndersized();
+ if (bRelaxed)
+ {
+ // It's possible that pPara was deleted above; retrieve it again
+ pPara = aAccess.GetPara();
+ }
}
}
}
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index ebcdced03c52..ffb7aed2c5e0 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -314,7 +314,31 @@ void SwFormatField::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
}
}
- const bool bForceNotify = (pOld == nullptr) && (pNew == nullptr);
+ bool bForceNotify = (pOld == nullptr) && (pNew == nullptr);
+ if (bForceNotify)
+ {
+ // Force notify was added for conditional text fields, at least the below fields need
+ // no forced notify.
+ const SwField* pField = mpTextField->GetFormatField().GetField();
+ const SwFieldIds nWhich = pField->GetTyp()->Which();
+ if (nWhich == SwFieldIds::DocInfo)
+ {
+ auto pDocInfoField = static_cast<const SwDocInfoField*>(pField);
+ sal_uInt16 nSubType = pDocInfoField->GetSubType();
+ // Do not consider extended SubTypes.
+ nSubType &= 0xff;
+ switch (nSubType)
+ {
+ case nsSwDocInfoSubType::DI_TITLE:
+ case nsSwDocInfoSubType::DI_THEMA:
+ case nsSwDocInfoSubType::DI_CHANGE:
+ case nsSwDocInfoSubType::DI_CUSTOM:
+ bForceNotify = false;
+ break;
+ }
+ }
+ }
+
mpTextField->ExpandTextField( bForceNotify );
}
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index 6cc805d1518d..e9d41a7bcd3e 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -56,7 +56,7 @@ void SwUndoBookmark::ResetInDoc( SwDoc* pDoc )
{
if ( m_pHistoryBookmark->IsEqualBookmark( **ppBkmk ) )
{
- pMarkAccess->deleteMark( ppBkmk );
+ pMarkAccess->deleteMark(ppBkmk, false);
break;
}
}
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index fa86072a3008..3fe7f107f052 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1168,7 +1168,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark,
&& ( bSaveOtherPos
|| !pBkmk->IsExpanded() ) )
{
- pMarkAccess->deleteMark(pMarkAccess->getAllMarksBegin()+n);
+ pMarkAccess->deleteMark(pMarkAccess->getAllMarksBegin()+n, false);
n--;
}
}
@@ -1558,9 +1558,14 @@ static bool IsNotBackspaceHeuristic(
SwPosition const& rStart, SwPosition const& rEnd)
{
// check if the selection is backspace/delete created by DelLeft/DelRight
- return rStart.nNode.GetIndex() + 1 != rEnd.nNode.GetIndex()
- || rEnd.nContent != 0
- || rStart.nContent != rStart.nNode.GetNode().GetTextNode()->Len();
+ if (rStart.nNode.GetIndex() + 1 != rEnd.nNode.GetIndex())
+ return true;
+ if (rEnd.nContent != 0)
+ return true;
+ const SwTextNode* pTextNode = rStart.nNode.GetNode().GetTextNode();
+ if (!pTextNode || rStart.nContent != pTextNode->Len())
+ return true;
+ return false;
}
bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index e2e5c9411715..60dc135caa3f 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2078,7 +2078,8 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
aAny <<= pGrfNode->GetGrf().GetXGraphic();
}
}
- else if( FN_UNO_TRANSFORMED_GRAPHIC == pEntry->nWID )
+ else if( FN_UNO_TRANSFORMED_GRAPHIC == pEntry->nWID
+ || FN_UNO_GRAPHIC_PREVIEW == pEntry->nWID )
{
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
if(pIdx)
@@ -2102,6 +2103,19 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
awt::Size aFrameSize = getSize();
Size aSize100thmm(aFrameSize.Width, aFrameSize.Height);
Size aSize = OutputDevice::LogicToLogic(aSize100thmm, MapMode(MapUnit::Map100thMM), aGraphicObj.GetPrefMapMode());
+
+ if (FN_UNO_GRAPHIC_PREVIEW == pEntry->nWID)
+ {
+ double fX = static_cast<double>(aSize.getWidth()) / 1280;
+ double fY = static_cast<double>(aSize.getHeight()) / 720;
+ double fFactor = fX > fY ? fX : fY;
+ if (fFactor > 1.0)
+ {
+ aSize.setWidth(aSize.getWidth() / fFactor);
+ aSize.setHeight(aSize.getHeight() / fFactor);
+ }
+ }
+
Graphic aGraphic = aGraphicObj.GetTransformedGraphic(aSize, aGraphicObj.GetPrefMapMode(), aGraphicAttr);
aAny <<= aGraphic.GetXGraphic();
}
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 05695e8585b2..63fbd6e78c13 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -952,6 +952,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{OUString(UNO_NAME_HINT), FIELD_PROP_PAR2, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0},
{OUString(UNO_NAME_HELP), FIELD_PROP_PAR3, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0},
{OUString(UNO_NAME_TOOLTIP), FIELD_PROP_PAR4, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0},
+ {OUString(UNO_NAME_MISC_OBJ_INTEROPGRABBAG), FIELD_PROP_GRABBAG, cppu::UnoType< cppu::UnoSequenceType<css::beans::PropertyValue> >::get(), PROPERTY_NONE, 0},
COMMON_FLDTYP_PROPERTIES
{ OUString(), 0, css::uno::Type(), 0, 0 }
};
diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx
index 08c97f878703..5ee500c17776 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -858,6 +858,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetGraphicPropertyMap(
{ OUString(UNO_NAME_GRAPHIC), FN_UNO_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 },
{ OUString(UNO_NAME_GRAPHIC_URL), FN_UNO_GRAPHIC_URL, cppu::UnoType<css::uno::Any>::get(), 0, 0 },
{ OUString(UNO_NAME_TRANSFORMED_GRAPHIC), FN_UNO_TRANSFORMED_GRAPHIC, cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 },
+ { OUString(UNO_NAME_GRAPHIC_PREVIEW), FN_UNO_GRAPHIC_PREVIEW, cppu::UnoType<css::graphic::XGraphic>::get(), 0, 0 },
{ OUString(UNO_NAME_ACTUAL_SIZE), FN_UNO_ACTUAL_SIZE, cppu::UnoType<css::awt::Size>::get(), PropertyAttribute::READONLY, CONVERT_TWIPS},
{ OUString(UNO_NAME_CONTOUR_POLY_POLYGON), FN_PARAM_CONTOUR_PP, cppu::UnoType<css::drawing::PointSequenceSequence>::get(), PropertyAttribute::MAYBEVOID, 0 },
{ OUString(UNO_NAME_IS_PIXEL_CONTOUR), FN_UNO_IS_PIXEL_CONTOUR, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 1f68135f7a4a..f931f16a8d09 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1148,6 +1148,7 @@ void SwXNumberingRules::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElemen
SwXNumberingRules::SetNumberingRuleByIndex( aNumRule,
*rProperties, nIndex);
// set character format if needed
+ // this code appears to be dead - except when a style is assigned for BITMAP numbering?
const SwCharFormats* pFormats = m_pDocShell->GetDoc()->GetCharFormats();
const size_t nChCount = pFormats->size();
for(sal_uInt16 i = 0; i < MAXLEVEL;i++)
@@ -1492,7 +1493,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SetPropertiesToNumFormat(aFormat, m_sNewCharStyleNames[nIndex],
&m_sNewBulletFontNames[nIndex],
&sHeadingStyleName, &sParagraphStyleName,
- m_pDoc, rProperties);
+ m_pDoc, m_pDocShell, rProperties);
if (m_pDoc && !sParagraphStyleName.isEmpty())
@@ -1539,8 +1540,11 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
OUString *const pHeadingStyleName,
OUString *const pParagraphStyleName,
SwDoc *const pDoc,
+ SwDocShell *const pDocShell,
const uno::Sequence<beans::PropertyValue>& rProperties)
{
+ assert(pDoc == nullptr || pDocShell == nullptr); // can't be both ordinary and chapter numbering
+
bool bWrongArg = false;
std::unique_ptr<SvxBrushItem> pSetBrush;
std::unique_ptr<Size> pSetSize;
@@ -1588,14 +1592,15 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
rProp.Value >>= uTmp;
OUString sCharFormatName;
SwStyleNameMapper::FillUIName( uTmp, sCharFormatName, SwGetPoolIdFromName::ChrFmt );
+ SwDoc *const pLocalDoc = pDocShell ? pDocShell->GetDoc() : pDoc;
if (sCharFormatName == UNO_NAME_CHARACTER_FORMAT_NONE)
{
rCharStyleName = aInvalidStyle;
aFormat.SetCharFormat(nullptr);
}
- else if(pDoc)
+ else if (pLocalDoc)
{
- const SwCharFormats* pFormats = pDoc->GetCharFormats();
+ const SwCharFormats* pFormats = pLocalDoc->GetCharFormats();
const size_t nChCount = pFormats->size();
SwCharFormat* pCharFormat = nullptr;
@@ -1614,7 +1619,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
{
SfxStyleSheetBase* pBase;
- SfxStyleSheetBasePool* pPool = pDoc->GetDocShell()->GetStyleSheetPool();
+ SfxStyleSheetBasePool* pPool = pLocalDoc->GetDocShell()->GetStyleSheetPool();
pBase = pPool->Find(sCharFormatName, SfxStyleFamily::Char);
if(!pBase)
pBase = &pPool->Make(sCharFormatName, SfxStyleFamily::Char);
@@ -1626,7 +1631,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
// If the character format has been found its name should not be in the
// char style names array
rCharStyleName.clear();
- }
+ }
else
rCharStyleName = sCharFormatName;
}
@@ -1779,8 +1784,8 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
{
OUString sBulletFontName;
rProp.Value >>= sBulletFontName;
- SwDocShell* pLclDocShell = pDoc->GetDocShell();
- if( !sBulletFontName.isEmpty() && pLclDocShell )
+ SwDocShell *const pLclDocShell = pDocShell ? pDocShell : pDoc ? pDoc->GetDocShell() : nullptr;
+ if (!sBulletFontName.isEmpty() && pLclDocShell)
{
const SvxFontListItem* pFontListItem =
static_cast<const SvxFontListItem* >(pLclDocShell
@@ -1878,7 +1883,8 @@ void SwXNumberingRules::SetPropertiesToNumFormat(
}
pSetVOrient->PutValue(rProp.Value, MID_VERTORIENT_ORIENT);
}
- else if (rProp.Name == UNO_NAME_HEADING_STYLE_NAME)
+ else if (rProp.Name == UNO_NAME_HEADING_STYLE_NAME
+ && pDocShell) // only on chapter numbering
{
if (pHeadingStyleName)
{
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index bf160861ee3c..0a87c1672f97 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -418,7 +418,10 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
// seems to work (and does technically) but fails with transparent objects. Since the
// region given to BeginDarwLayers() defines the clip region for DrawingLayer paint,
// transparent objects in the single rectangles will indeed be painted multiple times.
- DLPrePaint2(vcl::Region(aRect.SVRect()));
+ if (!comphelper::LibreOfficeKit::isActive())
+ {
+ DLPrePaint2(vcl::Region(aRect.SVRect()));
+ }
if ( bPaintsFromSystem )
PaintDesktop(*GetOut(), aRect);
@@ -428,7 +431,10 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
// #i75172# end DrawingLayer paint
- DLPostPaint2(true);
+ if (!comphelper::LibreOfficeKit::isActive())
+ {
+ DLPostPaint2(true);
+ }
}
}
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index e6e0517a0489..7d96867acb00 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -659,9 +659,8 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
{
SwTextNode const*const pTextNode(
aRegion.End()->nNode.GetNode().GetTextNode());
- assert(pTextNode);
- SwTextField const*const pField(pTextNode->GetFieldTextAttrAt(
- aRegion.End()->nContent.GetIndex() - 1, true));
+ SwTextField const*const pField = pTextNode ? pTextNode->GetFieldTextAttrAt(
+ aRegion.End()->nContent.GetIndex() - 1, true) : nullptr;
if (pField)
{
SwPostItField const*const pPostIt(
@@ -1126,4 +1125,31 @@ void UpdatePageDescs(SwDoc &rDoc, size_t nInPageDescOffset)
rDoc.ChgPageDesc(i, rDoc.GetPageDesc(i));
}
+FrameDeleteWatch::FrameDeleteWatch(SwFrameFormat* pFormat)
+ : m_pFormat(pFormat)
+{
+ if(m_pFormat)
+ StartListening(pFormat->GetNotifier());
+}
+
+void FrameDeleteWatch::Notify(const SfxHint& rHint)
+{
+ bool bDying = false;
+ if (rHint.GetId() == SfxHintId::Dying)
+ bDying = true;
+ else if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint))
+ bDying = pDrawFrameFormatHint->m_eId == sw::DrawFrameFormatHintId::DYING;
+ if (bDying)
+ {
+ m_pFormat = nullptr;
+ EndListeningAll();
+ }
+}
+
+FrameDeleteWatch::~FrameDeleteWatch()
+{
+ m_pFormat = nullptr;
+ EndListeningAll();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 62b0071e13c3..26abd886e42f 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -93,6 +93,7 @@
#include <o3tl/typed_flags_set.hxx>
#include <rtl/strbuf.hxx>
+#include <rtl/xmlencode.hxx>
using namespace css;
using editeng::SvxBorderLine;
@@ -1099,7 +1100,7 @@ void SwHTMLWriter::PrepareFontList( const SvxFontItem& rFontItem,
while( nStrPos != -1 )
{
OUString aName = rName.getToken( 0, ';', nStrPos );
- aName = comphelper::string::strip(aName, ' ');
+ aName = rtl::encodeForXml(comphelper::string::strip(aName, ' '));
if( aName.isEmpty() )
continue;
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 2f153fdd3b79..e93499799a74 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -23,6 +23,7 @@
#include <svtools/htmlkywd.hxx>
#include <svtools/htmlout.hxx>
#include <svtools/htmltokn.h>
+#include <rtl/xmlencode.hxx>
#include <osl/diagnose.h>
#include <fmtfld.hxx>
#include <doc.hxx>
@@ -513,7 +514,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const SfxPoolItem& rHt )
OString sOut =
"<" OOO_STRING_SVTOOLS_HTML_comment
" " +
- OUStringToOString(sComment, static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc) +
+ OUStringToOString(rtl::encodeForXml(sComment), static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc) +
" -->";
rWrt.Strm().WriteOString( sOut );
}
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 488edb6dce06..a390ffc0368e 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -284,7 +284,7 @@ void SwHTMLParser::RegisterFlyFrame( SwFrameFormat *pFlyFormat )
(RndStdIds::FLY_AT_PARA == pFlyFormat->GetAnchor().GetAnchorId()) &&
css::text::WrapTextMode_THROUGH == pFlyFormat->GetSurround().GetSurround() )
{
- m_aMoveFlyFrames.push_back( pFlyFormat );
+ m_aMoveFlyFrames.emplace_back(std::make_unique<SwHTMLFrameFormatListener>(pFlyFormat));
m_aMoveFlyCnts.push_back( m_pPam->GetPoint()->nContent.GetIndex() );
}
}
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index ce22cfcd274e..4cbc2bea141d 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1087,7 +1087,12 @@ void SwHTMLParser::InsertFloatingFrame()
bool bHasBorder = aFrameDesc.HasFrameBorder();
Size aMargin = aFrameDesc.GetMargin();
- xSet->setPropertyValue("FrameURL", uno::makeAny( aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) );
+ OUString sHRef = aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE );
+
+ if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro)
+ NotifyMacroEventRead();
+
+ xSet->setPropertyValue("FrameURL", uno::makeAny( sHRef ) );
xSet->setPropertyValue("FrameName", uno::makeAny( aName ) );
if ( eScroll == ScrollingMode::Auto )
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 0d659d7dfd65..670ed3ae7aeb 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -34,6 +34,7 @@
#include <svtools/htmlkywd.hxx>
#include <svl/urihelper.hxx>
#include <svl/listener.hxx>
+#include <svx/sdrobjectuser.hxx>
#include <sal/log.hxx>
#include <dcontact.hxx>
@@ -372,7 +373,7 @@ typedef std::vector<HTMLTableColumn> HTMLTableColumns;
typedef std::vector<SdrObject *> SdrObjects;
-class HTMLTable
+class HTMLTable : public sdr::ObjectUser
{
OUString m_aId;
OUString m_aStyle;
@@ -520,6 +521,8 @@ private:
sal_uInt16 GetBorderWidth( const SvxBorderLine& rBLine,
bool bWithDistance=false ) const;
+ virtual void ObjectInDestruction(const SdrObject& rObject) override;
+
public:
bool m_bFirstCell; // is there a cell created already?
@@ -529,7 +532,7 @@ public:
bool bHasToFly,
const HTMLTableOptions& rOptions);
- ~HTMLTable();
+ virtual ~HTMLTable();
// Identifying of a cell
const HTMLTableCell& GetCell(sal_uInt16 nRow, sal_uInt16 nCell) const;
@@ -1065,11 +1068,33 @@ bool SwHTMLParser::IsReqIF() const
return m_bReqIF;
}
+// if any m_pResizeDrawObjects members are deleted during parse, remove them
+// from m_pResizeDrawObjects and m_pDrawObjectPrcWidths
+void HTMLTable::ObjectInDestruction(const SdrObject& rObject)
+{
+ auto it = std::find(m_pResizeDrawObjects->begin(), m_pResizeDrawObjects->end(), &rObject);
+ assert(it != m_pResizeDrawObjects->end());
+ auto nIndex = std::distance(m_pResizeDrawObjects->begin(), it);
+ m_pResizeDrawObjects->erase(it);
+ auto otherit = m_pDrawObjectPrcWidths->begin() + nIndex * 3;
+ m_pDrawObjectPrcWidths->erase(otherit, otherit + 3);
+}
+
HTMLTable::~HTMLTable()
{
m_pParser->DeregisterHTMLTable(this);
- m_pResizeDrawObjects.reset();
+ if (m_pResizeDrawObjects)
+ {
+ size_t nCount = m_pResizeDrawObjects->size();
+ for (size_t i = 0; i < nCount; ++i)
+ {
+ SdrObject *pObj = (*m_pResizeDrawObjects)[i];
+ pObj->RemoveObjectUser(*this);
+ }
+ m_pResizeDrawObjects.reset();
+ }
+
m_pDrawObjectPrcWidths.reset();
m_pContext.reset();
@@ -2483,6 +2508,7 @@ void HTMLTable::RegisterDrawObject( SdrObject *pObj, sal_uInt8 nPrcWidth )
if( !m_pResizeDrawObjects )
m_pResizeDrawObjects.reset(new SdrObjects);
m_pResizeDrawObjects->push_back( pObj );
+ pObj->AddObjectUser(*this);
if( !m_pDrawObjectPrcWidths )
m_pDrawObjectPrcWidths.reset(new std::vector<sal_uInt16>);
@@ -4860,41 +4886,6 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions,
namespace
{
- class FrameDeleteWatch final: public SvtListener
- {
- SwFrameFormat* m_pFormat;
- public:
- FrameDeleteWatch(SwFrameFormat* pFormat)
- : m_pFormat(pFormat)
- {
- if(m_pFormat)
- StartListening(pFormat->GetNotifier());
- }
-
- virtual void Notify(const SfxHint& rHint) override
- {
- if (auto pDrawFrameFormatHint = dynamic_cast<const sw::DrawFrameFormatHint*>(&rHint))
- {
- if (pDrawFrameFormatHint->m_eId == sw::DrawFrameFormatHintId::DYING)
- {
- m_pFormat = nullptr;
- EndListeningAll();
- }
- }
- }
-
- bool WasDeleted() const
- {
- return !m_pFormat;
- }
-
- virtual ~FrameDeleteWatch() override
- {
- m_pFormat = nullptr;
- EndListeningAll();
- }
- };
-
class IndexInRange
{
private:
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index aaa6c2e7dd35..3f72a8a044e3 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2679,6 +2679,18 @@ SwViewShell *SwHTMLParser::CheckActionViewShell()
return m_pActionViewShell;
}
+SwHTMLFrameFormatListener::SwHTMLFrameFormatListener(SwFrameFormat* pFrameFormat)
+ : m_pFrameFormat(pFrameFormat)
+{
+ StartListening(m_pFrameFormat->GetNotifier());
+}
+
+void SwHTMLFrameFormatListener::Notify(const SfxHint& rHint)
+{
+ if (rHint.GetId() == SfxHintId::Dying)
+ m_pFrameFormat = nullptr;
+}
+
void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
std::deque<std::unique_ptr<HTMLAttr>> *pPostIts )
{
@@ -2938,7 +2950,14 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
for( auto n = m_aMoveFlyFrames.size(); n; )
{
- SwFrameFormat *pFrameFormat = m_aMoveFlyFrames[ --n ];
+ SwFrameFormat *pFrameFormat = m_aMoveFlyFrames[--n]->GetFrameFormat();
+ if (!pFrameFormat)
+ {
+ SAL_WARN("sw.html", "SwFrameFormat deleted during import");
+ m_aMoveFlyFrames.erase( m_aMoveFlyFrames.begin() + n );
+ m_aMoveFlyCnts.erase( m_aMoveFlyCnts.begin() + n );
+ continue;
+ }
const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor();
OSL_ENSURE( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId(),
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 64872e684a92..e0537d5e7880 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -330,6 +330,15 @@ namespace o3tl
template<> struct typed_flags<HtmlFrameFormatFlags> : is_typed_flags<HtmlFrameFormatFlags, 0x0f> {};
}
+class SwHTMLFrameFormatListener : public SvtListener
+{
+ SwFrameFormat* m_pFrameFormat;
+public:
+ SwHTMLFrameFormatListener(SwFrameFormat* pFrameFormat);
+ SwFrameFormat* GetFrameFormat() { return m_pFrameFormat; }
+ virtual void Notify(const SfxHint&) override;
+};
+
class SwHTMLParser : public SfxHTMLParser, public SvtListener
{
friend class SectionSaveStruct;
@@ -365,7 +374,7 @@ class SwHTMLParser : public SfxHTMLParser, public SvtListener
HTMLAttrs m_aParaAttrs; // temporary paragraph attributes
std::shared_ptr<HTMLAttrTable> m_xAttrTab; // "open" attributes
HTMLAttrContexts m_aContexts;// the current context of attribute/token
- std::vector<SwFrameFormat *> m_aMoveFlyFrames;// Fly-Frames, the anchor is moved
+ std::vector<std::unique_ptr<SwHTMLFrameFormatListener>> m_aMoveFlyFrames;// Fly-Frames, the anchor is moved
std::deque<sal_Int32> m_aMoveFlyCnts;// and the Content-Positions
//stray SwTableBoxes which need to be deleted to avoid leaking, but hold
//onto them until parsing is done
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 2f8450556d39..1e6bf6c8a735 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -330,6 +330,28 @@ public:
}
};
+// detect if the SwFrameFormat it is watching was deleted
+class SW_DLLPUBLIC FrameDeleteWatch final: public SvtListener
+{
+ SwFrameFormat* m_pFormat;
+public:
+ FrameDeleteWatch(SwFrameFormat* pFormat);
+
+ virtual void Notify(const SfxHint& rHint) override;
+
+ SwFrameFormat* GetFormat()
+ {
+ return m_pFormat;
+ }
+
+ bool WasDeleted() const
+ {
+ return !m_pFormat;
+ }
+
+ virtual ~FrameDeleteWatch() override;
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 3d8daa633daa..da23f8ba3a7c 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -155,7 +155,7 @@ public:
virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) = 0;
/// Start of the paragraph.
- virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ) = 0;
+ virtual sal_Int32 StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, bool bGenerateParaId ) = 0;
/// End of the paragraph.
virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index c2776d461c89..76a8ab0187bd 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -89,6 +89,7 @@
#include <editeng/charhiddenitem.hxx>
#include <editeng/editobj.hxx>
#include <editeng/keepitem.hxx>
+#include <sax/tools/converter.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xflgrit.hxx>
#include <svx/fmglob.hxx>
@@ -290,6 +291,15 @@ class FieldMarkParamsHelper
return bResult;
}
};
+
+// [ISO/IEC29500-1:2016] 17.18.50 ST_LongHexNumber (Eight Digit Hexadecimal Value)
+static OUString NumberToHexBinary(sal_Int32 n)
+{
+ OUStringBuffer aBuf;
+ sax::Converter::convertNumberToHexBinary(aBuf, n);
+ return aBuf.makeStringAndClear();
+}
+
void DocxAttributeOutput::RTLAndCJKState( bool bIsRTL, sal_uInt16 /*nScript*/ )
{
if (bIsRTL)
@@ -302,6 +312,28 @@ static bool lcl_isOnelinerSdt(const OUString& rName)
return rName == "Title" || rName == "Subtitle" || rName == "Company";
}
+static void AddToAttrList(rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nAttrs, ...)
+{
+ if (!pAttrList.is())
+ pAttrList = FastSerializerHelper::createAttrList();
+
+ va_list args;
+ va_start(args, nAttrs);
+ for (sal_Int32 i = 0; i < nAttrs; i++)
+ {
+ sal_Int32 nName = va_arg(args, sal_Int32);
+ const char* pValue = va_arg(args, const char*);
+ if (pValue)
+ pAttrList->add(nName, pValue);
+ }
+ va_end(args);
+}
+
+static void AddToAttrList(rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nAttrName, const char* sAttrValue)
+{
+ AddToAttrList(pAttrList, 1, nAttrName, sAttrValue);
+}
+
// write a floating table directly to docx without the surrounding frame
void DocxAttributeOutput::WriteFloatingTable(ww8::Frame const* pParentFrame)
{
@@ -379,7 +411,8 @@ static void checkAndWriteFloatingTables(DocxAttributeOutput& rDocxAttributeOutpu
}
}
-void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo )
+sal_Int32 DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
+ bool bGenerateParaId)
{
// look ahead for floating tables that were put into a frame during import
// floating tables in shapes are not supported: exclude this case
@@ -439,7 +472,7 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
// would normally arrive, it would be too late (would be after the
// paragraph start has been written).
bool bEndParaSdt = false;
- if (m_bStartedParaSdt)
+ if (m_aParagraphSdt.m_bStartedSdt)
{
SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode();
if (pTextNode && pTextNode->GetpSwAttrSet())
@@ -449,17 +482,16 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
{
const SfxGrabBagItem& rParaGrabBag = static_cast<const SfxGrabBagItem&>(*pItem);
const std::map<OUString, css::uno::Any>& rMap = rParaGrabBag.GetGrabBag();
- bEndParaSdt = m_bStartedParaSdt && rMap.find("ParaSdtEndBefore") != rMap.end();
+ bEndParaSdt = m_aParagraphSdt.m_bStartedSdt && rMap.find("ParaSdtEndBefore") != rMap.end();
}
}
}
// TODO also avoid multiline paragraphs in those SDT types for shape text
- bool bOneliner = m_bStartedParaSdt && !m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen() && lcl_isOnelinerSdt(m_aStartedParagraphSdtPrAlias);
- if (bEndParaSdt || (m_bStartedParaSdt && m_bHadSectPr) || bOneliner)
+ bool bOneliner = m_aParagraphSdt.m_bStartedSdt && !m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen() && lcl_isOnelinerSdt(m_aStartedParagraphSdtPrAlias);
+ if (bEndParaSdt || (m_aParagraphSdt.m_bStartedSdt && m_bHadSectPr) || bOneliner)
{
// This is the common case: "close sdt before the current paragraph" was requested by the next paragraph.
- EndSdtBlock();
- m_bStartedParaSdt = false;
+ m_aParagraphSdt.EndSdtBlock(m_pSerializer);
m_aStartedParagraphSdtPrAlias.clear();
}
m_bHadSectPr = false;
@@ -468,7 +500,16 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
// We will only know if we have to do that later.
m_pSerializer->mark(Tag_StartParagraph_1);
- m_pSerializer->startElementNS(XML_w, XML_p);
+ const char* pParaId = nullptr;
+ OString aParaId;
+ sal_Int32 nParaId = 0;
+ if (bGenerateParaId)
+ {
+ nParaId = m_nNextParaId++;
+ aParaId = OUStringToOString(NumberToHexBinary(nParaId), RTL_TEXTENCODING_UTF8);
+ pParaId = aParaId.getStr();
+ }
+ m_pSerializer->startElementNS(XML_w, XML_p, FSNS(XML_w14, XML_paraId), pParaId);
// postpone the output of the run (we get it before the paragraph
// properties, but must write it after them)
@@ -479,6 +520,8 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
m_bParagraphOpened = true;
m_bIsFirstParagraph = false;
+
+ return nParaId;
}
static OString convertToOOXMLVertOrient(sal_Int16 nOrient)
@@ -552,14 +595,270 @@ static OString convertToOOXMLHoriOrientRel(sal_Int16 nOrientRel)
}
}
-static void lcl_deleteAndResetTheLists( rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren, rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs, OUString& rSdtPrAlias)
+void SdtBlockHelper::DeleteAndResetTheLists()
{
- if( pSdtPrTokenChildren.is() )
- pSdtPrTokenChildren.clear();
- if( pSdtPrDataBindingAttrs.is() )
- pSdtPrDataBindingAttrs.clear();
- if (!rSdtPrAlias.isEmpty())
- rSdtPrAlias.clear();
+ if (m_pTokenChildren.is() )
+ m_pTokenChildren.clear();
+ if (m_pDataBindingAttrs.is() )
+ m_pDataBindingAttrs.clear();
+ if (m_pTextAttrs.is())
+ m_pTextAttrs.clear();
+ if (!m_aAlias.isEmpty())
+ m_aAlias.clear();
+ if (!m_aPlaceHolderDocPart.isEmpty())
+ m_aPlaceHolderDocPart.clear();
+ if (!m_aColor.isEmpty())
+ m_aColor.clear();
+ m_bHasId = false;
+}
+
+void SdtBlockHelper::WriteSdtBlock(::sax_fastparser::FSHelperPtr& pSerializer, bool bRunTextIsOn, bool bParagraphHasDrawing)
+{
+ if (m_nSdtPrToken <= 0 && !m_pDataBindingAttrs.is() && !m_bHasId)
+ return;
+
+ // sdt start mark
+ pSerializer->mark(Tag_WriteSdtBlock);
+
+ pSerializer->startElementNS(XML_w, XML_sdt);
+
+ // output sdt properties
+ pSerializer->startElementNS(XML_w, XML_sdtPr);
+
+ if (m_nSdtPrToken > 0 && m_pTokenChildren.is())
+ {
+ if (!m_pTokenAttributes.is())
+ pSerializer->startElement(m_nSdtPrToken);
+ else
+ {
+ XFastAttributeListRef xAttrList( m_pTokenAttributes.get() );
+ m_pTokenAttributes.clear();
+ pSerializer->startElement(m_nSdtPrToken, xAttrList);
+ }
+
+ if (m_nSdtPrToken == FSNS(XML_w, XML_date) || m_nSdtPrToken == FSNS(XML_w, XML_docPartObj) || m_nSdtPrToken == FSNS(XML_w, XML_docPartList) || m_nSdtPrToken == FSNS(XML_w14, XML_checkbox)) {
+ const uno::Sequence<xml::FastAttribute> aChildren = m_pTokenChildren->getFastAttributes();
+ for (const auto& rChild : aChildren)
+ pSerializer->singleElement(rChild.Token, FSNS(XML_w, XML_val), rChild.Value.toUtf8() );
+ }
+
+ pSerializer->endElement(m_nSdtPrToken);
+ }
+ else if ((m_nSdtPrToken > 0) && m_nSdtPrToken != FSNS(XML_w, XML_id) && !(bRunTextIsOn && bParagraphHasDrawing))
+ {
+ if (!m_pTokenAttributes.is())
+ pSerializer->singleElement(m_nSdtPrToken);
+ else
+ {
+ XFastAttributeListRef xAttrList( m_pTokenAttributes.get() );
+ m_pTokenAttributes.clear();
+ pSerializer->singleElement(m_nSdtPrToken, xAttrList);
+ }
+ }
+
+ WriteExtraParams(pSerializer);
+
+ pSerializer->endElementNS(XML_w, XML_sdtPr);
+
+ // sdt contents start tag
+ pSerializer->startElementNS(XML_w, XML_sdtContent);
+
+ // prepend the tags since the sdt start mark before the paragraph
+ pSerializer->mergeTopMarks(Tag_WriteSdtBlock, sax_fastparser::MergeMarks::PREPEND);
+
+ // write the ending tags after the paragraph
+ m_bStartedSdt = true;
+
+ // clear sdt status
+ m_nSdtPrToken = 0;
+ m_pTokenChildren.clear();
+ m_pDataBindingAttrs.clear();
+ m_pTextAttrs.clear();
+ m_aAlias.clear();
+ m_bHasId = false;
+}
+
+void SdtBlockHelper::WriteExtraParams(::sax_fastparser::FSHelperPtr& pSerializer)
+{
+ if (m_nSdtPrToken == FSNS(XML_w, XML_id) || m_bHasId)
+ //Word won't open a document with an empty id tag, we fill it with a random number
+ pSerializer->singleElementNS(XML_w, XML_id, FSNS(XML_w, XML_val),
+ OString::number(comphelper::rng::uniform_int_distribution(0, std::numeric_limits<int>::max())));
+
+ if (m_pDataBindingAttrs.is())
+ {
+ XFastAttributeListRef xAttrList( m_pDataBindingAttrs.get() );
+ m_pDataBindingAttrs.clear();
+ pSerializer->singleElementNS(XML_w, XML_dataBinding, xAttrList);
+ }
+
+ if (m_pTextAttrs.is())
+ {
+ XFastAttributeListRef xAttrList( m_pTextAttrs.get() );
+ m_pTextAttrs.clear();
+ pSerializer->singleElementNS(XML_w, XML_text, xAttrList);
+ }
+
+ if (!m_aPlaceHolderDocPart.isEmpty())
+ {
+ pSerializer->startElementNS(XML_w, XML_placeholder);
+ pSerializer->singleElementNS(XML_w, XML_docPart, FSNS(XML_w, XML_val), m_aPlaceHolderDocPart.toUtf8() );
+ pSerializer->endElementNS(XML_w, XML_placeholder);
+ }
+ if (!m_aColor.isEmpty())
+ {
+ pSerializer->singleElementNS(XML_w15, XML_color, FSNS(XML_w, XML_val), m_aColor.toUtf8() );
+ }
+
+ if (!m_aAlias.isEmpty())
+ pSerializer->singleElementNS(XML_w, XML_alias, FSNS(XML_w, XML_val), m_aAlias.toUtf8() );
+}
+
+void SdtBlockHelper::EndSdtBlock(::sax_fastparser::FSHelperPtr& pSerializer)
+{
+ pSerializer->endElementNS(XML_w, XML_sdtContent);
+ pSerializer->endElementNS(XML_w, XML_sdt);
+ m_bStartedSdt = false;
+}
+
+void SdtBlockHelper::GetSdtParamsFromGrabBag(const uno::Sequence<beans::PropertyValue>& aGrabBagSdt)
+{
+ for (const beans::PropertyValue& aPropertyValue : aGrabBagSdt)
+ {
+ if (aPropertyValue.Name == "ooxml:CT_SdtPr_checkbox")
+ {
+ m_nSdtPrToken = FSNS(XML_w14, XML_checkbox);
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ aPropertyValue.Value >>= aGrabBag;
+ for (const auto& rProp : std::as_const(aGrabBag))
+ {
+ OUString sValue = rProp.Value.get<OUString>();
+ if (rProp.Name == "ooxml:CT_SdtCheckbox_checked")
+ AddToAttrList(m_pTokenChildren,
+ FSNS(XML_w14, XML_checked),
+ OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
+ else if (rProp.Name == "ooxml:CT_SdtCheckbox_checkedState")
+ AddToAttrList(m_pTokenChildren,
+ FSNS(XML_w14, XML_checkedState),
+ OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
+ else if (rProp.Name == "ooxml:CT_SdtCheckbox_uncheckedState")
+ AddToAttrList(m_pTokenChildren,
+ FSNS(XML_w14, XML_uncheckedState),
+ OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ }
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_dataBinding" && !m_pDataBindingAttrs.is())
+ {
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ aPropertyValue.Value >>= aGrabBag;
+ for (const auto& rProp : std::as_const(aGrabBag))
+ {
+ OUString sValue = rProp.Value.get<OUString>();
+ if (rProp.Name == "ooxml:CT_DataBinding_prefixMappings")
+ AddToAttrList( m_pDataBindingAttrs,
+ FSNS( XML_w, XML_prefixMappings ),
+ OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
+ else if (rProp.Name == "ooxml:CT_DataBinding_xpath")
+ AddToAttrList( m_pDataBindingAttrs,
+ FSNS( XML_w, XML_xpath ),
+ OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
+ else if (rProp.Name == "ooxml:CT_DataBinding_storeItemID")
+ AddToAttrList( m_pDataBindingAttrs,
+ FSNS( XML_w, XML_storeItemID ),
+ OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_text")
+ {
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ aPropertyValue.Value >>= aGrabBag;
+ if (aGrabBag.hasElements())
+ {
+ for (const auto& rProp : std::as_const(aGrabBag))
+ {
+ OUString sValue = rProp.Value.get<OUString>();
+ if (rProp.Name == "ooxml:CT_SdtText_multiLine")
+ AddToAttrList(m_pTextAttrs,
+ FSNS(XML_w, XML_multiLine),
+ OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ }
+ else
+ {
+ // We still have w:text, but no attrs
+ m_nSdtPrToken = FSNS(XML_w, XML_text);
+ }
+ }
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPlaceholder_docPart")
+ {
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ aPropertyValue.Value >>= aGrabBag;
+ for (const auto& rProp : std::as_const(aGrabBag))
+ {
+ OUString sValue = rProp.Value.get<OUString>();
+ if (rProp.Name == "ooxml:CT_SdtPlaceholder_docPart_val")
+ m_aPlaceHolderDocPart = sValue;
+ }
+ }
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_color")
+ {
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ aPropertyValue.Value >>= aGrabBag;
+ for (const auto& rProp : std::as_const(aGrabBag))
+ {
+ OUString sValue = rProp.Value.get<OUString>();
+ if (rProp.Name == "ooxml:CT_SdtColor_val")
+ m_aColor = sValue;
+ }
+ }
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_alias" && m_aAlias.isEmpty())
+ {
+ if (!(aPropertyValue.Value >>= m_aAlias))
+ SAL_WARN("sw.ww8", "DocxAttributeOutput::GrabBag: unexpected sdt alias value");
+ }
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_id")
+ m_bHasId = true;
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_citation")
+ m_nSdtPrToken = FSNS(XML_w, XML_citation);
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_docPartObj" ||
+ aPropertyValue.Name == "ooxml:CT_SdtPr_docPartList")
+ {
+ if (aPropertyValue.Name == "ooxml:CT_SdtPr_docPartObj")
+ m_nSdtPrToken = FSNS(XML_w, XML_docPartObj);
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_docPartList")
+ m_nSdtPrToken = FSNS(XML_w, XML_docPartList);
+
+ uno::Sequence<beans::PropertyValue> aGrabBag;
+ aPropertyValue.Value >>= aGrabBag;
+ for (const auto& rProp : std::as_const(aGrabBag))
+ {
+ OUString sValue = rProp.Value.get<OUString>();
+ if (rProp.Name == "ooxml:CT_SdtDocPart_docPartGallery")
+ AddToAttrList(m_pTokenChildren,
+ FSNS(XML_w, XML_docPartGallery),
+ OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
+ else if (rProp.Name == "ooxml:CT_SdtDocPart_docPartCategory")
+ AddToAttrList(m_pTokenChildren,
+ FSNS(XML_w, XML_docPartCategory),
+ OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
+ else if (rProp.Name == "ooxml:CT_SdtDocPart_docPartUnique")
+ {
+ if (sValue.isEmpty())
+ sValue = "true";
+ AddToAttrList(m_pTokenChildren, FSNS(XML_w, XML_docPartUnique),
+ OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ }
+ }
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_equation")
+ m_nSdtPrToken = FSNS(XML_w, XML_equation);
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_picture")
+ m_nSdtPrToken = FSNS(XML_w, XML_picture);
+ else if (aPropertyValue.Name == "ooxml:CT_SdtPr_group")
+ m_nSdtPrToken = FSNS(XML_w, XML_group);
+ else
+ SAL_WARN("sw.ww8", "GetSdtParamsFromGrabBag unhandled SdtPr grab bag property " << aPropertyValue.Name);
+ }
}
void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFormat, const Size& rSize)
@@ -637,7 +936,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
++m_nTextFrameLevel;
if( m_nTextFrameLevel == 1 && !m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen() )
{
- comphelper::FlagRestorationGuard aStartedParaSdtGuard(m_bStartedParaSdt, false);
+ comphelper::FlagRestorationGuard aStartedParaSdtGuard(m_aParagraphSdt.m_bStartedSdt, false);
assert(!m_pPostponedCustomShape);
m_pPostponedCustomShape.reset(new std::vector<PostponedDrawing>);
@@ -649,11 +948,10 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
if (!TextBoxIsFramePr(rFrameFormat) || m_bWritingHeaderFooter)
{
- if (m_bStartedCharSdt)
+ if (m_aRunSdt.m_bStartedSdt)
{
// Run-level SDT still open? Close it before AlternateContent.
- EndSdtBlock();
- m_bStartedCharSdt = false;
+ m_aRunSdt.EndSdtBlock(m_pSerializer);
}
m_pSerializer->startElementNS(XML_w, XML_r);
m_pSerializer->startElementNS(XML_mc, XML_AlternateContent);
@@ -739,11 +1037,10 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
m_nHyperLinkCount = 0;
}
- if (m_bStartedCharSdt)
+ if (m_aRunSdt.m_bStartedSdt)
{
// Run-level SDT still open? Close it now.
- EndSdtBlock();
- m_bStartedCharSdt = false;
+ m_aRunSdt.EndSdtBlock(m_pSerializer);
}
if (m_bPageBreakAfter)
@@ -755,15 +1052,25 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
m_pSerializer->endElementNS( XML_w, XML_p );
// on export sdt blocks are never nested ATM
- if( !m_bAnchorLinkedToNode && !m_bStartedParaSdt )
- WriteSdtBlock( m_nParagraphSdtPrToken, m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrTokenAttributes, m_pParagraphSdtPrDataBindingAttrs, m_aParagraphSdtPrAlias, /*bPara=*/true );
+ if (!m_bAnchorLinkedToNode && !m_aParagraphSdt.m_bStartedSdt)
+ {
+ m_aParagraphSdt.WriteSdtBlock(m_pSerializer, m_bRunTextIsOn, m_rExport.SdrExporter().IsParagraphHasDrawing());
+
+ if (m_aParagraphSdt.m_bStartedSdt)
+ {
+ if (m_tableReference->m_bTableCellOpen)
+ m_tableReference->m_bTableCellParaSdtOpen = true;
+ if (m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen())
+ m_rExport.SdrExporter().setParagraphSdtOpen(true);
+ }
+ }
else
{
//These should be written out to the actual Node and not to the anchor.
//Clear them as they will be repopulated when the node is processed.
- m_nParagraphSdtPrToken = 0;
- m_bParagraphSdtHasId = false;
- lcl_deleteAndResetTheLists( m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs, m_aParagraphSdtPrAlias );
+ m_aParagraphSdt.m_nSdtPrToken = 0;
+ m_aParagraphSdt.m_bHasId = false;
+ m_aParagraphSdt.DeleteAndResetTheLists();
}
//sdtcontent is written so Set m_bParagraphHasDrawing to false
@@ -791,107 +1098,6 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
m_aBookmarksOfParagraphEnd.clear();
}
-void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken,
- rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren,
- rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrTokenAttributes,
- rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs,
- OUString& rSdtPrAlias,
- bool bPara )
-{
- if( nSdtPrToken <= 0 && !pSdtPrDataBindingAttrs.is() )
- return;
-
- // sdt start mark
- m_pSerializer->mark(Tag_WriteSdtBlock);
-
- m_pSerializer->startElementNS(XML_w, XML_sdt);
-
- // output sdt properties
- m_pSerializer->startElementNS(XML_w, XML_sdtPr);
-
- if( nSdtPrToken > 0 && pSdtPrTokenChildren.is() )
- {
- if (!pSdtPrTokenAttributes.is())
- m_pSerializer->startElement(nSdtPrToken);
- else
- {
- XFastAttributeListRef xAttrList(pSdtPrTokenAttributes.get());
- pSdtPrTokenAttributes.clear();
- m_pSerializer->startElement(nSdtPrToken, xAttrList);
- }
-
- if (nSdtPrToken == FSNS( XML_w, XML_date ) || nSdtPrToken == FSNS( XML_w, XML_docPartObj ) || nSdtPrToken == FSNS( XML_w, XML_docPartList ) || nSdtPrToken == FSNS( XML_w14, XML_checkbox )) {
- const uno::Sequence<xml::FastAttribute> aChildren = pSdtPrTokenChildren->getFastAttributes();
- for( const auto& rChild : aChildren )
- m_pSerializer->singleElement( rChild.Token,
- FSNS(XML_w, XML_val), rChild.Value.toUtf8() );
- }
-
- m_pSerializer->endElement( nSdtPrToken );
- }
- else if( (nSdtPrToken > 0) && nSdtPrToken != FSNS( XML_w, XML_id ) && !(m_bRunTextIsOn && m_rExport.SdrExporter().IsParagraphHasDrawing()))
- {
- if (!pSdtPrTokenAttributes.is())
- m_pSerializer->singleElement(nSdtPrToken);
- else
- {
- XFastAttributeListRef xAttrList(pSdtPrTokenAttributes.get());
- pSdtPrTokenAttributes.clear();
- m_pSerializer->singleElement(nSdtPrToken, xAttrList);
- }
- }
-
- if( nSdtPrToken == FSNS( XML_w, XML_id ) || ( bPara && m_bParagraphSdtHasId ) )
- //Word won't open a document with an empty id tag, we fill it with a random number
- m_pSerializer->singleElementNS(XML_w, XML_id, FSNS(XML_w, XML_val),
- OString::number(comphelper::rng::uniform_int_distribution(0, std::numeric_limits<int>::max())));
-
- if( pSdtPrDataBindingAttrs.is() && !m_rExport.SdrExporter().IsParagraphHasDrawing())
- {
- XFastAttributeListRef xAttrList( pSdtPrDataBindingAttrs.get() );
- pSdtPrDataBindingAttrs.clear();
- m_pSerializer->singleElementNS(XML_w, XML_dataBinding, xAttrList);
- }
-
- if (!rSdtPrAlias.isEmpty())
- m_pSerializer->singleElementNS(XML_w, XML_alias, FSNS(XML_w, XML_val),
- rSdtPrAlias.toUtf8());
-
- m_pSerializer->endElementNS( XML_w, XML_sdtPr );
-
- // sdt contents start tag
- m_pSerializer->startElementNS(XML_w, XML_sdtContent);
-
- // prepend the tags since the sdt start mark before the paragraph
- m_pSerializer->mergeTopMarks(Tag_WriteSdtBlock, sax_fastparser::MergeMarks::PREPEND);
-
- // write the ending tags after the paragraph
- if (bPara)
- {
- m_bStartedParaSdt = true;
- if (m_tableReference->m_bTableCellOpen)
- m_tableReference->m_bTableCellParaSdtOpen = true;
- if (m_rExport.SdrExporter().IsDMLAndVMLDrawingOpen())
- m_rExport.SdrExporter().setParagraphSdtOpen(true);
- }
- else
- // Support multiple runs inside a run-level SDT: don't close the SDT block yet.
- m_bStartedCharSdt = true;
-
- // clear sdt status
- nSdtPrToken = 0;
- pSdtPrTokenChildren.clear();
- pSdtPrDataBindingAttrs.clear();
- rSdtPrAlias.clear();
-
-}
-
-void DocxAttributeOutput::EndSdtBlock()
-{
- m_pSerializer->endElementNS( XML_w, XML_sdtContent );
- m_pSerializer->endElementNS( XML_w, XML_sdt );
-}
-
#define MAX_CELL_IN_WORD 62
void DocxAttributeOutput::SyncNodelessCells(ww8::WW8TableNodeInfoInner::Pointer_t const & pInner, sal_Int32 nCell, sal_uInt32 nRow)
@@ -1327,7 +1533,10 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool /
for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin() + nFieldsInPrevHyperlink; pIt != m_Fields.end(); )
{
// Add the fields starts for all but hyperlinks and TOCs
- if (pIt->bOpen && pIt->pField && pIt->eType != ww::eFORMDROPDOWN)
+ if (pIt->bOpen && pIt->pField && pIt->eType != ww::eFORMDROPDOWN &&
+ // it is not an input field with extra grabbag params (sdt field)
+ (!(pIt->eType == ww::eFILLIN && static_cast<const SwInputField*>(pIt->pField.get())->getGrabBagParams().hasElements()))
+ )
{
StartField_Impl( pNode, nPos, *pIt );
@@ -1361,12 +1570,11 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool /
// if another sdt starts in this run, then wait
// as closing the sdt now, might cause nesting of sdts
- if (m_nRunSdtPrToken > 0)
+ if (m_aRunSdt.m_nSdtPrToken > 0)
bCloseEarlierSDT = true;
else
- EndSdtBlock();
+ m_aRunSdt.EndSdtBlock(m_pSerializer);
m_bEndCharSdt = false;
- m_bStartedCharSdt = false;
}
if ( m_closeHyperlinkInPreviousRun )
@@ -1392,7 +1600,9 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool /
for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin(); pIt != m_Fields.end(); )
{
// Add the fields starts for hyperlinks, TOCs and index marks
- if (pIt->bOpen && (!pIt->pField || pIt->eType == ww::eFORMDROPDOWN))
+ if (pIt->bOpen && (!pIt->pField || pIt->eType == ww::eFORMDROPDOWN ||
+ // InputField with extra grabbag params - it is sdt field
+ (pIt->eType == ww::eFILLIN && static_cast<const SwInputField*>(pIt->pField.get())->getGrabBagParams().hasElements())))
{
StartRedline( m_pRedlineData );
StartField_Impl( pNode, nPos, *pIt, true );
@@ -1524,23 +1734,22 @@ void DocxAttributeOutput::EndRun(const SwTextNode* pNode, sal_Int32 nPos, bool /
// enclose in a sdt block, if necessary: if one is already started, then don't do it for now
// (so on export sdt blocks are never nested ATM)
- if ( !m_bAnchorLinkedToNode && !m_bStartedCharSdt )
+ if ( !m_bAnchorLinkedToNode && !m_aRunSdt.m_bStartedSdt)
{
- rtl::Reference<sax_fastparser::FastAttributeList> pRunSdtPrTokenAttributes;
- WriteSdtBlock( m_nRunSdtPrToken, m_pRunSdtPrTokenChildren, pRunSdtPrTokenAttributes, m_pRunSdtPrDataBindingAttrs, m_aRunSdtPrAlias, /*bPara=*/false );
+ m_aRunSdt.WriteSdtBlock(m_pSerializer, m_bRunTextIsOn, m_rExport.SdrExporter().IsParagraphHasDrawing());
}
else
{
//These should be written out to the actual Node and not to the anchor.
//Clear them as they will be repopulated when the node is processed.
- m_nRunSdtPrToken = 0;
- lcl_deleteAndResetTheLists( m_pRunSdtPrTokenChildren, m_pRunSdtPrDataBindingAttrs, m_aRunSdtPrAlias );
+ m_aRunSdt.m_nSdtPrToken = 0;
+ m_aRunSdt.DeleteAndResetTheLists();
}
if (bCloseEarlierSDT)
{
m_pSerializer->mark(Tag_EndRun_2);
- EndSdtBlock();
+ m_aRunSdt.EndSdtBlock(m_pSerializer);
m_pSerializer->mergeTopMarks(Tag_EndRun_2, sax_fastparser::MergeMarks::PREPEND);
}
@@ -1899,7 +2108,7 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos )
}
}
-void DocxAttributeOutput::WriteFormDateStart(const OUString& sFullDate, const OUString& sDateFormat, const OUString& sLang)
+void DocxAttributeOutput::WriteFormDateStart(const OUString& sFullDate, const OUString& sDateFormat, const OUString& sLang, const uno::Sequence<beans::PropertyValue>& aGrabBagSdt)
{
m_pSerializer->startElementNS(XML_w, XML_sdt);
m_pSerializer->startElementNS(XML_w, XML_sdtPr);
@@ -1920,8 +2129,64 @@ void DocxAttributeOutput::WriteFormDateStart(const OUString& sFullDate, const OU
FSNS(XML_w, XML_val), "dateTime");
m_pSerializer->singleElementNS(XML_w, XML_calendar,
FSNS(XML_w, XML_val), "gregorian");
-
m_pSerializer->endElementNS(XML_w, XML_date);
+
+ if (aGrabBagSdt.hasElements())
+ {
+ // There are some extra sdt parameters came from grab bag
+ SdtBlockHelper aSdtBlock;
+ aSdtBlock.GetSdtParamsFromGrabBag(aGrabBagSdt);
+ aSdtBlock.WriteExtraParams(m_pSerializer);
+ }
+
+ m_pSerializer->endElementNS(XML_w, XML_sdtPr);
+
+ m_pSerializer->startElementNS(XML_w, XML_sdtContent);
+}
+
+void DocxAttributeOutput::WriteSdtPlainText(const OUString & sValue, const uno::Sequence<beans::PropertyValue>& aGrabBagSdt)
+{
+ m_pSerializer->startElementNS(XML_w, XML_sdt);
+ m_pSerializer->startElementNS(XML_w, XML_sdtPr);
+
+ if (aGrabBagSdt.hasElements())
+ {
+ // There are some extra sdt parameters came from grab bag
+ SdtBlockHelper aSdtBlock;
+ aSdtBlock.GetSdtParamsFromGrabBag(aGrabBagSdt);
+ aSdtBlock.WriteExtraParams(m_pSerializer);
+
+ if (aSdtBlock.m_nSdtPrToken && aSdtBlock.m_nSdtPrToken != FSNS(XML_w, XML_id))
+ {
+ // Write <w:text/> or whatsoever from grabbag
+ m_pSerializer->singleElement(aSdtBlock.m_nSdtPrToken);
+ }
+
+ // Store databindings data for later writing to corresponding XMLs
+ OUString sPrefixMapping, sXpath;
+ for (const auto& rProp : std::as_const(aGrabBagSdt))
+ {
+ if (rProp.Name == "ooxml:CT_SdtPr_dataBinding")
+ {
+ uno::Sequence<beans::PropertyValue> aDataBindingProps;
+ rProp.Value >>= aDataBindingProps;
+ for (const auto& rDBProp : std::as_const(aDataBindingProps))
+ {
+ if (rDBProp.Name == "ooxml:CT_DataBinding_prefixMappings")
+ sPrefixMapping = rDBProp.Value.get<OUString>();
+ else if (rDBProp.Name == "ooxml:CT_DataBinding_xpath")
+ sXpath = rDBProp.Value.get<OUString>();
+ }
+ }
+ }
+
+ if (sXpath.getLength())
+ {
+ // Given xpath is sufficient
+ m_rExport.AddSdtData(sPrefixMapping, sXpath, sValue);
+ }
+ }
+
m_pSerializer->endElementNS(XML_w, XML_sdtPr);
m_pSerializer->startElementNS(XML_w, XML_sdtContent);
@@ -1997,6 +2262,7 @@ void DocxAttributeOutput::StartField_Impl( const SwTextNode* pNode, sal_Int32 nP
{
// Expand unsupported fields
RunText( rInfos.pField->GetFieldName() );
+ return;
}
else if ( rInfos.eType == ww::eFORMDATE )
{
@@ -2024,7 +2290,11 @@ void DocxAttributeOutput::StartField_Impl( const SwTextNode* pNode, sal_Int32 nP
OUString sLang;
params.extractParam( ODF_FORMDATE_DATEFORMAT_LANGUAGE, sLang );
- WriteFormDateStart( sFullDate, sDateFormat, sLang );
+ uno::Sequence<beans::PropertyValue> aSdtParams;
+ params.extractParam(UNO_NAME_MISC_OBJ_INTEROPGRABBAG, aSdtParams);
+
+ WriteFormDateStart( sFullDate, sDateFormat, sLang, aSdtParams);
+ return;
}
else if (rInfos.eType == ww::eFORMDROPDOWN && rInfos.pField)
{
@@ -2033,8 +2303,20 @@ void DocxAttributeOutput::StartField_Impl( const SwTextNode* pNode, sal_Int32 nP
WriteSdtDropDownStart(rField2.GetName(),
rField2.GetSelectedItem(),
rField2.GetItemSequence());
+ return;
}
- else if ( rInfos.eType != ww::eNONE ) // HYPERLINK fields are just commands
+ else if (rInfos.eType == ww::eFILLIN)
+ {
+ SwInputField const& rField(*static_cast<SwInputField const*>(rInfos.pField.get()));
+ if (rField.getGrabBagParams().hasElements())
+ {
+ WriteSdtPlainText(rField.GetPar1(), rField.getGrabBagParams());
+ m_sRawText = rField.GetPar1(); // Write field content also as a fallback
+ return;
+ }
+ }
+
+ if ( rInfos.eType != ww::eNONE ) // HYPERLINK fields are just commands
{
if ( bWriteRun )
m_pSerializer->startElementNS(XML_w, XML_r);
@@ -2248,7 +2530,7 @@ void DocxAttributeOutput::EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos
WriteSdtEnd();
return;
}
- if (rInfos.eType == ww::eFORMDROPDOWN && rInfos.pField)
+ else if (rInfos.eType == ww::eFORMDROPDOWN && rInfos.pField)
{
// write selected item from End not Start to ensure that any bookmarks
// precede it
@@ -2256,7 +2538,15 @@ void DocxAttributeOutput::EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos
WriteSdtDropDownEnd(rField.GetSelectedItem(), rField.GetItemSequence());
return;
}
-
+ else if (rInfos.eType == ww::eFILLIN && rInfos.pField)
+ {
+ SwInputField const& rField(*static_cast<SwInputField const*>(rInfos.pField.get()));
+ if (rField.getGrabBagParams().hasElements())
+ {
+ WriteSdtEnd();
+ return;
+ }
+ }
// The command has to be written before for the hyperlinks
if ( rInfos.pField )
{
@@ -2714,7 +3004,7 @@ void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj)
auto pProp = std::find_if(aGrabBag.begin(), aGrabBag.end(),
[this](const beans::PropertyValue& rProp) {
- return "SdtEndBefore" == rProp.Name && m_bStartedCharSdt && !m_bEndCharSdt; });
+ return "SdtEndBefore" == rProp.Name && m_aRunSdt.m_bStartedSdt && !m_bEndCharSdt; });
if (pProp != aGrabBag.end())
pProp->Value >>= m_bEndCharSdt;
}
@@ -5794,7 +6084,7 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
sal_Int32 nCurrentPos = 0;
sal_Int32 nEnd = aStr.getLength();
- StartParagraph(ww8::WW8TableNodeInfo::Pointer_t());
+ StartParagraph(ww8::WW8TableNodeInfo::Pointer_t(), false);
// Write paragraph properties.
StartParagraphProperties();
@@ -5851,8 +6141,8 @@ void DocxAttributeOutput::pushToTableExportContext(DocxTableExportContext& rCont
rContext.m_nTableDepth = m_tableReference->m_nTableDepth;
m_tableReference->m_nTableDepth = 0;
- rContext.m_bStartedParaSdt = m_bStartedParaSdt;
- m_bStartedParaSdt = false;
+ rContext.m_bStartedParaSdt = m_aParagraphSdt.m_bStartedSdt;
+ m_aParagraphSdt.m_bStartedSdt = false;
}
void DocxAttributeOutput::popFromTableExportContext(DocxTableExportContext const & rContext)
@@ -5860,7 +6150,7 @@ void DocxAttributeOutput::popFromTableExportContext(DocxTableExportContext const
m_rExport.m_pTableInfo = rContext.m_pTableInfo;
m_tableReference->m_bTableCellOpen = rContext.m_bTableCellOpen;
m_tableReference->m_nTableDepth = rContext.m_nTableDepth;
- m_bStartedParaSdt = rContext.m_bStartedParaSdt;
+ m_aParagraphSdt.m_bStartedSdt = rContext.m_bStartedParaSdt;
}
void DocxAttributeOutput::WriteTextBox(uno::Reference<drawing::XShape> xShape)
@@ -6191,11 +6481,10 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, bool bBreakAfter, const WW
void DocxAttributeOutput::EndParaSdtBlock()
{
- if (m_bStartedParaSdt)
+ if (m_aParagraphSdt.m_bStartedSdt)
{
// Paragraph-level SDT still open? Close it now.
- EndSdtBlock();
- m_bStartedParaSdt = false;
+ m_aParagraphSdt.EndSdtBlock(m_pSerializer);
}
}
@@ -7515,14 +7804,14 @@ void DocxAttributeOutput::PostitField( const SwField* pField )
else
// Otherwise get a new one.
nId = m_nNextAnnotationMarkId++;
- m_postitFields.emplace_back(pPostItField, nId);
+ m_postitFields.emplace_back(pPostItField, PostItDOCXData{ nId });
}
void DocxAttributeOutput::WritePostitFieldReference()
{
while( m_postitFieldsMaxId < m_postitFields.size())
{
- OString idstr = OString::number(m_postitFields[m_postitFieldsMaxId].second);
+ OString idstr = OString::number(m_postitFields[m_postitFieldsMaxId].second.id);
// In case this file is inside annotation marks, we want to write the
// comment reference after the annotation mark is closed, not here.
@@ -7534,27 +7823,39 @@ void DocxAttributeOutput::WritePostitFieldReference()
}
}
-void DocxAttributeOutput::WritePostitFields()
+DocxAttributeOutput::hasResolved DocxAttributeOutput::WritePostitFields()
{
- for (const auto& rPair : m_postitFields)
+ hasResolved eResult = hasResolved::no;
+ for (auto& [f, data] : m_postitFields)
{
- OString idstr = OString::number( rPair.second);
- const SwPostItField* f = rPair.first;
+ OString idstr = OString::number(data.id);
m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr,
FSNS( XML_w, XML_author ), f->GetPar1().toUtf8(),
FSNS( XML_w, XML_date ), DateTimeToOString(f->GetDateTime()),
FSNS( XML_w, XML_initials ), f->GetInitials().toUtf8() );
+ const bool bNeedParaId = f->GetResolved();
+ if (bNeedParaId)
+ eResult = hasResolved::yes;
+
if (f->GetTextObject() != nullptr)
{
// richtext
- GetExport().WriteOutliner(*f->GetTextObject(), TXT_ATN);
+ data.lastParaId = GetExport().WriteOutliner(*f->GetTextObject(), TXT_ATN, bNeedParaId);
}
else
{
// just plain text - eg. when the field was created via the
// .uno:InsertAnnotation API
- m_pSerializer->startElementNS(XML_w, XML_p);
+ const char* pParaId = nullptr;
+ OString aParaId;
+ if (bNeedParaId)
+ {
+ data.lastParaId = m_nNextParaId++;
+ aParaId = OUStringToOString(NumberToHexBinary(data.lastParaId), RTL_TEXTENCODING_UTF8);
+ pParaId = aParaId.getStr();
+ }
+ m_pSerializer->startElementNS(XML_w, XML_p, FSNS(XML_w14, XML_paraId), pParaId);
m_pSerializer->startElementNS(XML_w, XML_r);
RunText(f->GetText());
m_pSerializer->endElementNS(XML_w, XML_r);
@@ -7563,6 +7864,19 @@ void DocxAttributeOutput::WritePostitFields()
m_pSerializer->endElementNS( XML_w, XML_comment );
}
+ return eResult;
+}
+
+void DocxAttributeOutput::WritePostItFieldsResolved()
+{
+ for (auto& [f, data] : m_postitFields)
+ {
+ if (!f->GetResolved())
+ continue;
+ OString idstr = OUStringToOString(NumberToHexBinary(data.lastParaId), RTL_TEXTENCODING_UTF8);
+ m_pSerializer->singleElementNS(XML_w15, XML_commentEx, FSNS(XML_w15, XML_paraId), idstr,
+ FSNS(XML_w15, XML_done), "1");
+ }
}
bool DocxAttributeOutput::DropdownField( const SwField* pField )
@@ -9090,102 +9404,8 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
{
const uno::Sequence<beans::PropertyValue> aGrabBagSdt =
rGrabBagElement.second.get< uno::Sequence<beans::PropertyValue> >();
- for (const beans::PropertyValue& aPropertyValue : aGrabBagSdt)
- {
- if (aPropertyValue.Name == "ooxml:CT_SdtPr_docPartObj" ||
- aPropertyValue.Name == "ooxml:CT_SdtPr_docPartList")
- {
- if (aPropertyValue.Name == "ooxml:CT_SdtPr_docPartObj")
- m_nParagraphSdtPrToken = FSNS( XML_w, XML_docPartObj );
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_docPartList")
- m_nParagraphSdtPrToken = FSNS( XML_w, XML_docPartList );
-
- uno::Sequence<beans::PropertyValue> aGrabBag;
- aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : std::as_const(aGrabBag))
- {
- OUString sValue = rProp.Value.get<OUString>();
- if (rProp.Name == "ooxml:CT_SdtDocPart_docPartGallery")
- AddToAttrList( m_pParagraphSdtPrTokenChildren,
- FSNS( XML_w, XML_docPartGallery ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_SdtDocPart_docPartCategory")
- AddToAttrList( m_pParagraphSdtPrTokenChildren,
- FSNS( XML_w, XML_docPartCategory ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_SdtDocPart_docPartUnique")
- {
- if (sValue.isEmpty())
- sValue = "true";
- AddToAttrList( m_pParagraphSdtPrTokenChildren, FSNS( XML_w, XML_docPartUnique ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- }
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_equation")
- m_nParagraphSdtPrToken = FSNS( XML_w, XML_equation );
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_picture")
- m_nParagraphSdtPrToken = FSNS( XML_w, XML_picture );
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_citation")
- m_nParagraphSdtPrToken = FSNS( XML_w, XML_citation );
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_group")
- m_nParagraphSdtPrToken = FSNS( XML_w, XML_group );
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_text")
- m_nParagraphSdtPrToken = FSNS(XML_w, XML_text);
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_dataBinding" && !m_pParagraphSdtPrDataBindingAttrs.is())
- {
- uno::Sequence<beans::PropertyValue> aGrabBag;
- aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : std::as_const(aGrabBag))
- {
- OUString sValue = rProp.Value.get<OUString>();
- if (rProp.Name == "ooxml:CT_DataBinding_prefixMappings")
- AddToAttrList( m_pParagraphSdtPrDataBindingAttrs,
- FSNS( XML_w, XML_prefixMappings ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_DataBinding_xpath")
- AddToAttrList( m_pParagraphSdtPrDataBindingAttrs,
- FSNS( XML_w, XML_xpath ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_DataBinding_storeItemID")
- AddToAttrList( m_pParagraphSdtPrDataBindingAttrs,
- FSNS( XML_w, XML_storeItemID ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_alias" && m_aParagraphSdtPrAlias.isEmpty())
- {
- if (!(aPropertyValue.Value >>= m_aParagraphSdtPrAlias))
- SAL_WARN("sw.ww8", "DocxAttributeOutput::ParaGrabBag: unexpected sdt alias value");
- m_aStartedParagraphSdtPrAlias = m_aParagraphSdtPrAlias;
- }
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_checkbox")
- {
- m_nParagraphSdtPrToken = FSNS( XML_w14, XML_checkbox );
- uno::Sequence<beans::PropertyValue> aGrabBag;
- aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : std::as_const(aGrabBag))
- {
- OUString sValue = rProp.Value.get<OUString>();
- if (rProp.Name == "ooxml:CT_SdtCheckbox_checked")
- AddToAttrList( m_pParagraphSdtPrTokenChildren,
- FSNS( XML_w14, XML_checked ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_SdtCheckbox_checkedState")
- AddToAttrList( m_pParagraphSdtPrTokenChildren,
- FSNS( XML_w14, XML_checkedState ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_SdtCheckbox_uncheckedState")
- AddToAttrList( m_pParagraphSdtPrTokenChildren,
- FSNS( XML_w14, XML_uncheckedState ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_id")
- m_bParagraphSdtHasId = true;
- else
- SAL_WARN("sw.ww8", "DocxAttributeOutput::ParaGrabBag: unhandled SdtPr grab bag property " << aPropertyValue.Name);
- }
+ m_aParagraphSdt.GetSdtParamsFromGrabBag(aGrabBagSdt);
+ m_aStartedParagraphSdtPrAlias = m_aParagraphSdt.m_aAlias;
}
else if (rGrabBagElement.first == "ParaCnfStyle")
{
@@ -9316,72 +9536,14 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
}
else if (rGrabBagElement.first == "SdtEndBefore")
{
- if (m_bStartedCharSdt)
+ if (m_aRunSdt.m_bStartedSdt)
m_bEndCharSdt = true;
}
else if (rGrabBagElement.first == "SdtPr" && FLY_NOT_PROCESSED != m_nStateOfFlyFrame )
{
const uno::Sequence<beans::PropertyValue> aGrabBagSdt =
rGrabBagElement.second.get< uno::Sequence<beans::PropertyValue> >();
- for (const beans::PropertyValue& aPropertyValue : aGrabBagSdt)
- {
- if (aPropertyValue.Name == "ooxml:CT_SdtPr_checkbox")
- {
- m_nRunSdtPrToken = FSNS( XML_w14, XML_checkbox );
- uno::Sequence<beans::PropertyValue> aGrabBag;
- aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : std::as_const(aGrabBag))
- {
- OUString sValue = rProp.Value.get<OUString>();
- if (rProp.Name == "ooxml:CT_SdtCheckbox_checked")
- AddToAttrList( m_pRunSdtPrTokenChildren,
- FSNS( XML_w14, XML_checked ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_SdtCheckbox_checkedState")
- AddToAttrList( m_pRunSdtPrTokenChildren,
- FSNS( XML_w14, XML_checkedState ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_SdtCheckbox_uncheckedState")
- AddToAttrList( m_pRunSdtPrTokenChildren,
- FSNS( XML_w14, XML_uncheckedState ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_dataBinding" && !m_pRunSdtPrDataBindingAttrs.is())
- {
- uno::Sequence<beans::PropertyValue> aGrabBag;
- aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : std::as_const(aGrabBag))
- {
- OUString sValue = rProp.Value.get<OUString>();
- if (rProp.Name == "ooxml:CT_DataBinding_prefixMappings")
- AddToAttrList( m_pRunSdtPrDataBindingAttrs,
- FSNS( XML_w, XML_prefixMappings ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_DataBinding_xpath")
- AddToAttrList( m_pRunSdtPrDataBindingAttrs,
- FSNS( XML_w, XML_xpath ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- else if (rProp.Name == "ooxml:CT_DataBinding_storeItemID")
- AddToAttrList( m_pRunSdtPrDataBindingAttrs,
- FSNS( XML_w, XML_storeItemID ),
- OUStringToOString( sValue, RTL_TEXTENCODING_UTF8 ).getStr() );
- }
- }
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_alias" && m_aRunSdtPrAlias.isEmpty())
- {
- if (!(aPropertyValue.Value >>= m_aRunSdtPrAlias))
- SAL_WARN("sw.ww8", "DocxAttributeOutput::CharGrabBag: unexpected sdt alias value");
- }
- //do not overwrite the parent node.
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_text" && !m_pRunSdtPrTokenChildren.is())
- m_nRunSdtPrToken = FSNS( XML_w, XML_text );
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_id" && m_nRunSdtPrToken == 0)
- // only write id token as a marker if no other exist
- m_nRunSdtPrToken = FSNS( XML_w, XML_id );
- else if (aPropertyValue.Name == "ooxml:CT_SdtPr_citation")
- m_nRunSdtPrToken = FSNS( XML_w, XML_citation );
- }
+ m_aRunSdt.GetSdtParamsFromGrabBag(aGrabBagSdt);
}
else
SAL_INFO("sw.ww8", "DocxAttributeOutput::CharGrabBag: unhandled grab bag property " << rGrabBagElement.first);
@@ -9394,8 +9556,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, const FSHelperPtr
m_pSerializer( pSerializer ),
m_rDrawingML( *pDrawingML ),
m_bEndCharSdt(false),
- m_bStartedCharSdt(false),
- m_bStartedParaSdt(false),
m_endPageRef( false ),
m_pFootnotesList( new ::docx::FootnotesList() ),
m_pEndnotesList( new ::docx::FootnotesList() ),
@@ -9441,10 +9601,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, const FSHelperPtr
m_nParaBeforeSpacing(0),
m_nParaAfterSpacing(0),
m_setFootnote(false)
- , m_nParagraphSdtPrToken(0)
- , m_nRunSdtPrToken(0)
, m_nStateOfFlyFrame( FLY_NOT_PROCESSED )
- , m_bParagraphSdtHasId(false)
{
// Push initial items to the RelId cache. In case the document contains no
// special streams (headers, footers, etc.) then these items are used
@@ -9507,26 +9664,4 @@ void DocxAttributeOutput::BulletDefinition(int nId, const Graphic& rGraphic, Siz
m_pSerializer->endElementNS(XML_w, XML_numPicBullet);
}
-void DocxAttributeOutput::AddToAttrList( rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nAttrName, const sal_Char* sAttrValue )
-{
- AddToAttrList( pAttrList, 1, nAttrName, sAttrValue );
-}
-
-void DocxAttributeOutput::AddToAttrList( rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nAttrs, ... )
-{
- if( !pAttrList.is() )
- pAttrList = FastSerializerHelper::createAttrList();
-
- va_list args;
- va_start( args, nAttrs );
- for( sal_Int32 i = 0; i<nAttrs; i++)
- {
- sal_Int32 nName = va_arg( args, sal_Int32 );
- const char* pValue = va_arg( args, const char* );
- if( pValue )
- pAttrList->add( nName, pValue );
- }
- va_end( args );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 6655b180bb2b..0f8c1bc689b6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -119,6 +119,37 @@ struct TableReference
}
};
+class SdtBlockHelper
+{
+public:
+ SdtBlockHelper()
+ : m_bHasId(false)
+ , m_bStartedSdt(false)
+ , m_nSdtPrToken(0)
+ {}
+
+ bool m_bHasId;
+ bool m_bStartedSdt;
+ rtl::Reference<sax_fastparser::FastAttributeList> m_pTokenChildren;
+ rtl::Reference<sax_fastparser::FastAttributeList> m_pTokenAttributes;
+ rtl::Reference<sax_fastparser::FastAttributeList> m_pTextAttrs;
+ rtl::Reference<sax_fastparser::FastAttributeList> m_pDataBindingAttrs;
+ OUString m_aColor;
+ OUString m_aPlaceHolderDocPart;
+ OUString m_aAlias;
+ sal_Int32 m_nSdtPrToken;
+
+ void DeleteAndResetTheLists();
+
+ void WriteSdtBlock(::sax_fastparser::FSHelperPtr& pSerializer, bool bRunTextIsOn, bool bParagraphHasDrawing);
+ void WriteExtraParams(::sax_fastparser::FSHelperPtr& pSerializer);
+
+ /// Closes a currently open SDT block.
+ void EndSdtBlock(::sax_fastparser::FSHelperPtr& pSerializer);
+
+ void GetSdtParamsFromGrabBag(const uno::Sequence<beans::PropertyValue>& aGrabBagSdt);
+};
+
/// The class that has handlers for various resource types when exporting as DOCX.
class DocxAttributeOutput : public AttributeOutputBase, public oox::vml::VMLTextExport, public oox::drawingml::DMLTextExport
{
@@ -127,7 +158,8 @@ public:
virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) override;
/// Start of the paragraph.
- virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ) override;
+ virtual sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
+ bool bGenerateParaId) override;
/// End of the paragraph.
virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) override;
@@ -709,16 +741,8 @@ private:
void WritePostponedDMLDrawing();
void WritePostponedCustomShape();
- void WriteSdtBlock(sal_Int32& nSdtPrToken,
- rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren,
- rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrTokenAttributes,
- rtl::Reference<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs,
- OUString& rSdtPrAlias,
- bool bPara);
- /// Closes a currently open SDT block.
- void EndSdtBlock();
-
- void WriteFormDateStart(const OUString& sFullDate, const OUString& sDateFormat, const OUString& sLang);
+ void WriteFormDateStart(const OUString& sFullDate, const OUString& sDateFormat, const OUString& sLang, const uno::Sequence<beans::PropertyValue>& aGrabBagSdt);
+ void WriteSdtPlainText(const OUString& sValue, const uno::Sequence<beans::PropertyValue>& aGrabBagSdt);
void WriteSdtDropDownStart(OUString const& rName, OUString const& rSelected, uno::Sequence<OUString> const& rListItems);
void WriteSdtDropDownEnd(OUString const& rSelected, uno::Sequence<OUString> const& rListItems);
void WriteSdtEnd();
@@ -730,9 +754,6 @@ private:
void EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos, FieldInfos& rInfos );
void DoWriteFieldRunProperties( const SwTextNode* pNode, sal_Int32 nPos, bool bWriteCombChars = false );
- static void AddToAttrList( rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nAttrName, const sal_Char* sAttrValue );
- static void AddToAttrList( rtl::Reference<sax_fastparser::FastAttributeList>& pAttrList, sal_Int32 nArgs, ... );
-
rtl::Reference<sax_fastparser::FastAttributeList> m_pFontsAttrList;
rtl::Reference<sax_fastparser::FastAttributeList> m_pEastAsianLayoutAttrList;
rtl::Reference<sax_fastparser::FastAttributeList> m_pCharLangAttrList;
@@ -741,10 +762,6 @@ private:
rtl::Reference<sax_fastparser::FastAttributeList> m_pHyperlinkAttrList;
/// If the current SDT around runs should be ended before the current run.
bool m_bEndCharSdt;
- /// If an SDT around runs is currently open.
- bool m_bStartedCharSdt;
- /// If an SDT around paragraphs is currently open.
- bool m_bStartedParaSdt;
/// Attributes of the run color
rtl::Reference<sax_fastparser::FastAttributeList> m_pColorAttrList;
sal_uInt8 m_nCharTransparence = 0;
@@ -787,6 +804,9 @@ private:
sal_Int32 m_nNextBookmarkId;
sal_Int32 m_nNextAnnotationMarkId;
+ /// [MS-DOCX] section 2.6.2.3
+ sal_Int32 m_nNextParaId = 1; // MUST be greater than 0
+
OUString m_sRawText;
/// Bookmarks to output
@@ -915,8 +935,13 @@ private:
std::vector<const SdrObject*> m_aPostponedFormControls;
std::vector<PostponedDrawing> m_aPostponedActiveXControls;
const SwField* pendingPlaceholder;
+
+ struct PostItDOCXData{
+ sal_Int32 id;
+ sal_Int32 lastParaId = 0; // [MS-DOCX] 2.5.3.1 CT_CommentEx needs paraId attribute
+ };
/// Maps postit fields to ID's, used in commentRangeStart/End, commentReference and comment.xml.
- std::vector< std::pair<const SwPostItField*, sal_Int32> > m_postitFields;
+ std::vector<std::pair<const SwPostItField*, PostItDOCXData>> m_postitFields;
/// Number of postit fields which already have a commentReference written.
unsigned int m_postitFieldsMaxId;
int m_anchorId;
@@ -960,24 +985,14 @@ private:
/// RelId <-> BitmapChecksum cache, similar to m_aRelIdCache, but used for non-Writer graphics, handled in oox.
std::stack< std::map<BitmapChecksum, OUString> > m_aSdrRelIdCache;
- /// members to control the existence of grabbagged SDT properties in the paragraph
- sal_Int32 m_nParagraphSdtPrToken;
- rtl::Reference<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenChildren;
- rtl::Reference<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenAttributes;
- rtl::Reference<sax_fastparser::FastAttributeList> m_pParagraphSdtPrDataBindingAttrs;
- /// members to control the existence of grabbagged SDT properties in the text run
- sal_Int32 m_nRunSdtPrToken;
+ SdtBlockHelper m_aParagraphSdt;
+ SdtBlockHelper m_aRunSdt;
+
/// State of the Fly at current position
FlyProcessingState m_nStateOfFlyFrame;
- rtl::Reference<sax_fastparser::FastAttributeList> m_pRunSdtPrTokenChildren;
- rtl::Reference<sax_fastparser::FastAttributeList> m_pRunSdtPrDataBindingAttrs;
- /// Value of the <w:alias> paragraph SDT element.
- OUString m_aParagraphSdtPrAlias;
+
/// Same as m_aParagraphSdtPrAlias, but its content is available till the SDT is closed.
OUString m_aStartedParagraphSdtPrAlias;
- OUString m_aRunSdtPrAlias;
- /// Currently paragraph SDT has a <w:id> child element.
- bool m_bParagraphSdtHasId;
std::vector<std::map<SvxBoxItemLine, css::table::BorderLine2>> m_aTableStyleConfs;
@@ -1009,7 +1024,9 @@ public:
static void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr const & fs, int tag, const SwEndNoteInfo& info, int listtag );
bool HasPostitFields() const;
- void WritePostitFields();
+ enum class hasResolved { no, yes };
+ hasResolved WritePostitFields();
+ void WritePostItFieldsResolved();
/// VMLTextExport
virtual void WriteOutliner(const OutlinerParaObject& rParaObj) override;
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 74745f68f604..8c06db88a762 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -34,7 +34,12 @@
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/io/XStreamListener.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/xml/xslt/XSLTTransformer.hpp>
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
@@ -50,6 +55,8 @@
#include <map>
#include <algorithm>
+#include <condition_variable>
+#include <mutex>
#include <IMark.hxx>
#include <IDocumentSettingAccess.hxx>
@@ -86,6 +93,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/storagehelper.hxx>
+#include <o3tl/any.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <vcl/font.hxx>
@@ -736,9 +744,29 @@ void DocxExport::WritePostitFields()
pPostitFS->startElementNS( XML_w, XML_comments, MainXmlNamespaces());
m_pAttrOutput->SetSerializer( pPostitFS );
- m_pAttrOutput->WritePostitFields();
+ const auto eHasResolved = m_pAttrOutput->WritePostitFields();
m_pAttrOutput->SetSerializer( m_pDocumentFS );
pPostitFS->endElementNS( XML_w, XML_comments );
+
+ if (eHasResolved != DocxAttributeOutput::hasResolved::yes)
+ return;
+
+ m_pFilter->addRelation(m_pDocumentFS->getOutputStream(),
+ oox::getRelationship(Relationship::COMMENTSEXTENDED),
+ "commentsExtended.xml");
+
+ pPostitFS = m_pFilter->openFragmentStreamWithSerializer(
+ "word/commentsExtended.xml",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml");
+
+ pPostitFS->startElementNS(XML_w15, XML_commentsEx, // Add namespaces manually now
+ FSNS(XML_xmlns, XML_mc), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(mce)), RTL_TEXTENCODING_UTF8),
+ FSNS(XML_xmlns, XML_w15), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(w15)), RTL_TEXTENCODING_UTF8),
+ FSNS(XML_mc, XML_Ignorable), "w15");
+ m_pAttrOutput->SetSerializer(pPostitFS);
+ m_pAttrOutput->WritePostItFieldsResolved();
+ m_pAttrOutput->SetSerializer(m_pDocumentFS);
+ pPostitFS->endElementNS(XML_w15, XML_commentsEx);
}
}
@@ -1214,8 +1242,7 @@ void DocxExport::WriteSettings()
}
else if (rProp.Name == "HyphenationZone")
{
- sal_Int16 nHyphenationZone;
- rProp.Value >>= nHyphenationZone;
+ sal_Int16 nHyphenationZone = *o3tl::doAccess<sal_Int16>(rProp.Value);
if (nHyphenationZone > 0)
pFS->singleElementNS(XML_w, XML_hyphenationZone, FSNS(XML_w, XML_val),
OString::number(nHyphenationZone));
@@ -1355,6 +1382,77 @@ void DocxExport::WriteGlossary()
}
}
+namespace {
+ class XsltTransformListener : public ::cppu::WeakImplHelper<io::XStreamListener>
+ {
+ public:
+ XsltTransformListener() : m_bDone(false) {}
+
+ void wait() {
+ std::unique_lock<std::mutex> g(m_mutex);
+ m_cond.wait(g, [this]() { return m_bDone; });
+ }
+
+ private:
+ std::mutex m_mutex;
+ std::condition_variable m_cond;
+ bool m_bDone;
+
+ virtual void SAL_CALL disposing(const lang::EventObject&) noexcept override {}
+ virtual void SAL_CALL started() noexcept override {}
+ virtual void SAL_CALL closed() noexcept override { notifyDone(); }
+ virtual void SAL_CALL terminated() noexcept override { notifyDone(); }
+ virtual void SAL_CALL error(const uno::Any& e) override
+ {
+ notifyDone(); // set on error too, otherwise main thread waits forever
+ SAL_WARN("sw.ww8", e);
+ }
+
+ void notifyDone() {
+ std::scoped_lock<std::mutex> g(m_mutex);
+ m_bDone = true;
+ m_cond.notify_all();
+ }
+ };
+}
+
+static void lcl_UpdateXmlValues(const SdtData& sdtData, const uno::Reference<css::io::XInputStream>& xInputStream, const uno::Reference<css::io::XOutputStream>& xOutputStream)
+{
+ uno::Sequence<uno::Any> aArgs{
+ // XSLT transformation stylesheet:
+ // - write all elements as is
+ // - but if element matches sdtData.xpath, replace its text content by sdtData.xpath
+ uno::Any(beans::NamedValue("StylesheetText", uno::Any(OUString("<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
+<xsl:stylesheet\
+ xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\
+ " + sdtData.namespaces + "\
+ version=\"1.0\">\
+ <xsl:template match=\"@* | node()\">\
+ <xsl:copy>\
+ <xsl:apply-templates select=\"@* | node()\"/>\
+ </xsl:copy>\
+ </xsl:template>\
+ <xsl:template match = \"" + sdtData.xpath + "\">\
+ <xsl:copy>\
+ <xsl:text>" + sdtData.data + "</xsl:text>\
+ </xsl:copy>\
+ </xsl:template>\
+</xsl:stylesheet>\
+"))))
+ };
+
+ css::uno::Reference<css::xml::xslt::XXSLTTransformer> xTransformer =
+ css::xml::xslt::XSLTTransformer::create(comphelper::getProcessComponentContext(), aArgs);
+ xTransformer->setInputStream(xInputStream);
+ xTransformer->setOutputStream(xOutputStream);
+
+ rtl::Reference<XsltTransformListener> xListener = new XsltTransformListener();
+ xTransformer->addListener(xListener.get());
+
+ xTransformer->start();
+ xListener->wait();
+}
+
void DocxExport::WriteCustomXml()
{
uno::Reference< beans::XPropertySet > xPropSet( m_pDoc->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
@@ -1390,10 +1488,54 @@ void DocxExport::WriteCustomXml()
uno::Reference< xml::sax::XSAXSerializable > serializer( customXmlDom, uno::UNO_QUERY );
uno::Reference< xml::sax::XWriter > writer = xml::sax::Writer::create( comphelper::getProcessComponentContext() );
- writer->setOutputStream( GetFilter().openFragmentStream( "customXml/item"+OUString::number((j+1))+".xml",
- "application/xml" ) );
- serializer->serialize( uno::Reference< xml::sax::XDocumentHandler >( writer, uno::UNO_QUERY_THROW ),
- uno::Sequence< beans::StringPair >() );
+
+ uno::Reference < css::io::XOutputStream > xOutStream = GetFilter().openFragmentStream("customXml/item" + OUString::number(j + 1) + ".xml",
+ "application/xml");
+ if (m_SdtData.size())
+ {
+ // There are some SDT blocks data with data bindings which can update some custom xml values
+ uno::Reference< io::XStream > xMemStream(
+ comphelper::getProcessComponentContext()->getServiceManager()->createInstanceWithContext("com.sun.star.comp.MemoryStream",
+ comphelper::getProcessComponentContext()),
+ uno::UNO_QUERY_THROW);
+
+ writer->setOutputStream(xMemStream->getOutputStream());
+
+ serializer->serialize(uno::Reference< xml::sax::XDocumentHandler >(writer, uno::UNO_QUERY_THROW),
+ uno::Sequence< beans::StringPair >());
+
+ uno::Reference< io::XStream > xXSLTInStream = xMemStream;
+ uno::Reference< io::XStream > xXSLTOutStream;
+ // Apply XSLT transformations for each SDT data binding
+ // Seems it is not possible to do this as one transformation: each data binding
+ // can have different namespaces, but with conflicting names (ns0, ns1, etc..)
+ for (size_t i = 0; i < m_SdtData.size(); i++)
+ {
+ if (i == m_SdtData.size() - 1)
+ {
+ // last transformation
+ lcl_UpdateXmlValues(m_SdtData[i], xXSLTInStream->getInputStream(), xOutStream);
+ }
+ else
+ {
+ xXSLTOutStream.set(
+ comphelper::getProcessComponentContext()->getServiceManager()->createInstanceWithContext("com.sun.star.comp.MemoryStream",
+ comphelper::getProcessComponentContext()),
+ uno::UNO_QUERY_THROW);
+ lcl_UpdateXmlValues(m_SdtData[i], xXSLTInStream->getInputStream(), xXSLTOutStream->getOutputStream());
+ // Use previous output as an input for next run
+ xXSLTInStream.set( xXSLTOutStream );
+ }
+ }
+
+ }
+ else
+ {
+ writer->setOutputStream(xOutStream);
+
+ serializer->serialize(uno::Reference< xml::sax::XDocumentHandler >(writer, uno::UNO_QUERY_THROW),
+ uno::Sequence< beans::StringPair >());
+ }
}
if (customXmlDomProps.is())
@@ -1606,7 +1748,8 @@ XFastAttributeListRef DocxExport::MainXmlNamespaces()
pAttr->add( FSNS( XML_xmlns, XML_mc ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(mce)), RTL_TEXTENCODING_UTF8).getStr() );
pAttr->add( FSNS( XML_xmlns, XML_wp14 ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(wp14)), RTL_TEXTENCODING_UTF8).getStr() );
pAttr->add( FSNS( XML_xmlns, XML_w14 ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(w14)), RTL_TEXTENCODING_UTF8).getStr() );
- pAttr->add( FSNS( XML_mc, XML_Ignorable ), "w14 wp14" );
+ pAttr->add( FSNS( XML_xmlns, XML_w15 ), OUStringToOString(m_pFilter->getNamespaceURL(OOX_NS(w15)), RTL_TEXTENCODING_UTF8).getStr() );
+ pAttr->add( FSNS( XML_mc, XML_Ignorable ), "w14 wp14 w15" );
return XFastAttributeListRef( pAttr );
}
@@ -1619,18 +1762,21 @@ bool DocxExport::ignoreAttributeForStyleDefaults( sal_uInt16 nWhich ) const
return MSWordExportBase::ignoreAttributeForStyleDefaults( nWhich );
}
-void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTyp)
+sal_Int32 DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTyp,
+ bool bNeedsLastParaId)
{
const EditTextObject& rEditObj = rParaObj.GetTextObject();
MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp );
sal_Int32 nPara = rEditObj.GetParagraphCount();
+ sal_Int32 nParaId = 0;
for( sal_Int32 n = 0; n < nPara; ++n )
{
if( n )
aAttrIter.NextPara( n );
- AttrOutput().StartParagraph( ww8::WW8TableNodeInfo::Pointer_t());
+ nParaId = AttrOutput().StartParagraph(ww8::WW8TableNodeInfo::Pointer_t(),
+ bNeedsLastParaId && n == nPara - 1);
rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet();
OUString aStr( rEditObj.GetText( n ));
sal_Int32 nCurrentPos = 0;
@@ -1665,6 +1811,7 @@ void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTy
// aAttrIter.OutParaAttr(false);
AttrOutput().EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t());
}
+ return nParaId;
}
void DocxExport::SetFS( ::sax_fastparser::FSHelperPtr const & pFS )
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index f659cd1244f4..570050a7bca0 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -61,6 +61,14 @@ struct DocxSettingsData
bool trackRevisions; // Should 'Track Revisions' be set
};
+/// Data to keep and write to XMLs
+struct SdtData
+{
+ OUString namespaces;
+ OUString xpath;
+ OUString data;
+};
+
/// The class that does all the actual DOCX export-related work.
class DocxExport : public MSWordExportBase
{
@@ -114,6 +122,9 @@ class DocxExport : public MSWordExportBase
/// Pointer to the Frame of a floating table it is nested in
const ww8::Frame *m_pFloatingTableFrame = nullptr;
+ /// Storage for sdt data which need to be written to other XMLs
+ std::vector<SdtData> m_SdtData;
+
public:
DocxExportFilter& GetFilter() { return *m_pFilter; };
@@ -191,10 +202,15 @@ public:
/// Writes the shape using drawingML syntax.
void OutputDML( css::uno::Reference< css::drawing::XShape > const & xShape );
- void WriteOutliner(const OutlinerParaObject& rOutliner, sal_uInt8 nTyp);
+ sal_Int32 WriteOutliner(const OutlinerParaObject& rOutliner, sal_uInt8 nTyp, bool bNeedsLastParaId);
virtual ExportFormat GetExportFormat() const override { return ExportFormat::DOCX; }
+ void AddSdtData(const OUString & namespaces, const OUString & xpath, const OUString & data)
+ {
+ m_SdtData.push_back({ namespaces, xpath, data });
+ }
+
protected:
/// Format-dependent part of the actual export.
virtual ErrCode ExportDocument_Impl() override;
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 53fffd032a17..b8a2fdcaf680 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -209,7 +209,8 @@ void RtfAttributeOutput::RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript)
m_bControlLtrRtl = true;
}
-void RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo)
+sal_Int32 RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
+ bool /*bGenerateParaId*/)
{
if (m_bIsBeforeFirstParagraph && m_rExport.m_nTextTyp != TXT_HDFT)
m_bIsBeforeFirstParagraph = false;
@@ -265,6 +266,7 @@ void RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNo
}
OSL_ENSURE(m_aRun.getLength() == 0, "m_aRun is not empty");
+ return 0;
}
void RtfAttributeOutput::EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner)
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 791fdf8d2678..879ec751266c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -48,7 +48,8 @@ public:
void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript) override;
/// Start of the paragraph.
- void StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo) override;
+ sal_Int32 StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo,
+ bool bGenerateParaId) override;
/// End of the paragraph.
void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 2d31a2f52aed..f0d40dcb3ecc 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2297,7 +2297,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
if( softBreakList.size() > 1 ) // not for empty paragraph
++aBreakIt;
- AttrOutput().StartParagraph( pTextNodeInfo );
+ AttrOutput().StartParagraph(pTextNodeInfo, false);
const SwSection* pTOXSect = nullptr;
if( m_bInWriteTOX )
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index e8f26c3292b3..7454acd83dee 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -61,6 +61,17 @@ SwNumRule* MSWordExportBase::DuplicateNumRuleImpl(const SwNumRule *pRule)
return pMyNumRule;
}
+sal_uInt16 MSWordExportBase::DuplicateNumRule(const SwNumRule* pRule, sal_uInt8 nLevel, sal_uInt16 nVal)
+{
+ SwNumRule* const pMyNumRule = DuplicateNumRuleImpl(pRule);
+
+ SwNumFormat aNumFormat(pMyNumRule->Get(nLevel));
+ aNumFormat.SetStart(nVal);
+ pMyNumRule->Set(nLevel, aNumFormat);
+
+ return GetNumberingId(*pMyNumRule);
+}
+
// multiple SwList can be based on the same SwNumRule; ensure one w:abstractNum
// per SwList
sal_uInt16 MSWordExportBase::DuplicateAbsNum(OUString const& rListId,
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index e84d84e1c35f..8e808b93289a 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -153,13 +153,13 @@ MSWordStyles::MSWordStyles( MSWordExportBase& rExport, bool bListStyles )
m_rExport.m_pDoc->GetFootnoteInfo().GetAnchorCharFormat( *m_rExport.m_pDoc );
m_rExport.m_pDoc->GetFootnoteInfo().GetCharFormat( *m_rExport.m_pDoc );
}
- sal_uInt16 nAlloc = WW8_RESERVED_SLOTS + m_rExport.m_pDoc->GetCharFormats()->size() - 1 +
+ sal_uInt32 nAlloc = WW8_RESERVED_SLOTS + m_rExport.m_pDoc->GetCharFormats()->size() - 1 +
m_rExport.m_pDoc->GetTextFormatColls()->size() - 1 +
(bListStyles ? m_rExport.m_pDoc->GetNumRuleTable().size() - 1 : 0);
+ nAlloc = std::min<sal_uInt32>(nAlloc, MSWORD_MAX_STYLES_LIMIT);
// somewhat generous ( free for up to 15 )
- m_pFormatA.reset( new SwFormat*[ nAlloc ] );
- memset( m_pFormatA.get(), 0, nAlloc * sizeof( SwFormat* ) );
+ m_aFormatA.resize(nAlloc, nullptr);
memset( m_aHeadingParagraphStyles, -1 , MAXLEVEL * sizeof( sal_uInt16));
BuildStylesTable();
@@ -175,7 +175,7 @@ sal_uInt16 MSWordStyles::GetSlot( const SwFormat* pFormat ) const
{
sal_uInt16 n;
for ( n = 0; n < m_nUsedSlots; n++ )
- if ( m_pFormatA[n] == pFormat )
+ if ( m_aFormatA[n] == pFormat )
return n;
return 0xfff; // 0xfff: WW: zero
}
@@ -284,19 +284,19 @@ void MSWordStyles::BuildStylesTable()
const SwCharFormats& rArr = *m_rExport.m_pDoc->GetCharFormats(); // first CharFormat
// the default character style ( 0 ) will not be outputted !
- for( size_t n = 1; n < rArr.size(); n++ )
+ for( size_t n = 1; n < rArr.size() && m_nUsedSlots < MSWORD_MAX_STYLES_LIMIT; n++ )
{
SwCharFormat* pFormat = rArr[n];
- m_pFormatA[ BuildGetSlot( *pFormat ) ] = pFormat;
+ m_aFormatA[ BuildGetSlot( *pFormat ) ] = pFormat;
}
const SwTextFormatColls& rArr2 = *m_rExport.m_pDoc->GetTextFormatColls(); // then TextFormatColls
// the default character style ( 0 ) will not be outputted !
- for( size_t n = 1; n < rArr2.size(); n++ )
+ for( size_t n = 1; n < rArr2.size() && m_nUsedSlots < MSWORD_MAX_STYLES_LIMIT; n++ )
{
SwTextFormatColl* pFormat = rArr2[n];
sal_uInt16 nId = BuildGetSlot( *pFormat ) ;
- m_pFormatA[ nId ] = pFormat;
+ m_aFormatA[ nId ] = pFormat;
if ( pFormat->IsAssignedToListLevelOfOutlineStyle() )
{
int nLvl = pFormat->GetAssignedOutlineStyleLevel() ;
@@ -309,7 +309,7 @@ void MSWordStyles::BuildStylesTable()
return;
const SwNumRuleTable& rNumRuleTable = m_rExport.m_pDoc->GetNumRuleTable();
- for (size_t i = 0; i < rNumRuleTable.size(); ++i)
+ for (size_t i = 0; i < rNumRuleTable.size() && m_nUsedSlots < MSWORD_MAX_STYLES_LIMIT; ++i)
{
const SwNumRule* pNumRule = rNumRuleTable[i];
if (pNumRule->IsAutoRule() || pNumRule->GetName().startsWith("WWNum"))
@@ -349,8 +349,8 @@ void MSWordStyles::BuildStyleIds()
for (sal_uInt16 n = 1; n < m_nUsedSlots; ++n)
{
OUString aName;
- if(m_pFormatA[n])
- aName = m_pFormatA[n]->GetName();
+ if (m_aFormatA[n])
+ aName = m_aFormatA[n]->GetName();
else if (m_aNumRules.find(n) != m_aNumRules.end())
aName = m_aNumRules[n]->GetName();
@@ -614,8 +614,8 @@ void MSWordStyles::OutputStyle( SwFormat* pFormat, sal_uInt16 nPos )
for ( int nSuffix = 0; ; ++nSuffix ) {
bool clash=false;
for ( sal_uInt16 n = 1; n < m_nUsedSlots; ++n )
- if ( m_pFormatA[n] &&
- m_pFormatA[n]->GetName().equalsIgnoreAsciiCase(aName) )
+ if ( m_aFormatA[n] &&
+ m_aFormatA[n]->GetName().equalsIgnoreAsciiCase(aName) )
{
clash = true;
break;
@@ -704,7 +704,7 @@ void MSWordStyles::OutputStylesTable()
if (m_aNumRules.find(n) != m_aNumRules.end())
OutputStyle(m_aNumRules[n], n);
else
- OutputStyle( m_pFormatA[n], n );
+ OutputStyle(m_aFormatA[n], n);
}
m_rExport.AttrOutput().EndStyles( m_nUsedSlots );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 851e50a4b55b..408baf0694f0 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -657,6 +657,7 @@ public:
/// List is set to restart at a particular value so for export make a
/// completely new list based on this one and export that instead,
/// which duplicates words behaviour in this respect.
+ sal_uInt16 DuplicateNumRule(const SwNumRule* pRule, sal_uInt8 nLevel, sal_uInt16 nVal);
SwNumRule * DuplicateNumRuleImpl(const SwNumRule *pRule);
/// check if a new abstractNum is needed for this list
@@ -1580,7 +1581,7 @@ class MSWordStyles
{
MSWordExportBase& m_rExport;
sal_uInt16 m_aHeadingParagraphStyles[MAXLEVEL];
- std::unique_ptr<SwFormat*[]> m_pFormatA; ///< Slot <-> Character and paragraph style array (0 for list styles).
+ std::vector<SwFormat*> m_aFormatA; ///< Slot <-> Character and paragraph style array (0 for list styles).
sal_uInt16 m_nUsedSlots;
bool const m_bListStyles; ///< If list styles are requested to be exported as well.
std::map<sal_uInt16, const SwNumRule*> m_aNumRules; ///< Slot <-> List style map.
@@ -1631,7 +1632,7 @@ public:
/// Get styleId of the nId-th style (nId is its position in pFormatA).
OString const & GetStyleId(sal_uInt16 nId) const;
- const SwFormat* GetSwFormat(sal_uInt16 nId) const { return m_pFormatA[nId]; }
+ const SwFormat* GetSwFormat(sal_uInt16 nId) const { return m_aFormatA[nId]; }
/// Get numbering rule of the nId-th style
const SwNumRule* GetSwNumRule(sal_uInt16 nId) const;
sal_uInt16 GetHeadingParagraphStyleId(sal_uInt16 nLevel) const { return m_aHeadingParagraphStyles[ nLevel ]; }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index eb5d42253024..3af874cb41fa 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3671,6 +3671,13 @@ void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
}
}
}
+ else if (pTextNd->IsListRestart())
+ {
+ sal_uInt16 nStartWith = static_cast<sal_uInt16>(pTextNd->GetActualListStartValue());
+ nNumId = GetExport().DuplicateNumRule(pRule, nLvl, nStartWith);
+ if (USHRT_MAX != nNumId)
+ ++nNumId;
+ }
}
else
{
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index 7e3f2a31ff20..9e50b953369b 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -32,7 +32,7 @@ public:
virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) override;
/// Start of the paragraph.
- virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/ ) override {}
+ virtual sal_Int32 StartParagraph( ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, bool /*bGenerateParaId*/ ) override { return 0; }
/// End of the paragraph.
virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) override;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 39b75dc8c4a4..eaf31d9f0fc3 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1997,7 +1997,7 @@ void SwWW8ImplReader::ImportDopTypography(const WW8DopTypography &rTypo)
* Footnotes and Endnotes
*/
WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) :
- maTmpPos(*pRdr->m_pPaM->GetPoint()),
+ mxTmpPos(pRdr->m_rDoc.CreateUnoCursor(*pRdr->m_pPaM->GetPoint())),
mxOldStck(std::move(pRdr->m_xCtrlStck)),
mxOldAnchorStck(std::move(pRdr->m_xAnchorStck)),
mxOldRedlines(std::move(pRdr->m_xRedlineStack)),
@@ -2081,12 +2081,21 @@ void WW8ReaderSave::Restore( SwWW8ImplReader* pRdr )
pRdr->m_xRedlineStack->closeall(*pRdr->m_pPaM->GetPoint());
pRdr->m_aFrameRedlines.emplace(std::move(pRdr->m_xRedlineStack));
+
+ // ofz#37322 drop m_pLastAnchorPos during RedlineStack dtor and restore it afterwards to the same
+ // place, or somewhere close if that place got destroyed
+ std::shared_ptr<SwUnoCursor> xLastAnchorCursor(pRdr->m_pLastAnchorPos ? pRdr->m_rDoc.CreateUnoCursor(*pRdr->m_pLastAnchorPos) : nullptr);
+ pRdr->m_pLastAnchorPos.reset();
+
pRdr->m_xRedlineStack = std::move(mxOldRedlines);
+ if (xLastAnchorCursor)
+ pRdr->m_pLastAnchorPos.reset(new SwPosition(*xLastAnchorCursor->GetPoint()));
+
pRdr->DeleteAnchorStack();
pRdr->m_xAnchorStck = std::move(mxOldAnchorStck);
- *pRdr->m_pPaM->GetPoint() = maTmpPos;
+ *pRdr->m_pPaM->GetPoint() = GetStartPos();
if (mxOldPlcxMan != pRdr->m_xPlcxMan)
pRdr->m_xPlcxMan = mxOldPlcxMan;
@@ -2175,7 +2184,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
std::unique_ptr<OutlinerParaObject> pOutliner = ImportAsOutliner( sText, pRes->nCp2OrIdx,
pRes->nCp2OrIdx + pRes->nMemLen, MAN_AND );
- m_pFormatOfJustInsertedApo = nullptr;
+ m_xFormatOfJustInsertedApo.reset();
SwPostItField aPostIt(
static_cast<SwPostItFieldType*>(m_rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::Postit)), sAuthor,
sText, sInitials, OUString(), aDate );
@@ -4265,7 +4274,6 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SotStorage* pStorage,
, m_aParaStyleMapper(rD)
, m_aCharStyleMapper(rD)
, m_pFlyFormatOfJustInsertedGraphic(nullptr)
- , m_pFormatOfJustInsertedApo(nullptr)
, m_pPreviousNumPaM(nullptr)
, m_pPrevNumRule(nullptr)
, m_aTextNodesHavingFirstLineOfstSet()
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 7759951e6805..63196280db89 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -591,7 +591,7 @@ class WW8ReaderSave
{
private:
WW8PLCFxSaveAll maPLCFxSave;
- SwPosition const maTmpPos;
+ std::shared_ptr<SwUnoCursor> mxTmpPos;
std::deque<bool> maOldApos;
std::deque<WW8FieldEntry> maOldFieldStack;
std::unique_ptr<SwWW8FltControlStack> mxOldStck;
@@ -619,7 +619,7 @@ private:
public:
WW8ReaderSave(SwWW8ImplReader* pRdr, WW8_CP nStart=-1);
void Restore(SwWW8ImplReader* pRdr);
- const SwPosition &GetStartPos() const { return maTmpPos; }
+ const SwPosition &GetStartPos() const { return *mxTmpPos->GetPoint(); }
};
enum class eF_ResT { OK, TEXT, TAGIGN, READ_FSPA };
@@ -925,6 +925,14 @@ public:
explicit wwExtraneousParas(SwDoc &rDoc) : m_rDoc(rDoc) {}
~wwExtraneousParas() { delete_all_from_doc(); }
void insert(SwTextNode *pTextNode) { m_aTextNodes.insert(pTextNode); }
+ void check_anchor_destination(SwTextNode *pTextNode)
+ {
+ auto it = m_aTextNodes.find(pTextNode);
+ if (it == m_aTextNodes.end())
+ return;
+ SAL_WARN("sw.ww8", "It is unexpected to anchor something in a para scheduled for removal");
+ m_aTextNodes.erase(it);
+ }
void delete_all_from_doc();
};
@@ -1199,7 +1207,7 @@ private:
std::unique_ptr<SwMSConvertControls> m_xFormImpl; // implementation of control
SwFlyFrameFormat* m_pFlyFormatOfJustInsertedGraphic;
- SwFrameFormat* m_pFormatOfJustInsertedApo;
+ std::unique_ptr<FrameDeleteWatch> m_xFormatOfJustInsertedApo;
SwPaM* m_pPreviousNumPaM;
const SwNumRule* m_pPrevNumRule;
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index c96f74b28559..a2c8bc832ab8 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2403,18 +2403,20 @@ void WW8TabDesc::CreateSwTable()
Set fly anchor to its anchor pos, so that if a table starts immediately
at this position a new node will be inserted before inserting the table.
*/
- if (!bInsNode && m_pIo->m_pFormatOfJustInsertedApo)
+ SwFrameFormat* pFormat = (!bInsNode && m_pIo->m_xFormatOfJustInsertedApo)
+ ? m_pIo->m_xFormatOfJustInsertedApo->GetFormat() : nullptr;
+ if (pFormat)
{
const SwPosition* pAPos =
- m_pIo->m_pFormatOfJustInsertedApo->GetAnchor().GetContentAnchor();
+ pFormat->GetAnchor().GetContentAnchor();
if (pAPos && &pAPos->nNode.GetNode() == &pPoint->nNode.GetNode())
{
bInsNode = true;
bSetMinHeight = true;
- SwFormatSurround aSur(m_pIo->m_pFormatOfJustInsertedApo->GetSurround());
+ SwFormatSurround aSur(pFormat->GetSurround());
aSur.SetAnchorOnly(true);
- m_pIo->m_pFormatOfJustInsertedApo->SetFormatAttr(aSur);
+ pFormat->SetFormatAttr(aSur);
}
}
@@ -2751,8 +2753,17 @@ void WW8TabDesc::FinishSwTable()
{
m_pIo->m_xRedlineStack->closeall(*m_pIo->m_pPaM->GetPoint());
m_pIo->m_aFrameRedlines.emplace(std::move(m_pIo->m_xRedlineStack));
+
+ // ofz#38011 drop m_pLastAnchorPos during RedlineStack dtor and restore it afterwards to the same
+ // place, or somewhere close if that place got destroyed
+ std::shared_ptr<SwUnoCursor> xLastAnchorCursor(m_pIo->m_pLastAnchorPos ? m_pIo->m_rDoc.CreateUnoCursor(*m_pIo->m_pLastAnchorPos) : nullptr);
+ m_pIo->m_pLastAnchorPos.reset();
+
m_pIo->m_xRedlineStack = std::move(mxOldRedlineStack);
+ if (xLastAnchorCursor)
+ m_pIo->m_pLastAnchorPos.reset(new SwPosition(*xLastAnchorCursor->GetPoint()));
+
WW8DupProperties aDup(m_pIo->m_rDoc,m_pIo->m_xCtrlStck.get());
m_pIo->m_xCtrlStck->SetAttr( *m_pIo->m_pPaM->GetPoint(), 0, false);
@@ -2801,7 +2812,7 @@ void WW8TabDesc::FinishSwTable()
}
}
}
- m_pIo->m_pFormatOfJustInsertedApo = nullptr;
+ m_pIo->m_xFormatOfJustInsertedApo.reset();
m_MergeGroups.clear();
}
}
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index be0c2145763a..cb15bbd96aa4 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2455,6 +2455,9 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p
}
else
{
+ // ofz#34749 we shouldn't anchor anything into an 'extra' paragraph scheduled for
+ // removal at end of import, but check if that scenario is happening
+ m_aExtraneousParas.check_anchor_destination(m_pPaM->GetNode().GetTextNode());
m_xSFlyPara->pFlyFormat = m_rDoc.MakeFlySection(WW8SwFlyPara::eAnchor,
m_pPaM->GetPoint(), &aFlySet);
OSL_ENSURE(m_xSFlyPara->pFlyFormat->GetAnchor().GetAnchorId() ==
@@ -2720,7 +2723,7 @@ void SwWW8ImplReader::StopApo()
//#i8062#
if (m_xSFlyPara && m_xSFlyPara->pFlyFormat)
- m_pFormatOfJustInsertedApo = m_xSFlyPara->pFlyFormat;
+ m_xFormatOfJustInsertedApo.reset(new FrameDeleteWatch(m_xSFlyPara->pFlyFormat));
m_xSFlyPara.reset();
m_xWFlyPara.reset();
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 35fa751c37f0..b52469f08208 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -2334,26 +2334,40 @@ void WW8PLCF::ReadPLCF(SvStream& rSt, WW8_FC nFilePos, sal_uInt32 nPLCF)
void WW8PLCF::MakeFailedPLCF()
{
nIMax = 0;
- pPLCF_PosArray.reset( new sal_Int32[2] );
+ pPLCF_PosArray.reset( new WW8_CP[2] );
pPLCF_PosArray[0] = pPLCF_PosArray[1] = WW8_CP_MAX;
pPLCF_Contents = reinterpret_cast<sal_uInt8*>(&pPLCF_PosArray[nIMax + 1]);
}
-void WW8PLCF::TruncToSortedRange()
+namespace
{
- //Docs state that: ... all Plcs ... are sorted in ascending order.
- //So ensure that here for broken documents.
- for (auto nI = 0; nI < nIMax; ++nI)
+ sal_Int32 TruncToSortedRange(const sal_Int32* pPLCF_PosArray, sal_Int32 nIMax)
{
- if (pPLCF_PosArray[nI] > pPLCF_PosArray[nI+1])
+ //Docs state that: ... all Plcs ... are sorted in ascending order.
+ //So ensure that here for broken documents.
+ for (auto nI = 0; nI < nIMax; ++nI)
{
- SAL_WARN("sw.ww8", "Document has unsorted PLCF, truncated to sorted portion");
- nIMax = nI;
- break;
+ if (pPLCF_PosArray[nI] > pPLCF_PosArray[nI+1])
+ {
+ SAL_WARN("sw.ww8", "Document has unsorted PLCF, truncated to sorted portion");
+ nIMax = nI;
+ break;
+ }
}
+ return nIMax;
}
}
+void WW8PLCFpcd::TruncToSortedRange()
+{
+ nIMax = ::TruncToSortedRange(pPLCF_PosArray.get(), nIMax);
+}
+
+void WW8PLCF::TruncToSortedRange()
+{
+ nIMax = ::TruncToSortedRange(pPLCF_PosArray.get(), nIMax);
+}
+
void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN)
{
OSL_ENSURE( nIMax < ncpN, "Pcl.Fkp: Why is PLCF too big?" );
@@ -2375,7 +2389,7 @@ void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN)
{
size_t nSiz = (4 + nStru) * nIMax + 4;
size_t nElems = ( nSiz + 3 ) / 4;
- pPLCF_PosArray.reset( new sal_Int32[ nElems ] ); // Pointer to Pos-array
+ pPLCF_PosArray.reset( new WW8_CP[ nElems ] ); // Pointer to Pos-array
for (sal_Int32 i = 0; i < ncpN && !failure; ++i)
{
@@ -2509,7 +2523,7 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos,
bValid = false;
nPLCF = bValid ? std::min(nRemainingSize, static_cast<std::size_t>(nPLCF)) : nValidMin;
- pPLCF_PosArray.reset( new sal_Int32[ ( nPLCF + 3 ) / 4 ] ); // Pointer to Pos-array
+ pPLCF_PosArray.reset( new WW8_CP[ ( nPLCF + 3 ) / 4 ] ); // Pointer to Pos-array
pPLCF_PosArray[0] = 0;
nPLCF = bValid ? pSt->ReadBytes(pPLCF_PosArray.get(), nPLCF) : nValidMin;
@@ -2523,6 +2537,7 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos,
// Pointer to content array
pPLCF_Contents = reinterpret_cast<sal_uInt8*>(&pPLCF_PosArray[nIMax + 1]);
+ TruncToSortedRange();
pSt->Seek( nOldPos );
}
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 1a5b024c12fb..6d01af87316e 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -339,14 +339,16 @@ class WW8PLCFpcd
{
friend class WW8PLCFpcd_Iter;
- std::unique_ptr<sal_Int32[]> pPLCF_PosArray; // pointer to Pos-array and the whole structure
+ std::unique_ptr<WW8_CP[]> pPLCF_PosArray; // pointer to Pos-array and the whole structure
sal_uInt8* pPLCF_Contents; // pointer to content-array-part of Pos-array
- long nIMax;
+ sal_Int32 nIMax;
sal_uInt32 nStru;
WW8PLCFpcd(const WW8PLCFpcd&) = delete;
WW8PLCFpcd& operator=(const WW8PLCFpcd&) = delete;
+ void TruncToSortedRange();
+
public:
WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos, sal_uInt32 nPLCF,
sal_uInt32 nStruct);
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 3e7a10dfca4f..58ca9418c681 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2024,7 +2024,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox(
{
const SwTableBoxNumFormat* pNumFormat =
static_cast<const SwTableBoxNumFormat*>( pItem );
- if( ( pNumFormat != nullptr ) && ( pNumFormat->GetValue() == 0 ) )
+ if (pNumFormat && (pNumFormat->GetValue() % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
{
// only one text node?
SwNodeIndex aNodeIndex( *(pCell->GetStartNode()), 1 );
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 788bec5c2d47..169cbdc1534d 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -853,9 +853,14 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra
uno::Reference < beans::XPropertySet > xSet( xObj->getComponent(), uno::UNO_QUERY );
if ( xSet.is() )
{
+ OUString sHRef = URIHelper::SmartRel2Abs(
+ INetURLObject( GetXMLImport().GetBaseURL() ), rHRef );
+
+ if (INetURLObject(sHRef).GetProtocol() == INetProtocol::Macro)
+ GetXMLImport().NotifyMacroEventRead();
+
xSet->setPropertyValue("FrameURL",
- makeAny( URIHelper::SmartRel2Abs(
- INetURLObject( GetXMLImport().GetBaseURL() ), rHRef ) ) );
+ makeAny( sHRef ) );
xSet->setPropertyValue("FrameName",
makeAny( rName ) );
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 0c539a16901d..0d0583f3d05e 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -196,6 +196,9 @@ void SwDropCapsPict::UpdatePaintSettings()
vcl::Font aFont;
if (mpPage)
{
+ // tdf#135244: preview generation should not jump document view
+ auto aLock(mpPage->rSh.GetView().GetDocShell()->LockAllViews());
+
if (!mpPage->m_xTemplateBox->get_active())
{
// query the Font at paragraph's beginning
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index aa18828648fc..50c42b40e7ca 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -147,7 +147,16 @@ void SwMailMergeWizard::enterState( WizardState _nState )
switch(_nState)
{
case MM_DOCUMENTSELECTPAGE:
+ {
bEnablePrev = false; // the first page
+
+ OUString sDataSourceName = GetSwView()->GetDataSourceName();
+ if(!sDataSourceName.isEmpty() &&
+ !SwView::IsDataSourceAvailable(sDataSourceName))
+ {
+ bEnableNext = false;
+ }
+ }
break;
case MM_ADDRESSBLOCKPAGE :
bEnableNext = m_xConfigItem->GetResultSet().is();
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 21d0f96d74f9..7d99f8274976 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -30,9 +30,8 @@
#include <shellio.hxx>
#include <swabstdlg.hxx>
#include <mmconfigitem.hxx>
-
#include <dbui.hrc>
-
+#include <swuiexp.hxx>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
@@ -53,6 +52,8 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(weld::Container* pPage, SwMai
, m_xBrowseDocPB(m_xBuilder->weld_button("browsedoc"))
, m_xBrowseTemplatePB(m_xBuilder->weld_button("browsetemplate"))
, m_xRecentDocLB(m_xBuilder->weld_combo_box("recentdoclb"))
+ , m_xDataSourceWarningFT(m_xBuilder->weld_label("datasourcewarning"))
+ , m_xExchangeDatabasePB(m_xBuilder->weld_button("exchangedatabase"))
{
m_xCurrentDocRB->set_active(true);
DocSelectHdl(*m_xNewDocRB);
@@ -68,6 +69,9 @@ SwMailMergeDocSelectPage::SwMailMergeDocSelectPage(weld::Container* pPage, SwMai
m_xBrowseDocPB->connect_clicked(aFileSelectHdl);
m_xBrowseTemplatePB->connect_clicked(aFileSelectHdl);
+ Link<weld::Button&,void> aExchangeDatabaseHdl = LINK(this, SwMailMergeDocSelectPage, ExchangeDatabaseHdl);
+ m_xExchangeDatabasePB->connect_clicked(aExchangeDatabaseHdl);
+
const uno::Sequence< OUString >& rDocs =
m_pWizard->GetConfigItem().GetSavedDocuments();
for(const auto& rDoc : rDocs)
@@ -89,9 +93,26 @@ SwMailMergeDocSelectPage::~SwMailMergeDocSelectPage()
IMPL_LINK_NOARG(SwMailMergeDocSelectPage, DocSelectHdl, weld::ToggleButton&, void)
{
m_xRecentDocLB->set_sensitive(m_xRecentDocRB->get_active());
-
m_pWizard->UpdateRoadmap();
- m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
+ OUString sDataSourceName = m_pWizard->GetSwView()->GetDataSourceName();
+
+ if(m_xCurrentDocRB->get_active() &&
+ !sDataSourceName.isEmpty() &&
+ !SwView::IsDataSourceAvailable(sDataSourceName))
+ {
+ m_xDataSourceWarningFT->show();
+ m_pWizard->enableButtons(WizardButtonFlags::NEXT, false);
+ }
+ else
+ {
+ m_xDataSourceWarningFT->hide();
+ m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
+ }
+
+ if(m_xCurrentDocRB->get_active())
+ m_xExchangeDatabasePB->set_sensitive(true);
+ else
+ m_xExchangeDatabasePB->set_sensitive(false);
}
IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, weld::Button&, rButton, void)
@@ -147,6 +168,24 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, weld::Button&, rButton, void)
m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE));
}
+IMPL_LINK_NOARG(SwMailMergeDocSelectPage, ExchangeDatabaseHdl, weld::Button&, void)
+{
+
+ SwAbstractDialogFactory& rFact = ::swui::GetFactory();
+ ScopedVclPtr<VclAbstractDialog> pDlg(rFact.CreateSwChangeDBDlg(*m_pWizard->GetSwView()));
+ pDlg->Execute();
+
+ OUString sDataSourceName = m_pWizard->GetSwView()->GetDataSourceName();
+
+ if(m_xCurrentDocRB->get_active() &&
+ !sDataSourceName.isEmpty() &&
+ SwView::IsDataSourceAvailable(sDataSourceName))
+ {
+ m_xDataSourceWarningFT->hide();
+ m_pWizard->enableButtons(WizardButtonFlags::NEXT, true);
+ }
+}
+
bool SwMailMergeDocSelectPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason )
{
bool bReturn = false;
diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx
index 0930caf03982..8a2a86a6e400 100644
--- a/sw/source/ui/dbui/mmdocselectpage.hxx
+++ b/sw/source/ui/dbui/mmdocselectpage.hxx
@@ -39,9 +39,12 @@ class SwMailMergeDocSelectPage : public vcl::OWizardPage
std::unique_ptr<weld::Button> m_xBrowseDocPB;
std::unique_ptr<weld::Button> m_xBrowseTemplatePB;
std::unique_ptr<weld::ComboBox> m_xRecentDocLB;
+ std::unique_ptr<weld::Label> m_xDataSourceWarningFT;
+ std::unique_ptr<weld::Button> m_xExchangeDatabasePB;
DECL_LINK(DocSelectHdl, weld::ToggleButton&, void);
DECL_LINK(FileSelectHdl, weld::Button&, void);
+ DECL_LINK(ExchangeDatabaseHdl, weld::Button&, void);
virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index e4147262859e..44ce60cd531f 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -34,6 +34,7 @@
#include <sfx2/filedlghelper.hxx>
#include <editeng/sizeitem.hxx>
#include <svtools/htmlcfg.hxx>
+#include <comphelper/lok.hxx>
#include <uitool.hxx>
#include <IMark.hxx>
@@ -401,6 +402,19 @@ SwEditRegionDlg::SwEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh)
m_xTree->show();
bDontCheckPasswd = false;
+
+ if(comphelper::LibreOfficeKit::isActive())
+ {
+ m_xBuilder->weld_label("label8")->hide(); // Link
+ m_xFileCB->hide();
+ m_xDDECB->hide();
+ m_xDDECommandFT->hide();
+ m_xFileNameFT->hide();
+ m_xFileNameED->hide();
+ m_xFilePB->hide();
+ m_xSubRegionFT->hide();
+ m_xSubRegionED->hide();
+ }
}
bool SwEditRegionDlg::CheckPasswd(weld::ToggleButton* pBox)
@@ -1509,6 +1523,21 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(weld::Container* pPage, weld::Dia
m_xDDECB->connect_toggled( LINK( this, SwInsertSectionTabPage, DDEHdl ));
ChangeProtectHdl(*m_xProtectCB);
m_xSubRegionED->set_entry_completion(true, true);
+
+ // Hide Link section. In general it makes no sense to insert a file from the jail,
+ // because it does not contain any usable files (documents).
+ if(comphelper::LibreOfficeKit::isActive())
+ {
+ m_xBuilder->weld_label("label1")->hide(); // Link
+ m_xFileCB->hide();
+ m_xDDECB->hide();
+ m_xDDECommandFT->hide();
+ m_xFileNameFT->hide();
+ m_xFileNameED->hide();
+ m_xFilePB->hide();
+ m_xSubRegionFT->hide();
+ m_xSubRegionED->hide();
+ }
}
SwInsertSectionTabPage::~SwInsertSectionTabPage()
diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx
index 3dd7149b558e..6683215d5f86 100644
--- a/sw/source/ui/dialog/wordcountdialog.cxx
+++ b/sw/source/ui/dialog/wordcountdialog.cxx
@@ -20,6 +20,7 @@
#include <officecfg/Office/Writer.hxx>
#include <swtypes.hxx>
#include <wordcountdialog.hxx>
+#include <docsh.hxx>
#include <docstat.hxx>
#include <cmdid.h>
#include <swmodule.hxx>
@@ -135,7 +136,9 @@ void SwWordCountFloatDlg::UpdateCounts()
SwDocStat aCurrCnt;
SwDocStat aDocStat;
{
- SwWait aWait( *::GetActiveView()->GetDocShell(), true );
+ auto& rDocShell(*GetActiveView()->GetDocShell());
+ SwWait aWait(rDocShell, true);
+ auto aLock = rDocShell.LockAllViews();
rSh.StartAction();
rSh.CountWords( aCurrCnt );
aDocStat = rSh.GetUpdatedDocStat();
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 01b9065cd36e..7cdf4d73d4d4 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -182,6 +182,10 @@ void SwFieldDBPage::Reset(const SfxItemSet*)
}
}
+// SwFieldDBPage may ask for password to select current document's data source,
+// so only do that when activating the page, not when dialog is creating all pages
+bool SwFieldDBPage::DeferResetToFirstActivation() { return true; }
+
bool SwFieldDBPage::FillItemSet(SfxItemSet* )
{
OUString sTableName;
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index e507fcb86ee0..b25c38699234 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -70,6 +70,7 @@ public:
virtual bool FillItemSet( SfxItemSet* rSet ) override;
virtual void Reset( const SfxItemSet* rSet ) override;
+ virtual bool DeferResetToFirstActivation() override;
virtual void FillUserData() override;
void ActivateMailMergeAddress();
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 8c1bb998fb85..5a0a8022262a 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -40,6 +40,7 @@
#include <view.hxx>
#include <fldtdlg.hxx>
#include <swmodule.hxx>
+#include <comphelper/lok.hxx>
#include <globals.hrc>
@@ -93,6 +94,9 @@ SwFieldDlg::SwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, weld::Window *pP
RemoveTabPage("functions");
RemoveTabPage("database");
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ RemoveTabPage("database");
}
SwFieldDlg::~SwFieldDlg()
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index ca59c421b394..d591cef7b264 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -32,6 +32,7 @@
#include <wrap.hxx>
#include <column.hxx>
#include <macassgn.hxx>
+#include <IDocumentSettingAccess.hxx>
#include <globals.hrc>
#include <strings.hrc>
@@ -194,6 +195,12 @@ void SwFrameDlg::PageCreated(const OString& rId, SfxTabPage &rPage)
{
rPage.PageCreated(m_rSet);
}
+ else if (rId == "crop")
+ {
+ sal_Int32 nPreferredDPI = m_pWrtShell->GetDoc()->getIDocumentSettingAccess().getImagePreferredDPI();
+ if (nPreferredDPI)
+ rPage.getAdditionalProperties().emplace("PreferredDPI", css::uno::makeAny(nPreferredDPI));
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index cf872d5465f3..ed0c24b752af 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -103,7 +103,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, DeleteHdl, weld::Button&, void)
sw::mark::IMark* pBookmark = reinterpret_cast<sw::mark::IMark*>(m_xBookmarksBox->get_id(rEntry).toInt64());
OUString sRemoved = pBookmark->GetName();
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
- pMarkAccess->deleteMark(pMarkAccess->findMark(sRemoved));
+ pMarkAccess->deleteMark(pMarkAccess->findMark(sRemoved), false);
SfxRequest aReq(rSh.GetView().GetViewFrame(), FN_DELETE_BOOKMARK);
aReq.AppendItem(SfxStringItem(FN_DELETE_BOOKMARK, sRemoved));
aReq.Done();
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 151770695eeb..3704184eaf26 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -379,7 +379,7 @@ bool SwDocShell::Save()
return !nErr.IsError();
}
-SwDocShell::LockAllViewsGuard::LockAllViewsGuard(SwViewShell* pViewShell)
+SwDocShell::LockAllViewsGuard_Impl::LockAllViewsGuard_Impl(SwViewShell* pViewShell)
{
if (!pViewShell)
return;
@@ -393,23 +393,21 @@ SwDocShell::LockAllViewsGuard::LockAllViewsGuard(SwViewShell* pViewShell)
}
}
-SwDocShell::LockAllViewsGuard::~LockAllViewsGuard()
+SwDocShell::LockAllViewsGuard_Impl::~LockAllViewsGuard_Impl()
{
for (SwViewShell* pShell : m_aViewWasUnLocked)
pShell->LockView(false);
}
-std::unique_ptr<SwDocShell::LockAllViewsGuard> SwDocShell::LockAllViews()
+std::unique_ptr<SfxObjectShell::LockAllViewsGuard> SwDocShell::LockAllViews()
{
- return std::make_unique<LockAllViewsGuard>(GetEditShell());
+ return std::make_unique<LockAllViewsGuard_Impl>(GetEditShell());
}
// Save using the Defaultformat
bool SwDocShell::SaveAs( SfxMedium& rMedium )
{
SwWait aWait( *this, true );
- // tdf#41063: prevent jumping to cursor at any temporary modification
- auto aViewGuard(LockAllViews());
//#i3370# remove quick help to prevent saving of autocorrection suggestions
if (m_pView)
m_pView->GetEditWin().StopQuickHelp();
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 2e25b89ea9e6..c23d894fd4fd 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -24,7 +24,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <comphelper/flagguard.hxx>
-
+#include <o3tl/any.hxx>
#include <sal/log.hxx>
#include <hintids.hxx>
#include <sfx2/app.hxx>
@@ -163,11 +163,16 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY2:
if(!pShell->IsFrameSelected())
{
+ OUString aProgName;
SwTextFormatColl* pColl = pShell->GetCurTextFormatColl();
if(pColl)
+ {
aName = pColl->GetName();
+ sal_uInt16 nId = pColl->GetPoolFormatId();
+ SwStyleNameMapper::FillProgName(nId, aProgName);
+ }
- SfxTemplateItem aItem(nWhich, aName);
+ SfxTemplateItem aItem(nWhich, aName, aProgName);
SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto;
if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE))
@@ -717,21 +722,20 @@ void syncEndnoteOrientation(const uno::Reference< style::XStyleFamiliesSupplier
return;
}
- sal_Int32 nWidth, nHeight;
- bool bIsDefLandScape, bIsEndLandScape;
-
- xDefaultPagePropSet->getPropertyValue("IsLandscape") >>= bIsDefLandScape;
- xEndnotePagePropSet->getPropertyValue("IsLandscape") >>= bIsEndLandScape;
+ auto const bIsDefLandScape = *o3tl::doAccess<bool>(
+ xDefaultPagePropSet->getPropertyValue("IsLandscape"));
+ auto const bIsEndLandScape = *o3tl::doAccess<bool>(
+ xEndnotePagePropSet->getPropertyValue("IsLandscape"));
if (bIsDefLandScape == bIsEndLandScape)
return;
- xEndnotePagePropSet->getPropertyValue("Width") >>= nWidth;
- xEndnotePagePropSet->getPropertyValue("Height") >>= nHeight;
+ auto const nWidth = xEndnotePagePropSet->getPropertyValue("Width");
+ auto const nHeight = xEndnotePagePropSet->getPropertyValue("Height");
xEndnotePagePropSet->setPropertyValue("IsLandscape", css::uno::toAny(bIsDefLandScape));
- xEndnotePagePropSet->setPropertyValue("Width", css::uno::toAny(nHeight));
- xEndnotePagePropSet->setPropertyValue("Height", css::uno::toAny(nWidth));
+ xEndnotePagePropSet->setPropertyValue("Width", nHeight);
+ xEndnotePagePropSet->setPropertyValue("Height", nWidth);
}
}
diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx
index 8571794b2c7c..413a945c56b3 100644
--- a/sw/source/uibase/config/StoredChapterNumbering.cxx
+++ b/sw/source/uibase/config/StoredChapterNumbering.cxx
@@ -152,7 +152,7 @@ public:
SwXNumberingRules::SetPropertiesToNumFormat(
aNumberFormat,
charStyleName,
- nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr, nullptr,
props);
SwNumRulesWithName *const pRules(GetOrCreateRules());
pRules->SetNumFormat(nIndex, aNumberFormat, charStyleName);
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index c5f726758fb1..e83727fee73f 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1705,7 +1705,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
"sw::SwDBManager aEmailDispatcherPollTimer" );
aEmailDispatcherPollTimer.SetTimeout( 500 );
aEmailDispatcherPollTimer.Start();
- while( IsMergeOk() && m_pImpl->m_xLastMessage.is() )
+ while( IsMergeOk() && m_pImpl->m_xLastMessage.is() && !Application::IsQuit())
Application::Yield();
aEmailDispatcherPollTimer.Stop();
}
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index eea90633e048..f2aafb77965d 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -333,14 +333,25 @@ void SwDBTreeList::Select(const OUString& rDBName, const OUString& rTableName, c
{
if (rDBName == m_xTreeView->get_text(*xParent))
{
+ if (rTableName.isEmpty() && rColumnName.isEmpty())
+ {
+ // Just select the database node, do not expand
+ m_xTreeView->scroll_to_row(*xParent);
+ m_xTreeView->select(*xParent);
+ return;
+ }
if (!m_xTreeView->iter_has_child(*xParent))
{
RequestingChildrenHdl(*xParent);
- m_xTreeView->expand_row(*xParent);
+ // If successful, it will be expanded in a call to scroll_to_row for its children
}
std::unique_ptr<weld::TreeIter> xChild(m_xTreeView->make_iterator(xParent.get()));
if (!m_xTreeView->iter_children(*xChild))
+ {
+ m_xTreeView->scroll_to_row(*xParent);
+ m_xTreeView->select(*xParent);
continue;
+ }
do
{
if (rTableName == m_xTreeView->get_text(*xChild))
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index e58f95a95ccb..06ceed6d8b41 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -4262,7 +4262,7 @@ bool SwTransferDdeLink::WriteData( SvStream& rStrm )
// remove mark
rServerObject.SetNoServer(); // this removes the connection between SwServerObject and mark
// N.B. ppMark was not loaded from file and cannot have xml:id
- pMarkAccess->deleteMark(ppMark);
+ pMarkAccess->deleteMark(ppMark, false);
// recreate as Bookmark
::sw::mark::IMark* const pNewMark = pMarkAccess->makeMark(
@@ -4297,7 +4297,7 @@ void SwTransferDdeLink::Disconnect( bool bRemoveDataAdvise )
bool bIsModified = pDoc->getIDocumentState().IsModified();
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
- pMarkAccess->deleteMark(pMarkAccess->findMark(sName));
+ pMarkAccess->deleteMark(pMarkAccess->findMark(sName), false);
if( !bIsModified )
pDoc->getIDocumentState().ResetModified();
diff --git a/sw/source/uibase/docvw/SidebarScrollBar.cxx b/sw/source/uibase/docvw/SidebarScrollBar.cxx
index 9b57616ba89f..ee118f29b496 100644
--- a/sw/source/uibase/docvw/SidebarScrollBar.cxx
+++ b/sw/source/uibase/docvw/SidebarScrollBar.cxx
@@ -54,9 +54,8 @@ void SidebarScrollBar::LogicInvalidate(const tools::Rectangle* pRectangle)
rParent.Pop();
aRectangle.Move(aOffset.getX(), aOffset.getY());
- OString sRectangle = aRectangle.toString();
SwWrtShell& rWrtShell = m_rView.GetWrtShell();
- SfxLokHelper::notifyInvalidation(rWrtShell.GetSfxViewShell(), sRectangle);
+ SfxLokHelper::notifyInvalidation(rWrtShell.GetSfxViewShell(), &aRectangle);
}
void SidebarScrollBar::MouseButtonUp(const MouseEvent& /*rMouseEvent*/)
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index bdbb0e2804e4..9598b607bff1 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -214,9 +214,8 @@ void SidebarTextControl::LogicInvalidate(const tools::Rectangle* pRectangle)
rParent.Pop();
aRectangle.Move(aOffset.getX(), aOffset.getY());
- OString sRectangle = aRectangle.toString();
SwWrtShell& rWrtShell = mrDocView.GetWrtShell();
- SfxLokHelper::notifyInvalidation(rWrtShell.GetSfxViewShell(), sRectangle);
+ SfxLokHelper::notifyInvalidation(rWrtShell.GetSfxViewShell(), &aRectangle);
}
void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt )
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index facc9e95bda0..4f4cd8a6b754 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -6356,13 +6356,7 @@ Selection SwEditWin::GetSurroundingTextSelection() const
void SwEditWin::LogicInvalidate(const tools::Rectangle* pRectangle)
{
- OString sRectangle;
- if (!pRectangle)
- sRectangle = "EMPTY";
- else
- sRectangle = pRectangle->toString();
-
- SfxLokHelper::notifyInvalidation(&m_rView, sRectangle);
+ SfxLokHelper::notifyInvalidation(&m_rView, pRectangle);
}
void SwEditWin::LogicMouseButtonDown(const MouseEvent& rMouseEvent)
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 37ec78c3762e..2f0893e06136 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -104,7 +104,7 @@
#include <instable.hxx>
#include <svx/fmshell.hxx>
#include <SwRewriter.hxx>
-#include <unomid.h>
+#include <GraphicSizeCheck.hxx>
#include <svx/galleryitem.hxx>
#include <com/sun/star/gallery/GalleryItemType.hpp>
#include <memory>
@@ -1720,8 +1720,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
if (comphelper::LibreOfficeKit::isActive())
{
- if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == FN_TOOL_ANCHOR_PARAGRAPH
- || nWhich == FN_TOOL_ANCHOR_FRAME)
+ if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == FN_TOOL_ANCHOR_FRAME)
{
rSet.DisableItem(nWhich);
}
@@ -1871,6 +1870,13 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
else
rSet.Put( SfxVisibilityItem( nWhich, false ) );
break;
+ case SID_GRAPHIC_SIZE_CHECK:
+ {
+ sal_Int32 nDPI = rSh.GetDoc()->getIDocumentSettingAccess().getImagePreferredDPI();
+ if (nDPI <= 0)
+ rSet.DisableItem(nWhich);
+ }
+ break;
}
nWhich = aIter.NextWhich();
}
@@ -2677,6 +2683,14 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
}
}
break;
+ case SID_GRAPHIC_SIZE_CHECK:
+ {
+ sw::GraphicSizeCheckGUIResult aResult(rSh.GetDoc());
+ svx::GenericCheckDialog aDialog(pMDI, aResult);
+ aDialog.run();
+ }
+ break;
+
default:OSL_FAIL("wrong Dispatcher (basesh.cxx)");
}
if(!bDone)
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index e5169e229041..ef91d2efb9c3 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -221,16 +221,27 @@ void SwDrawShell::Execute(SfxRequest &rReq)
break;
case SID_MOVE_SHAPE_HANDLE:
{
- if (pArgs && pArgs->Count() == 3)
+ if (pArgs && pArgs->Count() >= 3)
{
const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1);
const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2);
const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3);
+ const SfxInt32Item* OrdNum = rReq.GetArg<SfxInt32Item>(FN_PARAM_4);
const sal_uLong handleNum = handleNumItem->GetValue();
const sal_uLong newPosX = newPosXTwips->GetValue();
const sal_uLong newPosY = newPosYTwips->GetValue();
- pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+ const Point mPoint(newPosX, newPosY);
+ const SdrHdl* handle = pSdrView->GetHdlList().GetHdl(handleNum);
+ if (handle->GetKind() == SdrHdlKind::Anchor || handle->GetKind() == SdrHdlKind::Anchor_TR)
+ {
+ rSh.FindAnchorPos(mPoint, /*bMoveIt=*/true);
+ SdrDragView* pDragView = dynamic_cast<SdrDragView*>(pSdrView);
+ if (pDragView != nullptr)
+ pDragView->ModelHasChanged();
+ }
+ else
+ pSdrView->MoveShapeHandle(handleNum, mPoint, OrdNum ? OrdNum->GetValue() : -1);
}
}
break;
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 44fa64318acb..d0c70582bb18 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -718,7 +718,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
if ( pItem )
{
IDocumentMarkAccess* const pMarkAccess = rWrtSh.getIDocumentMarkAccess();
- pMarkAccess->deleteMark( pMarkAccess->findMark(static_cast<const SfxStringItem*>(pItem)->GetValue()) );
+ pMarkAccess->deleteMark(pMarkAccess->findMark(static_cast<const SfxStringItem*>(pItem)->GetValue()), false);
}
break;
}
@@ -1488,12 +1488,14 @@ void SwTextShell::Execute(SfxRequest &rReq)
else if (sApplyText == sSpellingType)
{
SwRect aToFill;
- uno::Reference< linguistic2::XSpellAlternatives > xSpellAlt( rWrtSh.GetCorrection(nullptr, aToFill) );
+ uno::Reference<linguistic2::XSpellAlternatives> xSpellAlt(rWrtSh.GetCorrection(nullptr, aToFill));
+ if (!xSpellAlt.is())
+ return;
uno::Reference< linguistic2::XDictionary > xDictionary = LinguMgr::GetIgnoreAllList();
OUString sWord(xSpellAlt->getWord());
linguistic::DictionaryError nAddRes = linguistic::AddEntryToDic( xDictionary,
sWord, false, OUString() );
- if (linguistic::DictionaryError::NONE != nAddRes && !xDictionary->getEntry(sWord).is())
+ if (linguistic::DictionaryError::NONE != nAddRes && xDictionary.is() && !xDictionary->getEntry(sWord).is())
{
SvxDicError(rWrtSh.GetView().GetFrameWeld(), nAddRes);
}
diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx
index 9dc6d467f941..ee6b5d66de1c 100644
--- a/sw/source/uibase/uiview/uivwimp.cxx
+++ b/sw/source/uibase/uiview/uivwimp.cxx
@@ -292,6 +292,8 @@ SwClipboardChangeListener::~SwClipboardChangeListener()
void SAL_CALL SwClipboardChangeListener::disposing( const EventObject& /*rEventObject*/ )
{
+ SolarMutexGuard aGuard;
+ pView = nullptr; // so we don't touch the view if changedContents somehow fires afterwards
}
void SAL_CALL SwClipboardChangeListener::changedContents( const css::datatransfer::clipboard::ClipboardEvent& rEventObject )
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index b06fa1a38457..e2fa03b5f2ce 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -38,6 +38,8 @@
#include <sfx2/objface.hxx>
#include <sfx2/printer.hxx>
#include <sfx2/request.hxx>
+#include <sfx2/event.hxx>
+#include <sfx2/infobar.hxx>
#include <svx/ruler.hxx>
#include <svx/srchdlg.hxx>
#include <editeng/protitem.hxx>
@@ -75,6 +77,7 @@
#include <gloshdl.hxx>
#include <usrpref.hxx>
#include <srcview.hxx>
+#include <strings.hrc>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <IDocumentSettingAccess.hxx>
@@ -98,6 +101,10 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/scanner/ScannerContext.hpp>
#include <com/sun/star/scanner/XScannerManager2.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
+#include <com/sun/star/sdb/DatabaseContext.hpp>
+#include <com/sun/star/sdbc/XDataSource.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
@@ -125,6 +132,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::scanner;
+using namespace ::com::sun::star::sdb;
+using namespace ::com::sun::star::sdbc;
#define SWVIEWFLAGS SfxViewShellFlags::HAS_PRINTOPTIONS
@@ -1646,6 +1655,7 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
else
{
SfxHintId nId = rHint.GetId();
+
switch ( nId )
{
// sub shells will be destroyed by the
@@ -1726,7 +1736,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
GetViewFrame()->GetBindings().Invalidate(aSlotRedLine);
}
break;
-
default: break;
}
}
@@ -1889,6 +1898,25 @@ tools::Rectangle SwView::getLOKVisibleArea() const
return tools::Rectangle();
}
+OUString SwView::GetDataSourceName() const
+{
+ uno::Reference<lang::XMultiServiceFactory> xFactory(GetDocShell()->GetModel(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xSettings(
+ xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);
+ OUString sDataSourceName = "";
+ xSettings->getPropertyValue("CurrentDatabaseDataSource") >>= sDataSourceName;
+
+ return sDataSourceName;
+}
+
+bool SwView::IsDataSourceAvailable(const OUString sDataSourceName)
+{
+ uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference< XDatabaseContext> xDatabaseContext = DatabaseContext::create(xContext);
+
+ return xDatabaseContext->hasByName(sDataSourceName);
+}
+
namespace sw {
void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 760f18fc56df..9820b695d7cb 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1294,7 +1294,7 @@ void SwView::Execute(SfxRequest &rReq)
break;
case SID_MOVE_SHAPE_HANDLE:
{
- if (pArgs && pArgs->Count() == 3)
+ if (pArgs && pArgs->Count() >= 3)
{
SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() : nullptr;
if (pSdrView == nullptr)
@@ -1302,11 +1302,22 @@ void SwView::Execute(SfxRequest &rReq)
const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1);
const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2);
const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3);
+ const SfxInt32Item* OrdNum = rReq.GetArg<SfxInt32Item>(FN_PARAM_4);
const sal_uLong handleNum = handleNumItem->GetValue();
const sal_uLong newPosX = newPosXTwips->GetValue();
const sal_uLong newPosY = newPosYTwips->GetValue();
- pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY));
+ const Point mPoint(newPosX, newPosY);
+ const SdrHdl* handle = pSdrView->GetHdlList().GetHdl(handleNum);
+ if (!handle)
+ {
+ break;
+ }
+
+ if (handle->GetKind() == SdrHdlKind::Anchor || handle->GetKind() == SdrHdlKind::Anchor_TR)
+ m_pWrtShell->FindAnchorPos(mPoint, /*bMoveIt=*/true);
+ else
+ pSdrView->MoveShapeHandle(handleNum, mPoint, OrdNum ? OrdNum->GetValue() : -1);
}
break;
}
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index d5c2ff4284c7..507547b06666 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -266,6 +266,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_CAPTION:
case SID_DRAW_CAPTION_VERTICAL:
pFuncPtr.reset( new ConstRectangle(m_pWrtShell.get(), m_pEditWin, this) );
+ bCreateDirectly = comphelper::LibreOfficeKit::isActive();
m_nDrawSfxId = nSlotId;
m_sDrawCustom.clear();
break;
@@ -349,6 +350,8 @@ void SwView::ExecDraw(SfxRequest& rReq)
NoRotate();
if(rReq.GetModifier() == KEY_MOD1 || bCreateDirectly)
{
+ if (bCreateDirectly)
+ GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SfxCallMode::ASYNCHRON);
if(SID_OBJECT_SELECT == m_nDrawSfxId )
{
m_pWrtShell->GotoObj(true);
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 7a2f8c852625..4edf541aa973 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1112,24 +1112,30 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
if (sType == "column-left")
{
- auto & rEntry = aTabCols.GetEntry(0);
- long nNewPosition = aTabCols.GetLeft() + long(nOffset);
- long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
- aTabCols.SetLeft(nPosition);
+ long nNewPosition = aTabCols.GetLeft() + nOffset;
+ if(aTabCols.Count() > 0)
+ {
+ auto & rEntry = aTabCols.GetEntry(0);
+ nNewPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
+ }
+ aTabCols.SetLeft(nNewPosition);
}
else if (sType == "column-right")
{
- auto & rEntry = aTabCols.GetEntry(aTabCols.Count() - 1);
- long nNewPosition = aTabCols.GetRight() + long(nOffset);
- long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
- aTabCols.SetRight(nPosition);
+ long nNewPosition = aTabCols.GetRight() + nOffset;
+ if(aTabCols.Count() > 0)
+ {
+ auto & rEntry = aTabCols.GetEntry(aTabCols.Count() - 1);
+ nNewPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
+ }
+ aTabCols.SetRight(nNewPosition);
}
else if (sType == "column-middle" && nIndex < aTabCols.Count())
{
auto & rEntry = aTabCols.GetEntry(nIndex);
- long nNewPosition = rEntry.nPos + long(nOffset);
- long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
- rEntry.nPos = nPosition;
+ long nNewPosition = rEntry.nPos + nOffset;
+ nNewPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
+ rEntry.nPos = nNewPosition;
}
rSh.SetTabCols(aTabCols, false);
@@ -1142,23 +1148,26 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
if (sType == "row-left")
{
auto & rEntry = aTabRows.GetEntry(0);
- long nNewPosition = aTabRows.GetLeft() + long(nOffset);
- long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
- aTabRows.SetLeft(nPosition);
+ long nNewPosition = aTabRows.GetLeft() + nOffset;
+ nNewPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset);
+ aTabRows.SetLeft(nNewPosition);
}
else if (sType == "row-right")
{
- auto & rEntry = aTabRows.GetEntry(aTabRows.Count() - 1);
- long nNewPosition = aTabRows.GetRight() + long(nOffset);
- long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
- aTabRows.SetRight(nPosition);
+ long nNewPosition = aTabRows.GetRight() + nOffset;
+ if(aTabRows.Count() > 0)
+ {
+ auto & rEntry = aTabRows.GetEntry(aTabRows.Count() - 1);
+ nNewPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset);
+ }
+ aTabRows.SetRight(nNewPosition);
}
else if (sType == "row-middle" && nIndex < aTabRows.Count())
{
auto & rEntry = aTabRows.GetEntry(nIndex);
- long nNewPosition = rEntry.nPos + long(nOffset);
- long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
- rEntry.nPos = nPosition;
+ long nNewPosition = rEntry.nPos + nOffset;
+ nNewPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset);
+ rEntry.nPos = nNewPosition;
}
rSh.SetTabRows(aTabRows, false);
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index b33be85354f2..458123d88871 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -148,6 +148,7 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_CONTINUOUS_ENDNOTES,
HANDLE_HEADER_SPACING_BELOW_LAST_PARA,
HANDLE_GUTTER_AT_TOP,
+ HANDLE_IMAGE_PREFERRED_DPI,
};
static MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -237,6 +238,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ OUString("ContinuousEndnotes"), HANDLE_CONTINUOUS_ENDNOTES, cppu::UnoType<bool>::get(), 0 },
{ OUString("HeaderSpacingBelowLastPara"), HANDLE_HEADER_SPACING_BELOW_LAST_PARA, cppu::UnoType<bool>::get(), 0 },
{ OUString("GutterAtTop"), HANDLE_GUTTER_AT_TOP, cppu::UnoType<bool>::get(), 0 },
+ { OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType<sal_Int32>::get(), 0 },
/*
* As OS said, we don't have a view when we need to set this, so I have to
@@ -977,6 +979,16 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
}
break;
+ case HANDLE_IMAGE_PREFERRED_DPI:
+ {
+ sal_uInt32 nValue = 0;
+ if (rValue >>= nValue)
+ {
+ mpDoc->getIDocumentSettingAccess().setImagePreferredDPI(nValue);
+ }
+ }
+ break;
+
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}
@@ -1460,6 +1472,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP);
}
break;
+ case HANDLE_IMAGE_PREFERRED_DPI:
+ {
+ rValue <<= mpDoc->getIDocumentSettingAccess().getImagePreferredDPI();
+ }
+ break;
default:
throw UnknownPropertyException(OUString::number(rInfo.mnHandle));
}
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 6eeec4395f04..bec5f57762eb 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2951,6 +2951,11 @@ void SAL_CALL SwXTextDocument::render(
if (0 > nRenderer)
throw IllegalArgumentException();
+ // tdf#135244: prevent jumping to cursor at any temporary modification
+ decltype(pDocShell->LockAllViews()) aLock;
+ if (pDocShell)
+ aLock = pDocShell->LockAllViews();
+
const bool bHasPDFExtOutDevData = lcl_SeqHasProperty( rxOptions, "HasPDFExtOutDevData" );
const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ) || bHasPDFExtOutDevData;
bool bIsSwSrcView = false;
@@ -3167,7 +3172,7 @@ Size SwXTextDocument::getDocumentSize()
aDocSize.Height() + 2 * DOCUMENTBORDER);
}
-void SwXTextDocument::setPart(int nPart)
+void SwXTextDocument::setPart(int nPart, bool /*bAllowChangeFocus*/)
{
SolarMutexGuard aGuard;
@@ -3551,6 +3556,11 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int
SolarMutexGuard aGuard;
SwViewShell* pWrtViewShell = pDocShell->GetWrtShell();
+ if (!pWrtViewShell)
+ {
+ return;
+ }
+
SwViewOption aOption(*(pWrtViewShell->GetViewOptions()));
double fScale = aOption.GetZoom() / (TWIPS_PER_PIXEL * 100.0);
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 85e6d4559608..aa2ec930a743 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -268,6 +268,26 @@ namespace
return false;
}
+
+// Gets "YPos" for SwRegionContent, i.e. a number used to sort sections in Navigator's list
+long getYPosForSection(const SwNodeIndex& rNodeIndex)
+{
+ sal_uLong nIndex = rNodeIndex.GetIndex();
+ if (rNodeIndex.GetNodes().GetEndOfExtras().GetIndex() >= nIndex)
+ {
+ // Not a node of BodyText
+ // Are we in a fly?
+ if (const auto pFlyFormat = rNodeIndex.GetNode().GetFlyFormat())
+ {
+ // Get node index of anchor
+ if (auto pSwPosition = pFlyFormat->GetAnchor().GetContentAnchor())
+ {
+ nIndex = getYPosForSection(pSwPosition->nNode);
+ }
+ }
+ }
+ return static_cast<long>(nIndex);
+}
} // end of anonymous namespace
SwContentType::SwContentType(SwWrtShell* pShell, ContentTypeId nType, sal_uInt8 nLevel) :
@@ -359,18 +379,20 @@ void SwContentType::Init(bool* pbInvalidateWindow)
pOldMember = std::move(m_pMember);
m_pMember.reset( new SwContentArr );
}
- const Point aNullPt;
m_nMemberCount = m_pWrtShell->GetSectionFormatCount();
for(size_t i = 0; i < m_nMemberCount; ++i)
{
- const SwSectionFormat* pFormat;
- SectionType eTmpType;
- if( (pFormat = &m_pWrtShell->GetSectionFormat(i))->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ const SwSectionFormat* pFormat = &m_pWrtShell->GetSectionFormat(i);
+ if (!pFormat->IsInNodesArr())
+ continue;
+ const SwSection* pSection = pFormat->GetSection();
+ if (SectionType eTmpType = pSection->GetType();
+ eTmpType == TOX_CONTENT_SECTION || eTmpType == TOX_HEADER_SECTION)
+ continue;
+ const SwNodeIndex* pNodeIndex = pFormat->GetContent().GetContentIdx();
+ if (pNodeIndex)
{
- const OUString& rSectionName =
- pFormat->GetSection()->GetSectionName();
+ const OUString& rSectionName = pSection->GetSectionName();
sal_uInt8 nLevel = 0;
SwSectionFormat* pParentFormat = pFormat->GetParent();
while(pParentFormat)
@@ -380,8 +402,7 @@ void SwContentType::Init(bool* pbInvalidateWindow)
}
std::unique_ptr<SwContent> pCnt(new SwRegionContent(this, rSectionName,
- nLevel,
- pFormat->FindLayoutRect( false, &aNullPt ).Top()));
+ nLevel, getYPosForSection(*pNodeIndex)));
SwPtrMsgPoolItem aAskItem( RES_CONTENT_VISIBLE, nullptr );
if( !pFormat->GetInfo( aAskItem ) &&
@@ -664,17 +685,20 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
break;
case ContentTypeId::REGION :
{
- const Point aNullPt;
m_nMemberCount = m_pWrtShell->GetSectionFormatCount();
for(size_t i = 0; i < m_nMemberCount; ++i)
{
- const SwSectionFormat* pFormat;
- SectionType eTmpType;
- if( (pFormat = &m_pWrtShell->GetSectionFormat(i))->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ const SwSectionFormat* pFormat = &m_pWrtShell->GetSectionFormat(i);
+ if (!pFormat->IsInNodesArr())
+ continue;
+ const SwSection* pSection = pFormat->GetSection();
+ if (SectionType eTmpType = pSection->GetType();
+ eTmpType == TOX_CONTENT_SECTION || eTmpType == TOX_HEADER_SECTION)
+ continue;
+ const SwNodeIndex* pNodeIndex = pFormat->GetContent().GetContentIdx();
+ if (pNodeIndex)
{
- OUString sSectionName = pFormat->GetSection()->GetSectionName();
+ const OUString& sSectionName = pSection->GetSectionName();
sal_uInt8 nLevel = 0;
SwSectionFormat* pParentFormat = pFormat->GetParent();
@@ -685,8 +709,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
}
std::unique_ptr<SwContent> pCnt(new SwRegionContent(this, sSectionName,
- nLevel,
- pFormat->FindLayoutRect( false, &aNullPt ).Top()));
+ nLevel, getYPosForSection(*pNodeIndex)));
if( !pFormat->GetInfo( aAskItem ) &&
!aAskItem.pObject ) // not visible
pCnt->SetInvisible();
@@ -3532,7 +3555,7 @@ void SwContentTree::EditEntry(SvTreeListEntry const * pEntry, EditEntryMode nMod
if(nMode == EditEntryMode::DELETE)
{
IDocumentMarkAccess* const pMarkAccess = m_pActiveShell->getIDocumentMarkAccess();
- pMarkAccess->deleteMark( pMarkAccess->findMark(pCnt->GetName()) );
+ pMarkAccess->deleteMark(pMarkAccess->findMark(pCnt->GetName()), false);
}
else if(nMode == EditEntryMode::RENAME)
{
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index e016ab69910f..29bdd3938cde 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -512,7 +512,7 @@ void SwNavigationPI::MakeMark()
// nAutoMarkIdx rotates through the available MarkNames
// this assumes that IDocumentMarkAccess generates Names in ascending order
if(vNavMarkNames.size() == MAX_MARKS)
- pMarkAccess->deleteMark(pMarkAccess->findMark(vNavMarkNames[m_nAutoMarkIdx]));
+ pMarkAccess->deleteMark(pMarkAccess->findMark(vNavMarkNames[m_nAutoMarkIdx]), false);
rSh.SetBookmark(vcl::KeyCode(), OUString(), IDocumentMarkAccess::MarkType::NAVIGATOR_REMINDER);
SwView::SetActMark( m_nAutoMarkIdx );
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 077a1b5f2968..87e33096ffa5 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -344,8 +344,23 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
if( bSetGrfSize )
{
- Size aGrfSize, aBound = GetGraphicDefaultSize();
- GetGrfSize( aGrfSize );
+ Size aSizePixel = rGrf.GetSizePixel();
+ Size aBound = GetGraphicDefaultSize();
+
+ sal_Int32 nPreferredDPI = mxDoc->getIDocumentSettingAccess().getImagePreferredDPI();
+ Size aGrfSize;
+
+ if (nPreferredDPI > 0)
+ {
+ constexpr double fTwipsInAnInch = 1444.0;
+ auto nWidth = (aSizePixel.Width() / double(nPreferredDPI)) * fTwipsInAnInch;
+ auto nHeight = (aSizePixel.Height() / double(nPreferredDPI)) * fTwipsInAnInch;
+ aGrfSize = Size(nWidth, nHeight);
+ }
+ else
+ {
+ GetGrfSize(aGrfSize);
+ }
// Add the margin attributes to GrfSize,
// because these counts at the margin additionally
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index fcd660e9ad51..658d795f3e4c 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -479,6 +479,7 @@
<menu:menuitem menu:id=".uno:ColorSettings"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:GraphicDialog"/>
+ <menu:menuitem menu:id=".uno:GraphicSizeCheck"/>
</menu:menupopup>
</menu:menu>
<menu:menu menu:id=".uno:FormatObjectMenu">
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index dc0aac9e3f19..0c18afa0ccdc 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -487,6 +487,7 @@
<menu:menuitem menu:id=".uno:ColorSettings"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:GraphicDialog"/>
+ <menu:menuitem menu:id=".uno:GraphicSizeCheck"/>
</menu:menupopup>
</menu:menu>
<menu:menu menu:id=".uno:FormatObjectMenu">
diff --git a/sw/uiconfig/swriter/ui/mmselectpage.ui b/sw/uiconfig/swriter/ui/mmselectpage.ui
index 414cb0455ec5..323af20266fd 100644
--- a/sw/uiconfig/swriter/ui/mmselectpage.ui
+++ b/sw/uiconfig/swriter/ui/mmselectpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
+<!-- Generated with glade 3.22.2 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkBox" id="MMSelectPage">
@@ -55,7 +55,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">3</property>
</packing>
</child>
<child>
@@ -72,7 +72,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
@@ -89,7 +89,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">6</property>
</packing>
</child>
<child>
@@ -105,7 +105,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">8</property>
</packing>
</child>
<child>
@@ -116,7 +116,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">7</property>
+ <property name="top_attach">9</property>
</packing>
</child>
<child>
@@ -131,7 +131,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
@@ -146,7 +146,39 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="datasourcewarning">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin_left">18</property>
+ <property name="margin_start">18</property>
+ <property name="label" translatable="yes" context="mmselectpage|extended_tip|datasourcewarning">Data source of the current document is not registered. Please exchange database.</property>
+ <attributes>
+ <attribute name="foreground" value="#cccc00000000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="exchangedatabase">
+ <property name="label" translatable="yes" context="mmselectpage|extended_tip|exchangedatabase">Exchange Database...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">start</property>
+ <property name="margin_left">18</property>
+ <property name="margin_start">18</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
</packing>
</child>
</object>
diff --git a/sw/uiconfig/swriter/ui/notebookbar_online.ui b/sw/uiconfig/swriter/ui/notebookbar_online.ui
new file mode 100644
index 000000000000..3626086288dc
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/notebookbar_online.ui
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface domain="sw">
+ <requires lib="gtk+" version="3.18"/>
+ <requires lib="LibreOffice" version="1.0"/>
+ <!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="font">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkToolButton" id="Home-CharFontName">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="action_name">.uno:CharFontName</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="fontheight">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_left">5</property>
+ <child>
+ <object class="GtkToolButton" id="Home-FontHeight">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">.uno:FontHeight</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-NotebookbarToolBox" id="SectionBottom127">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="toolbar_style">icons</property>
+ <property name="show_arrow">False</property>
+ <child>
+ <object class="GtkToolButton" id="Home-StylesPreview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="hexpand">True</property>
+ <property name="action_name">.uno:StylesPreview</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>
diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec
index ea618ca4ab77..e49833814b71 100644
--- a/sysui/desktop/freedesktop/freedesktop-menus.spec
+++ b/sysui/desktop/freedesktop/freedesktop-menus.spec
@@ -33,7 +33,7 @@ Conflicts: %pkgprefix-mandriva-menus
BuildArch: noarch
AutoReqProv: no
%define _binary_filedigest_algorithm 1
-%define _binary_payload w9.gzdio
+%define _binary_payload w1T.xzdio
%define gnome_dir /usr
%define gnome_mime_theme hicolor
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 38420ba384d2..9cfe7b876ad5 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -144,9 +144,11 @@ OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath)
xmlXPathFreeObject(pXmlObj);
return convertedVal;
}
+#if LIBXML_VERSION < 21000 || defined(LIBXML_XPTR_LOCS_ENABLED)
case XPATH_POINT:
case XPATH_RANGE:
case XPATH_LOCATIONSET:
+#endif
case XPATH_USERS:
case XPATH_XSLT_TREE:
xmlXPathFreeObject(pXmlObj);
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 2121e14c3e15..e79ceefbacbf 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -2535,17 +2535,17 @@ void SAL_CALL VCLXToolkit::pause(sal_Int32 nMilliseconds)
void SAL_CALL VCLXToolkit::startRecording()
{
- ::comphelper::ProfileRecording::startRecording(true);
+ comphelper::TraceEvent::startRecording();
}
void SAL_CALL VCLXToolkit::stopRecording()
{
- ::comphelper::ProfileRecording::startRecording( false );
+ comphelper::TraceEvent::stopRecording();
}
css::uno::Sequence< OUString > VCLXToolkit::getRecordingAndClear()
{
- return ::comphelper::ProfileRecording::getRecordingAndClear();
+ return comphelper::ProfileZone::getRecordingAndClear();
}
// css:awt:XToolkitRobot
diff --git a/tools/qa/cppunit/test_json_writer.cxx b/tools/qa/cppunit/test_json_writer.cxx
index 6a2cc7813574..6ff2810d79d4 100644
--- a/tools/qa/cppunit/test_json_writer.cxx
+++ b/tools/qa/cppunit/test_json_writer.cxx
@@ -58,7 +58,7 @@ void JsonWriterTest::test1()
std::unique_ptr<char, Free> result(aJson.extractData());
CPPUNIT_ASSERT_EQUAL(std::string("{ \"node\": { \"oustring\": \"val1\", \"ostring\": \"val2\", "
- "\"charptr\": \"val3\", \"int\": 12}}"),
+ "\"charptr\": \"val3\", \"int\": \"12\"}}"),
std::string(result.get()));
}
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 7c182818c460..d7360af6419c 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -29,12 +29,10 @@
OString Pair::toString() const
{
- std::stringstream ss;
// Note that this is not just used for debugging output but the
// format is parsed by external code (passed in callbacks to
// LibreOfficeKit clients). So don't change.
- ss << A() << ", " << B();
- return ss.str().c_str();
+ return OString::number(A()) + ", " + OString::number(B());
}
void tools::Rectangle::SetSize( const Size& rSize )
@@ -185,12 +183,10 @@ bool tools::Rectangle::IsOver( const tools::Rectangle& rRect ) const
OString tools::Rectangle::toString() const
{
- std::stringstream ss;
// Note that this is not just used for debugging output but the
// format is parsed by external code (passed in callbacks to
// LibreOfficeKit clients). So don't change.
- ss << getX() << ", " << getY() << ", " << getWidth() << ", " << getHeight();
- return ss.str().c_str();
+ return OString::number(getX()) + ", " + OString::number(getY()) + ", " + OString::number(getWidth()) + ", " + OString::number(getHeight());
}
void tools::Rectangle::expand(long nExpandBy)
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 0a597fdff1fc..b549f1cd65c1 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -251,7 +251,7 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c
}
- if( ( nRadX > 32 ) && ( nRadY > 32 ) && ( nRadX + nRadY ) < 8192 )
+ if (nRadX > 32 && nRadY > 32 && o3tl::saturating_add(nRadX, nRadY) < 8192)
nPoints >>= 1;
// compute threshold
diff --git a/tools/source/misc/json_writer.cxx b/tools/source/misc/json_writer.cxx
index 9319db2799bc..aa78b44549da 100644
--- a/tools/source/misc/json_writer.cxx
+++ b/tools/source/misc/json_writer.cxx
@@ -121,7 +121,7 @@ void JsonWriter::endStruct()
void JsonWriter::put(const char* pPropName, const OUString& rPropVal)
{
auto nPropNameLength = strlen(pPropName);
- auto nWorstCasePropValLength = rPropVal.getLength() * 2;
+ auto nWorstCasePropValLength = rPropVal.getLength() * 3;
ensureSpace(nPropNameLength + nWorstCasePropValLength + 8);
addCommaBeforeField();
@@ -159,6 +159,13 @@ void JsonWriter::put(const char* pPropName, const OUString& rPropVal)
*mPos = 'n';
++mPos;
}
+ else if (ch == '\t')
+ {
+ *mPos = '\\';
+ ++mPos;
+ *mPos = 't';
+ ++mPos;
+ }
else if (ch == '\r')
{
*mPos = '\\';
@@ -214,7 +221,7 @@ void JsonWriter::put(const char* pPropName, const OUString& rPropVal)
void JsonWriter::put(const char* pPropName, const OString& rPropVal)
{
auto nPropNameLength = strlen(pPropName);
- auto nWorstCasePropValLength = rPropVal.getLength();
+ auto nWorstCasePropValLength = rPropVal.getLength() * 2;
ensureSpace(nPropNameLength + nWorstCasePropValLength + 8);
addCommaBeforeField();
@@ -318,7 +325,7 @@ void JsonWriter::put(const char* pPropName, int nPropVal)
memcpy(mPos, "\": ", 3);
mPos += 3;
- mPos += sprintf(mPos, "%d", nPropVal);
+ mPos += sprintf(mPos, "\"%d\"", nPropVal);
}
void JsonWriter::putRaw(const rtl::OStringBuffer& rRawBuf)
diff --git a/translations b/translations
-Subproject 0c8c6b0d6280466e025e5b5bcfb4d2db1399c87
+Subproject 56a45d8aa92aa087c1e74d80d666905f1356f33
diff --git a/ucb/source/ucp/webdav/SerfUri.cxx b/ucb/source/ucp/webdav/SerfUri.cxx
index f146dfade70b..1d0745f10260 100644
--- a/ucb/source/ucp/webdav/SerfUri.cxx
+++ b/ucb/source/ucp/webdav/SerfUri.cxx
@@ -90,9 +90,9 @@ SerfUri::SerfUri( const OUString & inUri )
void SerfUri::init( const apr_uri_t * pUri )
{
- mScheme = OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 );
- mUserInfo = OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 );
- mHostName = OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 );
+ mScheme = pUri->scheme ? OStringToOUString( pUri->scheme, RTL_TEXTENCODING_UTF8 ) : "";
+ mUserInfo = pUri->user ? OStringToOUString( pUri->user, RTL_TEXTENCODING_UTF8 ) : "";
+ mHostName = pUri->hostname ? OStringToOUString( pUri->hostname, RTL_TEXTENCODING_UTF8 ) : "";
mPort = pUri->port;
mPath = OStringToOUString( pUri->path, RTL_TEXTENCODING_UTF8 );
diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx
index e25fc8fd2f67..0066160a985b 100644
--- a/unotest/source/cpp/macros_test.cxx
+++ b/unotest/source/cpp/macros_test.cxx
@@ -13,6 +13,8 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/frame/DispatchHelper.hpp>
#include <cppunit/TestAssert.h>
#include <rtl/ustrbuf.hxx>
@@ -21,6 +23,7 @@
#include <osl/file.hxx>
#include <osl/process.h>
#include <osl/thread.h>
+#include <comphelper/processfactory.hxx>
using namespace css;
@@ -115,6 +118,23 @@ void MacrosTest::tearDownNssGpg()
(void)this;
#endif
}
+
+void MacrosTest::dispatchCommand(const uno::Reference<lang::XComponent>& xComponent,
+ const OUString& rCommand,
+ const uno::Sequence<beans::PropertyValue>& rPropertyValues)
+{
+ uno::Reference<frame::XController> xController
+ = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
+ CPPUNIT_ASSERT(xController.is());
+ uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xFrame.is());
+
+ uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
+ uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext));
+ CPPUNIT_ASSERT(xDispatchHelper.is());
+
+ xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues);
+}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unoxml/source/xpath/xpathobject.cxx b/unoxml/source/xpath/xpathobject.cxx
index 2a055f10cdc4..6da7ed351f80 100644
--- a/unoxml/source/xpath/xpathobject.cxx
+++ b/unoxml/source/xpath/xpathobject.cxx
@@ -44,12 +44,14 @@ namespace XPath
return XPathObjectType_XPATH_NUMBER;
case XPATH_STRING:
return XPathObjectType_XPATH_STRING;
+#if LIBXML_VERSION < 21000 || defined(LIBXML_XPTR_LOCS_ENABLED)
case XPATH_POINT:
return XPathObjectType_XPATH_POINT;
case XPATH_RANGE:
return XPathObjectType_XPATH_RANGE;
case XPATH_LOCATIONSET:
return XPathObjectType_XPATH_LOCATIONSET;
+#endif
case XPATH_USERS:
return XPathObjectType_XPATH_USERS;
case XPATH_XSLT_TREE:
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index 4835a485dd2a..5764e62cb1c6 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -436,8 +436,9 @@ executeMasterPasswordDialog(
OUStringBuffer aBuffer;
for (sal_uInt8 i : aKey)
{
- aBuffer.append(static_cast< sal_Unicode >('a' + (i >> 4)));
- aBuffer.append(static_cast< sal_Unicode >('a' + (i & 15)));
+ // match PasswordContainer::DecodePasswords aMasterPasswd.copy(index * 2, 2).toUInt32(16));
+ aBuffer.append(OUString::number(i >> 4, 16));
+ aBuffer.append(OUString::number(i & 15, 16));
}
rInfo.SetPassword(aBuffer.makeStringAndClear());
}
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index c63c0a3f9499..be647c8cf509 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -23,9 +23,10 @@
#include <comphelper/documentconstants.hxx>
#include <comphelper/processfactory.hxx>
#include <vcl/svapp.hxx>
-#include <osl/file.h>
+#include <osl/file.hxx>
#include <sal/macros.h>
#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
#include <unotools/resmgr.hxx>
#include <com/sun/star/security/NoPasswordException.hpp>
@@ -89,9 +90,11 @@ IMPL_STATIC_LINK_NOARG(MacroWarning, InstallLOKNotifierHdl, void*, vcl::ILibreOf
void MacroWarning::SetDocumentURL( const OUString& rDocURL )
{
- OUString aAbbreviatedPath;
- osl_abbreviateSystemPath(rDocURL.pData, &aAbbreviatedPath.pData, 50, nullptr);
- m_xDialog->set_primary_text(aAbbreviatedPath);
+ OUString aPath;
+
+ osl::FileBase::getFileURLFromSystemPath(rDocURL, aPath);
+ aPath = INetURLObject(aPath).GetLastName();
+ m_xDialog->set_primary_text(aPath);
}
IMPL_LINK_NOARG(MacroWarning, ViewSignsBtnHdl, weld::Button&, void)
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index ee55df6b651e..0c0462115ad6 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -445,7 +445,7 @@ void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell co
void WaitUntilPreviewIsClosed( SfxViewFrame* pViewFrame )
{
- while ( pViewFrame && isInPrintPreview( pViewFrame ) )
+ while ( pViewFrame && isInPrintPreview( pViewFrame ) && !Application::IsQuit())
Application::Yield();
}
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 15a083df19a6..1916292b5c36 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -318,6 +318,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/gdi/scrptrun \
vcl/source/gdi/CommonSalLayout \
vcl/source/gdi/TypeSerializer \
+ vcl/source/pdf/PdfConfig \
vcl/source/pdf/PDFiumLibrary \
vcl/source/pdf/ExternalPDFStreams \
vcl/source/graphic/GraphicID \
@@ -473,6 +474,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/backendtest/outputdevice/polyline \
vcl/backendtest/outputdevice/polyline_b2d \
vcl/backendtest/outputdevice/rectangle \
+ vcl/jsdialog/enabled \
vcl/jsdialog/jsdialogbuilder \
vcl/jsdialog/executor \
))
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index afcb9956c2cf..1f62de43c3b6 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1670,6 +1670,7 @@ bool SvpSalGraphics::drawGradient(const tools::PolyPolygon& rPolyPolygon, const
1.0);
cairo_set_source(cr, pattern);
+ cairo_pattern_destroy(pattern);
basegfx::B2DRange extents = getClippedFillDamage(cr);
cairo_fill_preserve(cr);
@@ -1689,8 +1690,7 @@ bool SvpSalGraphics::implDrawGradient(basegfx::B2DPolyPolygon const & rPolyPolyg
for (auto const & rPolygon : rPolyPolygon)
AddPolygonToPath(cr, rPolygon, rObjectToDevice, !getAntiAliasB2DDraw(), false);
- cairo_pattern_t* pattern;
- pattern = cairo_pattern_create_linear(rGradient.maPoint1.getX(), rGradient.maPoint1.getY(), rGradient.maPoint2.getX(), rGradient.maPoint2.getY());
+ cairo_pattern_t* pattern = cairo_pattern_create_linear(rGradient.maPoint1.getX(), rGradient.maPoint1.getY(), rGradient.maPoint2.getX(), rGradient.maPoint2.getY());
for (SalGradientStop const & rStop : rGradient.maStops)
{
@@ -1703,6 +1703,7 @@ bool SvpSalGraphics::implDrawGradient(basegfx::B2DPolyPolygon const & rPolyPolyg
cairo_pattern_add_color_stop_rgba(pattern, offset, r, g, b, a);
}
cairo_set_source(cr, pattern);
+ cairo_pattern_destroy(pattern);
basegfx::B2DRange extents = getClippedFillDamage(cr);
cairo_fill_preserve(cr);
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 303ee40f4da7..4694a9e4bff4 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -59,6 +59,7 @@
// FIXME: remove when we re-work the svp mainloop
#include <unx/salunxtime.h>
#include <comphelper/lok.hxx>
+#include <comphelper/profilezone.hxx>
SvpSalInstance* SvpSalInstance::s_pDefaultInstance = nullptr;
@@ -483,6 +484,8 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
if (pSVData->mpPollCallback)
{
+ comphelper::ProfileZone("mpPollCallback invocation");
+
// Poll for events from the LOK client.
if (nTimeoutMicroS < 0)
nTimeoutMicroS = 5000 * 1000;
diff --git a/vcl/inc/jsdialog/enabled.hxx b/vcl/inc/jsdialog/enabled.hxx
new file mode 100644
index 000000000000..34116b41c009
--- /dev/null
+++ b/vcl/inc/jsdialog/enabled.hxx
@@ -0,0 +1,20 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <rtl/ustring.hxx>
+
+namespace jsdialog
+{
+bool isBuilderEnabled(const OUString& rUIFile, bool bMobile);
+bool isInterimBuilderEnabledForNotebookbar(const OUString& rUIFile);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 24dbf8744d03..d826e6625606 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -259,12 +259,17 @@ public:
bool bTakeOwnership = false) override;
virtual std::unique_ptr<weld::RadioButton>
weld_radio_button(const OString& id, bool bTakeOwnership = false) override;
+ virtual std::unique_ptr<weld::Image> weld_image(const OString& id,
+ bool bTakeOwnership = false) override;
static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent,
VclMessageType eMessageType,
VclButtonsType eButtonType,
const OUString& rPrimaryMessage);
+ static void AddChildWidget(sal_uInt64 nWindowId, const OString& id, weld::Widget* pWidget);
+ static void RemoveWindowWidget(sal_uInt64 nWindowId);
+
private:
const std::string& GetTypeOfJSON();
VclPtr<vcl::Window>& GetContentWindow();
@@ -466,11 +471,17 @@ public:
class JSMessageDialog : public JSWidget<SalInstanceMessageDialog, ::MessageDialog>
{
std::unique_ptr<JSDialogSender> m_pOwnedSender;
+ std::unique_ptr<JSButton> m_pOK;
+ std::unique_ptr<JSButton> m_pCancel;
+
+ DECL_LINK(OKHdl, weld::Button&, void);
+ DECL_LINK(CancelHdl, weld::Button&, void);
public:
JSMessageDialog(JSDialogSender* pSender, ::MessageDialog* pDialog, SalInstanceBuilder* pBuilder,
bool bTakeOwnership);
JSMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+ virtual ~JSMessageDialog();
virtual void set_primary_text(const OUString& rText) override;
@@ -588,4 +599,11 @@ public:
virtual void set_active(bool active) override;
};
+class JSImage : public JSWidget<SalInstanceImage, FixedImage>
+{
+public:
+ JSImage(JSDialogSender* pSender, FixedImage* pImage, SalInstanceBuilder* pBuilder,
+ bool bTakeOwnership);
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/inc/pdf/ExternalPDFStreams.hxx b/vcl/inc/pdf/ExternalPDFStreams.hxx
index 3bd59478c212..de0819539e76 100644
--- a/vcl/inc/pdf/ExternalPDFStreams.hxx
+++ b/vcl/inc/pdf/ExternalPDFStreams.hxx
@@ -29,21 +29,25 @@ struct VCL_DLLPUBLIC ExternalPDFStream
std::map<sal_Int32, sal_Int32>& getCopiedResources() { return maCopiedResources; }
- filter::PDFDocument& getPDFDocument()
+ std::shared_ptr<filter::PDFDocument>& getPDFDocument()
{
if (!mpPDFDocument)
{
SvMemoryStream aPDFStream;
aPDFStream.WriteBytes(maData.data(), maData.size());
aPDFStream.Seek(0);
- mpPDFDocument = std::make_unique<filter::PDFDocument>();
- if (!mpPDFDocument->Read(aPDFStream))
+ auto pPDFDocument = std::make_shared<filter::PDFDocument>();
+ if (!pPDFDocument->Read(aPDFStream))
{
SAL_WARN("vcl.pdfwriter",
"PDFWriterImpl::writeReferenceXObject: reading the PDF document failed");
}
+ else
+ {
+ mpPDFDocument = pPDFDocument;
+ }
}
- return *mpPDFDocument;
+ return mpPDFDocument;
}
};
diff --git a/vcl/inc/pdf/PdfConfig.hxx b/vcl/inc/pdf/PdfConfig.hxx
new file mode 100644
index 000000000000..235fd008ea2b
--- /dev/null
+++ b/vcl/inc/pdf/PdfConfig.hxx
@@ -0,0 +1,18 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+namespace vcl::pdf
+{
+double getDefaultPdfResolutionDpi();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx
index 405e25c0197e..bfc8343bf65b 100644
--- a/vcl/ios/DataFlavorMapping.cxx
+++ b/vcl/ios/DataFlavorMapping.cxx
@@ -74,9 +74,7 @@ NSString* OUStringToNSString(const OUString& ustring)
return [NSString stringWithCString:utf8Str.getStr() encoding:NSUTF8StringEncoding];
}
-NSString* PBTYPE_PLAINTEXT = (__bridge NSString*)kUTTypePlainText;
-// Nope. See commented-out use below.
-// NSString* PBTYPE_UTF8PLAINTEXT = (__bridge NSString*)kUTTypeUTF8PlainText;
+NSString* PBTYPE_UTF8PLAINTEXT = (__bridge NSString*)kUTTypeUTF8PlainText;
NSString* PBTYPE_RTF = (__bridge NSString*)kUTTypeRTF;
NSString* PBTYPE_PNG = (__bridge NSString*)kUTTypePNG;
NSString* PBTYPE_JPEG = (__bridge NSString*)kUTTypeJPEG;
@@ -118,9 +116,7 @@ struct FlavorMap
// lcl_TestFormat() in sc/source/ui/view/cellsh.cxx.
static const FlavorMap flavorMap[]
- = { { PBTYPE_PLAINTEXT, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", true },
- // Nope. The LO code does not understand text/plain in UTF-8. Which is a shame.
- // PBTYPE_UTF8PLAINTEXT, "text/plain;charset=utf-8", "Unicode Text (UTF-8)", false },
+ = { { PBTYPE_UTF8PLAINTEXT, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", true },
{ PBTYPE_RTF, "text/rtf", "Rich Text Format", false },
{ PBTYPE_PNG, "image/png", "Portable Network Graphics", false },
{ PBTYPE_JPEG, "image/jpeg", "JPEG", false },
@@ -183,27 +179,27 @@ DataProviderBaseImpl::~DataProviderBaseImpl()
}
}
-class UniDataProvider : public DataProviderBaseImpl
+class Utf8DataProvider : public DataProviderBaseImpl
{
public:
- UniDataProvider(const Any& data);
- UniDataProvider(NSData* data);
+ Utf8DataProvider(const Any& data);
+ Utf8DataProvider(NSData* data);
NSData* getSystemData() override;
Any getOOoData() override;
};
-UniDataProvider::UniDataProvider(const Any& data)
+Utf8DataProvider::Utf8DataProvider(const Any& data)
: DataProviderBaseImpl(data)
{
}
-UniDataProvider::UniDataProvider(NSData* data)
+Utf8DataProvider::Utf8DataProvider(NSData* data)
: DataProviderBaseImpl(data)
{
}
-NSData* UniDataProvider::getSystemData()
+NSData* Utf8DataProvider::getSystemData()
{
OUString ustr;
mData >>= ustr;
@@ -214,7 +210,7 @@ NSData* UniDataProvider::getSystemData()
return [NSData dataWithBytes:strUtf8.getStr() length:strUtf8.getLength()];
}
-Any UniDataProvider::getOOoData()
+Any Utf8DataProvider::getOOoData()
{
Any oOOData;
@@ -464,7 +460,7 @@ DataFlavorMapper::getDataProvider(const NSString* systemFlavor,
else // Must be OUString type
{
SAL_WARN_IF(!isOUStringType(data.getValueType()), "vcl", "must be OUString type");
- dp = DataProviderPtr_t(new UniDataProvider(data));
+ dp = DataProviderPtr_t(new Utf8DataProvider(data));
}
}
catch (const UnsupportedFlavorException& e)
@@ -483,9 +479,12 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider(const NSString* systemFlavor
{
DataProviderPtr_t dp;
- if ([systemFlavor caseInsensitiveCompare:PBTYPE_PLAINTEXT] == NSOrderedSame)
+ if (systemData == nil)
+ return dp;
+
+ if ([systemFlavor caseInsensitiveCompare:PBTYPE_UTF8PLAINTEXT] == NSOrderedSame)
{
- dp = DataProviderPtr_t(new UniDataProvider(systemData));
+ dp = DataProviderPtr_t(new Utf8DataProvider(systemData));
}
else if ([systemFlavor caseInsensitiveCompare:PBTYPE_HTML] == NSOrderedSame)
{
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
new file mode 100644
index 000000000000..ab1cc9852d74
--- /dev/null
+++ b/vcl/jsdialog/enabled.cxx
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <jsdialog/enabled.hxx>
+
+namespace jsdialog
+{
+bool isBuilderEnabled(const OUString& rUIFile, bool bMobile)
+{
+ if (bMobile)
+ {
+ if (rUIFile == "modules/swriter/ui/wordcount-mobile.ui"
+ || rUIFile == "svx/ui/findreplacedialog-mobile.ui"
+ || rUIFile == "modules/swriter/ui/watermarkdialog.ui"
+ || rUIFile == "modules/scalc/ui/validationdialog.ui"
+ || rUIFile == "modules/scalc/ui/validationcriteriapage.ui"
+ || rUIFile == "modules/scalc/ui/validationhelptabpage-mobile.ui"
+ || rUIFile == "modules/scalc/ui/erroralerttabpage-mobile.ui"
+ || rUIFile == "modules/scalc/ui/validationdialog.ui")
+ {
+ return true;
+ }
+ }
+
+ if (rUIFile == "modules/scalc/ui/pivottablelayoutdialog.ui"
+ || rUIFile == "modules/scalc/ui/selectsource.ui"
+ || rUIFile == "modules/scalc/ui/managenamesdialog.ui"
+ || rUIFile == "modules/scalc/ui/definename.ui"
+ || rUIFile == "modules/scalc/ui/correlationdialog.ui"
+ || rUIFile == "modules/scalc/ui/samplingdialog.ui"
+ || rUIFile == "modules/scalc/ui/descriptivestatisticsdialog.ui"
+ || rUIFile == "modules/scalc/ui/analysisofvariancedialog.ui"
+ || rUIFile == "modules/scalc/ui/covariancedialog.ui"
+ || rUIFile == "modules/scalc/ui/exponentialsmoothingdialog.ui"
+ || rUIFile == "modules/scalc/ui/movingaveragedialog.ui"
+ || rUIFile == "modules/scalc/ui/regressiondialog.ui"
+ || rUIFile == "modules/scalc/ui/ttestdialog.ui"
+ || rUIFile == "modules/scalc/ui/ttestdialog.ui"
+ || rUIFile == "modules/scalc/ui/ztestdialog.ui"
+ || rUIFile == "modules/scalc/ui/chisquaretestdialog.ui"
+ || rUIFile == "modules/scalc/ui/fourieranalysisdialog.ui"
+ || rUIFile == "modules/scalc/ui/datafielddialog.ui"
+ || rUIFile == "modules/scalc/ui/pivotfielddialog.ui"
+ || rUIFile == "modules/scalc/ui/datafieldoptionsdialog.ui"
+ || rUIFile == "svx/ui/fontworkgallerydialog.ui"
+ || rUIFile == "cui/ui/macroselectordialog.ui" || rUIFile == "uui/ui/macrowarnmedium.ui"
+ || rUIFile == "modules/scalc/ui/textimportcsv.ui"
+ || rUIFile == "xmlsec/ui/digitalsignaturesdialog.ui"
+ || rUIFile == "xmlsec/ui/viewcertdialog.ui" || rUIFile == "xmlsec/ui/certgeneral.ui"
+ || rUIFile == "xmlsec/ui/viewcertdialog.ui" || rUIFile == "xmlsec/ui/certpage.ui")
+ {
+ return true;
+ }
+
+ return false;
+}
+
+bool isInterimBuilderEnabledForNotebookbar(const OUString& rUIFile)
+{
+ if (rUIFile == "svx/ui/stylespreview.ui" || rUIFile == "modules/scalc/ui/numberbox.ui")
+ {
+ return true;
+ }
+
+ return false;
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index bca3d0a98ea7..4ee9865e5437 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -48,11 +48,27 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
{
weld::Widget* pWidget = JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, rWidget);
- if (pWidget != nullptr)
+ OUString sControlType = rData["type"];
+ OUString sAction = rData["cmd"];
+
+ if (sControlType == "responsebutton")
{
- OUString sControlType = rData["type"];
- OUString sAction = rData["cmd"];
+ if (pWidget == nullptr)
+ {
+ // welded wrapper not found - use response code instead
+ pWidget = JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, "__DIALOG__");
+ sControlType = "dialog";
+ sAction = "response";
+ }
+ else
+ {
+ // welded wrapper for button found - use it
+ sControlType = "pushbutton";
+ }
+ }
+ if (pWidget != nullptr)
+ {
if (sControlType == "tabcontrol")
{
auto pNotebook = dynamic_cast<weld::Notebook*>(pWidget);
@@ -141,7 +157,11 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
{
double posX = std::atof(clickPosX.getStr());
double posY = std::atof(clickPosY.getStr());
- Size size = pArea->get_size_request();
+ OutputDevice& rRefDevice = pArea->get_ref_device();
+ // We send OutPutSize for the drawing area bitmap
+ // get_size_request is not necessarily updated
+ // therefore it may be incorrect.
+ Size size = rRefDevice.GetOutputSize();
posX = posX * size.Width();
posY = posY * size.Height();
LOKTrigger::trigger_click(*pArea, Point(posX, posY));
@@ -242,7 +262,8 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
{
OString nRowString
= OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
- pTreeView->unselect(pTreeView->get_selected_index());
+
+ pTreeView->unselect_all();
int nAbsPos = std::atoi(nRowString.getStr());
@@ -259,7 +280,7 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
= OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
int nRow = std::atoi(nRowString.getStr());
- pTreeView->unselect(pTreeView->get_selected_index());
+ pTreeView->unselect_all();
pTreeView->select(nRow);
pTreeView->set_cursor(nRow);
LOKTrigger::trigger_changed(*pTreeView);
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 3fd84f281ef7..431b9a46df8a 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -520,6 +520,26 @@ void JSInstanceBuilder::RememberWidget(const OString& id, weld::Widget* pWidget)
}
}
+void JSInstanceBuilder::AddChildWidget(sal_uInt64 nWindowId, const OString& id,
+ weld::Widget* pWidget)
+{
+ auto it = GetLOKWeldWidgetsMap().find(nWindowId);
+ if (it != GetLOKWeldWidgetsMap().end())
+ {
+ it->second.erase(id);
+ it->second.insert(WidgetMap::value_type(id, pWidget));
+ }
+}
+
+void JSInstanceBuilder::RemoveWindowWidget(sal_uInt64 nWindowId)
+{
+ auto it = JSInstanceBuilder::GetLOKWeldWidgetsMap().find(nWindowId);
+ if (it != JSInstanceBuilder::GetLOKWeldWidgetsMap().end())
+ {
+ JSInstanceBuilder::GetLOKWeldWidgetsMap().erase(it);
+ }
+}
+
const std::string& JSInstanceBuilder::GetTypeOfJSON() { return m_sTypeOfJSON; }
VclPtr<vcl::Window>& JSInstanceBuilder::GetContentWindow()
@@ -788,6 +808,19 @@ std::unique_ptr<weld::RadioButton> JSInstanceBuilder::weld_radio_button(const OS
return pWeldWidget;
}
+std::unique_ptr<weld::Image> JSInstanceBuilder::weld_image(const OString& id, bool bTakeOwnership)
+{
+ FixedImage* pImage = m_xBuilder->get<FixedImage>(id);
+
+ auto pWeldWidget
+ = pImage ? std::make_unique<JSImage>(this, pImage, this, bTakeOwnership) : nullptr;
+
+ if (pWeldWidget)
+ RememberWidget(id, pWeldWidget.get());
+
+ return pWeldWidget;
+}
+
weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent,
VclMessageType eMessageType,
VclButtonsType eButtonType,
@@ -810,6 +843,8 @@ weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParen
pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str());
}
+ xMessageDialog->SetLOKTunnelingState(false);
+ InsertWindowToMap(xMessageDialog->GetLOKWindowId());
return new JSMessageDialog(xMessageDialog, nullptr, true);
}
@@ -948,6 +983,8 @@ void JSNotebook::set_current_page(int nPage)
SalInstanceNotebook::set_current_page(nPage);
sendFullUpdate(bForce);
+
+ m_aEnterPageHdl.Call(get_current_page_ident());
}
void JSNotebook::set_current_page(const OString& rIdent)
@@ -959,6 +996,8 @@ void JSNotebook::set_current_page(const OString& rIdent)
SalInstanceNotebook::set_current_page(rIdent);
sendFullUpdate(bForce);
+
+ m_aEnterPageHdl.Call(get_current_page_ident());
}
void JSNotebook::remove_page(const OString& rIdent)
@@ -999,8 +1038,39 @@ JSMessageDialog::JSMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* p
, m_pOwnedSender(new JSDialogSender(pDialog, pDialog, "dialog"))
{
m_pSender = m_pOwnedSender.get();
+
+ if (!pBuilder)
+ {
+ if (::OKButton* pOKBtn
+ = dynamic_cast<::OKButton*>(m_xMessageDialog->get_widget_for_response(RET_OK)))
+ {
+ m_pOK.reset(new JSButton(m_pSender, pOKBtn, nullptr, false));
+ JSInstanceBuilder::AddChildWidget(m_xMessageDialog->GetLOKWindowId(),
+ pOKBtn->get_id().toUtf8(), m_pOK.get());
+ m_pOK->connect_clicked(LINK(this, JSMessageDialog, OKHdl));
+ }
+
+ if (::CancelButton* pCancelBtn
+ = dynamic_cast<::CancelButton*>(m_xMessageDialog->get_widget_for_response(RET_CANCEL)))
+ {
+ m_pCancel.reset(new JSButton(m_pSender, pCancelBtn, nullptr, false));
+ JSInstanceBuilder::AddChildWidget(m_xMessageDialog->GetLOKWindowId(),
+ pCancelBtn->get_id().toUtf8(), m_pCancel.get());
+ m_pCancel->connect_clicked(LINK(this, JSMessageDialog, CancelHdl));
+ }
+ }
}
+JSMessageDialog::~JSMessageDialog()
+{
+ if (m_pOK || m_pCancel)
+ JSInstanceBuilder::RemoveWindowWidget(m_xMessageDialog->GetLOKWindowId());
+}
+
+IMPL_LINK_NOARG(JSMessageDialog, OKHdl, weld::Button&, void) { response(RET_OK); }
+
+IMPL_LINK_NOARG(JSMessageDialog, CancelHdl, weld::Button&, void) { response(RET_CANCEL); }
+
void JSMessageDialog::set_primary_text(const OUString& rText)
{
SalInstanceMessageDialog::set_primary_text(rText);
@@ -1276,4 +1346,10 @@ void JSRadioButton::set_active(bool active)
sendUpdate();
}
+JSImage::JSImage(JSDialogSender* pSender, FixedImage* pImage, SalInstanceBuilder* pBuilder,
+ bool bTakeOwnership)
+ : JSWidget<SalInstanceImage, FixedImage>(pSender, pImage, pBuilder, bTakeOwnership)
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/qa/cppunit/PDFDocumentTest.cxx b/vcl/qa/cppunit/PDFDocumentTest.cxx
index 66de7dfc77d4..9b0374f00341 100644
--- a/vcl/qa/cppunit/PDFDocumentTest.cxx
+++ b/vcl/qa/cppunit/PDFDocumentTest.cxx
@@ -156,6 +156,18 @@ CPPUNIT_TEST_FIXTURE(PDFDocumentTest, testParseBasicPDF)
}
}
+CPPUNIT_TEST_FIXTURE(PDFDocumentTest, testParseDocumentWithNullAsWhitespace)
+{
+ // tdf#140606
+ // Bug document contained a null, which cause the parser to panic,
+ // but other PDF readers can handle the file well.
+
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "DocumentWithNull.pdf";
+ vcl::filter::PDFDocument aDocument;
+ SvFileStream aStream(aURL, StreamMode::READ);
+ CPPUNIT_ASSERT(aDocument.Read(aStream));
+}
+
namespace
{
vcl::filter::PDFObjectElement*
diff --git a/vcl/qa/cppunit/PDFiumLibraryTest.cxx b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
index f18681c0adda..54f5e70e00d3 100644
--- a/vcl/qa/cppunit/PDFiumLibraryTest.cxx
+++ b/vcl/qa/cppunit/PDFiumLibraryTest.cxx
@@ -25,6 +25,8 @@
#include <tools/stream.hxx>
#include <vcl/filter/PDFiumLibrary.hxx>
+#include <vcl/pdfread.hxx>
+#include <vcl/bitmapaccess.hxx>
class PDFiumLibraryTest : public test::BootstrapFixtureBase
{
@@ -39,6 +41,7 @@ class PDFiumLibraryTest : public test::BootstrapFixtureBase
void testAnnotationsMadeInEvince();
void testAnnotationsMadeInAcrobat();
void testTools();
+ void testFormFields();
CPPUNIT_TEST_SUITE(PDFiumLibraryTest);
CPPUNIT_TEST(testDocument);
@@ -47,6 +50,7 @@ class PDFiumLibraryTest : public test::BootstrapFixtureBase
CPPUNIT_TEST(testAnnotationsMadeInEvince);
CPPUNIT_TEST(testAnnotationsMadeInAcrobat);
CPPUNIT_TEST(testTools);
+ CPPUNIT_TEST(testFormFields);
CPPUNIT_TEST_SUITE_END();
};
@@ -287,6 +291,41 @@ void PDFiumLibraryTest::testAnnotationsMadeInAcrobat()
}
}
+void PDFiumLibraryTest::testFormFields()
+{
+ // Given a document with a form field that looks like plain text:
+ OUString aURL = getFullUrl(u"form-fields.pdf");
+ SvFileStream aFileStream(aURL, StreamMode::READ);
+ SvMemoryStream aMemory;
+ aMemory.WriteStream(aFileStream);
+ aMemory.Seek(0);
+
+ // When rendering its first (and only) page to a bitmap:
+ std::vector<Bitmap> aBitmaps;
+ int nRet = vcl::RenderPDFBitmaps(aMemory.GetData(), aMemory.GetSize(), aBitmaps);
+ CPPUNIT_ASSERT(nRet);
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aBitmaps.size());
+
+ // Then make sure the bitmap contains that text:
+ Bitmap aBitmap = aBitmaps[0];
+ BitmapReadAccess aAccess(aBitmap);
+ Size aSize = aBitmap.GetSizePixel();
+ std::set<sal_uInt32> aColors;
+ for (long y = 0; y < aSize.Height(); ++y)
+ {
+ for (long x = 0; x < aSize.Width(); ++x)
+ {
+ aColors.insert(static_cast<sal_uInt32>(aAccess.GetPixel(y, x)));
+ }
+ }
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected greater than: 1
+ // - Actual : 1
+ // i.e. at least black text and white background is expected (possibly more, due to
+ // anti-aliasing), but nothing was rendered.
+ CPPUNIT_ASSERT_GREATER(static_cast<size_t>(1), aColors.size());
+}
+
void PDFiumLibraryTest::testTools()
{
OUString sConverted = vcl::pdf::convertPdfDateToISO8601("D:20200612201322+02'00");
diff --git a/vcl/qa/cppunit/data/DocumentWithNull.pdf b/vcl/qa/cppunit/data/DocumentWithNull.pdf
new file mode 100644
index 000000000000..f6d926957366
--- /dev/null
+++ b/vcl/qa/cppunit/data/DocumentWithNull.pdf
Binary files differ
diff --git a/vcl/qa/cppunit/data/form-fields.pdf b/vcl/qa/cppunit/data/form-fields.pdf
new file mode 100644
index 000000000000..a014b36c9821
--- /dev/null
+++ b/vcl/qa/cppunit/data/form-fields.pdf
@@ -0,0 +1,95 @@
+%PDF-1.7
+%
+1 0 obj <<
+ /Type /Catalog
+ /Pages 5 0 R
+>>
+endobj
+
+2 0 obj <<
+ /Length 0
+>>
+stream
+endstream
+endobj
+
+3 0 obj <<
+ /Font <<
+ /TT1 4 0 R
+ >>
+>>
+endobj
+
+4 0 obj <<
+ /Type /Font
+ /Subtype /Type1
+ /Name /TT1
+ /BaseFont/Helvetica
+>>
+endobj
+
+5 0 obj <<
+ /Type /Pages
+ /Kids [6 0 R]
+ /Count 1
+ /MediaBox [ 0 0 612 446 ]
+>>
+endobj
+
+6 0 obj <<
+ /Type /Page
+ /Parent 5 0 R
+ /Resources 3 0 R
+ /Contents 2 0 R
+ /Annots [7 0 R]
+>>
+endobj
+
+7 0 obj <<
+ /Type /Annot
+ /Subtype /Widget
+ /T (T)
+ /V (V)
+ /DA (/Helv 0 Tf 0 g)
+ /Rect [ 0 0 612 446 ]
+ /FT /Tx
+ /AP <<
+ /N 8 0 R
+ >>
+>>
+endobj
+
+8 0 obj <<
+ /Type /XObject
+ /Subtype /Form
+ /Matrix [1.0 0.0 0.0 1.0 0.0 0.0]
+ /Resources 3 0 R
+ /BBox [ 0 0 612 446 ]
+ /Length 55
+>>
+stream
+ BT
+ /TT1 24 Tf
+ 1 0 0 1 260 254 Tm
+ (test)Tj
+ ET
+endstream
+endobj
+xref
+0 9
+0000000000 65535 f
+0000000015 00000 n
+0000000069 00000 n
+0000000121 00000 n
+0000000174 00000 n
+0000000259 00000 n
+0000000351 00000 n
+0000000458 00000 n
+0000000616 00000 n
+trailer <<
+ /Root 1 0 R
+ /Size 9
+>>
+startxref
+836
+%%EOF
diff --git a/vcl/qa/cppunit/filter/ipdf/data/comment-end.pdf b/vcl/qa/cppunit/filter/ipdf/data/comment-end.pdf
new file mode 100644
index 000000000000..6f1ad86f5c99
--- /dev/null
+++ b/vcl/qa/cppunit/filter/ipdf/data/comment-end.pdf
@@ -0,0 +1,69 @@
+%PDF-1.7
+%
+1 0 obj <<
+ /Type /Catalog
+ /Pages 2 0 R
+>>
+endobj
+2 0 obj <<
+ /Type /Pages
+ /MediaBox [0 0 200 300]
+ /Count 1
+ /Kids [3 0 R]
+>>
+endobj
+3 0 obj <<
+ /Type /Page
+ /Parent 2 0 R
+ /Contents 4 0 R
+>>
+endobj
+4 0 obj <<
+ /Length 4
+>>
+stream
+q
+Q
+endstream
+endobj
+xref
+0 5
+0000000000 65535 f
+0000000015 00000 n
+0000000068 00000 n
+0000000157 00000 n
+0000000226 00000 n
+trailer <<
+ /Root 1 0 R
+ /Size 5
+ /Prev 541
+>>
+startxref
+280
+%%EOF %%TEST
+4 0 obj <<
+ /Length 5 0 R
+>>
+stream
+q
+Q
+endstream
+endobj
+5 0 obj
+4
+endobj
+xref
+0 6
+0000000000 65535 f
+0000000015 00000 n
+0000000068 00000 n
+0000000157 00000 n
+0000000466 00000 n
+0000000524 00000 n
+trailer <<
+ /Root 1 0 R
+ /Size 6
+>>
+startxref
+280
+%%EOF
diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
index 5055e36a922e..3307db5c9743 100644
--- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
+++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
@@ -168,6 +168,25 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testDictArrayDict)
CPPUNIT_ASSERT(pKey);
}
+CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testCommentEnd)
+{
+ // Load the test document:
+ // - it has two xrefs
+ // - second xref has an updated page content object with an indirect length
+ // - last startxref refers to the first xref
+ // - first xref has a /Prev to the second xref
+ // - first xref is terminated by a \r, which is not followed by a newline
+ // this means that if reading doesn't stop at the end of the first xref, then we'll try to look
+ // up the offset of the length object, which we don't yet have
+ OUString aSourceURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "comment-end.pdf";
+ SvFileStream aFile(aSourceURL, StreamMode::READ);
+ vcl::filter::PDFDocument aDocument;
+
+ // Without the accompanying fix in place, this test would have failed, because Tokenize() didn't
+ // stop at the end of the first xref.
+ CPPUNIT_ASSERT(aDocument.Read(aFile));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/graphicfilter/data/bmp/fail/crash-1.bmp b/vcl/qa/cppunit/graphicfilter/data/bmp/pass/crash-1.bmp
index 84b6c35c87e6..84b6c35c87e6 100644
--- a/vcl/qa/cppunit/graphicfilter/data/bmp/fail/crash-1.bmp
+++ b/vcl/qa/cppunit/graphicfilter/data/bmp/pass/crash-1.bmp
Binary files differ
diff --git a/vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odg b/vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odg
new file mode 100644
index 000000000000..6dee0145c536
--- /dev/null
+++ b/vcl/qa/cppunit/pdfexport/data/pdf-image-annots.odg
Binary files differ
diff --git a/vcl/qa/cppunit/pdfexport/data/pdf-image-hyperlink.odg b/vcl/qa/cppunit/pdfexport/data/pdf-image-hyperlink.odg
new file mode 100644
index 000000000000..aa0f89300b2c
--- /dev/null
+++ b/vcl/qa/cppunit/pdfexport/data/pdf-image-hyperlink.odg
Binary files differ
diff --git a/vcl/qa/cppunit/pdfexport/data/pdf-image-rotate-180.pdf b/vcl/qa/cppunit/pdfexport/data/pdf-image-rotate-180.pdf
new file mode 100644
index 000000000000..981ca32061cd
--- /dev/null
+++ b/vcl/qa/cppunit/pdfexport/data/pdf-image-rotate-180.pdf
Binary files differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 5f50661b013e..fc7103fede47 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -38,6 +38,7 @@
#include <fpdfview.h>
#include <vcl/graphicfilter.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <rtl/math.hxx>
#include <vcl/filter/PDFiumLibrary.hxx>
@@ -146,6 +147,9 @@ public:
void testVersion15();
void testDefaultVersion();
void testMultiPagePDF();
+ void testPdfImageRotate180();
+ void testPdfImageHyperlink();
+ void testPdfImageAnnots();
CPPUNIT_TEST_SUITE(PdfExportTest);
@@ -189,6 +193,9 @@ public:
CPPUNIT_TEST(testVersion15);
CPPUNIT_TEST(testDefaultVersion);
CPPUNIT_TEST(testMultiPagePDF);
+ CPPUNIT_TEST(testPdfImageRotate180);
+ CPPUNIT_TEST(testPdfImageHyperlink);
+ CPPUNIT_TEST(testPdfImageAnnots);
CPPUNIT_TEST_SUITE_END();
};
@@ -2180,6 +2187,182 @@ void PdfExportTest::testMultiPagePDF()
#endif
}
+void PdfExportTest::testPdfImageRotate180()
+{
+ // Create an empty document.
+ uno::Reference<lang::XComponent> xComponent = loadFromDesktop("private:factory/swriter");
+ uno::Reference<text::XTextDocument> xTextDocument(xComponent, uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextDocument->getText();
+ uno::Reference<text::XTextCursor> xCursor = xText->createTextCursor();
+
+ // Insert the PDF image.
+ uno::Reference<lang::XMultiServiceFactory> xFactory(xComponent, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xGraphicObject(
+ xFactory->createInstance("com.sun.star.text.TextGraphicObject"), uno::UNO_QUERY);
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "pdf-image-rotate-180.pdf";
+ xGraphicObject->setPropertyValue("GraphicURL", uno::makeAny(aURL));
+ uno::Reference<drawing::XShape> xShape(xGraphicObject, uno::UNO_QUERY);
+ xShape->setSize(awt::Size(1000, 1000));
+ uno::Reference<text::XTextContent> xTextContent(xGraphicObject, uno::UNO_QUERY);
+ xText->insertTextContent(xCursor->getStart(), xTextContent, /*bAbsorb=*/false);
+
+ // Save as PDF.
+ uno::Reference<frame::XStorable> xStorable(xComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+ xComponent->dispose();
+
+ // Parse the export result.
+ SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ);
+ SvMemoryStream aMemory;
+ aMemory.WriteStream(aFile);
+ DocumentHolder pPdfDocument(FPDF_LoadMemDocument(aMemory.GetData(), aMemory.GetSize(), /*password=*/nullptr));
+ CPPUNIT_ASSERT_EQUAL(1, FPDF_GetPageCount(pPdfDocument.get()));
+
+ // Make sure that the page -> form -> form has a child image.
+ PageHolder pPdfPage(FPDF_LoadPage(pPdfDocument.get(), /*page_index=*/0));
+ CPPUNIT_ASSERT(pPdfPage.get());
+ CPPUNIT_ASSERT_EQUAL(1, FPDFPage_CountObjects(pPdfPage.get()));
+ FPDF_PAGEOBJECT pPageObject = FPDFPage_GetObject(pPdfPage.get(), 0);
+ CPPUNIT_ASSERT_EQUAL(FPDF_PAGEOBJ_FORM, FPDFPageObj_GetType(pPageObject));
+ // 2: white background and the actual object.
+ CPPUNIT_ASSERT_EQUAL(2, FPDFFormObj_CountObjects(pPageObject));
+ FPDF_PAGEOBJECT pFormObject = FPDFFormObj_GetObject(pPageObject, 1);
+ CPPUNIT_ASSERT_EQUAL(FPDF_PAGEOBJ_FORM, FPDFPageObj_GetType(pFormObject));
+ CPPUNIT_ASSERT_EQUAL(1, FPDFFormObj_CountObjects(pFormObject));
+
+ // Check if the inner form object (original page object in the pdf image) has the correct
+ // rotation.
+ FPDF_PAGEOBJECT pInnerFormObject = FPDFFormObj_GetObject(pFormObject, 0);
+ CPPUNIT_ASSERT_EQUAL(FPDF_PAGEOBJ_FORM, FPDFPageObj_GetType(pInnerFormObject));
+ CPPUNIT_ASSERT_EQUAL(1, FPDFFormObj_CountObjects(pInnerFormObject));
+ FPDF_PAGEOBJECT pImage = FPDFFormObj_GetObject(pInnerFormObject, 0);
+ CPPUNIT_ASSERT_EQUAL(FPDF_PAGEOBJ_IMAGE, FPDFPageObj_GetType(pImage));
+ FS_MATRIX aMatrix;
+ FPDFFormObj_GetMatrix(pInnerFormObject, &aMatrix);
+ basegfx::B2DHomMatrix aMat{ aMatrix.a, aMatrix.c, aMatrix.e, aMatrix.b, aMatrix.d, aMatrix.f };
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate = 0;
+ double fShearX = 0;
+ aMat.decompose(aScale, aTranslate, fRotate, fShearX);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: -1
+ // - Actual : 1
+ // i.e. the 180 degrees rotation didn't happen (via a combination of horizontal + vertical
+ // flip).
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, aScale.getX(), 0.01);
+}
+
+void PdfExportTest::testPdfImageHyperlink()
+{
+ // Given a Draw file, containing a PDF image, which has a hyperlink in it:
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "pdf-image-hyperlink.odg";
+ mxComponent = loadFromDesktop(aURL);
+ CPPUNIT_ASSERT(mxComponent.is());
+
+ // When saving to PDF:
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("draw_pdf_Export");
+ xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+
+ // Then make sure that link is preserved:
+ SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+ maMemory.WriteStream(aFile);
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
+ = pPDFium->openDocument(maMemory.GetData(), maMemory.GetSize());
+ CPPUNIT_ASSERT(pPdfDocument);
+ CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount());
+ std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(/*nIndex=*/0);
+ CPPUNIT_ASSERT(pPdfPage);
+ int nStartPos = 0;
+ FPDF_LINK pLinkAnnot = nullptr;
+ // Without the accompanying fix in place, this test would have failed, the hyperlink of the PDF
+ // image was lost.
+ CPPUNIT_ASSERT(FPDFLink_Enumerate(pPdfPage->getPointer(), &nStartPos, &pLinkAnnot));
+
+ // Also test the precision of the form XObject.
+ // Given a full-page form XObject, page height is 27.94 cm (792 points):
+ // When writing the reciprocal of the object height to PDF:
+ std::unique_ptr<vcl::pdf::PDFiumPageObject> pFormObject;
+ for (int i = 0; i < pPdfPage->getObjectCount(); ++i)
+ {
+ std::unique_ptr<vcl::pdf::PDFiumPageObject> pObject = pPdfPage->getObject(i);
+ if (FPDFPageObj_GetType(pObject->getPointer()) == FPDF_PAGEOBJ_FORM)
+ {
+ pFormObject = std::move(pObject);
+ break;
+ }
+ }
+ CPPUNIT_ASSERT(pFormObject);
+ std::unique_ptr<vcl::pdf::PDFiumPageObject> pInnerFormObject;
+ for (int i = 0; i < pFormObject->getFormObjectCount(); ++i)
+ {
+ std::unique_ptr<vcl::pdf::PDFiumPageObject> pObject = pFormObject->getFormObject(i);
+ if (FPDFPageObj_GetType(pObject->getPointer()) == FPDF_PAGEOBJ_FORM)
+ {
+ pInnerFormObject = std::move(pObject);
+ break;
+ }
+ }
+ CPPUNIT_ASSERT(pInnerFormObject);
+ // Then make sure that enough digits are used, so the point size is unchanged:
+ basegfx::B2DHomMatrix aMatrix;
+ FS_MATRIX matrix;
+ if (FPDFFormObj_GetMatrix(pInnerFormObject->getPointer(), &matrix))
+ {
+ aMatrix = basegfx::B2DHomMatrix::abcdef(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e,
+ matrix.f);
+ }
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate{};
+ double fShearX{};
+ aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 0.0012626264
+ // - Actual : 0.00126
+ // i.e. the rounded reciprocal was 794 points, not the original 792.
+ // FIXME macOS actual value is 0.0001578282, for unknown reasons.
+#if !defined MACOSX
+ CPPUNIT_ASSERT_EQUAL(0.0012626264, rtl::math::round(aScale.getY(), 10));
+#endif
+}
+
+void PdfExportTest::testPdfImageAnnots()
+{
+ // Given a document with a PDF image that has 2 comments (popup, text) and a hyperlink:
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "pdf-image-annots.odg";
+ mxComponent = loadFromDesktop(aURL);
+ CPPUNIT_ASSERT(mxComponent.is());
+
+ // When saving to PDF:
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("draw_pdf_Export");
+ xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+
+ // Then make sure only the hyperlink is kept, since Draw itself has its own comments:
+ SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+ maMemory.WriteStream(aFile);
+ std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get();
+ std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
+ = pPDFium->openDocument(maMemory.GetData(), maMemory.GetSize());
+ CPPUNIT_ASSERT(pPdfDocument);
+ CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount());
+ std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(/*nIndex=*/0);
+ CPPUNIT_ASSERT(pPdfPage);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1
+ // - Actual : 3
+ // i.e. not only the hyperlink but also the 2 comments were exported, leading to duplication.
+ CPPUNIT_ASSERT_EQUAL(1, pPdfPage->getAnnotationCount());
+}
CPPUNIT_TEST_SUITE_REGISTRATION(PdfExportTest);
}
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 32deb0c9a310..4208c1465d23 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -529,6 +529,15 @@ OUString SalInstanceWidget::get_tooltip_text() const
return m_xWidget->GetQuickHelpText();
}
+void SalInstanceWidget::set_cursor_data(void * pData)
+{
+ vcl::Cursor * pCursor = static_cast<vcl::Cursor *>(pData);
+ if (!pCursor)
+ return;
+
+ m_xWidget->SetCursor(pCursor);
+}
+
void SalInstanceWidget::connect_focus_in(const Link<Widget&, void>& rLink)
{
ensure_event_listener();
@@ -2928,37 +2937,6 @@ public:
}
};
-class SalInstanceImage : public SalInstanceWidget, public virtual weld::Image
-{
-private:
- VclPtr<FixedImage> m_xImage;
-
-public:
- SalInstanceImage(FixedImage* pImage, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
- : SalInstanceWidget(pImage, pBuilder, bTakeOwnership)
- , m_xImage(pImage)
- {
- }
-
- virtual void set_from_icon_name(const OUString& rIconName) override
- {
- m_xImage->SetImage(::Image(StockImage::Yes, rIconName));
- }
-
- virtual void set_image(VirtualDevice* pDevice) override
- {
- if (pDevice)
- m_xImage->SetImage(createImage(*pDevice));
- else
- m_xImage->SetImage(::Image());
- }
-
- virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override
- {
- m_xImage->SetImage(::Image(rImage));
- }
-};
-
class SalInstanceCalendar : public SalInstanceWidget, public virtual weld::Calendar
{
private:
@@ -3007,6 +2985,31 @@ IMPL_LINK_NOARG(SalInstanceCalendar, ActivateHdl, ::Calendar*, void)
signal_activated();
}
+SalInstanceImage::SalInstanceImage(FixedImage* pImage, SalInstanceBuilder* pBuilder,
+ bool bTakeOwnership)
+ : SalInstanceWidget(pImage, pBuilder, bTakeOwnership)
+ , m_xImage(pImage)
+{
+}
+
+void SalInstanceImage::set_from_icon_name(const OUString& rIconName)
+{
+ m_xImage->SetImage(::Image(StockImage::Yes, rIconName));
+}
+
+void SalInstanceImage::set_image(VirtualDevice* pDevice)
+{
+ if (pDevice)
+ m_xImage->SetImage(createImage(*pDevice));
+ else
+ m_xImage->SetImage(::Image());
+}
+
+void SalInstanceImage::set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage)
+{
+ m_xImage->SetImage(::Image(rImage));
+}
+
WeldTextFilter::WeldTextFilter(Link<OUString&, bool>& rInsertTextHdl)
: TextFilter(OUString())
, m_rInsertTextHdl(rInsertTextHdl)
@@ -5412,7 +5415,6 @@ void SalInstanceDrawingArea::HandleMouseEventListener(VclSimpleEvent& rEvent)
SalInstanceWidget::HandleMouseEventListener(rEvent);
}
-
bool SalInstanceDrawingArea::HandleKeyEventListener(VclWindowEvent& /*rEvent*/)
{
return false;
@@ -6257,8 +6259,10 @@ void SalInstanceWindow::help()
{
//show help for widget with keyboard focus
vcl::Window* pWidget = ImplGetSVData()->mpWinData->mpFocusWin;
- if (!pWidget || comphelper::LibreOfficeKit::isActive())
+ if (!pWidget)
pWidget = m_xWindow;
+ if (comphelper::LibreOfficeKit::isActive() && m_xWindow->GetFocusedWindow())
+ pWidget = m_xWindow->GetFocusedWindow();
OString sHelpId = pWidget->GetHelpId();
while (sHelpId.isEmpty())
{
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 34227013dc23..3eb67e3f309a 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -572,6 +572,11 @@ bool Application::IsInExecute()
return ImplGetSVData()->maAppData.mbInAppExecute;
}
+bool Application::IsQuit()
+{
+ return ImplGetSVData()->maAppData.mbAppQuit;
+}
+
bool Application::IsInModalMode()
{
return (ImplGetSVData()->maAppData.mnModalMode != 0);
@@ -1682,6 +1687,14 @@ bool isUnipoll()
return pSVData && pSVData->mpPollCallback != nullptr;
}
+void numberOfViewsChanged(int count)
+{
+ ImplSVData * pSVData = ImplGetSVData();
+ auto& rCache = pSVData->maGDIData.maScaleCache;
+ // Normally the cache size is set to 10, scale according to the number of users.
+ rCache.setMaxSize(count * 10);
+}
+
} } // namespace lok, namespace vcl
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
index bd6b7bd00b56..af57c98e7dcd 100644
--- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
+++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/profilezone.hxx>
#include <comphelper/threadpool.hxx>
#include <tools/helpers.hxx>
@@ -127,6 +128,7 @@ public:
void scaleUp32bit(ScaleContext &rCtx, long nStartY, long nEndY)
{
+ comphelper::ProfileZone pz("BitmapScaleSuperFilter::scaleUp32bit");
const int nColorComponents = 4;
const long nStartX = 0;
@@ -261,6 +263,7 @@ void scaleUpPaletteGeneral(ScaleContext &rCtx, long nStartY, long nEndY)
void scaleUp24bit(ScaleContext &rCtx, long nStartY, long nEndY)
{
+ comphelper::ProfileZone pz("BitmapScaleSuperFilter::scaleUp24bit");
const int nColorComponents = 3;
const long nStartX = 0;
@@ -351,6 +354,7 @@ void scaleUpNonPaletteGeneral(ScaleContext &rCtx, long nStartY, long nEndY)
void scaleDown32bit(ScaleContext &rCtx, long nStartY, long nEndY)
{
+ comphelper::ProfileZone pz("BitmapScaleSuperFilter::scaleDown32bit");
const int constColorComponents = 4;
const long nStartX = 0;
@@ -746,6 +750,7 @@ void scaleDownPaletteGeneral(ScaleContext &rCtx, long nStartY, long nEndY)
void scaleDown24bit(ScaleContext &rCtx, long nStartY, long nEndY)
{
+ comphelper::ProfileZone pz("BitmapScaleSuperFilter::scaleDown24bit");
const int constColorComponents = 3;
const long nStartX = 0;
diff --git a/vcl/source/control/WeldedTabbedNotebookbar.cxx b/vcl/source/control/WeldedTabbedNotebookbar.cxx
index ad9947241e32..9f3f0db181f5 100644
--- a/vcl/source/control/WeldedTabbedNotebookbar.cxx
+++ b/vcl/source/control/WeldedTabbedNotebookbar.cxx
@@ -18,8 +18,6 @@ WeldedTabbedNotebookbar::WeldedTabbedNotebookbar(
pContainerWindow, VclBuilderContainer::getUIRootDir(), rUIFilePath, rFrame, nWindowId))
{
m_xContainer = m_xBuilder->weld_container("NotebookBar");
- m_xNotebook = m_xBuilder->weld_notebook("ContextContainer");
- m_xNotebook->set_current_page("HomeLabel");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 522446561a79..38db41b03126 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -492,4 +492,19 @@ Control::GetUnzoomedControlPointFont() const
return aFont;
}
+void Control::LogicMouseButtonDown(const MouseEvent& rEvent)
+{
+ MouseButtonDown(rEvent);
+}
+
+void Control::LogicMouseButtonUp(const MouseEvent& rEvent)
+{
+ MouseButtonUp(rEvent);
+}
+
+void Control::LogicMouseMove(const MouseEvent& rEvent)
+{
+ MouseMove(rEvent);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index c5eb075a8e0d..6bf24d6fc8bc 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -17,15 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <vcl/cvtgrf.hxx>
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/fixed.hxx>
#include <vcl/settings.hxx>
+#include <comphelper/base64.hxx>
#include <comphelper/string.hxx>
#include <sal/log.hxx>
#include <controldata.hxx>
#include <boost/property_tree/ptree.hpp>
+#include <tools/stream.hxx>
#define FIXEDLINE_TEXT_BORDER 4
@@ -970,4 +973,26 @@ bool FixedImage::set_property(const OString &rKey, const OUString &rValue)
return true;
}
+boost::property_tree::ptree FixedImage::DumpAsPropertyTree()
+{
+ boost::property_tree::ptree aTree = Control::DumpAsPropertyTree();
+
+ aTree.put("type", "image");
+
+ if (!!maImage)
+ {
+ SvMemoryStream aOStm(6535, 6535);
+ if(GraphicConverter::Export(aOStm, maImage.GetBitmapEx(), ConvertDataFormat::PNG) == ERRCODE_NONE)
+ {
+ css::uno::Sequence<sal_Int8> aSeq( static_cast<sal_Int8 const *>(aOStm.GetData()), aOStm.Tell());
+ OUStringBuffer aBuffer("data:image/png;base64,");
+ ::comphelper::Base64::encode(aBuffer, aSeq);
+ aTree.put("image", aBuffer.makeStringAndClear());
+ }
+ }
+
+ return aTree;
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx
index 451c2c9a59f8..ea8a938977c0 100644
--- a/vcl/source/control/notebookbar.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -68,11 +68,7 @@ NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rU
if ( doesCustomizedUIExist )
sUIDir = getCustomizedUIRootDir();
- bool bIsWelded = comphelper::LibreOfficeKit::isActive()
- && (rUIXMLDescription == "modules/swriter/ui/notebookbar.ui"
- || rUIXMLDescription == "modules/scalc/ui/notebookbar.ui"
- || rUIXMLDescription == "modules/simpress/ui/notebookbar.ui"
- || rUIXMLDescription == "modules/sdraw/ui/notebookbar.ui");
+ bool bIsWelded = comphelper::LibreOfficeKit::isActive();
if (bIsWelded)
{
m_bIsWelded = true;
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index 16ec32de0597..d99ade44ec88 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -182,7 +182,7 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent )
Idle aIdle("ProgressBar::SetValue aIdle");
aIdle.SetPriority(TaskPriority::POST_PAINT);
aIdle.Start();
- while (aIdle.IsActive())
+ while (aIdle.IsActive() && !Application::IsQuit())
{
Application::Yield();
}
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index dd1355d924a8..8715000f1627 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -1327,12 +1327,18 @@ bool PDFDocument::Tokenize(SvStream& rStream, TokenizeMode eMode,
}
else
{
- if (!rtl::isAsciiWhiteSpace(static_cast<unsigned char>(ch)))
+ auto uChar = static_cast<unsigned char>(ch);
+ // Be more lenient and allow unexpected null char
+ if (!rtl::isAsciiWhiteSpace(uChar) && uChar != 0)
{
- SAL_WARN("vcl.filter", "PDFDocument::Tokenize: unexpected character: "
- << ch << " at byte position " << rStream.Tell());
+ SAL_WARN("vcl.filter",
+ "PDFDocument::Tokenize: unexpected character with code "
+ << sal_Int32(ch) << " at byte position " << rStream.Tell());
return false;
}
+ SAL_WARN_IF(uChar == 0, "vcl.filter",
+ "PDFDocument::Tokenize: unexpected null character at "
+ << rStream.Tell() << " - ignoring");
}
break;
}
@@ -2139,9 +2145,14 @@ bool PDFCommentElement::Read(SvStream& rStream)
sal_uInt64 nPos = rStream.Tell();
if (ch == '\r')
{
+ rStream.ReadChar(ch);
+ rStream.SeekRel(-1);
// If the comment ends with a \r\n, count the \n as well to match Adobe Acrobat
// behavior.
- nPos += 1;
+ if (ch == '\n')
+ {
+ nPos += 1;
+ }
}
m_rDoc.PushBackEOF(nPos);
}
diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx
index 2fb7a11bb681..ef8862c0d1a3 100644
--- a/vcl/source/filter/ipdf/pdfread.cxx
+++ b/vcl/source/filter/ipdf/pdfread.cxx
@@ -15,8 +15,10 @@
#include <fpdfview.h>
#include <fpdf_edit.h>
#include <fpdf_save.h>
+#include <fpdf_formfill.h>
#endif
+#include <pdf/PdfConfig.hxx>
#include <vcl/graph.hxx>
#include <bitmapwriteaccess.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -150,7 +152,8 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<Bitmap>& rBi
const size_t nFirstPage, int nPages, const basegfx::B2DTuple* pSizeHint)
{
#if HAVE_FEATURE_PDFIUM
- const double fResolutionDPI = 96;
+ static const double fResolutionDPI = vcl::pdf::getDefaultPdfResolutionDpi();
+
auto pPdfium = vcl::pdf::PDFiumLibrary::get();
// Load the buffer using pdfium.
@@ -158,6 +161,10 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<Bitmap>& rBi
if (!pPdfDocument)
return 0;
+ FPDF_FORMFILLINFO aFormCallbacks = {};
+ aFormCallbacks.version = 1;
+ FPDF_FORMHANDLE pFormHandle = FPDFDOC_InitFormFillEnvironment(pPdfDocument, &aFormCallbacks);
+
const int nPageCount = FPDF_GetPageCount(pPdfDocument);
if (nPages <= 0)
nPages = nPageCount;
@@ -191,6 +198,10 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<Bitmap>& rBi
FPDF_RenderPageBitmap(pPdfBitmap, pPdfPage, /*start_x=*/0, /*start_y=*/0, nPageWidth,
nPageHeight, /*rotate=*/0, /*flags=*/0);
+ // Render widget annotations for FormFields.
+ FPDF_FFLDraw(pFormHandle, pPdfBitmap, pPdfPage, /*start_x=*/0, /*start_y=*/0, nPageWidth,
+ nPageHeight, /*rotate=*/0, /*flags=*/0);
+
// Save the buffer as a bitmap.
Bitmap aBitmap(Size(nPageWidth, nPageHeight), 24);
{
@@ -210,6 +221,8 @@ size_t RenderPDFBitmaps(const void* pBuffer, int nSize, std::vector<Bitmap>& rBi
FPDF_ClosePage(pPdfPage);
}
+ FPDFDOC_ExitFormFillEnvironment(pFormHandle);
+
FPDF_CloseDocument(pPdfDocument);
return rBitmaps.size();
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx
index 92760875b647..11a6a366e208 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -229,7 +229,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
// update the glyphid-array with the glyphs in this range
pStartGlyphs[i] = -static_cast<int>(aGlyphIdArray.size());
const unsigned char* pGlyphIdPtr = pOffsetBase + 2*i + nRangeOffset;
- const size_t nRemainingSize = pEndValidArea - pGlyphIdPtr;
+ const size_t nRemainingSize = pEndValidArea >= pGlyphIdPtr ? pEndValidArea - pGlyphIdPtr : 0;
const size_t nMaxPossibleRecords = nRemainingSize/2;
if (nMaxPossibleRecords == 0) { // no sane font should trigger this
SAL_WARN("vcl.gdi", "More indexes claimed that space available in font!");
@@ -333,7 +333,8 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
static const int NINSIZE = 64;
static const int NOUTSIZE = 64;
- sal_Char cCharsInp[ NINSIZE ];
+ std::vector<char> cCharsInp;
+ cCharsInp.reserve(NINSIZE);
sal_Unicode cCharsOut[ NOUTSIZE ];
sal_UCS4* pCP = pCodePairs;
for( int i = 0; i < nRangeCount; ++i )
@@ -344,25 +345,26 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
// input codepoints in 0..SAL_MAX_UINT16 range
while (cMin < cEnd && cMin <= SAL_MAX_UINT16)
{
- int j = 0;
- for(; (cMin < cEnd) && (j < NINSIZE); ++cMin )
+ for (int j = 0; (cMin < cEnd) && (j < NINSIZE); ++cMin, ++j)
{
if( cMin >= 0x0100 )
- cCharsInp[ j++ ] = static_cast<sal_Char>(cMin >> 8);
+ cCharsInp.push_back(static_cast<char>(cMin >> 8));
if( (cMin >= 0x0100) || (cMin < 0x00A0) )
- cCharsInp[ j++ ] = static_cast<sal_Char>(cMin);
+ cCharsInp.push_back(static_cast<char>(cMin));
}
sal_uInt32 nCvtInfo;
sal_Size nSrcCvtBytes;
int nOutLen = rtl_convertTextToUnicode(
aConverter, aCvtContext,
- cCharsInp, j, cCharsOut, NOUTSIZE,
+ cCharsInp.data(), cCharsInp.size(), cCharsOut, NOUTSIZE,
RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE
| RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE,
&nCvtInfo, &nSrcCvtBytes );
- for( j = 0; j < nOutLen; ++j )
+ cCharsInp.clear();
+
+ for (int j = 0; j < nOutLen; ++j)
aSupportedCodePoints.insert( cCharsOut[j] );
}
}
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index fd6e6f96df10..8a684e472e0a 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -362,7 +362,13 @@ static int GetSimpleTTOutline(TrueTypeFont const *ttf, sal_uInt32 glyphID, Contr
if( glyphID >= ttf->nglyphs ) /*- glyph is not present in the font */
return 0;
- const sal_uInt8* ptr = table + ttf->goffsets[glyphID];
+ sal_uInt32 nGlyphOffset = ttf->goffsets[glyphID];
+ if (nGlyphOffset > nTableSize)
+ return 0;
+
+ const sal_uInt8* ptr = table + nGlyphOffset;
+ const sal_uInt32 nMaxGlyphSize = nTableSize - nGlyphOffset;
+
const sal_Int16 numberOfContours = GetInt16(ptr, GLYF_numberOfContours_offset);
if( numberOfContours <= 0 ) /*- glyph is not simple */
return 0;
@@ -377,7 +383,7 @@ static int GetSimpleTTOutline(TrueTypeFont const *ttf, sal_uInt32 glyphID, Contr
/* determine the last point and be extra safe about it. But probably this code is not needed */
sal_uInt16 lastPoint=0;
- const sal_Int32 nMaxContours = (nTableSize - 10)/2;
+ const sal_Int32 nMaxContours = (nMaxGlyphSize - 10)/2;
if (numberOfContours > nMaxContours)
return 0;
for (i=0; i<numberOfContours; i++)
@@ -394,7 +400,7 @@ static int GetSimpleTTOutline(TrueTypeFont const *ttf, sal_uInt32 glyphID, Contr
const sal_uInt8* p = ptr + nOffset;
const sal_uInt32 nBytesRemaining = nTableSize - nOffset;
- const sal_uInt16 palen = lastPoint+1;
+ const sal_uInt32 palen = lastPoint+1;
//at a minimum its one byte per entry
if (palen > nBytesRemaining || lastPoint > nBytesRemaining-1)
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index e78f6d01853b..e80260160c45 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -25,6 +25,7 @@
#include "ttcr.hxx"
#include "list.h"
+#include <sal/log.hxx>
#include <string.h>
namespace vcl
@@ -1250,7 +1251,7 @@ static void ProcessTables(TrueTypeCreator *tt)
/* printf("IDs: %d %d.\n", gd->glyphID, gd->newID); */
- if (gd->nbytes != 0) {
+ if (gd->nbytes >= 10) {
z = GetInt16(gd->ptr, 2);
if (z < xMin) xMin = z;
@@ -1288,14 +1289,21 @@ static void ProcessTables(TrueTypeCreator *tt)
do {
GlyphData *gd = static_cast<GlyphData *>(listCurrent(glyphlist));
- if (gd->compflag) { /* re-number all components */
+ if (gd->compflag && gd->nbytes > 10) { /* re-number all components */
sal_uInt16 flags, index;
sal_uInt8 *ptr = gd->ptr + 10;
+ size_t nRemaining = gd->nbytes - 10;
do {
- sal_uInt32 j;
+ if (nRemaining < 4)
+ {
+ SAL_WARN("vcl.fonts", "truncated font");
+ break;
+ }
flags = GetUInt16(ptr, 0);
index = GetUInt16(ptr, 2);
+
/* XXX use the sorted array of old to new glyphID mapping and do a binary search */
+ sal_uInt32 j;
for (j = 0; j < nGlyphs; j++) {
if (gid[j] == index) {
break;
@@ -1306,20 +1314,32 @@ static void ProcessTables(TrueTypeCreator *tt)
PutUInt16(static_cast<sal_uInt16>(j), ptr, 2);
ptr += 4;
+ nRemaining -= 4;
+ sal_uInt32 nAdvance = 0;
if (flags & ARG_1_AND_2_ARE_WORDS) {
- ptr += 4;
+ nAdvance += 4;
} else {
- ptr += 2;
+ nAdvance += 2;
}
if (flags & WE_HAVE_A_SCALE) {
- ptr += 2;
+ nAdvance += 2;
} else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
- ptr += 4;
+ nAdvance += 4;
} else if (flags & WE_HAVE_A_TWO_BY_TWO) {
- ptr += 8;
+ nAdvance += 8;
}
+
+ if (nRemaining < nAdvance)
+ {
+ SAL_WARN("vcl.fonts", "truncated font");
+ break;
+ }
+
+ ptr += nAdvance;
+ nRemaining -= nAdvance;
+
} while (flags & MORE_COMPONENTS);
}
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index 4b0b42f5d268..67a0bf03eba0 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -35,8 +35,6 @@ BitmapInfoAccess::BitmapInfoAccess( Bitmap& rBitmap, BitmapAccessMode nMode ) :
{
std::shared_ptr<SalBitmap> xImpBmp = rBitmap.ImplGetSalBitmap();
- assert( xImpBmp && "Forbidden Access to empty bitmap!" );
-
if( !xImpBmp )
return;
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index ce1df4a68a65..6a64f60549fa 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -249,8 +249,18 @@ bool ImplReadDIBInfoHeader(SvStream& rIStm, DIBV5Header& rHeader, bool& bTopDown
readUInt32( rHeader.nV5ProfileSize );
readUInt32( rHeader.nV5Reserved );
+ // Read color mask. An additional 12 bytes of color bitfields follow the info header (WinBMPv3-NT)
+ sal_uInt32 nColorMask = 0;
+ if (BITFIELDS == rHeader.nCompression && DIBINFOHEADERSIZE == rHeader.nSize)
+ {
+ rIStm.ReadUInt32( rHeader.nV5RedMask );
+ rIStm.ReadUInt32( rHeader.nV5GreenMask );
+ rIStm.ReadUInt32( rHeader.nV5BlueMask );
+ nColorMask = 12;
+ }
+
// seek to EndPos
- if (!checkSeek(rIStm, aStartPos + rHeader.nSize))
+ if (!checkSeek(rIStm, aStartPos + rHeader.nSize + nColorMask))
return false;
}
@@ -533,14 +543,12 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
}
else
{
- // Read color mask
- if(bTCMask && BITFIELDS == rHeader.nCompression)
- {
- rIStm.SeekRel( -12 );
- rIStm.ReadUInt32( nRMask );
- rIStm.ReadUInt32( nGMask );
- rIStm.ReadUInt32( nBMask );
- }
+ if (rHeader.nV5RedMask > 0)
+ nRMask = rHeader.nV5RedMask;
+ if (rHeader.nV5GreenMask > 0)
+ nGMask = rHeader.nV5GreenMask;
+ if (rHeader.nV5BlueMask > 0)
+ nBMask = rHeader.nV5BlueMask;
const long nWidth(rHeader.nWidth);
const long nHeight(rHeader.nHeight);
@@ -911,7 +919,13 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uL
if (nOffset)
{
- pIStm->SeekRel(nOffset - (pIStm->Tell() - nStmPos));
+ // It is problematic to seek backwards. We are at the
+ // end of BITMAPINFOHEADER or 12 bytes further in case
+ // of WinBMPv3-NT format. It is possible to seek forward
+ // though because a gap may be there.
+ sal_Int32 nSeekRel = nOffset - (pIStm->Tell() - nStmPos);
+ if (nSeekRel > 0)
+ pIStm->SeekRel(nSeekRel);
}
const sal_Int64 nBitsPerLine (static_cast<sal_Int64>(aHeader.nWidth) * static_cast<sal_Int64>(aHeader.nBitCount));
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 2aa973e567c5..5d2fbf6a6b13 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -45,6 +45,7 @@
#include <osl/thread.h>
#include <rtl/digest.h>
#include <rtl/ustrbuf.hxx>
+#include <rtl/xmlencode.hxx>
#include <sal/log.hxx>
#include <svl/urihelper.hxx>
#include <tools/fract.hxx>
@@ -75,6 +76,7 @@
#include <bitmapwriteaccess.hxx>
#include <impglyphitem.hxx>
#include <pdf/objectcopier.hxx>
+#include <pdf/PdfConfig.hxx>
#include "pdfwriter_impl.hxx"
@@ -4155,9 +4157,6 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
pop();
- OStringBuffer aDA( 256 );
- appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA );
- rBox.m_aDAString = aDA.makeStringAndClear();
//to encrypt this (el)
rBox.m_aMKDict = "/CA";
//after this assignment, to m_aMKDic cannot be added anything
@@ -4170,6 +4169,7 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P
SvMemoryStream* pCheckStream = new SvMemoryStream( 256, 256 );
beginRedirect( pCheckStream, aCheckRect );
+ OStringBuffer aDA( 256 );
aDA.append( "/Tx BMC\nq BT\n" );
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ), aDA );
aDA.append( ' ' );
@@ -5326,37 +5326,6 @@ sal_Int32 PDFWriterImpl::emitOutputIntent()
return nOIObject;
}
-// formats the string for the XML stream
-static void escapeStringXML( const OUString& rStr, OUString &rValue)
-{
- const sal_Unicode* pUni = rStr.getStr();
- int nLen = rStr.getLength();
- for( ; nLen; nLen--, pUni++ )
- {
- switch( *pUni )
- {
- case u'&':
- rValue += "&amp;";
- break;
- case u'<':
- rValue += "&lt;";
- break;
- case u'>':
- rValue += "&gt;";
- break;
- case u'\'':
- rValue += "&apos;";
- break;
- case u'"':
- rValue += "&quot;";
- break;
- default:
- rValue += OUStringChar( *pUni );
- break;
- }
- }
-}
-
// emits the document metadata
sal_Int32 PDFWriterImpl::emitDocumentMetadata()
{
@@ -5405,8 +5374,7 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <dc:title>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
- OUString aTitle;
- escapeStringXML( m_aContext.DocumentInfo.Title, aTitle );
+ OUString aTitle = rtl::encodeForXml( m_aContext.DocumentInfo.Title );
aMetadataStream.append( OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
@@ -5417,8 +5385,7 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <dc:creator>\n" );
aMetadataStream.append( " <rdf:Seq>\n" );
aMetadataStream.append( " <rdf:li>" );
- OUString aAuthor;
- escapeStringXML( m_aContext.DocumentInfo.Author, aAuthor );
+ OUString aAuthor = rtl::encodeForXml( m_aContext.DocumentInfo.Author );
aMetadataStream.append( OUStringToOString( aAuthor , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Seq>\n" );
@@ -5430,8 +5397,7 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
aMetadataStream.append( " <dc:description>\n" );
aMetadataStream.append( " <rdf:Alt>\n" );
aMetadataStream.append( " <rdf:li xml:lang=\"x-default\">" );
- OUString aSubject;
- escapeStringXML( m_aContext.DocumentInfo.Subject, aSubject );
+ OUString aSubject = rtl::encodeForXml( m_aContext.DocumentInfo.Subject );
aMetadataStream.append( OUStringToOString( aSubject , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</rdf:li>\n" );
aMetadataStream.append( " </rdf:Alt>\n" );
@@ -5449,16 +5415,14 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
if( !m_aContext.DocumentInfo.Producer.isEmpty() )
{
aMetadataStream.append( " <pdf:Producer>" );
- OUString aProducer;
- escapeStringXML( m_aContext.DocumentInfo.Producer, aProducer );
+ OUString aProducer = rtl::encodeForXml( m_aContext.DocumentInfo.Producer );
aMetadataStream.append( OUStringToOString( aProducer , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Producer>\n" );
}
if( !m_aContext.DocumentInfo.Keywords.isEmpty() )
{
aMetadataStream.append( " <pdf:Keywords>" );
- OUString aKeywords;
- escapeStringXML( m_aContext.DocumentInfo.Keywords, aKeywords );
+ OUString aKeywords = rtl::encodeForXml( m_aContext.DocumentInfo.Keywords );
aMetadataStream.append( OUStringToOString( aKeywords , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</pdf:Keywords>\n" );
}
@@ -5470,8 +5434,7 @@ sal_Int32 PDFWriterImpl::emitDocumentMetadata()
if( !m_aContext.DocumentInfo.Creator.isEmpty() )
{
aMetadataStream.append( " <xmp:CreatorTool>" );
- OUString aCreator;
- escapeStringXML( m_aContext.DocumentInfo.Creator, aCreator );
+ OUString aCreator = rtl::encodeForXml( m_aContext.DocumentInfo.Creator );
aMetadataStream.append( OUStringToOString( aCreator , RTL_TEXTENCODING_UTF8 ) );
aMetadataStream.append( "</xmp:CreatorTool>\n" );
}
@@ -8668,11 +8631,14 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
return;
// Count /Matrix and /BBox.
- // vcl::ImportPDF() works with 96 DPI so use the same values here, too.
+ // vcl::ImportPDF() uses getDefaultPdfResolutionDpi to set the desired
+ // rendering DPI so we have to take into account that here too.
+ static const double fResolutionDPI = vcl::pdf::getDefaultPdfResolutionDpi();
+
sal_Int32 nOldDPIX = GetDPIX();
- SetDPIX(96);
sal_Int32 nOldDPIY = GetDPIY();
- SetDPIY(96);
+ SetDPIX(fResolutionDPI);
+ SetDPIY(fResolutionDPI);
Size aSize = PixelToLogic(rEmit.m_aPixelSize, MapMode(m_aMapMode.GetMapUnit()));
SetDPIX(nOldDPIX);
SetDPIY(nOldDPIY);
@@ -8686,10 +8652,16 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
// object.
if (rEmit.m_nExternalPDFDataIndex < 0)
return;
- auto & rExternalPDFStream = m_aExternalPDFStreams.get(rEmit.m_nExternalPDFDataIndex);
- auto & rPDFDocument = rExternalPDFStream.getPDFDocument();
+ auto& rExternalPDFStream = m_aExternalPDFStreams.get(rEmit.m_nExternalPDFDataIndex);
+ auto& pPDFDocument = rExternalPDFStream.getPDFDocument();
+ if (!pPDFDocument)
+ {
+ // Couldn't parse the document and can't continue
+ SAL_WARN("vcl.pdfwriter", "PDFWriterImpl::writeReferenceXObject: failed to parse the document");
+ return;
+ }
- std::vector<filter::PDFObjectElement*> aPages = rPDFDocument.GetPages();
+ std::vector<filter::PDFObjectElement*> aPages = pPDFDocument->GetPages();
if (aPages.empty())
{
SAL_WARN("vcl.pdfwriter", "PDFWriterImpl::writeReferenceXObject: no pages");
@@ -8730,6 +8702,53 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
return;
}
+ // Merge link annotations from pPage to our page.
+ std::vector<filter::PDFObjectElement*> aAnnots;
+ if (auto pArray = dynamic_cast<filter::PDFArrayElement*>(pPage->Lookup("Annots")))
+ {
+ for (const auto pElement : pArray->GetElements())
+ {
+ auto pReference = dynamic_cast<filter::PDFReferenceElement*>(pElement);
+ if (!pReference)
+ {
+ continue;
+ }
+
+ filter::PDFObjectElement* pObject = pReference->LookupObject();
+ if (!pObject)
+ {
+ continue;
+ }
+
+ auto pType = dynamic_cast<filter::PDFNameElement*>(pObject->Lookup("Type"));
+ if (!pType || pType->GetValue() != "Annot")
+ {
+ continue;
+ }
+
+ auto pSubtype = dynamic_cast<filter::PDFNameElement*>(pObject->Lookup("Subtype"));
+ if (!pSubtype || pSubtype->GetValue() != "Link")
+ {
+ continue;
+ }
+
+ // Reference to a link annotation object, remember it.
+ aAnnots.push_back(pObject);
+ }
+ }
+ if (!aAnnots.empty())
+ {
+ PDFObjectCopier aCopier(*this);
+ SvMemoryStream& rDocBuffer = pPage->GetDocument().GetEditBuffer();
+ std::map<sal_Int32, sal_Int32> aMap;
+ for (const auto& pAnnot : aAnnots)
+ {
+ // Copy over the annotation and refer to its new id.
+ sal_Int32 nNewId = aCopier.copyExternalResource(rDocBuffer, *pAnnot, aMap);
+ m_aPages.back().m_aAnnotations.push_back(nNewId);
+ }
+ }
+
nWrappedFormObject = createObject();
// Write the form XObject wrapped below. This is a separate object from
// the wrapper, this way there is no need to alter the stream contents.
@@ -8742,29 +8761,40 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
long nWidth = aSize.Width();
long nHeight = aSize.Height();
+ basegfx::B2DRange aBBox(0, 0, aSize.Width(), aSize.Height());
if (auto pRotate = dynamic_cast<filter::PDFNumberElement*>(pPage->Lookup("Rotate")))
{
// The original page was rotated, then construct a transformation matrix which does the
// same with our form object.
- if (rtl::math::approxEqual(pRotate->GetValue(), 90))
- {
- std::swap(nWidth, nHeight);
- basegfx::B2DHomMatrix aMat;
- aMat.rotate(basegfx::deg2rad(pRotate->GetValue()));
- // Rotate around the origo (bottom left corner) counter-clockwise, then translate
- // horizontally to effectively keep the bottom left corner unchanged.
- aLine.append(" /Matrix [ ");
- aLine.append(aMat.get(0, 0));
- aLine.append(" ");
- aLine.append(aMat.get(0, 1));
- aLine.append(" ");
- aLine.append(aMat.get(1, 0));
- aLine.append(" ");
- aLine.append(aMat.get(1, 1));
- aLine.append(" 0 ");
- aLine.append(nWidth);
- aLine.append(" ] ");
- }
+ sal_Int32 nRotAngle = static_cast<sal_Int32>(pRotate->GetValue()) % 360;
+ // /Rotate is clockwise, matrix rotate is counter-clockwise.
+ sal_Int32 nAngle = -1 * nRotAngle;
+
+ // The bounding box just rotates.
+ basegfx::B2DHomMatrix aBBoxMat;
+ aBBoxMat.rotate(basegfx::deg2rad(pRotate->GetValue()));
+ aBBox.transform(aBBoxMat);
+
+ // Now transform the object: rotate around the center and make sure that the rotation
+ // doesn't affect the aspect ratio.
+ basegfx::B2DHomMatrix aMat;
+ aMat.translate(-0.5 * aBBox.getWidth(), -0.5 * aBBox.getHeight());
+ aMat.rotate(basegfx::deg2rad(nAngle));
+ aMat.translate(0.5 * nWidth, 0.5 * nHeight);
+
+ aLine.append(" /Matrix [ ");
+ aLine.append(aMat.a());
+ aLine.append(" ");
+ aLine.append(aMat.b());
+ aLine.append(" ");
+ aLine.append(aMat.c());
+ aLine.append(" ");
+ aLine.append(aMat.d());
+ aLine.append(" ");
+ aLine.append(aMat.e());
+ aLine.append(" ");
+ aLine.append(aMat.f());
+ aLine.append(" ] ");
}
PDFObjectCopier aCopier(*this);
@@ -8772,9 +8802,9 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
aCopier.copyPageResources(pPage, aLine, rResources);
aLine.append(" /BBox [ 0 0 ");
- aLine.append(nWidth);
+ aLine.append(aBBox.getWidth());
aLine.append(" ");
- aLine.append(nHeight);
+ aLine.append(aBBox.getHeight());
aLine.append(" ]");
if (!g_bDebugDisableCompression)
@@ -8816,9 +8846,9 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit)
aLine.append(">> >>");
aLine.append(" /Matrix [ ");
- appendDouble(fScaleX, aLine);
+ appendDouble(fScaleX, aLine, /*nPrecision=*/10);
aLine.append(" 0 0 ");
- appendDouble(fScaleY, aLine);
+ appendDouble(fScaleY, aLine, /*nPrecision=*/10);
aLine.append(" 0 0 ]");
aLine.append(" /BBox [ 0 0 ");
aLine.append(aSize.Width());
diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx
index 1be52a7e987c..cb7e483f4aed 100644
--- a/vcl/source/graphic/Manager.cxx
+++ b/vcl/source/graphic/Manager.cxx
@@ -84,7 +84,12 @@ void Manager::reduceGraphicMemory()
std::scoped_lock<std::recursive_mutex> aGuard(maMutex);
- for (ImpGraphic* pEachImpGraphic : m_pImpGraphicList)
+ // make a copy of m_pImpGraphicList because if we swap out a svg, the svg
+ // filter may create more temp Graphics which are auto-added to
+ // m_pImpGraphicList invalidating a loop over m_pImpGraphicList, e.g.
+ // reexport of tdf118346-1.odg
+ auto const aImpGraphicList = m_pImpGraphicList;
+ for (ImpGraphic* pEachImpGraphic : aImpGraphicList)
{
if (mnUsedSize < mnMemoryLimit * 0.7)
return;
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 1153c6b520cf..1726220f4519 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -83,7 +83,8 @@ void CopyUntil( sal_Unicode*& pTo, const sal_Unicode*& pFrom, sal_Unicode cUntil
*pTo = *pFrom;
pTo++;
}
- pFrom++;
+ if( *pFrom )
+ pFrom++;
} while( *pFrom && *pFrom != cUntil );
// copy the terminating character unless zero or protector
if( ! isProtect( *pFrom ) || bIncludeUntil )
diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx
index 33ff9e648213..4d05467aacc4 100644
--- a/vcl/source/outdev/hatch.cxx
+++ b/vcl/source/outdev/hatch.cxx
@@ -370,7 +370,14 @@ void OutputDevice::DrawHatchLine( const tools::Line& rLine, const tools::PolyPol
nAdd = 1;
if( nAdd )
+ {
+ if (nPCounter == HATCH_MAXPOINTS)
+ {
+ SAL_WARN("vcl.gdi", "too many hatch points");
+ return;
+ }
pPtBuffer[ nPCounter++ ] = Point( FRound( fX ), FRound( fY ) );
+ }
}
aCurSegment.SetStart( aCurSegment.GetEnd() );
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index e52b02410ebd..f4dd135d1080 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -25,6 +25,7 @@
#include <vcl/outdev.hxx>
#include <vcl/settings.hxx>
#include <vcl/virdev.hxx>
+#include <vcl/lazydelete.hxx>
#include <tools/helpers.hxx>
@@ -33,10 +34,70 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/WaveLine.hxx>
+#include <boost/functional/hash.hpp>
+#include <o3tl/lru_map.hxx>
#define UNDERLINE_LAST LINESTYLE_BOLDWAVE
#define STRIKEOUT_LAST STRIKEOUT_X
+struct WavyLineCache final
+{
+ WavyLineCache () : m_aItems( 10 ) {}
+
+ bool find( Color aLineColor, size_t nLineWidth, size_t nWaveHeight, size_t nWordWidth, BitmapEx& rOutput )
+ {
+ Key aKey = { nWaveHeight, aLineColor.mValue };
+ auto item = m_aItems.find( aKey );
+ if ( item == m_aItems.end() )
+ return false;
+ // needs update
+ if ( item->second.m_aLineWidth != nLineWidth || item->second.m_aWordWidth < nWordWidth )
+ {
+ return false;
+ }
+ rOutput = item->second.m_Bitmap;
+ return true;
+ }
+
+ void insert( const BitmapEx& aBitmap, const Color& aLineColor, const size_t nLineWidth, const size_t nWaveHeight, const size_t nWordWidth, BitmapEx& rOutput )
+ {
+ Key aKey = { nWaveHeight, aLineColor.mValue };
+ m_aItems.insert( std::pair< Key, WavyLineCacheItem>( aKey, { nLineWidth, nWordWidth, aBitmap } ) );
+ rOutput = aBitmap;
+ }
+
+ private:
+ struct WavyLineCacheItem
+ {
+ size_t m_aLineWidth;
+ size_t m_aWordWidth;
+ BitmapEx m_Bitmap;
+ };
+
+ struct Key
+ {
+ size_t m_aFirst;
+ size_t m_aSecond;
+ bool operator ==( const Key& rOther ) const
+ {
+ return ( m_aFirst == rOther.m_aFirst && m_aSecond == rOther.m_aSecond );
+ }
+ };
+
+ struct Hash
+ {
+ size_t operator() ( const Key& rKey ) const
+ {
+ size_t aSeed = 0;
+ boost::hash_combine(aSeed, rKey.m_aFirst);
+ boost::hash_combine(aSeed, rKey.m_aSecond);
+ return aSeed;
+ }
+ };
+
+ o3tl::lru_map< Key, WavyLineCacheItem, Hash > m_aItems;
+};
+
void OutputDevice::ImplInitTextLineSize()
{
mpFontInstance->mxFontMetric->ImplInitTextLineSize( this );
@@ -599,6 +660,8 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
int nStrikeStrLen = (nWidth+(nStrikeoutWidth-1)) / nStrikeoutWidth;
if( nStrikeStrLen > nMaxStrikeStrLen )
nStrikeStrLen = nMaxStrikeStrLen;
+ else if (nStrikeStrLen < 0)
+ nStrikeStrLen = 0;
// build the strikeout string
for( int i = nTestStrLen; i < nStrikeStrLen; ++i)
@@ -1000,6 +1063,48 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, const Point& rEndPos, lo
nLineWidth = 1;
}
+ if ( fOrientation == 0.0 )
+ {
+ static vcl::DeleteOnDeinit< WavyLineCache > snLineCache( new WavyLineCache() );
+ if ( !snLineCache.get() )
+ return;
+ WavyLineCache& rLineCache = *snLineCache.get();
+ BitmapEx aWavylinebmp;
+ if ( !rLineCache.find( GetLineColor(), nLineWidth, nWaveHeight, nEndX - nStartX, aWavylinebmp ) )
+ {
+ size_t nWordLength = nEndX - nStartX;
+ // start with something big to avoid updating it frequently
+ nWordLength = nWordLength < 1024 ? 1024 : nWordLength;
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev( *this, DeviceFormat::DEFAULT,
+ DeviceFormat::DEFAULT );
+ pVirtDev->SetAntialiasing( AntialiasingFlags::EnableB2dDraw );
+ pVirtDev->SetOutputSizePixel( Size( nWordLength, nWaveHeight * 2 ), false );
+ pVirtDev->SetLineColor( GetLineColor() );
+ pVirtDev->SetBackground( Wallpaper( COL_TRANSPARENT ) );
+#ifdef IOS
+ // Stopgap workaround for some bug in the iOS-specific vcl code.
+ pVirtDev->SetFillColor( COL_WHITE );
+ pVirtDev->DrawRect( tools::Rectangle( 0, 0, pVirtDev->GetOutputSize().Width(), pVirtDev->GetOutputSize().Height() ) );
+#endif
+ pVirtDev->ImplDrawWaveLineBezier( 0, 0, nWordLength, 0, nWaveHeight, fOrientation, nLineWidth );
+ rLineCache.insert( pVirtDev->GetBitmapEx( Point( 0, 0 ), pVirtDev->GetOutputSize() ), GetLineColor(), nLineWidth, nWaveHeight, nWordLength, aWavylinebmp );
+ }
+ if ( aWavylinebmp.ImplGetBitmapSalBitmap() != nullptr )
+ {
+ Size _size( nEndX - nStartX, aWavylinebmp.GetSizePixel().Height() );
+ DrawBitmapEx(Point( rStartPos.X(), rStartPos.Y() ), PixelToLogic( _size ), Point(), _size, aWavylinebmp);
+ }
+ return;
+ }
+
+ ImplDrawWaveLineBezier( nStartX, nStartY, nEndX, nEndY, nWaveHeight, fOrientation, nLineWidth );
+
+ if( mpAlphaVDev )
+ mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos, nLineWidth );
+}
+
+void OutputDevice::ImplDrawWaveLineBezier(long nStartX, long nStartY, long nEndX, long nEndY, long nWaveHeight, double fOrientation, long nLineWidth)
+{
const basegfx::B2DRectangle aWaveLineRectangle(nStartX, nStartY, nEndX, nEndY + nWaveHeight);
const basegfx::B2DPolygon aWaveLinePolygon = basegfx::createWaveLinePolygon(aWaveLineRectangle);
const basegfx::B2DHomMatrix aRotationMatrix = basegfx::utils::createRotateAroundPoint(nStartX, nStartY, basegfx::deg2rad(-fOrientation));
@@ -1018,9 +1123,6 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, const Point& rEndPos, lo
basegfx::deg2rad(15.0),
bPixelSnapHairline,
this);
-
- if( mpAlphaVDev )
- mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos, nLineWidth );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/pdf/PdfConfig.cxx b/vcl/source/pdf/PdfConfig.cxx
new file mode 100644
index 000000000000..52859c7b1f6e
--- /dev/null
+++ b/vcl/source/pdf/PdfConfig.cxx
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <cstdlib>
+
+namespace vcl::pdf
+{
+/// Get the default PDF rendering resolution in DPI.
+double getDefaultPdfResolutionDpi()
+{
+ // If an overriding default is set, use it.
+ const char* envar = ::getenv("PDFIMPORT_RESOLUTION_DPI");
+ if (envar)
+ {
+ const double dpi = atof(envar);
+ if (dpi > 0)
+ return dpi;
+ }
+
+ // Fallback to a sensible default.
+ return 96.;
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 2c6010dc205d..08e2dc01fb9c 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -11,6 +11,7 @@
#include <vcl/event.hxx>
#include <vcl/tabpage.hxx>
+#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
#include <vcl/toolkit/spin.hxx>
@@ -394,7 +395,7 @@ vcl::Window* findChild(vcl::Window* pParent, const OUString& rID, bool bRequireV
for (size_t i = 0; i < nCount; ++i)
{
vcl::Window* pChild = pParent->GetChild(i);
- if (pChild && pChild->get_id() == rID
+ if (pChild && !pChild->isDisposed() && pChild->get_id() == rID
&& (!bRequireVisible || pChild->IsVisible()))
return pChild;
@@ -1485,6 +1486,55 @@ std::unique_ptr<UIObject> TabControlUIObject::create(vcl::Window* pWindow)
return std::unique_ptr<UIObject>(new TabControlUIObject(pTabControl));
}
+DrawingAreaUIObject::DrawingAreaUIObject(const VclPtr<VclDrawingArea>& rDrawingArea)
+ : WindowUIObject(rDrawingArea)
+ , mxDrawingArea(rDrawingArea.get())
+{
+ assert(mxDrawingArea);
+}
+
+DrawingAreaUIObject::~DrawingAreaUIObject()
+{
+}
+
+void DrawingAreaUIObject::execute(const OUString& rAction, const StringMap& rParameters)
+{
+ if (rAction == "CLICK")
+ {
+ // POSX and POSY are percentage of width/height dimensions
+ if (rParameters.find("POSX") != rParameters.end() &&
+ rParameters.find("POSY") != rParameters.end())
+ {
+ auto aPosX = rParameters.find("POSX");
+ auto aPosY = rParameters.find("POSY");
+
+ OString sPosX2 = OUStringToOString(aPosX->second, RTL_TEXTENCODING_ASCII_US);
+ OString sPoxY2 = OUStringToOString(aPosY->second, RTL_TEXTENCODING_ASCII_US);
+
+ if (!sPosX2.isEmpty() && !sPoxY2.isEmpty())
+ {
+ double fPosX = std::atof(sPosX2.getStr());
+ double fPosY = std::atof(sPoxY2.getStr());
+
+ fPosX = fPosX * mxDrawingArea->GetOutputWidthPixel();
+ fPosY = fPosY * mxDrawingArea->GetOutputHeightPixel();
+
+ MouseEvent aEvent(Point(fPosX, fPosY), 1, MouseEventModifiers::NONE, MOUSE_LEFT, 0);
+ mxDrawingArea->MouseButtonDown(aEvent);
+ mxDrawingArea->MouseButtonUp(aEvent);
+ }
+ }
+ }
+ else
+ WindowUIObject::execute(rAction, rParameters);
+}
+
+std::unique_ptr<UIObject> DrawingAreaUIObject::create(vcl::Window* pWindow)
+{
+ VclDrawingArea* pVclDrawingArea = dynamic_cast<VclDrawingArea*>(pWindow);
+ assert(pVclDrawingArea);
+ return std::unique_ptr<UIObject>(new DrawingAreaUIObject(pVclDrawingArea));
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 8a5c3783830d..892c7c4f1751 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -15,6 +15,7 @@
#include <comphelper/lok.hxx>
#include <i18nutil/unicode.hxx>
+#include <jsdialog/enabled.hxx>
#include <officecfg/Office/Common.hxx>
#include <osl/module.hxx>
#include <sal/log.hxx>
@@ -154,49 +155,7 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
bool bUseJSBuilder = false;
if (comphelper::LibreOfficeKit::isActive())
- {
- if (bMobile)
- {
- if (rUIFile == "modules/swriter/ui/wordcount-mobile.ui" ||
- rUIFile == "svx/ui/findreplacedialog-mobile.ui" ||
- rUIFile == "modules/swriter/ui/watermarkdialog.ui" ||
- rUIFile == "modules/scalc/ui/validationdialog.ui" ||
- rUIFile == "modules/scalc/ui/validationcriteriapage.ui" ||
- rUIFile == "modules/scalc/ui/validationhelptabpage-mobile.ui" ||
- rUIFile == "modules/scalc/ui/erroralerttabpage-mobile.ui" ||
- rUIFile == "modules/scalc/ui/validationdialog.ui")
- {
- bUseJSBuilder = true;
- }
- }
-
- if (rUIFile == "modules/scalc/ui/pivottablelayoutdialog.ui"
- || rUIFile == "modules/scalc/ui/selectsource.ui"
- || rUIFile == "modules/scalc/ui/managenamesdialog.ui"
- || rUIFile == "modules/scalc/ui/definename.ui"
- || rUIFile == "modules/scalc/ui/correlationdialog.ui"
- || rUIFile == "modules/scalc/ui/samplingdialog.ui"
- || rUIFile == "modules/scalc/ui/descriptivestatisticsdialog.ui"
- || rUIFile == "modules/scalc/ui/analysisofvariancedialog.ui"
- || rUIFile == "modules/scalc/ui/covariancedialog.ui"
- || rUIFile == "modules/scalc/ui/exponentialsmoothingdialog.ui"
- || rUIFile == "modules/scalc/ui/movingaveragedialog.ui"
- || rUIFile == "modules/scalc/ui/regressiondialog.ui"
- || rUIFile == "modules/scalc/ui/ttestdialog.ui"
- || rUIFile == "modules/scalc/ui/ttestdialog.ui"
- || rUIFile == "modules/scalc/ui/ztestdialog.ui"
- || rUIFile == "modules/scalc/ui/chisquaretestdialog.ui"
- || rUIFile == "modules/scalc/ui/fourieranalysisdialog.ui"
- || rUIFile == "modules/scalc/ui/datafielddialog.ui"
- || rUIFile == "modules/scalc/ui/pivotfielddialog.ui"
- || rUIFile == "modules/scalc/ui/datafieldoptionsdialog.ui"
- || rUIFile == "svx/ui/fontworkgallerydialog.ui"
- || rUIFile == "cui/ui/macroselectordialog.ui"
- || rUIFile == "uui/ui/macrowarnmedium.ui")
- {
- bUseJSBuilder = true;
- }
- }
+ bUseJSBuilder = jsdialog::isBuilderEnabled(rUIFile, bMobile);
if (bUseJSBuilder)
return JSInstanceBuilder::CreateDialogBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile);
@@ -207,14 +166,11 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
weld::Builder* Application::CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, sal_uInt64 nLOKWindowId)
{
// Notebookbar sub controls
- if (comphelper::LibreOfficeKit::isActive()
- && (rUIFile == "svx/ui/stylespreview.ui"
- || rUIFile == "modules/scalc/ui/numberbox.ui"))
+ if (comphelper::LibreOfficeKit::isActive() && jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile))
{
return JSInstanceBuilder::CreateNotebookbarBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>(), nLOKWindowId);
}
- else if (comphelper::LibreOfficeKit::isActive()
- && (rUIFile == "modules/scalc/ui/filterdropdown.ui"))
+ else if (comphelper::LibreOfficeKit::isActive() && (rUIFile == "modules/scalc/ui/filterdropdown.ui"))
{
return JSInstanceBuilder::CreateAutofilterWindowBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile);
}
@@ -224,9 +180,9 @@ weld::Builder* Application::CreateInterimBuilder(vcl::Window* pParent, const OUS
weld::MessageDialog* Application::CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType,
VclButtonsType eButtonType, const OUString& rPrimaryMessage,
- bool bMobile)
+ bool /*bMobile*/)
{
- if (bMobile)
+ if (comphelper::LibreOfficeKit::isActive())
return JSInstanceBuilder::CreateMessageDialog(pParent, eMessageType, eButtonType, rPrimaryMessage);
else
return ImplGetSVData()->mpDefInst->CreateMessageDialog(pParent, eMessageType, eButtonType, rPrimaryMessage);
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 83fa562023ce..a68a6a8e4249 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -18,6 +18,7 @@
*/
#include <config_feature_desktop.h>
+#include <config_features.h>
#ifdef IOS
#include <premac.h>
@@ -415,7 +416,8 @@ vcl::Window* Dialog::GetDefaultParent(WinBits nStyle)
auto& rExecuteDialogs = pSVData->mpWinData->mpExecuteDialogs;
auto it = std::find_if(rExecuteDialogs.rbegin(), rExecuteDialogs.rend(),
[&pParent](VclPtr<Dialog>& rDialogPtr) {
- return pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild(rDialogPtr, true) &&
+ return pParent->ImplGetFirstOverlapWindow() &&
+ pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild(rDialogPtr, true) &&
rDialogPtr->IsReallyVisible() && rDialogPtr->IsEnabled() &&
rDialogPtr->IsInputEnabled() && !rDialogPtr->IsInModalMode(); });
if (it != rExecuteDialogs.rend())
@@ -961,12 +963,15 @@ bool Dialog::ImplStartExecute()
if ( pParent )
{
pParent = pParent->ImplGetFirstOverlapWindow();
- SAL_WARN_IF( !pParent->IsReallyVisible(), "vcl",
- "Dialog::StartExecuteModal() - Parent not visible" );
- SAL_WARN_IF( !pParent->IsInputEnabled(), "vcl",
- "Dialog::StartExecuteModal() - Parent input disabled, use another parent to ensure modality!" );
- SAL_WARN_IF( pParent->IsInModalMode(), "vcl",
- "Dialog::StartExecuteModal() - Parent already modally disabled, use another parent to ensure modality!" );
+ if (pParent)
+ {
+ SAL_WARN_IF( !pParent->IsReallyVisible(), "vcl",
+ "Dialog::StartExecuteModal() - Parent not visible" );
+ SAL_WARN_IF( !pParent->IsInputEnabled(), "vcl",
+ "Dialog::StartExecuteModal() - Parent input disabled, use another parent to ensure modality!" );
+ SAL_WARN_IF( pParent->IsInModalMode(), "vcl",
+ "Dialog::StartExecuteModal() - Parent already modally disabled, use another parent to ensure modality!" );
+ }
}
#endif
@@ -1034,10 +1039,6 @@ void Dialog::ImplEndExecuteModal()
short Dialog::Execute()
{
-// Once the Android app is based on same idea as the iOS one currently
-// being developed, no conditional should be needed here. Until then,
-// play it safe.
-#if HAVE_FEATURE_DESKTOP || defined IOS
VclPtr<vcl::Window> xWindow = this;
mbInSyncExecute = true;
@@ -1050,7 +1051,7 @@ short Dialog::Execute()
// Yield util EndDialog is called or dialog gets destroyed
// (the latter should not happen, but better safe than sorry
- while ( !xWindow->IsDisposed() && mbInExecute )
+ while ( !xWindow->IsDisposed() && mbInExecute && !Application::IsQuit() )
Application::Yield();
ImplEndExecuteModal();
@@ -1068,10 +1069,6 @@ short Dialog::Execute()
mpDialogImpl->mnResult = -1;
return static_cast<short>(nRet);
-
-#else
- return RET_OK;
-#endif
}
// virtual
@@ -1271,12 +1268,11 @@ void Dialog::ImplSetModalInputMode( bool bModal )
void Dialog::GrabFocusToFirstControl()
{
- vcl::Window* pFocusControl;
+ vcl::Window* pFocusControl = nullptr;
+ vcl::Window* pFirstOverlapWindow = ImplGetFirstOverlapWindow();
// find focus control, even if the dialog has focus
- if ( HasFocus() )
- pFocusControl = nullptr;
- else
+ if (!HasFocus() && pFirstOverlapWindow && pFirstOverlapWindow->mpWindowImpl)
{
// prefer a child window which had focus before
pFocusControl = ImplGetFirstOverlapWindow()->mpWindowImpl->mpLastFocusWindow;
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 36cefbc201df..064b889467f4 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -28,6 +28,7 @@
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
#include <vcl/settings.hxx>
+#include <comphelper/lok.hxx>
#include <svdata.hxx>
#include <window.h>
@@ -923,7 +924,9 @@ Point DockingWindow::GetFloatingPos() const
aData.SetMask( WindowStateMask::Pos );
pWrapper->mpFloatWin->GetWindowStateData( aData );
Point aPos( aData.GetX(), aData.GetY() );
- aPos = pWrapper->mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel( aPos );
+ // LOK needs logic coordinates not absolute screen position for autofilter menu
+ if (!comphelper::LibreOfficeKit::isActive() || get_id() != "check_list_menu")
+ aPos = pWrapper->mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel( aPos );
return aPos;
}
else
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 23bb7b00a43c..0b096938fa74 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -552,7 +552,8 @@ void Window::ImplCallMove()
vcl::Window *pParent = ImplGetParent();
while( pParent )
{
- if( pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
+ if( pParent->mpWindowImpl &&
+ pParent->mpWindowImpl->mpFrame != mpWindowImpl->mpFrame )
{
pParentFrame = pParent->mpWindowImpl->mpFrame;
break;
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 81c0ddb3d32d..f1923c5c1152 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -648,7 +648,10 @@ void FloatingWindow::StateChanged( StateChangedType nType )
// we are a toplevel window, let's so far pretend to be a
// dialog - but maybe we'll need a separate type for this
// later
- aItems.emplace_back("type", "dialog");
+ if (mbInPopupMode)
+ aItems.emplace_back("type", "dropdown");
+ else
+ aItems.emplace_back("type", "dialog");
aItems.emplace_back("position", mpImplData->maLOKTwipsPos.toString()); // twips
}
else
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 4e2efa065439..f1753b548466 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <config_features.h>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <o3tl/enumarray.hxx>
#include <o3tl/enumrange.hxx>
@@ -17,6 +18,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/messagedialog.hxx>
+#include <vcl/uitest/uiobject.hxx>
#include <window.h>
#include <boost/multi_array.hpp>
#include <boost/property_tree/ptree.hpp>
@@ -2721,4 +2723,11 @@ bool isLayoutEnabled(const vcl::Window *pWindow)
return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(GetWindowType::Next);
}
+FactoryFunction VclDrawingArea::GetUITestFactory() const
+{
+ if (m_pFactoryFunction)
+ return m_pFactoryFunction;
+ return DrawingAreaUIObject::create;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 753c3b7282ff..cd95b076ac3d 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -455,7 +455,7 @@ void MenuFloatingWindow::Execute()
Start();
- while (bInExecute)
+ while (bInExecute && !Application::IsQuit())
Application::Yield();
pSVData->maAppData.mpActivePopupMenu = nullptr;
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 16993d199987..e1f9c9e6777e 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -252,7 +252,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
bool bAsyncFocusWaiting = false;
vcl::Window *pFrame = pSVData->maFrameData.mpFirstFrame;
- while( pFrame )
+ while( pFrame && pFrame->mpWindowImpl && pFrame->mpWindowImpl->mpFrameData )
{
if( pFrame != mpWindowImpl->mpFrameWindow.get() && pFrame->mpWindowImpl->mpFrameData->mnFocusId )
{
@@ -275,6 +275,8 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
bMustNotGrabFocus = true;
break;
}
+ if (!pParent->mpWindowImpl)
+ break;
pParent = pParent->mpWindowImpl->mpParent;
}
@@ -290,7 +292,8 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
// mark this windows as the last FocusWindow
vcl::Window* pOverlapWindow = ImplGetFirstOverlapWindow();
- pOverlapWindow->mpWindowImpl->mpLastFocusWindow = this;
+ if (pOverlapWindow->mpWindowImpl)
+ pOverlapWindow->mpWindowImpl->mpLastFocusWindow = this;
mpWindowImpl->mpFrameData->mpFocusWin = this;
if( !bHasFocus )
@@ -332,13 +335,16 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
else
{
vcl::Window* pNewOverlapWindow = ImplGetFirstOverlapWindow();
- vcl::Window* pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
- pNewOverlapWindow->mpWindowImpl->mbActive = true;
- pNewOverlapWindow->Activate();
- if ( pNewRealWindow != pNewOverlapWindow )
+ if ( pNewOverlapWindow && pNewOverlapWindow->mpWindowImpl )
{
- pNewRealWindow->mpWindowImpl->mbActive = true;
- pNewRealWindow->Activate();
+ vcl::Window* pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
+ pNewOverlapWindow->mpWindowImpl->mbActive = true;
+ pNewOverlapWindow->Activate();
+ if ( pNewRealWindow != pNewOverlapWindow && pNewRealWindow && pNewRealWindow->mpWindowImpl )
+ {
+ pNewRealWindow->mpWindowImpl->mbActive = true;
+ pNewRealWindow->Activate();
+ }
}
}
@@ -461,7 +467,8 @@ void Window::ReleaseMouse()
{
ImplSVData* pSVData = ImplGetSVData();
pSVData->mpWinData->mpCaptureWin = nullptr;
- mpWindowImpl->mpFrame->CaptureMouse( false );
+ if (mpWindowImpl && mpWindowImpl->mpFrame)
+ mpWindowImpl->mpFrame->CaptureMouse( false );
ImplGenerateMouseMove();
}
}
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 218cdd3216ed..e890503e615d 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -622,6 +622,9 @@ void Window::ImplCallPaint(const vcl::Region* pRegion, ImplPaintFlags nPaintFlag
void Window::ImplCallOverlapPaint()
{
+ if (!mpWindowImpl)
+ return;
+
// emit overlapping windows first
vcl::Window* pTempWindow = mpWindowImpl->mpFirstOverlap;
while ( pTempWindow )
@@ -642,7 +645,6 @@ void Window::ImplCallOverlapPaint()
IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
{
-#ifndef IOS
comphelper::ProfileZone aZone("VCL idle re-paint");
// save paint events until layout is done
@@ -665,7 +667,6 @@ IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
mpWindowImpl->mpFrameData->maPaintIdle.IsActive())
mpWindowImpl->mpFrameData->maPaintIdle.Stop();
}
-#endif
}
IMPL_LINK_NOARG(Window, ImplHandleResizeTimerHdl, Timer *, void)
@@ -988,7 +989,7 @@ void Window::ImplValidate()
void Window::ImplUpdateAll()
{
- if ( !mpWindowImpl->mbReallyVisible )
+ if ( !mpWindowImpl || !mpWindowImpl->mbReallyVisible )
return;
bool bFlush = false;
@@ -1287,6 +1288,9 @@ bool Window::HasPaintEvent() const
void Window::Update()
{
+ if (!mpWindowImpl)
+ return;
+
if ( mpWindowImpl->mpBorderWindow )
{
mpWindowImpl->mpBorderWindow->Update();
@@ -1338,7 +1342,11 @@ void Window::Update()
// trigger an update also for system windows on top of us,
// otherwise holes would remain
- vcl::Window* pUpdateOverlapWindow = ImplGetFirstOverlapWindow()->mpWindowImpl->mpFirstOverlap;
+ vcl::Window* pUpdateOverlapWindow = ImplGetFirstOverlapWindow();
+ if (pUpdateOverlapWindow->mpWindowImpl)
+ pUpdateOverlapWindow = pUpdateOverlapWindow->mpWindowImpl->mpFirstOverlap;
+ else
+ pUpdateOverlapWindow = nullptr;
while ( pUpdateOverlapWindow )
{
pUpdateOverlapWindow->Update();
@@ -1601,6 +1609,9 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /*rSize*/ )
{
+ if( !mpWindowImpl )
+ return;
+
SAL_WARN_IF( pDev->HasMirroredGraphics(), "vcl.window", "PaintToDevice to mirroring graphics" );
SAL_WARN_IF( pDev->IsRTLEnabled(), "vcl.window", "PaintToDevice to mirroring device" );
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 41d0d5f89ec9..c8ee805b7354 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -256,6 +256,12 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
if (!rMEvt.IsRight())
ReleaseMouse();
+#if defined IOS || defined ANDROID
+ const bool bDoMessWithSelection = !rMEvt.IsRight();
+#else
+ constexpr bool bDoMessWithSelection = true;
+#endif
+
if( (nFlags & SelectionEngineFlags::WAIT_UPEVT) && !(nFlags & SelectionEngineFlags::CMDEVT) &&
eSelMode != SelectionMode::Single)
{
@@ -271,13 +277,16 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
pFunctionSet->DeselectAtPoint( aLastMove.GetPosPixel() );
nFlags &= ~SelectionEngineFlags::HAS_ANCH; // uncheck anchor
- pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), true );
+ if (bDoMessWithSelection)
+ pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), true );
}
else
{
- pFunctionSet->DeselectAll();
+ if (bDoMessWithSelection)
+ pFunctionSet->DeselectAll();
nFlags &= ~SelectionEngineFlags::HAS_ANCH; // uncheck anchor
- pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel() );
+ if (bDoMessWithSelection)
+ pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel() );
}
}
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 9d2a0b671c66..f0f1e1744749 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1188,7 +1188,7 @@ void SystemWindow::ensureRepaint()
Invalidate();
mbPaintComplete = false;
- while (!mbPaintComplete)
+ while (!mbPaintComplete && !Application::IsQuit())
{
Application::Yield();
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index e7a15643f111..0a255688dd46 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3077,7 +3077,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
vcl::Window *pWin = pFocusWin->GetParent();
while (pWin)
{
- if(pWin->ImplGetWindowImpl()->mbToolBox)
+ if(pWin->ImplGetWindowImpl() && pWin->ImplGetWindowImpl()->mbToolBox)
{
bFocusWindowIsAToolBoxChild = true;
break;
@@ -3086,7 +3086,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
}
}
- if( bFocusWindowIsAToolBoxChild || (pFocusWin && pFocusWin->ImplGetWindowImpl()->mbToolBox && pFocusWin != this) )
+ if( bFocusWindowIsAToolBoxChild || (pFocusWin && pFocusWin->ImplGetWindowImpl() && pFocusWin->ImplGetWindowImpl()->mbToolBox && pFocusWin != this) )
bDrawHotSpot = false;
if ( mbSelection && bDrawHotSpot )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b3f6ce9e9a29..f9acc5db9c2f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1708,7 +1708,7 @@ void Window::ImplNewInputContext()
{
ImplSVData* pSVData = ImplGetSVData();
vcl::Window* pFocusWin = pSVData->mpWinData->mpFocusWin;
- if ( !pFocusWin )
+ if ( !pFocusWin || !pFocusWin->mpWindowImpl )
return;
// Is InputContext changed?
@@ -2240,7 +2240,8 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
// inherit native widget flag for form controls
// required here, because frames never show up in the child hierarchy - which should be fixed...
// eg, the drop down of a combobox which is a system floating window
- if( mpWindowImpl->mbFrame && GetParent() && GetParent()->IsCompoundControl() &&
+ if( mpWindowImpl->mbFrame && GetParent() && !GetParent()->IsDisposed() &&
+ GetParent()->IsCompoundControl() &&
GetParent()->IsNativeWidgetEnabled() != IsNativeWidgetEnabled() &&
!(GetStyle() & WB_TOOLTIPWIN) )
{
@@ -3709,7 +3710,7 @@ void Window::EnableNativeWidget( bool bEnable )
bool Window::IsNativeWidgetEnabled() const
{
- return ImplGetWinData()->mbEnableNativeWidget;
+ return mpWindowImpl ? ImplGetWinData()->mbEnableNativeWidget : false;
}
Reference< css::rendering::XCanvas > Window::ImplGetCanvas( bool bSpriteCanvas ) const
@@ -3889,7 +3890,10 @@ void Window::set_id(const OUString& rID)
const OUString& Window::get_id() const
{
- return mpWindowImpl->maID;
+ if (mpWindowImpl)
+ return mpWindowImpl->maID;
+ static OUString empty;
+ return empty;
}
FactoryFunction Window::GetUITestFactory() const
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index b4c69e49d0ff..8282396af932 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -286,6 +286,7 @@ void Window::EndTracking( TrackingEventFlags nFlags )
ReleaseMouse();
// call EndTracking if required
+ if (mpWindowImpl && mpWindowImpl->mpFrameData)
{
Point aMousePos( mpWindowImpl->mpFrameData->mnLastMouseX, mpWindowImpl->mpFrameData->mnLastMouseY );
if( ImplIsAntiparallel() )
@@ -311,7 +312,7 @@ void Window::EndTracking( TrackingEventFlags nFlags )
bool Window::IsTracking() const
{
- return (ImplGetSVData()->mpWinData->mpTrackWin == this);
+ return mpWindowImpl && (ImplGetSVData()->mpWinData->mpTrackWin == this);
}
void Window::StartAutoScroll( StartAutoScrollFlags nFlags )
@@ -892,6 +893,11 @@ vcl::Window* Window::ImplGetFirstOverlapWindow()
const vcl::Window* Window::ImplGetFirstOverlapWindow() const
{
+ if (!mpWindowImpl)
+ {
+ return nullptr;
+ }
+
if ( mpWindowImpl->mbOverlapWin )
return this;
else
@@ -1192,7 +1198,7 @@ GetFocusFlags Window::GetGetFocusFlags() const
bool Window::IsCompoundControl() const
{
- return mpWindowImpl->mbCompoundControl;
+ return mpWindowImpl ? mpWindowImpl->mbCompoundControl : false;
}
bool Window::IsWait() const
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index cd6e91b21f7e..096dd683c894 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -810,17 +810,20 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow )
vcl::Window* pChild = pSVData->mpWinData->mpFirstFloat;
while (pChild)
{
- if (pChild->ImplGetWindowImpl()->mbFloatWin)
+ if (pChild->ImplGetWindowImpl())
{
- if (static_cast<FloatingWindow *>(pChild)->GrabsFocus())
- break;
- }
- else if (pChild->ImplGetWindowImpl()->mbDockWin)
- {
- vcl::Window* pParent = pChild->GetWindow(GetWindowType::RealParent);
- if (pParent && pParent->ImplGetWindowImpl()->mbFloatWin &&
- static_cast<FloatingWindow *>(pParent)->GrabsFocus())
- break;
+ if (pChild->ImplGetWindowImpl()->mbFloatWin)
+ {
+ if (static_cast<FloatingWindow *>(pChild)->GrabsFocus())
+ break;
+ }
+ else if (pChild->ImplGetWindowImpl()->mbDockWin)
+ {
+ vcl::Window* pParent = pChild->GetWindow(GetWindowType::RealParent);
+ if (pParent && pParent->ImplGetWindowImpl()->mbFloatWin &&
+ static_cast<FloatingWindow *>(pParent)->GrabsFocus())
+ break;
+ }
}
pChild = pChild->GetParent();
}
@@ -828,7 +831,7 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow )
if (!pChild)
pChild = pWindow;
- pChild = pChild->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
+ pChild = pChild->ImplGetWindowImpl() && pChild->ImplGetWindowImpl()->mpFrameData ? pChild->ImplGetWindowImpl()->mpFrameData->mpFocusWin.get() : nullptr;
// no child - then no input
if ( !pChild )
@@ -1735,6 +1738,9 @@ static void ImplActivateFloatingWindows( vcl::Window const * pWindow, bool bActi
IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void*, void)
{
+ if (!ImplGetWindowImpl() || !ImplGetWindowImpl()->mpFrameData)
+ return;
+
ImplGetWindowImpl()->mpFrameData->mnFocusId = nullptr;
// If the status has been preserved, because we got back the focus
@@ -1793,22 +1799,27 @@ IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void*, void)
{
// transfer the FocusWindow
vcl::Window* pOverlapWindow = pFocusWin->ImplGetFirstOverlapWindow();
- pOverlapWindow->ImplGetWindowImpl()->mpLastFocusWindow = pFocusWin;
+ if ( pOverlapWindow && pOverlapWindow->ImplGetWindowImpl() )
+ pOverlapWindow->ImplGetWindowImpl()->mpLastFocusWindow = pFocusWin;
pSVData->mpWinData->mpFocusWin = nullptr;
- if ( pFocusWin->ImplGetWindowImpl()->mpCursor )
+ if ( pFocusWin->ImplGetWindowImpl() && pFocusWin->ImplGetWindowImpl()->mpCursor )
pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
// call the Deactivate
vcl::Window* pOldOverlapWindow = pFocusWin->ImplGetFirstOverlapWindow();
vcl::Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
- pOldOverlapWindow->ImplGetWindowImpl()->mbActive = false;
- pOldOverlapWindow->Deactivate();
- if ( pOldRealWindow != pOldOverlapWindow )
+ if (pOldOverlapWindow && pOldOverlapWindow->ImplGetWindowImpl() &&
+ pOldRealWindow && pOldRealWindow->ImplGetWindowImpl())
{
- pOldRealWindow->ImplGetWindowImpl()->mbActive = false;
- pOldRealWindow->Deactivate();
+ pOldOverlapWindow->ImplGetWindowImpl()->mbActive = false;
+ pOldOverlapWindow->Deactivate();
+ if ( pOldRealWindow != pOldOverlapWindow )
+ {
+ pOldRealWindow->ImplGetWindowImpl()->mbActive = false;
+ pOldRealWindow->Deactivate();
+ }
}
// TrackingMode is ended in ImplHandleLoseFocus
@@ -1832,6 +1843,9 @@ IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void*, void)
static void ImplHandleGetFocus( vcl::Window* pWindow )
{
+ if (!pWindow || !pWindow->ImplGetWindowImpl() || !pWindow->ImplGetWindowImpl()->mpFrameData)
+ return;
+
pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = true;
// execute Focus-Events after a delay, such that SystemChildWindows
@@ -1848,6 +1862,9 @@ static void ImplHandleGetFocus( vcl::Window* pWindow )
static void ImplHandleLoseFocus( vcl::Window* pWindow )
{
+ if (!pWindow)
+ return;
+
ImplSVData* pSVData = ImplGetSVData();
// Abort the autoscroll if the frame loses focus
@@ -1857,23 +1874,27 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
// Abort tracking if the frame loses focus
if (pSVData->mpWinData->mpTrackWin)
{
- if (pSVData->mpWinData->mpTrackWin->ImplGetWindowImpl()->mpFrameWindow == pWindow)
+ if (pSVData->mpWinData->mpTrackWin->ImplGetWindowImpl() &&
+ pSVData->mpWinData->mpTrackWin->ImplGetWindowImpl()->mpFrameWindow == pWindow)
pSVData->mpWinData->mpTrackWin->EndTracking(TrackingEventFlags::Cancel);
}
- pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = false;
-
- // execute Focus-Events after a delay, such that SystemChildWindows
- // do not flicker when they receive focus
- if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
+ if (pWindow->ImplGetWindowImpl() && pWindow->ImplGetWindowImpl()->mpFrameData)
{
- pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus;
- pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), nullptr, true );
- }
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = false;
+
+ // execute Focus-Events after a delay, such that SystemChildWindows
+ // do not flicker when they receive focus
+ if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
+ {
+ pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus;
+ pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, vcl::Window, ImplAsyncFocusHdl ), nullptr, true );
+ }
- vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
- if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
- pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
+ vcl::Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
+ if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
+ pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
+ }
// Make sure that no menu is visible when a toplevel window loses focus.
VclPtr<FloatingWindow> pFirstFloat = pSVData->mpWinData->mpFirstFloat;
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index e9861dca51d8..4f05e11a5845 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -142,7 +142,7 @@ Preedit_InsertText(preedit_text_t *pText, XIMText *pInsertText, int where)
if (pInsertText->encoding_is_wchar)
{
wchar_t *pWCString = pInsertText->string.wide_char;
- size_t nBytes = wcstombs ( nullptr, pWCString, 1024 /* don't care */);
+ size_t nBytes = wcstombs ( nullptr, pWCString, 0 /* don't care */);
pMBString = static_cast<char*>(alloca( nBytes + 1 ));
nMBLength = wcstombs ( pMBString, pWCString, nBytes + 1);
}
@@ -476,7 +476,7 @@ StatusDrawCallback (XIC, XPointer, XIMStatusDrawCallbackStruct *call_data)
if( call_data->data.text->string.wide_char )
{
wchar_t* pWString = call_data->data.text->string.wide_char;
- size_t nBytes = wcstombs( nullptr, pWString, 1024 );
+ size_t nBytes = wcstombs( nullptr, pWString, 0 /*don't care*/ );
pMBString = static_cast<sal_Char*>(alloca( nBytes+1 ));
nLength = wcstombs( pMBString, pWString, nBytes+1 );
}
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx
index cae2a4e1ab03..d114dd71accd 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -40,11 +40,11 @@ void CPDManager::onNameAcquired (GDBusConnection *connection,
gpointer user_data)
{
gchar* contents;
- GDBusNodeInfo *introspection_data;
-
// Get Interface for introspection
- g_file_get_contents (FRONTEND_INTERFACE, &contents, nullptr, nullptr);
- introspection_data = g_dbus_node_info_new_for_xml (contents, nullptr);
+ if (!g_file_get_contents (FRONTEND_INTERFACE, &contents, nullptr, nullptr))
+ return;
+
+ GDBusNodeInfo *introspection_data = g_dbus_node_info_new_for_xml (contents, nullptr);
g_dbus_connection_register_object (connection,
"/org/libreoffice/PrintDialog",
@@ -60,28 +60,29 @@ void CPDManager::onNameAcquired (GDBusConnection *connection,
std::vector<std::pair<std::string, gchar*>> backends = current->getTempBackends();
for (auto const& backend : backends)
{
- GDBusProxy *proxy;
// Get Interface for introspection
- g_file_get_contents (BACKEND_INTERFACE, &contents, nullptr, nullptr);
- introspection_data = g_dbus_node_info_new_for_xml (contents, nullptr);
- proxy = g_dbus_proxy_new_sync (connection,
- G_DBUS_PROXY_FLAGS_NONE,
- introspection_data->interfaces[0],
- backend.first.c_str(),
- backend.second,
- "org.openprinting.PrintBackend",
- nullptr,
- nullptr);
+ if (g_file_get_contents(BACKEND_INTERFACE, &contents, nullptr, nullptr))
+ {
+ introspection_data = g_dbus_node_info_new_for_xml (contents, nullptr);
+ GDBusProxy *proxy = g_dbus_proxy_new_sync (connection,
+ G_DBUS_PROXY_FLAGS_NONE,
+ introspection_data->interfaces[0],
+ backend.first.c_str(),
+ backend.second,
+ "org.openprinting.PrintBackend",
+ nullptr,
+ nullptr);
+ g_assert (proxy != nullptr);
+ g_dbus_proxy_call(proxy, "ActivateBackend",
+ nullptr,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, nullptr, nullptr, nullptr);
+
+ g_free(contents);
+ g_object_unref(proxy);
+ g_dbus_node_info_unref(introspection_data);
+ }
g_free(backend.second);
- g_assert (proxy != nullptr);
- g_dbus_proxy_call(proxy, "ActivateBackend",
- nullptr,
- G_DBUS_CALL_FLAGS_NONE,
- -1, nullptr, nullptr, nullptr);
-
- g_free(contents);
- g_object_unref(proxy);
- g_dbus_node_info_unref(introspection_data);
}
}
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 84163b05ac64..f9e1c9f17fd5 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2700,6 +2700,8 @@ public:
return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8);
}
+ virtual void set_cursor_data(void * /*pData*/) override {};
+
virtual std::unique_ptr<weld::Container> weld_parent() const override;
virtual OString get_buildable_name() const override
diff --git a/wizards/source/access2base/DoCmd.xba b/wizards/source/access2base/DoCmd.xba
index 27b0d74be34f..26755a8d901d 100644
--- a/wizards/source/access2base/DoCmd.xba
+++ b/wizards/source/access2base/DoCmd.xba
@@ -2655,7 +2655,7 @@ Private Sub _ShellExecute(sCommand As String)
Dim oShell As Object
Set oShell = createUnoService(&quot;com.sun.star.system.SystemShellExecute&quot;)
- oShell.execute(sCommand, &quot;&quot; , com.sun.star.system.SystemShellExecuteFlags.DEFAULTS)
+ oShell.execute(sCommand, &quot;&quot; , com.sun.star.system.SystemShellExecuteFlags.URIS_ONLY)
End Sub &apos; _ShellExecute V0.8.5
diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk
index 8d7b3d22b690..d0085654a146 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -41,6 +41,7 @@ writerfilter_OOXMLNAMESPACES= \
vml-wordprocessingDrawing \
wp14 \
w14 \
+ w15 \
a14 \
wml
diff --git a/writerfilter/inc/dmapper/CommentProperties.hxx b/writerfilter/inc/dmapper/CommentProperties.hxx
new file mode 100644
index 000000000000..1cba6930d4c6
--- /dev/null
+++ b/writerfilter/inc/dmapper/CommentProperties.hxx
@@ -0,0 +1,21 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+namespace writerfilter
+{
+struct CommentProperties
+{
+ bool bDone;
+ // TODO: a reference to a parent comment (paraIdParent: [MS-DOCX] sect. 2.5.3.1 CT_CommentEx)
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/writerfilter/inc/dmapper/resourcemodel.hxx b/writerfilter/inc/dmapper/resourcemodel.hxx
index bd528d1a1e59..177c3cee9d6b 100644
--- a/writerfilter/inc/dmapper/resourcemodel.hxx
+++ b/writerfilter/inc/dmapper/resourcemodel.hxx
@@ -56,6 +56,7 @@
typedef sal_uInt32 Id;
namespace writerfilter {
+struct CommentProperties;
/**
Reference to a resource that generates events and sends them to a
@@ -179,6 +180,11 @@ const sal_uInt8 cFieldStart = 0x13;
const sal_uInt8 cFieldSep = 0x14;
const sal_uInt8 cFieldEnd = 0x15;
+namespace ooxml
+{
+class OOXMLDocument;
+}
+
/**
Handler for a stream.
*/
@@ -204,6 +210,8 @@ public:
/// The current section is the last one in this body text.
virtual void markLastSectionGroup( ) { };
+ virtual void setDocumentReference(writerfilter::ooxml::OOXMLDocument* pDocument) = 0;
+
/**
Receives start mark for group with the same paragraph properties.
*/
@@ -303,6 +311,8 @@ public:
/// Receives end mark for glossary document entry.
virtual void endGlossaryEntry() = 0;
+ virtual void commentProps(const OUString& /*sId*/, const CommentProperties& /*rProps*/) {}
+
protected:
~Stream() override {}
};
diff --git a/writerfilter/inc/ooxml/OOXMLDocument.hxx b/writerfilter/inc/ooxml/OOXMLDocument.hxx
index 7856a6a4dced..57654b624d63 100644
--- a/writerfilter/inc/ooxml/OOXMLDocument.hxx
+++ b/writerfilter/inc/ooxml/OOXMLDocument.hxx
@@ -75,7 +75,7 @@ class OOXMLStream : public virtual SvRefBase
{
public:
enum StreamType_t { UNKNOWN, DOCUMENT, STYLES, WEBSETTINGS, FONTTABLE, NUMBERING,
- FOOTNOTES, ENDNOTES, COMMENTS, THEME, CUSTOMXML, CUSTOMXMLPROPS, GLOSSARY, CHARTS, EMBEDDINGS, SETTINGS, VBAPROJECT, FOOTER, HEADER, VBADATA };
+ FOOTNOTES, ENDNOTES, COMMENTS, COMMENTS_EXTENDED, THEME, CUSTOMXML, CUSTOMXMLPROPS, GLOSSARY, CHARTS, EMBEDDINGS, SETTINGS, VBAPROJECT, FOOTER, HEADER, VBADATA };
typedef tools::SvRef<OOXMLStream> Pointer_t;
/**
diff --git a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
index 37e462012c66..122996d2a675 100644
--- a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
+++ b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
@@ -18,6 +18,7 @@
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <comphelper/processfactory.hxx>
@@ -171,6 +172,50 @@ CPPUNIT_TEST_FIXTURE(Test, testWrapPolyCrop)
// were wrapping around the image, not only 2 as Word does it.
CPPUNIT_ASSERT_EQUAL(2368., aPolygon.getB2DPoint(0).getY());
}
+
+CPPUNIT_TEST_FIXTURE(Test, testTextboxTextline)
+{
+ // Load a document with a shape with a textbox.
+ // The shape's vertical relation is <wp:positionV relativeFrom="line">.
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "textbox-textline.docx";
+ getComponent() = loadFromDesktop(aURL);
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ sal_Int16 nActualRelation{};
+ CPPUNIT_ASSERT(xShape->getPropertyValue("VertOrientRelation") >>= nActualRelation);
+ sal_Int32 nActualPosition{};
+ CPPUNIT_ASSERT(xShape->getPropertyValue("VertOrientPosition") >>= nActualPosition);
+
+ sal_Int16 nExpectedRelation = text::RelOrientation::TEXT_LINE;
+ CPPUNIT_ASSERT_EQUAL(nExpectedRelation, nActualRelation);
+ // 0 on this branch, but sw/qa/extras/ooxmlexport/data/tdf97371.docx shows that negative values
+ // work fine in general, don't bother:
+ // sal_Int32 nExpectedPosition = -2;
+ // CPPUNIT_ASSERT_EQUAL(nExpectedPosition, nActualPosition);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testTextboxTextlineTop)
+{
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "textbox-textline-top.docx";
+ getComponent() = loadFromDesktop(aURL);
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ sal_Int16 nActualRelation{};
+ CPPUNIT_ASSERT(xShape->getPropertyValue("VertOrientRelation") >>= nActualRelation);
+ sal_Int16 nExpectedRelation = text::RelOrientation::TEXT_LINE;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 9 (TEXT_LINE)
+ // - Actual : 0 (FRAME)
+ // i.e. the anchor point for the positioning was wrong, resulting in overlapping textboxes.
+ CPPUNIT_ASSERT_EQUAL(nExpectedRelation, nActualRelation);
+
+ sal_Int16 nActualOrient{};
+ CPPUNIT_ASSERT(xShape->getPropertyValue("VertOrient") >>= nActualOrient);
+ sal_Int16 nExpectedOrient = text::VertOrientation::BOTTOM;
+ CPPUNIT_ASSERT_EQUAL(nExpectedOrient, nActualOrient);
+}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/qa/cppunittests/dmapper/data/textbox-textline-top.docx b/writerfilter/qa/cppunittests/dmapper/data/textbox-textline-top.docx
new file mode 100644
index 000000000000..dbd750092811
--- /dev/null
+++ b/writerfilter/qa/cppunittests/dmapper/data/textbox-textline-top.docx
Binary files differ
diff --git a/writerfilter/qa/cppunittests/dmapper/data/textbox-textline.docx b/writerfilter/qa/cppunittests/dmapper/data/textbox-textline.docx
new file mode 100644
index 000000000000..493604d778e9
--- /dev/null
+++ b/writerfilter/qa/cppunittests/dmapper/data/textbox-textline.docx
Binary files differ
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 2c47effafd45..40b03086d596 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -183,6 +183,11 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
catch( const uno::Exception& ) {}
}
+void DomainMapper::setDocumentReference(writerfilter::ooxml::OOXMLDocument* pDocument)
+{
+ m_pImpl->setDocumentReference(pDocument);
+}
+
DomainMapper::~DomainMapper()
{
try
@@ -1019,6 +1024,11 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
}
break;
case NS_ooxml::LN_CT_SdtBlock_sdtContent:
+ if (m_pImpl->m_pSdtHelper->getControlType() == SdtControlType::unknown)
+ {
+ // Still not determined content type? and it is even not unsupported? Then it is plain text field
+ m_pImpl->m_pSdtHelper->setControlType(SdtControlType::plainText);
+ }
m_pImpl->SetSdt(true);
break;
case NS_ooxml::LN_CT_SdtBlock_sdtEndContent:
@@ -1031,10 +1041,20 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
else
m_pImpl->setSdtEndDeferred(true);
- if (m_pImpl->m_pSdtHelper->isInsideDropDownControl())
- m_pImpl->m_pSdtHelper->createDropDownControl();
- else if (m_pImpl->m_pSdtHelper->validateDateFormat())
- m_pImpl->m_pSdtHelper->createDateContentControl();
+ switch (m_pImpl->m_pSdtHelper->getControlType())
+ {
+ case SdtControlType::dropDown:
+ m_pImpl->m_pSdtHelper->createDropDownControl();
+ break;
+ case SdtControlType::plainText:
+ m_pImpl->m_pSdtHelper->createPlainTextControl();
+ break;
+ case SdtControlType::datePicker:
+ m_pImpl->m_pSdtHelper->createDateContentControl();
+ break;
+ case SdtControlType::unknown:
+ default:;
+ }
break;
case NS_ooxml::LN_CT_SdtListItem_displayText:
// TODO handle when this is != value
@@ -1098,14 +1118,26 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
}
break;
case NS_ooxml::LN_CT_DataBinding_prefixMappings:
+ m_pImpl->m_pSdtHelper->setDataBindingPrefixMapping(sStringValue);
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_DataBinding_prefixMappings", sStringValue);
break;
case NS_ooxml::LN_CT_DataBinding_xpath:
+ m_pImpl->m_pSdtHelper->setDataBindingXPath(sStringValue);
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_DataBinding_xpath", sStringValue);
break;
case NS_ooxml::LN_CT_DataBinding_storeItemID:
+ m_pImpl->m_pSdtHelper->setDataBindingStoreItemID(sStringValue);
m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_DataBinding_storeItemID", sStringValue);
break;
+ case NS_ooxml::LN_CT_SdtPlaceholder_docPart_val:
+ m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_SdtPlaceholder_docPart_val", sStringValue);
+ break;
+ case NS_ooxml::LN_CT_SdtColor_val:
+ m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_SdtColor_val", sStringValue);
+ break;
+ case NS_ooxml::LN_CT_SdtText_multiLine:
+ m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ooxml:CT_SdtText_multiLine", sStringValue);
+ break;
case NS_ooxml::LN_CT_PTab_leader:
case NS_ooxml::LN_CT_PTab_relativeTo:
case NS_ooxml::LN_CT_PTab_alignment:
@@ -1221,6 +1253,13 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
m_pImpl->HandleAltChunk(sStringValue);
}
break;
+ case NS_ooxml::LN_AG_Parids_paraId:
+ if (ParagraphPropertyMap* pParaContext
+ = dynamic_cast<ParagraphPropertyMap*>(m_pImpl->GetTopContext().get()))
+ {
+ pParaContext->SetParaId(sStringValue);
+ }
+ break;
default:
SAL_WARN("writerfilter", "DomainMapper::lcl_attribute: unhandled token: " << nName);
}
@@ -2535,7 +2574,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
case NS_ooxml::LN_CT_SdtPr_dropDownList:
case NS_ooxml::LN_CT_SdtPr_comboBox:
{
- m_pImpl->m_pSdtHelper->setInsideDropDownControl(true);
+ m_pImpl->m_pSdtHelper->setControlType(SdtControlType::dropDown);
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
if (pProperties.get() != nullptr)
pProperties->resolve(*this);
@@ -2548,8 +2587,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
pProperties->resolve(*this);
}
break;
+ case NS_ooxml::LN_CT_SdtPr_placeholder:
+ {
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if (pProperties)
+ pProperties->resolve(*this);
+ }
+ break;
+ break;
case NS_ooxml::LN_CT_SdtPr_date:
{
+ m_pImpl->m_pSdtHelper->setControlType(SdtControlType::datePicker);
resolveSprmProps(*this, rSprm);
m_pImpl->m_pSdtHelper->setDateFieldStartRange(GetCurrentTextRange()->getEnd());
}
@@ -2572,6 +2620,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
m_pImpl->m_pSdtHelper->getLocale().append(sStringValue);
}
break;
+ case NS_ooxml::LN_CT_SdtPr_text:
+ {
+ m_pImpl->m_pSdtHelper->setControlType(SdtControlType::plainText);
+ enableInteropGrabBag("ooxml:CT_SdtPr_text");
+ writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
+ if (pProperties)
+ pProperties->resolve(*this);
+ m_pImpl->m_pSdtHelper->appendToInteropGrabBag(getInteropGrabBag());
+ m_pImpl->disableInteropGrabBag();
+ }
+ break;
case NS_ooxml::LN_CT_SdtPr_dataBinding:
case NS_ooxml::LN_CT_SdtPr_equation:
case NS_ooxml::LN_CT_SdtPr_checkbox:
@@ -2580,9 +2639,10 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
case NS_ooxml::LN_CT_SdtPr_picture:
case NS_ooxml::LN_CT_SdtPr_citation:
case NS_ooxml::LN_CT_SdtPr_group:
- case NS_ooxml::LN_CT_SdtPr_text:
case NS_ooxml::LN_CT_SdtPr_id:
case NS_ooxml::LN_CT_SdtPr_alias:
+ case NS_ooxml::LN_CT_SdtPlaceholder_docPart:
+ case NS_ooxml::LN_CT_SdtPr_color:
{
// this is an unsupported SDT property, create a grab bag for it
OUString sName;
@@ -2596,11 +2656,21 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
case NS_ooxml::LN_CT_SdtPr_picture: sName = "ooxml:CT_SdtPr_picture"; break;
case NS_ooxml::LN_CT_SdtPr_citation: sName = "ooxml:CT_SdtPr_citation"; break;
case NS_ooxml::LN_CT_SdtPr_group: sName = "ooxml:CT_SdtPr_group"; break;
- case NS_ooxml::LN_CT_SdtPr_text: sName = "ooxml:CT_SdtPr_text"; break;
case NS_ooxml::LN_CT_SdtPr_id: sName = "ooxml:CT_SdtPr_id"; break;
case NS_ooxml::LN_CT_SdtPr_alias: sName = "ooxml:CT_SdtPr_alias"; break;
+ case NS_ooxml::LN_CT_SdtPlaceholder_docPart: sName = "ooxml:CT_SdtPlaceholder_docPart"; break;
+ case NS_ooxml::LN_CT_SdtPr_color: sName = "ooxml:CT_SdtPr_color"; break;
default: assert(false);
};
+ if (
+ nSprmId == NS_ooxml::LN_CT_SdtPr_checkbox ||
+ nSprmId == NS_ooxml::LN_CT_SdtPr_docPartObj ||
+ nSprmId == NS_ooxml::LN_CT_SdtPr_docPartList ||
+ nSprmId == NS_ooxml::LN_CT_SdtPr_picture ||
+ nSprmId == NS_ooxml::LN_CT_SdtPr_citation)
+ {
+ m_pImpl->m_pSdtHelper->setControlType(SdtControlType::unsupported);
+ }
enableInteropGrabBag(sName);
// process subitems
@@ -3378,7 +3448,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
}
bool bNewLine = len == 1 && (sText[0] == 0x0d || sText[0] == 0x07);
- if (m_pImpl->m_pSdtHelper->isInsideDropDownControl())
+ if (m_pImpl->m_pSdtHelper->getControlType() == SdtControlType::dropDown)
{
if (bNewLine)
// Dropdown control has single-line texts, so in case of newline, create the control.
@@ -3389,43 +3459,54 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
return;
}
}
+ else if (m_pImpl->m_pSdtHelper->getControlType() == SdtControlType::datePicker)
+ {
+ if (IsInHeaderFooter() && m_pImpl->IsDiscardHeaderFooter())
+ {
+ m_pImpl->m_pSdtHelper->getDateFormat().truncate();
+ m_pImpl->m_pSdtHelper->getLocale().truncate();
+ m_pImpl->m_pSdtHelper->setControlType(SdtControlType::unknown);
+ return;
+ }
+ }
+ else if (m_pImpl->m_pSdtHelper->getControlType() == SdtControlType::plainText)
+ {
+ m_pImpl->m_pSdtHelper->getSdtTexts().append(sText);
+ if (bNewLine)
+ {
+ m_pImpl->m_pSdtHelper->createPlainTextControl();
+ finishParagraph();
+ }
+ return;
+ }
else if (!m_pImpl->m_pSdtHelper->isInteropGrabBagEmpty())
{
- // Ignore grabbag when we have a date field, it can conflict during export
- if(m_pImpl->m_pSdtHelper->validateDateFormat())
+ // there are unsupported SDT properties in the document
+ // save them in the paragraph interop grab bag
+ if (m_pImpl->IsDiscardHeaderFooter())
{
+ // Unless we're supposed to ignore this header/footer.
m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear();
+ return;
}
- else
+ if((m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_checkbox") ||
+ m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_text") ||
+ m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_dataBinding") ||
+ m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_citation") ||
+ (m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_id") &&
+ m_pImpl->m_pSdtHelper->getInteropGrabBagSize() == 1)) && !m_pImpl->m_pSdtHelper->isOutsideAParagraph())
{
+ PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_CHARACTER);
- // there are unsupported SDT properties in the document
- // save them in the paragraph interop grab bag
- if (m_pImpl->IsDiscardHeaderFooter())
- {
- // Unless we're supposed to ignore this header/footer.
- m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear();
- return;
- }
- if((m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_checkbox") ||
- m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_text") ||
- m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_dataBinding") ||
- m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_citation") ||
- (m_pImpl->m_pSdtHelper->containedInInteropGrabBag("ooxml:CT_SdtPr_id") &&
- m_pImpl->m_pSdtHelper->getInteropGrabBagSize() == 1)) && !m_pImpl->m_pSdtHelper->isOutsideAParagraph())
- {
- PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_CHARACTER);
-
- if (m_pImpl->IsOpenField())
- // We have a field, insert the SDT properties to the field's grab-bag, so they won't be lost.
- pContext = m_pImpl->GetTopFieldContext()->getProperties();
+ if (m_pImpl->IsOpenField())
+ // We have a field, insert the SDT properties to the field's grab-bag, so they won't be lost.
+ pContext = m_pImpl->GetTopFieldContext()->getProperties();
- pContext->Insert(PROP_SDTPR, uno::makeAny(m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear()), true, CHAR_GRAB_BAG);
- }
- else
- m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)->Insert(PROP_SDTPR,
- uno::makeAny(m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear()), true, PARA_GRAB_BAG);
+ pContext->Insert(PROP_SDTPR, uno::makeAny(m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear()), true, CHAR_GRAB_BAG);
}
+ else
+ m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)->Insert(PROP_SDTPR,
+ uno::makeAny(m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear()), true, PARA_GRAB_BAG);
}
else if (len == 1 && sText[0] == 0x03)
{
@@ -3451,15 +3532,6 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
return;
}
}
- else if (m_pImpl->m_pSdtHelper->validateDateFormat())
- {
- if(IsInHeaderFooter() && m_pImpl->IsDiscardHeaderFooter())
- {
- m_pImpl->m_pSdtHelper->getDateFormat().truncate();
- m_pImpl->m_pSdtHelper->getLocale().truncate();
- return;
- }
- }
if (!m_pImpl->hasTableManager())
return;
@@ -4009,12 +4081,18 @@ void DomainMapper::HandleRedline( Sprm& rSprm )
void DomainMapper::finishParagraph(const bool bRemove)
{
- if (m_pImpl->m_pSdtHelper->validateDateFormat())
+ if (m_pImpl->m_pSdtHelper->getControlType() == SdtControlType::datePicker)
m_pImpl->m_pSdtHelper->createDateContentControl();
m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH), bRemove);
}
+void DomainMapper::commentProps(const OUString& sId, const CommentProperties& rProps)
+{
+ m_pImpl->commentProps(sId, rProps);
+}
+
} //namespace dmapper
+
} //namespace writerfilter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.hxx b/writerfilter/source/dmapper/DomainMapper.hxx
index 55f9a20e0373..e606e8369cd1 100644
--- a/writerfilter/source/dmapper/DomainMapper.hxx
+++ b/writerfilter/source/dmapper/DomainMapper.hxx
@@ -81,6 +81,8 @@ public:
utl::MediaDescriptor const & rMediaDesc);
virtual ~DomainMapper() override;
+ virtual void setDocumentReference(writerfilter::ooxml::OOXMLDocument* pDocument) override;
+
// Stream
virtual void markLastParagraphInSection() override;
virtual void markLastSectionGroup() override;
@@ -129,6 +131,8 @@ public:
void HandleRedline( Sprm& rSprm );
+ virtual void commentProps(const OUString& sId, const CommentProperties& rProps) override;
+
private:
// Stream
virtual void lcl_startSectionGroup() override;
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 618ca603efe6..b5040c230b62 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -392,6 +392,8 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
DomainMapperTableManager::IntVectorPtr const & DomainMapperTableManager::getCurrentGrid( )
{
+ if (m_aTableGrid.empty())
+ throw std::out_of_range("no current grid");
return m_aTableGrid.back( );
}
@@ -552,6 +554,8 @@ void DomainMapperTableManager::endOfRowAction()
// Compare the table position with the previous ones. We may need to split
// into two tables if those are different. We surely don't want to do anything
// if we don't have any row yet.
+ if (m_aTmpPosition.empty())
+ throw std::out_of_range("row without a position");
TablePositionHandlerPtr pTmpPosition = m_aTmpPosition.back();
TablePropertyMapPtr pTablePropMap = m_aTmpTableProperties.back( );
TablePositionHandlerPtr pCurrentPosition = m_aTablePositions.back();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c180a1250945..8803603227df 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -270,6 +270,7 @@ DomainMapper_Impl::DomainMapper_Impl(
utl::MediaDescriptor const & rMediaDesc) :
m_eDocumentType( eDocumentType ),
m_rDMapper( rDMapper ),
+ m_pOOXMLDocument(nullptr),
m_xTextDocument( xModel, uno::UNO_QUERY ),
m_xTextFactory( xModel, uno::UNO_QUERY ),
m_xComponentContext( xContext ),
@@ -354,6 +355,11 @@ DomainMapper_Impl::DomainMapper_Impl(
appendTableManager( );
GetBodyText();
+ if (!m_bIsNewDoc && !m_xBodyText)
+ {
+ throw uno::Exception("failed to find body text of the insert position", nullptr);
+ }
+
uno::Reference< text::XTextAppend > xBodyTextAppend( m_xBodyText, uno::UNO_QUERY );
m_aTextAppendStack.push(TextAppendContext(xBodyTextAppend,
m_bIsNewDoc ? uno::Reference<text::XTextCursor>() : m_xBodyText->createTextCursorByRange(m_xInsertTextRange)));
@@ -366,7 +372,7 @@ DomainMapper_Impl::DomainMapper_Impl(
getTableManager( ).startLevel();
m_bUsingEnhancedFields = !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Filter::Microsoft::Import::ImportWWFieldsAsEnhancedFields::get(m_xComponentContext);
- m_pSdtHelper = new SdtHelper(*this);
+ m_pSdtHelper = new SdtHelper(*this, m_xComponentContext);
m_aRedlines.push(std::vector<RedlineParamsPtr>());
@@ -390,6 +396,11 @@ DomainMapper_Impl::~DomainMapper_Impl()
}
}
+writerfilter::ooxml::OOXMLDocument* DomainMapper_Impl::getDocumentReference() const
+{
+ return m_pOOXMLDocument;
+}
+
uno::Reference< container::XNameContainer > const & DomainMapper_Impl::GetPageStyles()
{
if(!m_xPageStyles1.is())
@@ -1902,6 +1913,17 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
}
m_previousRedline.clear();
+ if (m_bIsInComments && pParaContext)
+ {
+ if (const OUString sParaId = pParaContext->GetParaId(); !sParaId.isEmpty())
+ {
+ if (const auto& item = m_aCommentProps.find(sParaId); item != m_aCommentProps.end())
+ {
+ m_bAnnotationResolved = item->second.bDone;
+ }
+ }
+ }
+
if (m_bIsFirstParaInShape)
m_bIsFirstParaInShape = false;
@@ -2618,6 +2640,9 @@ void DomainMapper_Impl::PopAnnotation()
try
{
+ if (m_bAnnotationResolved)
+ m_xAnnotationField->setPropertyValue("Resolved", css::uno::Any(true));
+
// See if the annotation will be a single position or a range.
if (m_nAnnotationId == -1 || !m_aAnnotationPositions[m_nAnnotationId].m_xStart.is() || !m_aAnnotationPositions[m_nAnnotationId].m_xEnd.is())
{
@@ -2666,6 +2691,7 @@ void DomainMapper_Impl::PopAnnotation()
m_xAnnotationField.clear();
m_nAnnotationId = -1;
+ m_bAnnotationResolved = false;
}
void DomainMapper_Impl::PushPendingShape( const uno::Reference< drawing::XShape > & xShape )
@@ -7158,6 +7184,12 @@ void DomainMapper_Impl::substream(Id rName,
assert(m_aPropertyStacks[i].size() == propSize[i]);
}
}
+
+void DomainMapper_Impl::commentProps(const OUString& sId, const CommentProperties& rProps)
+{
+ m_aCommentProps[sId] = rProps;
+}
+
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 00621c1db263..43c2a2b85b8d 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -38,6 +38,8 @@
#include <ooxml/resourceids.hxx>
+#include <dmapper/CommentProperties.hxx>
+
#include "DomainMapper.hxx"
#include "DomainMapperTableManager.hxx"
#include "DomainMapperTableHandler.hxx"
@@ -73,6 +75,11 @@ namespace com{ namespace sun{ namespace star{
}}}
namespace writerfilter {
+
+namespace ooxml {
+ class OOXMLDocument;
+}
+
namespace dmapper {
class SdtHelper;
@@ -434,6 +441,7 @@ public:
private:
SourceDocumentType const m_eDocumentType;
DomainMapper& m_rDMapper;
+ writerfilter::ooxml::OOXMLDocument* m_pOOXMLDocument;
OUString m_aBaseUrl;
css::uno::Reference<css::text::XTextDocument> m_xTextDocument;
css::uno::Reference<css::beans::XPropertySet> m_xDocumentSettings;
@@ -569,6 +577,7 @@ private:
//annotation import
css::uno::Reference< css::beans::XPropertySet > m_xAnnotationField;
sal_Int32 m_nAnnotationId;
+ bool m_bAnnotationResolved = false;
std::unordered_map< sal_Int32, AnnotationPosition > m_aAnnotationPositions;
void GetCurrentLocale(css::lang::Locale& rLocale);
@@ -599,6 +608,9 @@ public:
utl::MediaDescriptor const & rMediaDesc);
~DomainMapper_Impl();
+ void setDocumentReference(writerfilter::ooxml::OOXMLDocument* pDocument) { if (!m_pOOXMLDocument) m_pOOXMLDocument = pDocument; };
+ writerfilter::ooxml::OOXMLDocument* getDocumentReference() const;
+
SectionPropertyMap* GetLastSectionContext( )
{
return dynamic_cast< SectionPropertyMap* >( m_pLastSectionContext.get( ) );
@@ -1074,6 +1086,8 @@ public:
/// Handles <w:altChunk>.
void HandleAltChunk(const OUString& rStreamName);
+ void commentProps(const OUString& sId, const CommentProperties& rProps);
+
private:
void PushPageHeaderFooter(bool bHeader, SectionPropertyMap::PageType eType);
// Start a new index section; if needed, finish current paragraph
@@ -1087,6 +1101,8 @@ private:
/// Current paragraph in a table is first paragraph of a cell
bool m_bFirstParagraphInCell;
bool m_bSaveFirstParagraphInCell;
+
+ std::unordered_map<OUString, CommentProperties> m_aCommentProps;
};
} //namespace dmapper
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index f8a2482d39ef..4af792ecd733 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -836,11 +836,21 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
// Avoid setting AnchorType for TextBoxes till SwTextBoxHelper::syncProperty() doesn't handle transition.
bool bTextBox = false;
xShapeProps->getPropertyValue("TextBox") >>= bTextBox;
- if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE && !bTextBox)
+ if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE)
eAnchorType = text::TextContentAnchorType_AT_CHARACTER;
xShapeProps->setPropertyValue("AnchorType", uno::makeAny(eAnchorType));
+ if (m_pImpl->nVertRelation == text::RelOrientation::TEXT_LINE)
+ {
+ // Word's "line" is "below the bottom of the line", our TEXT_LINE is
+ // "towards top, from the bottom of the line", so invert the vertical
+ // position.
+ awt::Point aPoint = xShape->getPosition();
+ aPoint.Y *= -1;
+ xShape->setPosition(aPoint);
+ }
+
//only the position orientation is handled in applyPosition()
m_pImpl->applyPosition(xShapeProps);
diff --git a/writerfilter/source/dmapper/LoggedResources.hxx b/writerfilter/source/dmapper/LoggedResources.hxx
index 3177224d4664..d89376bd679f 100644
--- a/writerfilter/source/dmapper/LoggedResources.hxx
+++ b/writerfilter/source/dmapper/LoggedResources.hxx
@@ -72,6 +72,8 @@ public:
void startGlossaryEntry() override;
void endGlossaryEntry() override;
+ virtual void setDocumentReference(writerfilter::ooxml::OOXMLDocument* /*pDocument*/) override{};
+
protected:
virtual void lcl_startSectionGroup() = 0;
virtual void lcl_endSectionGroup() = 0;
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 923581fcfb86..5d1074b24c1c 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -413,6 +413,7 @@ private:
sal_Int32 m_yAlign; // from ST_YAlign bottom, center, inline, inside, outside, top
sal_Int8 m_nDropCapLength; // number of characters
OUString m_sParaStyleName;
+ OUString m_sParaId; // [MS-DOCX] sect. 2.2.4 "p and tr Extensions"
css::uno::Reference< css::text::XTextRange > m_xStartingRange; // start of a frame
css::uno::Reference< css::text::XTextRange > m_xEndingRange; // end of the frame
@@ -491,6 +492,9 @@ public:
const OUString& GetParaStyleName() const { return m_sParaStyleName; }
void SetParaStyleName( const OUString& rSet ) { m_sParaStyleName = rSet; }
+ const OUString& GetParaId() const { return m_sParaId; }
+ void SetParaId(const OUString& rSet) { m_sParaId = rSet; }
+
void ResetFrameProperties();
};
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index 154e7660d842..8a2356051a21 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -12,20 +12,33 @@
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <editeng/unoprnms.hxx>
+#include <sal/log.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
+#include <comphelper/string.hxx>
#include <comphelper/sequence.hxx>
#include <xmloff/odffields.hxx>
#include <com/sun/star/text/XTextField.hpp>
#include "DomainMapper_Impl.hxx"
#include "StyleSheetTable.hxx"
#include <officecfg/Office/Writer.hxx>
+#include <com/sun/star/util/XRefreshable.hpp>
+#include <com/sun/star/text/XTextFieldsSupplier.hpp>
+#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <ooxml/OOXMLDocument.hxx>
+#include <com/sun/star/xml/xpath/XPathAPI.hpp>
+#include <com/sun/star/xml/dom/DocumentBuilder.hpp>
+#include <com/sun/star/xml/dom/XNode.hpp>
namespace writerfilter
{
namespace dmapper
+
{
using namespace ::com::sun::star;
+using namespace ::css::xml::xpath;
+using namespace ::comphelper;
/// w:sdt's w:dropDownList doesn't have width, so guess the size based on the longest string.
static awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet,
@@ -68,19 +81,139 @@ static awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& pStyleSheet,
return { nWidth + nBorder + nHeight, nHeight + nBorder };
}
-SdtHelper::SdtHelper(DomainMapper_Impl& rDM_Impl)
+SdtHelper::SdtHelper(DomainMapper_Impl& rDM_Impl,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext)
: m_rDM_Impl(rDM_Impl)
- , m_bInsideDropDownControl(false)
+ , m_xComponentContext(xContext)
+ , m_aControlType(SdtControlType::unknown)
, m_bHasElements(false)
, m_bOutsideAParagraph(false)
+ , m_bPropertiesXMLsLoaded(false)
{
}
SdtHelper::~SdtHelper() = default;
+void SdtHelper::loadPropertiesXMLs()
+{
+ // Initialize properties xml storage (m_xPropertiesXMLs)
+ uno::Reference<uno::XInterface> xTemp
+ = m_xComponentContext->getServiceManager()->createInstanceWithContext(
+ "com.sun.star.document.OOXMLDocumentPropertiesImporter", m_xComponentContext);
+ uno::Reference<document::XOOXMLDocumentPropertiesImporter> xImporter(xTemp, uno::UNO_QUERY);
+ if (!xImporter.is())
+ return;
+
+ uno::Reference<xml::dom::XDocumentBuilder> xDomBuilder(
+ xml::dom::DocumentBuilder::create(m_xComponentContext));
+ if (!xDomBuilder.is())
+ return;
+
+ std::vector<uno::Reference<xml::dom::XDocument>> aPropDocs;
+
+ // Load core properties
+ try
+ {
+ auto xCorePropsStream = xImporter->getCorePropertiesStream(m_rDM_Impl.m_xDocumentStorage);
+ aPropDocs.push_back(xDomBuilder->parse(xCorePropsStream));
+ }
+ catch (const uno::Exception&)
+ {
+ SAL_WARN("writerfilter",
+ "SdtHelper::loadPropertiesXMLs: failed loading core properties XML");
+ }
+
+ // Load extended properties
+ try
+ {
+ auto xExtPropsStream
+ = xImporter->getExtendedPropertiesStream(m_rDM_Impl.m_xDocumentStorage);
+ aPropDocs.push_back(xDomBuilder->parse(xExtPropsStream));
+ }
+ catch (const uno::Exception&)
+ {
+ SAL_WARN("writerfilter",
+ "SdtHelper::loadPropertiesXMLs: failed loading extended properties XML");
+ }
+
+ // TODO: some other property items?
+
+ // Add custom XMLs
+ uno::Sequence<uno::Reference<xml::dom::XDocument>> aCustomXmls
+ = m_rDM_Impl.getDocumentReference()->getCustomXmlDomList();
+ for (const auto& xDoc : aCustomXmls)
+ {
+ aPropDocs.push_back(xDoc);
+ }
+
+ m_xPropertiesXMLs = comphelper::containerToSequence(aPropDocs);
+ m_bPropertiesXMLsLoaded = true;
+}
+
+static void lcl_registerNamespaces(const OUString& sNamespaceString,
+ const uno::Reference<XXPathAPI>& xXPathAPI)
+{
+ // Split namespaces and register it in XPathAPI
+ auto aNamespaces = string::split(sNamespaceString, ' ');
+ for (const auto& sNamespace : aNamespaces)
+ {
+ // Here we have just one namespace in format "xmlns:ns0='http://someurl'"
+ auto aNamespace = string::split(sNamespace, '=');
+ if (aNamespace.size() < 2)
+ {
+ SAL_WARN("writerfilter",
+ "SdtHelper::getValueFromDataBinding: invalid namespace: " << sNamespace);
+ continue;
+ }
+
+ auto aNamespaceId = string::split(aNamespace[0], ':');
+ if (aNamespaceId.size() < 2)
+ {
+ SAL_WARN("writerfilter",
+ "SdtHelper::getValueFromDataBinding: invalid namespace: " << aNamespace[0]);
+ continue;
+ }
+
+ OUString sNamespaceURL = aNamespace[1];
+ sNamespaceURL = string::strip(sNamespaceURL, ' ');
+ sNamespaceURL = string::strip(sNamespaceURL, '\'');
+
+ xXPathAPI->registerNS(aNamespaceId[1], sNamespaceURL);
+ }
+}
+
+std::optional<OUString> SdtHelper::getValueFromDataBinding()
+{
+ // No xpath - nothing to do
+ if (m_sDataBindingXPath.isEmpty())
+ return {};
+
+ // Load properties XMLs
+ if (!m_bPropertiesXMLsLoaded)
+ loadPropertiesXMLs();
+
+ uno::Reference<XXPathAPI> xXpathAPI = XPathAPI::create(m_xComponentContext);
+
+ lcl_registerNamespaces(m_sDataBindingPrefixMapping, xXpathAPI);
+
+ // Iterate all properties xml documents and try to fetch data
+ for (const auto& xDocument : m_xPropertiesXMLs)
+ {
+ uno::Reference<XXPathObject> xResult = xXpathAPI->eval(xDocument, m_sDataBindingXPath);
+
+ if (xResult.is() && xResult->getNodeList() && xResult->getNodeList()->getLength())
+ {
+ return xResult->getString();
+ }
+ }
+
+ // No data
+ return {};
+}
+
void SdtHelper::createDropDownControl()
{
- assert(m_bInsideDropDownControl);
+ assert(getControlType() == SdtControlType::dropDown);
const bool bDropDown
= officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::get();
@@ -135,12 +268,39 @@ void SdtHelper::createDropDownControl()
// clean up
m_aDropDownItems.clear();
- m_bInsideDropDownControl = false;
+ setControlType(SdtControlType::unknown);
}
-bool SdtHelper::validateDateFormat()
+void SdtHelper::createPlainTextControl()
{
- return !m_sDateFormat.toString().isEmpty() && !m_sLocale.toString().isEmpty();
+ assert(getControlType() == SdtControlType::plainText);
+
+ OUString aDefaultText = m_aSdtTexts.makeStringAndClear();
+
+ // create field
+ uno::Reference<css::text::XTextField> xControlModel(
+ m_rDM_Impl.GetTextFactory()->createInstance("com.sun.star.text.TextField.Input"),
+ uno::UNO_QUERY);
+
+ // set properties
+ uno::Reference<beans::XPropertySet> xPropertySet(xControlModel, uno::UNO_QUERY);
+
+ std::optional<OUString> oData = getValueFromDataBinding();
+ if (oData.has_value())
+ aDefaultText = *oData;
+
+ xPropertySet->setPropertyValue("Content", uno::makeAny(aDefaultText));
+
+ // add it into document
+ m_rDM_Impl.appendTextContent(xControlModel, uno::Sequence<beans::PropertyValue>());
+
+ // Store all unused sdt parameters from grabbag
+ xPropertySet->setPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG,
+ uno::makeAny(getInteropGrabBagAndClear()));
+
+ // clean up
+ m_aDropDownItems.clear();
+ setControlType(SdtControlType::unknown);
}
void SdtHelper::createDateContentControl()
@@ -194,6 +354,11 @@ void SdtHelper::createDateContentControl()
uno::makeAny(m_sLocale.makeStringAndClear()));
}
OUString sFullDate = m_sDate.makeStringAndClear();
+
+ std::optional<OUString> oData = getValueFromDataBinding();
+ if (oData.has_value())
+ sFullDate = *oData;
+
if (!sFullDate.isEmpty())
{
sal_Int32 nTimeSep = sFullDate.indexOf("T");
@@ -201,8 +366,14 @@ void SdtHelper::createDateContentControl()
sFullDate = sFullDate.copy(0, nTimeSep);
xNameCont->insertByName(ODF_FORMDATE_CURRENTDATE, uno::makeAny(sFullDate));
}
+
+ // Store all unused sdt parameters from grabbag
+ xNameCont->insertByName(UNO_NAME_MISC_OBJ_INTEROPGRABBAG,
+ uno::makeAny(getInteropGrabBagAndClear()));
}
}
+
+ setControlType(SdtControlType::unknown);
}
void SdtHelper::createControlShape(awt::Size aSize,
diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx
index 3cce8e3658af..e206cdc33cbe 100644
--- a/writerfilter/source/dmapper/SdtHelper.hxx
+++ b/writerfilter/source/dmapper/SdtHelper.hxx
@@ -11,9 +11,12 @@
#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SDTHELPER_HXX
#include <vector>
+#include <optional>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/xml/dom/XDocument.hpp>
#include <rtl/ustrbuf.hxx>
#include <tools/ref.hxx>
@@ -24,6 +27,10 @@ namespace sun
{
namespace star
{
+namespace uno
+{
+class XComponentContext;
+}
namespace awt
{
struct Size;
@@ -39,6 +46,15 @@ namespace dmapper
{
class DomainMapper_Impl;
+enum class SdtControlType
+{
+ datePicker,
+ dropDown,
+ plainText,
+ unsupported, // Sdt block is defined, but we still do not support such type of field
+ unknown
+};
+
/**
* Helper to create form controls from w:sdt tokens.
*
@@ -48,17 +64,26 @@ class DomainMapper_Impl;
class SdtHelper final : public virtual SvRefBase
{
DomainMapper_Impl& m_rDM_Impl;
+ css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
/// Items of the drop-down control.
std::vector<OUString> m_aDropDownItems;
- /// Indicator of a drop-down control
- bool m_bInsideDropDownControl;
+ /// Type of sdt control
+ SdtControlType m_aControlType;
/// Pieces of the default text -- currently used only by the dropdown control.
OUStringBuffer m_aSdtTexts;
/// Date ISO string contained in the w:date element, used by the date control.
OUStringBuffer m_sDate;
/// Date format string as it comes from the ooxml document.
OUStringBuffer m_sDateFormat;
+
+ /// <w:dataBinding w:prefixMappings="">
+ OUString m_sDataBindingPrefixMapping;
+ /// <w:dataBinding w:xpath="">
+ OUString m_sDataBindingXPath;
+ /// <w:dataBinding w:storeItemID="">
+ OUString m_sDataBindingStoreItemID;
+
/// Start range of the date field
css::uno::Reference<css::text::XTextRange> m_xDateFieldStartRange;
/// Locale string as it comes from the ooxml document.
@@ -70,13 +95,25 @@ class SdtHelper final : public virtual SvRefBase
/// The last stored SDT element is outside paragraphs.
bool m_bOutsideAParagraph;
+ /// Storage for all properties documents as xml::dom::XDocument for later querying xpath for data
+ css::uno::Sequence<css::uno::Reference<css::xml::dom::XDocument>> m_xPropertiesXMLs;
+
+ /// Check if m_xPropertiesXMLs is initialized and loaded (need extra flag to distinguish
+ /// empty sequence from not yet initialized)
+ bool m_bPropertiesXMLsLoaded;
+
/// Create and append the drawing::XControlShape, containing the various models.
void createControlShape(css::awt::Size aSize,
css::uno::Reference<css::awt::XControlModel> const& xControlModel,
const css::uno::Sequence<css::beans::PropertyValue>& rGrabBag);
+ std::optional<OUString> getValueFromDataBinding();
+
+ void loadPropertiesXMLs();
+
public:
- explicit SdtHelper(DomainMapper_Impl& rDM_Impl);
+ explicit SdtHelper(DomainMapper_Impl& rDM_Impl,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext);
~SdtHelper() override;
std::vector<OUString>& getDropDownItems() { return m_aDropDownItems; }
@@ -86,14 +123,18 @@ public:
OUStringBuffer& getDateFormat() { return m_sDateFormat; }
+ void setDataBindingPrefixMapping(const OUString& sValue)
+ {
+ m_sDataBindingPrefixMapping = sValue;
+ }
+ void setDataBindingXPath(const OUString& sValue) { m_sDataBindingXPath = sValue; }
+ void setDataBindingStoreItemID(const OUString& sValue) { m_sDataBindingStoreItemID = sValue; }
+
void setDateFieldStartRange(const css::uno::Reference<css::text::XTextRange>& xStartRange)
{
m_xDateFieldStartRange = xStartRange;
}
- /// Decides if we have enough information to create a date control.
- bool validateDateFormat();
-
OUStringBuffer& getLocale() { return m_sLocale; }
/// If createControlShape() was ever called.
bool hasElements() const { return m_bHasElements; }
@@ -105,14 +146,16 @@ public:
bool isOutsideAParagraph() const { return m_bOutsideAParagraph; }
- bool isInsideDropDownControl() const { return m_bInsideDropDownControl; }
- void setInsideDropDownControl(bool bInside) { m_bInsideDropDownControl = bInside; }
+ SdtControlType getControlType() { return m_aControlType; }
+ void setControlType(SdtControlType aType) { m_aControlType = aType; }
/// Create drop-down control from w:sdt's w:dropDownList.
void createDropDownControl();
/// Create date control from w:sdt's w:date.
void createDateContentControl();
+ void createPlainTextControl();
+
void appendToInteropGrabBag(const css::beans::PropertyValue& rValue);
css::uno::Sequence<css::beans::PropertyValue> getInteropGrabBagAndClear();
bool isInteropGrabBagEmpty() const;
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index b5ef23464f8f..e8449752c77b 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -317,9 +317,20 @@ void OOXMLDocumentImpl::resolveEndnote(Stream & rStream,
resolveFastSubStreamWithId(rStream, pStream, nId);
}
+void OOXMLDocumentImpl::resolveCommentsExtendedStream(Stream& rStream)
+{
+ resolveFastSubStream(rStream, OOXMLStream::COMMENTS_EXTENDED);
+}
+
void OOXMLDocumentImpl::resolveComment(Stream & rStream,
const sal_Int32 nId)
{
+ if (!mbCommentsExtendedResolved)
+ {
+ resolveCommentsExtendedStream(rStream);
+ mbCommentsExtendedResolved = true;
+ }
+
writerfilter::Reference<Stream>::Pointer_t pStream =
getXNoteStream(OOXMLStream::COMMENTS, nId);
@@ -467,6 +478,7 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)
{
uno::Reference<uno::XComponentContext> xContext(mpStream->getContext());
+ rStream.setDocumentReference(this);
OOXMLFastDocumentHandler * pDocHandler =
new OOXMLFastDocumentHandler(xContext, &rStream, this, mnXNoteId);
pDocHandler->setIsSubstream( mbIsSubstream );
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
index 6b290bc489d9..20015dc6e923 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
@@ -69,6 +69,8 @@ class OOXMLDocumentImpl : public OOXMLDocument
/// Graphic mapper
css::uno::Reference<css::graphic::XGraphicMapper> mxGraphicMapper;
+ bool mbCommentsExtendedResolved = false;
+
private:
void resolveFastSubStream(Stream & rStream,
OOXMLStream::StreamType_t nType);
@@ -90,6 +92,8 @@ private:
void resolveCustomXmlStream(Stream & rStream);
void resolveGlossaryStream(Stream & rStream);
void resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pStream);
+ void resolveCommentsExtendedStream(Stream & rStream);
+
public:
OOXMLDocumentImpl(OOXMLStream::Pointer_t const & pStream, const css::uno::Reference<css::task::XStatusIndicator>& xStatusIndicator, bool bSkipImages, const css::uno::Sequence<css::beans::PropertyValue>& rDescriptor);
virtual ~OOXMLDocumentImpl() override;
diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx b/writerfilter/source/ooxml/OOXMLFactory.hxx
index 04a71bbc92f4..a08229c0a597 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.hxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.hxx
@@ -55,7 +55,8 @@ enum class ResourceType {
TwipsMeasure_asSigned,
TwipsMeasure_asZero,
HpsMeasure,
- MeasurementOrPercent
+ MeasurementOrPercent,
+ CommentEx,
};
struct AttributeInfo
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index d64192c115e4..68bfdf63a1a2 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -34,6 +34,7 @@
#include "OOXMLFastContextHandler.hxx"
#include "OOXMLFactory.hxx"
#include "Handler.hxx"
+#include <dmapper/CommentProperties.hxx>
static const sal_Unicode uCR = 0xd;
static const sal_Unicode uFtnEdnRef = 0x2;
@@ -384,6 +385,19 @@ void OOXMLFastContextHandler::startParagraphGroup()
{
mpStream->startParagraphGroup();
mpParserState->setInParagraphGroup(true);
+
+ if (const auto& pPropSet = getPropertySet())
+ {
+ OOXMLPropertySetEntryToString aHandler(NS_ooxml::LN_AG_Parids_paraId);
+ pPropSet->resolve(aHandler);
+ if (const OUString& sText = aHandler.getString(); !sText.isEmpty())
+ {
+ OOXMLStringValue::Pointer_t pVal = new OOXMLStringValue(sText);
+ OOXMLPropertySet::Pointer_t pPropertySet(new OOXMLPropertySet);
+ pPropertySet->add(NS_ooxml::LN_AG_Parids_paraId, pVal, OOXMLProperty::ATTRIBUTE);
+ mpStream->props(pPropertySet.get());
+ }
+ }
}
}
}
@@ -1686,7 +1700,7 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element )
if (mnTableDepth > 0 && mbLayoutInCell) //if we had a table
{
uno::Reference<beans::XPropertySet> xShapePropSet(xShape, uno::UNO_QUERY);
- sal_Int16 nCurrentHorOriRel; //A temp variable for storaging the current setting
+ sal_Int16 nCurrentHorOriRel = {}; // spurious -Werror=maybe-uninitialized
xShapePropSet->getPropertyValue("HoriOrientRelation") >>= nCurrentHorOriRel;
//and the correction:
if (nCurrentHorOriRel == com::sun::star::text::RelOrientation::PAGE_FRAME)
@@ -2161,6 +2175,28 @@ void OOXMLFastContextHandlerMath::process()
}
}
+OOXMLFastContextHandlerCommentEx::OOXMLFastContextHandlerCommentEx(
+ OOXMLFastContextHandler* pContext)
+ : OOXMLFastContextHandler(pContext)
+{
+}
+
+void OOXMLFastContextHandlerCommentEx::lcl_endFastElement(Token_t /*Element*/)
+{
+ mpStream->commentProps(m_sParaId, { m_bDone });
+}
+
+void OOXMLFastContextHandlerCommentEx::att_paraId(const OOXMLValue::Pointer_t& pValue)
+{
+ m_sParaId = pValue->getString();
+}
+
+void OOXMLFastContextHandlerCommentEx::att_done(const OOXMLValue::Pointer_t& pValue)
+{
+ if (pValue->getInt())
+ m_bDone = true;
+}
+
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index 4f2a070c85de..de3f3b7a61f9 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -589,6 +589,22 @@ protected:
virtual void process() override;
};
+class OOXMLFastContextHandlerCommentEx : public OOXMLFastContextHandler
+{
+public:
+ explicit OOXMLFastContextHandlerCommentEx(OOXMLFastContextHandler* pContext);
+
+ virtual std::string getType() const override { return "CommentEx"; }
+ virtual void lcl_endFastElement(Token_t Element) override;
+
+ void att_paraId(const OOXMLValue::Pointer_t& pValue);
+ void att_done(const OOXMLValue::Pointer_t& pValue);
+
+private:
+ OUString m_sParaId;
+ bool m_bDone = false;
+};
+
}}
#endif // INCLUDED_WRITERFILTER_SOURCE_OOXML_OOXMLFASTCONTEXTHANDLER_HXX
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index 2b773e02cf5e..81e75a29b627 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -148,6 +148,7 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc
static const char sFooterType[] = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
static const char sHeaderType[] = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
static const char sOleObjectType[] = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
+ static const char sCommentsExtendedType[] = "http://schemas.microsoft.com/office/2011/relationships/commentsExtended";
// OOXML strict
static const char sDocumentTypeStrict[] = "http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument";
static const char sStylesTypeStrict[] = "http://purl.oclc.org/ooxml/officeDocument/relationships/styles";
@@ -251,6 +252,10 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc
sStreamType = sHeaderType;
sStreamTypeStrict = sHeaderTypeStrict;
break;
+ case COMMENTS_EXTENDED:
+ sStreamType = sCommentsExtendedType;
+ sStreamTypeStrict = sCommentsExtendedType;
+ break;
default:
break;
}
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 4ac953bacb1d..f5b0e597a737 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -26,6 +26,7 @@
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
+ xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
@@ -5353,6 +5354,54 @@
<element name="cntxtAlts" tokenid="ooxml:cntxtAlts_cntxtAlts"/>
</resource>
</namespace>
+ <namespace name="w15">
+ <start name="commentsEx"/>
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="http://schemas.microsoft.com/office/word/2012/wordml" attributeFormDefault="qualified">
+ <define name="commentsEx">
+ <element name="commentsEx">
+ <ref name="CT_CommentsEx"/>
+ </element>
+ </define>
+ <define name="CT_CommentsEx">
+ <element name="commentEx">
+ <ref name="CT_CommentEx"/>
+ </element>
+ </define>
+ <define name="CT_CommentEx">
+ <attribute name="paraId">
+ <ref name="ST_LongHexNumber"/>
+ </attribute>
+ <!-- Not yet used
+ <attribute name="paraIdParent">
+ <ref name="ST_LongHexNumber"/>
+ </attribute>
+ -->
+ <attribute name="done">
+ <ref name="ST_OnOff"/>
+ </attribute>
+ </define>
+ <define name="ST_LongHexNumber">
+ <data type="hexBinary"/>
+ </define>
+ <define name="ST_OnOff">
+ <choice>
+ <value>true</value>
+ <value>false</value>
+ <value>0</value>
+ <value>1</value>
+ </choice>
+ </define>
+ </grammar>
+ <resource name="CT_CommentsEx" resource="Stream">
+ <element name="commentEx" tokenid="ooxml:CT_CommentsEx_commentEx"/>
+ </resource>
+ <resource name="CT_CommentEx" resource="CommentEx">
+ <attribute name="paraId" tokenid="ooxml:CT_CommentEx_paraId" action="att_paraId"/>
+ <attribute name="done" tokenid="ooxml:CT_CommentEx_done" action="att_done"/>
+ </resource>
+ <resource name="ST_LongHexNumber" resource="String"/>
+ <resource name="ST_OnOff" resource="Boolean"/>
+ </namespace>
<namespace name="a14">
<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="http://schemas.microsoft.com/office/drawing/2010/main">
<!-- Simple types -->
@@ -13854,9 +13903,14 @@
<data type="string"/>
</attribute>
</define>
- <define name="CT_Placeholder">
+ <define name="CT_SdtPlaceholderDocPart">
+ <attribute name="val">
+ <data type="string"/>
+ </attribute>
+ </define>
+ <define name="CT_SdtPlaceholder">
<element name="docPart">
- <ref name="CT_String"/>
+ <ref name="CT_SdtPlaceholderDocPart"/>
</element>
</define>
<define name="CT_SdtText">
@@ -13875,6 +13929,11 @@
<data type="string"/>
</attribute>
</define>
+ <define name="CT_SdtColor">
+ <attribute name="val">
+ <data type="string"/>
+ </attribute>
+ </define>
<define name="CT_SdtPr">
<choice>
<element name="rPr">
@@ -13887,7 +13946,7 @@
<ref name="CT_Lock"/>
</element>
<element name="placeholder">
- <ref name="CT_Placeholder"/>
+ <ref name="CT_SdtPlaceholder"/>
</element>
<element name="showingPlcHdr">
<ref name="CT_OnOff"/>
@@ -13932,7 +13991,7 @@
<ref name="CT_Empty"/>
</element>
<element name="text">
- <ref name="CT_OnOff"/>
+ <ref name="CT_SdtText"/>
</element>
<element name="citation">
<ref name="CT_OnOff"/>
@@ -13943,6 +14002,9 @@
<element name="bibliography">
<ref name="CT_Empty"/>
</element>
+ <element name="w15:color">
+ <ref name="CT_SdtColor"/>
+ </element>
</choice>
</define>
<define name="CT_SdtEndPr">
@@ -14186,6 +14248,18 @@
</element>
</choice>
</define>
+ <!-- [MS-DOCX] sect. 2.2.4 "p and tr Extensions" -->
+ <!-- Should rather be in w14 namespace, but I don't see how to reference things from there -->
+ <define name="AG_Parids">
+ <attribute name="w14:paraId">
+ <data type="string"/>
+ </attribute>
+ <!-- Not yet used
+ <attribute name="textId">
+ <ref name="ST_LongHexNumber"/>
+ </attribute>
+ -->
+ </define>
<define name="CT_P">
<element name="pPr">
<ref name="CT_PPr"/>
@@ -14206,6 +14280,7 @@
<attribute name="rsidRDefault">
<data type="string"/>
</attribute>
+ <ref name="AG_Parids"/>
<!-- tdf#108714 : allow <w:br> at paragraph level (despite this is illegal according to ECMA-376-1:2016) - bug-to-bug compatibility with Word -->
<element name="br">
<ref name="CT_Br_OutOfOrder"/>
@@ -14516,6 +14591,7 @@
<attribute name="rsidTr">
<data type="string"/>
</attribute>
+ <ref name="AG_Parids"/>
</define>
<define name="ST_TblLayout">
<choice>
@@ -18159,11 +18235,20 @@
<attribute name="val" tokenid="ooxml:CT_CalendarType_val" action="setValue"/>
<action name="start" action="setDefaultStringValue"/>
</resource>
+ <resource name="CT_SdtText" resource="Properties">
+ <attribute name="multiLine" tokenid="ooxml:CT_SdtText_multiLine"/>
+ </resource>
+ <resource name="CT_SdtPlaceholder" resource="Properties">
+ <attribute name="docPart" tokenid="ooxml:CT_SdtPlaceholder_docPart"/>
+ </resource>
<resource name="CT_DataBinding" resource="Properties">
<attribute name="prefixMappings" tokenid="ooxml:CT_DataBinding_prefixMappings"/>
<attribute name="xpath" tokenid="ooxml:CT_DataBinding_xpath"/>
<attribute name="storeItemID" tokenid="ooxml:CT_DataBinding_storeItemID"/>
</resource>
+ <resource name="CT_SdtColor" resource="Properties">
+ <attribute name="val" tokenid="ooxml:CT_SdtColor_val"/>
+ </resource>
<resource name="CT_SdtPr" resource="Properties">
<element name="rPr" tokenid="ooxml:CT_SdtPr_rPr"/>
<element name="alias" tokenid="ooxml:CT_SdtPr_alias"/>
@@ -18187,6 +18272,7 @@
<element name="citation" tokenid="ooxml:CT_SdtPr_citation"/>
<element name="group" tokenid="ooxml:CT_SdtPr_group"/>
<element name="bibliography" tokenid="ooxml:CT_SdtPr_bibliography"/>
+ <element name="w15:color" tokenid="ooxml:CT_SdtPr_color"/>
</resource>
<resource name="CT_SdtEndPr" resource="Properties">
<element name="rPr" tokenid="ooxml:CT_SdtEndPr_rPr"/>
@@ -18251,6 +18337,9 @@
<attribute name="displayText" tokenid="ooxml:CT_SdtListItem_displayText"/>
<attribute name="value" tokenid="ooxml:CT_SdtListItem_value"/>
</resource>
+ <resource name="CT_SdtPlaceholderDocPart" resource="Properties">
+ <attribute name="val" tokenid="ooxml:CT_SdtPlaceholder_docPart_val"/>
+ </resource>
<resource name="CT_Attr" resource="Properties">
<attribute name="uri" tokenid="ooxml:CT_Attr_uri"/>
<attribute name="name" tokenid="ooxml:CT_Attr_name"/>
@@ -18290,6 +18379,7 @@
<element name="subDoc" tokenid="ooxml:EG_PContent_subDoc"/>
</resource>
<resource name="CT_P" resource="Stream">
+ <attribute name="w14:paraId" tokenid="ooxml:AG_Parids_paraId"/>
<action name="start" action="handleLastParagraphInSection"/>
<action name="start" action="startParagraphGroup"/>
<action name="start" action="setHandle"/>
diff --git a/xmloff/CppunitTest_xmloff_draw.mk b/xmloff/CppunitTest_xmloff_draw.mk
new file mode 100644
index 000000000000..4ebac5c27a3b
--- /dev/null
+++ b/xmloff/CppunitTest_xmloff_draw.mk
@@ -0,0 +1,45 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,xmloff_draw))
+
+$(eval $(call gb_CppunitTest_use_externals,xmloff_draw,\
+ boost_headers \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,xmloff_draw, \
+ xmloff/qa/unit/draw \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,xmloff_draw, \
+ comphelper \
+ cppu \
+ embobj \
+ sal \
+ test \
+ unotest \
+ utl \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,xmloff_draw))
+
+$(eval $(call gb_CppunitTest_use_ure,xmloff_draw))
+$(eval $(call gb_CppunitTest_use_vcl,xmloff_draw))
+
+$(eval $(call gb_CppunitTest_use_rdb,xmloff_draw,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,xmloff_draw,\
+ officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,xmloff_draw))
+
+# vim: set noet sw=4 ts=4:
diff --git a/xmloff/Module_xmloff.mk b/xmloff/Module_xmloff.mk
index fe69b86b09f6..8f5853c9da41 100644
--- a/xmloff/Module_xmloff.mk
+++ b/xmloff/Module_xmloff.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_Module_add_check_targets,xmloff,\
CppunitTest_xmloff_uxmloff) \
CppunitTest_xmloff_style \
CppunitTest_xmloff_text \
+ CppunitTest_xmloff_draw \
))
$(eval $(call gb_Module_add_subsequentcheck_targets,xmloff,\
diff --git a/xmloff/qa/unit/data/textbox-loss.docx b/xmloff/qa/unit/data/textbox-loss.docx
new file mode 100644
index 000000000000..9190e662f851
--- /dev/null
+++ b/xmloff/qa/unit/data/textbox-loss.docx
Binary files differ
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
new file mode 100644
index 000000000000..cd19c878550e
--- /dev/null
+++ b/xmloff/qa/unit/draw.cxx
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <test/bootstrapfixture.hxx>
+#include <unotest/macros_test.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
+
+#include <unotools/mediadescriptor.hxx>
+#include <unotools/tempfile.hxx>
+
+using namespace ::com::sun::star;
+
+char const DATA_DIRECTORY[] = "/xmloff/qa/unit/data/";
+
+/// Covers xmloff/source/draw/ fixes.
+class XmloffDrawTest : public test::BootstrapFixture, public unotest::MacrosTest
+{
+private:
+ uno::Reference<lang::XComponent> mxComponent;
+
+public:
+ void setUp() override;
+ void tearDown() override;
+ uno::Reference<lang::XComponent>& getComponent() { return mxComponent; }
+};
+
+void XmloffDrawTest::setUp()
+{
+ test::BootstrapFixture::setUp();
+
+ mxDesktop.set(frame::Desktop::create(getComponentContext()));
+}
+
+void XmloffDrawTest::tearDown()
+{
+ if (mxComponent.is())
+ mxComponent->dispose();
+
+ test::BootstrapFixture::tearDown();
+}
+
+CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextBoxLoss)
+{
+ // Load a document that has a shape with a textbox in it. Save it to ODF and reload.
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "textbox-loss.docx";
+ getComponent() = loadFromDesktop(aURL);
+ uno::Reference<frame::XStorable> xStorable(getComponent(), uno::UNO_QUERY);
+ utl::TempFile aTempFile;
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("writer8");
+ xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+ getComponent()->dispose();
+ getComponent() = loadFromDesktop(aTempFile.GetURL());
+
+ // Make sure that the shape is still a textbox.
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ bool bTextBox = false;
+ xShape->getPropertyValue("TextBox") >>= bTextBox;
+
+ // Without the accompanying fix in place, this test would have failed, as the shape only had
+ // editeng text, loosing the image part of the shape text.
+ CPPUNIT_ASSERT(bTextBox);
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 73e03fa8aa8e..d64411284c6c 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -63,30 +63,13 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMailMergeInEditeng)
CPPUNIT_ASSERT(getComponent().is());
}
-static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& xComponent,
- const OUString& rCommand,
- const uno::Sequence<beans::PropertyValue>& rPropertyValues)
-{
- uno::Reference<frame::XController> xController
- = uno::Reference<frame::XModel>(xComponent, uno::UNO_QUERY_THROW)->getCurrentController();
- CPPUNIT_ASSERT(xController.is());
- uno::Reference<frame::XDispatchProvider> xFrame(xController->getFrame(), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xFrame.is());
-
- uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
- uno::Reference<frame::XDispatchHelper> xDispatchHelper(frame::DispatchHelper::create(xContext));
- CPPUNIT_ASSERT(xDispatchHelper.is());
-
- xDispatchHelper->executeDispatch(xFrame, rCommand, OUString(), 0, rPropertyValues);
-}
-
CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentResolved)
{
getComponent() = loadFromDesktop("private:factory/swriter");
uno::Sequence<beans::PropertyValue> aCommentProps = comphelper::InitPropertySequence({
{ "Text", uno::makeAny(OUString("comment")) },
});
- lcl_dispatchCommand(getComponent(), ".uno:InsertAnnotation", aCommentProps);
+ dispatchCommand(getComponent(), ".uno:InsertAnnotation", aCommentProps);
uno::Reference<text::XTextDocument> xTextDocument(getComponent(), uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(),
uno::UNO_QUERY);
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index b700dde5106f..780e2968cbde 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -657,6 +657,8 @@ void SAL_CALL SvXMLImport::endDocument()
}
std::unique_ptr<SvXMLNamespaceMap> SvXMLImport::processNSAttributes(
+ std::unique_ptr<SvXMLNamespaceMap> & rpNamespaceMap,
+ SvXMLImport *const pImport, // TODO???
const uno::Reference< xml::sax::XAttributeList >& xAttrList)
{
std::unique_ptr<SvXMLNamespaceMap> pRewindMap;
@@ -664,12 +666,13 @@ std::unique_ptr<SvXMLNamespaceMap> SvXMLImport::processNSAttributes(
for( sal_Int16 i=0; i < nAttrCount; i++ )
{
const OUString& rAttrName = xAttrList->getNameByIndex( i );
- if ( rAttrName == "office:version" )
+ if (pImport && rAttrName == "office:version")
{
- mpImpl->aODFVersion = xAttrList->getValueByIndex( i );
+ pImport->mpImpl->aODFVersion = xAttrList->getValueByIndex( i );
// the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2
- if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( mpImpl->aODFVersion ) )
+ if (pImport->mpImpl->mStreamName == "content.xml"
+ && !pImport->IsODFVersionConsistent(pImport->mpImpl->aODFVersion))
{
throw xml::sax::SAXException("Inconsistent ODF versions in content.xml and manifest.xml!",
uno::Reference< uno::XInterface >(),
@@ -683,8 +686,8 @@ std::unique_ptr<SvXMLNamespaceMap> SvXMLImport::processNSAttributes(
{
if( !pRewindMap )
{
- pRewindMap = std::move(mpNamespaceMap);
- mpNamespaceMap.reset(new SvXMLNamespaceMap(*pRewindMap));
+ pRewindMap = std::move(rpNamespaceMap);
+ rpNamespaceMap.reset(new SvXMLNamespaceMap(*pRewindMap));
}
const OUString& rAttrValue = xAttrList->getValueByIndex( i );
@@ -692,18 +695,18 @@ std::unique_ptr<SvXMLNamespaceMap> SvXMLImport::processNSAttributes(
? OUString()
: rAttrName.copy( 6 ) );
// Add namespace, but only if it is known.
- sal_uInt16 nKey = mpNamespaceMap->AddIfKnown( aPrefix, rAttrValue );
+ sal_uInt16 nKey = rpNamespaceMap->AddIfKnown( aPrefix, rAttrValue );
// If namespace is unknown, try to match a name with similar
// TC Id and version
if( XML_NAMESPACE_UNKNOWN == nKey )
{
OUString aTestName( rAttrValue );
if( SvXMLNamespaceMap::NormalizeURI( aTestName ) )
- nKey = mpNamespaceMap->AddIfKnown( aPrefix, aTestName );
+ nKey = rpNamespaceMap->AddIfKnown( aPrefix, aTestName );
}
// If that namespace is not known, too, add it as unknown
if( XML_NAMESPACE_UNKNOWN == nKey )
- mpNamespaceMap->Add( aPrefix, rAttrValue );
+ rpNamespaceMap->Add( aPrefix, rAttrValue );
}
}
@@ -716,7 +719,8 @@ void SAL_CALL SvXMLImport::startElement( const OUString& rName,
// SAL_INFO("svg", "startElement " << rName);
// Process namespace attributes. This must happen before creating the
// context, because namespace declaration apply to the element name itself.
- std::unique_ptr<SvXMLNamespaceMap> pRewindMap(processNSAttributes(xAttrList));
+ std::unique_ptr<SvXMLNamespaceMap> pRewindMap(
+ processNSAttributes(mpNamespaceMap, this, xAttrList));
// Get element's namespace and local name.
OUString aLocalName;
@@ -893,7 +897,7 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element,
maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList );
std::unique_ptr<SvXMLNamespaceMap> pRewindMap(
- processNSAttributes( maNamespaceAttrList.get() ));
+ processNSAttributes(mpNamespaceMap, this, maNamespaceAttrList.get()));
assert( dynamic_cast<SvXMLImportContext*>( xContext.get() ) != nullptr );
SvXMLImportContext *pContext = static_cast<SvXMLImportContext*>( xContext.get() );
if (pRewindMap)
@@ -2238,7 +2242,7 @@ void SAL_CALL SvXMLLegacyToFastDocHandler::endDocument()
void SAL_CALL SvXMLLegacyToFastDocHandler::startElement( const OUString& rName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList )
{
- mrImport->processNSAttributes(xAttrList);
+ SvXMLImport::processNSAttributes(mrImport->mpNamespaceMap, mrImport.get(), xAttrList);
OUString aLocalName;
sal_uInt16 nPrefix = mrImport->mpNamespaceMap->GetKeyByAttrName( rName, &aLocalName );
Sequence< sal_Int8 > aLocalNameSeq( reinterpret_cast<sal_Int8 const *>(
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 3978c2673edc..edaadf884146 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -137,6 +137,19 @@ namespace xmloff { namespace token {
TOKEN( "grddl", XML_NP_GRDDL ),
TOKEN( "http://www.w3.org/2003/g/data-view#", XML_N_GRDDL ),
+ // OOo extension digital signatures, used in ODF 1.1
+ TOKEN( "dsigooo", XML_NP_DSIG_OOO ),
+ TOKEN( "http://openoffice.org/2004/documentsignatures", XML_N_DSIG_OOO ),
+ // ODF 1.2 digital signature namespaces
+ TOKEN( "dsig", XML_NP_DSIG ),
+ TOKEN( "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0", XML_N_DSIG ),
+ TOKEN( "ds", XML_NP_DS ),
+ TOKEN( "http://www.w3.org/2000/09/xmldsig#", XML_N_DS ),
+ TOKEN( "xades132", XML_NP_XADES132 ),
+ TOKEN( "http://uri.etsi.org/01903/v1.3.2#", XML_N_XADES132 ),
+ TOKEN( "xades141", XML_NP_XADES141 ),
+ TOKEN( "http://uri.etsi.org/01903/v1.4.1#", XML_N_XADES141 ),
+
// ODF Enhanced namespaces
TOKEN( "officeooo", XML_NP_OFFICE_EXT ),
TOKEN( "http://openoffice.org/2009/office", XML_N_OFFICE_EXT ),
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 9d8a04c55b1f..6f33aee76805 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -382,18 +382,8 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
if (aParentName.isEmpty() && xPropertySetInfo->hasPropertyByName("TextBox") && xPropSet->getPropertyValue("TextBox").hasValue() && xPropSet->getPropertyValue("TextBox").get<bool>())
{
// Shapes with a Writer TextBox always have a parent style.
- // If there would be none, then just assign the first available.
- uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(GetExport().GetModel(), uno::UNO_QUERY);
- if (xStyleFamiliesSupplier.is()) // tdf#108231
- {
- uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
- uno::Reference<container::XNameAccess> xFrameStyles = xStyleFamilies->getByName("FrameStyles").get< uno::Reference<container::XNameAccess> >();
- uno::Sequence<OUString> aFrameStyles = xFrameStyles->getElementNames();
- if (aFrameStyles.hasElements())
- {
- aParentName = aFrameStyles[0];
- }
- }
+ // If there would be none, then assign the default one.
+ aParentName = "Frame";
}
// filter propset
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 90bec969bcae..18c09a5bd28f 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -87,6 +87,7 @@
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/vector/b2dvector.hxx>
+#include <tools/urlobj.hxx>
#include <o3tl/safeint.hxx>
using namespace ::com::sun::star;
@@ -3222,9 +3223,35 @@ SdXMLFloatingFrameShapeContext::~SdXMLFloatingFrameShapeContext()
{
}
+uno::Reference<drawing::XShape> SdXMLFloatingFrameShapeContext::CreateFloatingFrameShape() const
+{
+ uno::Reference<lang::XMultiServiceFactory> xServiceFact(GetImport().GetModel(), uno::UNO_QUERY);
+ if (!xServiceFact.is())
+ return nullptr;
+ uno::Reference<drawing::XShape> xShape(
+ xServiceFact->createInstance("com.sun.star.drawing.FrameShape"), uno::UNO_QUERY);
+ return xShape;
+}
+
void SdXMLFloatingFrameShapeContext::StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& )
{
- AddShape("com.sun.star.drawing.FrameShape");
+ uno::Reference<drawing::XShape> xShape(SdXMLFloatingFrameShapeContext::CreateFloatingFrameShape());
+
+ uno::Reference< beans::XPropertySet > xProps(xShape, uno::UNO_QUERY);
+ // set FrameURL before AddShape, we have to do it again later because it
+ // gets cleared when the SdrOle2Obj is attached to the XShape. But we want
+ // FrameURL to exist when AddShape triggers SetPersistName which itself
+ // triggers SdrOle2Obj::CheckFileLink_Impl and at that point we want to
+ // know what URL will end up being used. So bodge this by setting FrameURL
+ // to the temp pre-SdrOle2Obj attached properties and we can smuggle it
+ // eventually into SdrOle2Obj::SetPersistName at the right point after
+ // PersistName is set but before SdrOle2Obj::CheckFileLink_Impl is called
+ // in order to inform the link manager that this is an IFrame that links to
+ // a URL
+ if (xProps && !maHref.isEmpty())
+ xProps->setPropertyValue("FrameURL", Any(maHref));
+
+ AddShape(xShape);
if( mxShape.is() )
{
@@ -3233,7 +3260,6 @@ void SdXMLFloatingFrameShapeContext::StartElement( const css::uno::Reference< cs
// set pos, size, shear and rotate
SetTransformation();
- uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY );
if( xProps.is() )
{
if( !maFrameName.isEmpty() )
@@ -3243,6 +3269,9 @@ void SdXMLFloatingFrameShapeContext::StartElement( const css::uno::Reference< cs
if( !maHref.isEmpty() )
{
+ if (INetURLObject(maHref).GetProtocol() == INetProtocol::Macro)
+ GetImport().NotifyMacroEventRead();
+
xProps->setPropertyValue("FrameURL", Any(maHref) );
}
}
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index 5231163429c9..6a584542b42f 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -513,6 +513,8 @@ private:
OUString maFrameName;
OUString maHref;
+ css::uno::Reference<css::drawing::XShape> CreateFloatingFrameShape() const;
+
public:
SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index e20206b5b96a..a9aff467bbea 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -72,6 +72,16 @@ xhtml
N_XHTML_DUMMY
grddl
N_GRDDL_DUMMY
+dsigooo
+N_DSIG_OOO_DUMMY
+dsig
+N_DSIG_DUMMY
+ds
+N_DS_DUMMY
+xades132
+N_XADES132_DUMMY
+xades141
+N_XADES141_DUMMY
officeooo
N_OFFICE_EXT_DUMMY
formx
diff --git a/xmlsecurity/inc/biginteger.hxx b/xmlsecurity/inc/biginteger.hxx
index d07ecf45d8af..8b4d8a9143b5 100644
--- a/xmlsecurity/inc/biginteger.hxx
+++ b/xmlsecurity/inc/biginteger.hxx
@@ -31,6 +31,9 @@ namespace xmlsecurity
{
XSECXMLSEC_DLLPUBLIC OUString bigIntegerToNumericString( const css::uno::Sequence< sal_Int8 >& serial );
XSECXMLSEC_DLLPUBLIC css::uno::Sequence< sal_Int8 > numericStringToBigInteger ( const OUString& serialNumber );
+
+XSECXMLSEC_DLLPUBLIC bool EqualDistinguishedNames(OUString const& rName1,
+ OUString const& rName2);
}
#endif
diff --git a/xmlsecurity/inc/certificateviewer.hxx b/xmlsecurity/inc/certificateviewer.hxx
index d531dd1fc205..ccb2278f6972 100644
--- a/xmlsecurity/inc/certificateviewer.hxx
+++ b/xmlsecurity/inc/certificateviewer.hxx
@@ -139,6 +139,7 @@ private:
bool mbFirstActivateDone;
std::vector<std::unique_ptr<CertPath_UserData>> maUserData;
+ std::shared_ptr<CertificateViewer> mxCertificateViewer;
std::unique_ptr<weld::TreeView> mxCertPathLB;
std::unique_ptr<weld::Button> mxViewCertPB;
@@ -154,6 +155,7 @@ private:
public:
CertificateViewerCertPathTP(weld::Container* pParent, CertificateViewer* pDlg);
+ ~CertificateViewerCertPathTP();
void ActivatePage();
};
diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx
index 59e699db7b69..848a2deeac80 100644
--- a/xmlsecurity/inc/digitalsignaturesdialog.hxx
+++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx
@@ -44,6 +44,7 @@ namespace xml { namespace dom {
class HeaderBar;
+class CertificateViewer;
class DigitalSignaturesDialog : public weld::GenericDialogController
{
@@ -79,6 +80,9 @@ private:
std::unique_ptr<weld::Button> m_xStartCertMgrBtn;
std::unique_ptr<weld::Button> m_xCloseBtn;
+ std::shared_ptr<CertificateViewer> m_xViewer;
+ std::shared_ptr<weld::MessageDialog> m_xInfoBox;
+
DECL_LINK(AdESCompliantCheckBoxHdl, weld::ToggleButton&, void);
DECL_LINK(ViewButtonHdl, weld::Button&, void);
DECL_LINK(AddButtonHdl, weld::Button&, void);
@@ -119,6 +123,7 @@ public:
void SetSignatureStream( const css::uno::Reference < css::io::XStream >& rxStream );
// Execute the dialog...
+ void beforeRun();
short run() override;
// Did signatures change?
diff --git a/xmlsecurity/inc/xmlsec-wrapper.h b/xmlsecurity/inc/xmlsec-wrapper.h
index c060c8bf23b8..2d06dcfdd549 100644
--- a/xmlsecurity/inc/xmlsec-wrapper.h
+++ b/xmlsecurity/inc/xmlsec-wrapper.h
@@ -43,6 +43,10 @@
#include <xmlsec/nss/app.h>
#include <xmlsec/nss/crypto.h>
#include <xmlsec/nss/pkikeys.h>
+#include <xmlsec/nss/x509.h>
+#endif
+#ifdef XMLSEC_CRYPTO_MSCRYPTO
+#include <xmlsec/mscng/x509.h>
#endif
#endif
diff --git a/xmlsecurity/inc/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsignaturehelper.hxx
index 0fcbd665251f..2456ddd437ec 100644
--- a/xmlsecurity/inc/xmlsignaturehelper.hxx
+++ b/xmlsecurity/inc/xmlsignaturehelper.hxx
@@ -28,6 +28,9 @@
#include "xmlsignaturehelper.hxx"
#include "xsecctl.hxx"
+#include <com/sun/star/security/XCertificate.hpp>
+#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
+
class DateTime;
class UriBindingHelper;
@@ -93,6 +96,15 @@ public:
// After signing/verifying, get information about signatures
SignatureInformation GetSignatureInformation( sal_Int32 nSecurityId ) const;
SignatureInformations GetSignatureInformations() const;
+ /// ImplVerifySignature calls this to figure out which X509Data is the
+ /// signing certificate and update the internal state with the result.
+ /// @return
+ /// A sequence with the signing certificate at the back on success.
+ /// An empty sequence on failure.
+ std::vector<css::uno::Reference<css::security::XCertificate>>
+ CheckAndUpdateSignatureInformation(
+ css::uno::Reference<css::xml::crypto::XSecurityEnvironment> const& xSecEnv,
+ SignatureInformation const& rInfo);
// See XSecController for documentation
void StartMission(const css::uno::Reference<css::xml::crypto::XXMLSecurityContext>& xSecurityContext);
diff --git a/xmlsecurity/inc/xsecctl.hxx b/xmlsecurity/inc/xsecctl.hxx
index 351c94a2a3e6..7ce35cea22bf 100644
--- a/xmlsecurity/inc/xsecctl.hxx
+++ b/xmlsecurity/inc/xsecctl.hxx
@@ -252,6 +252,7 @@ private:
/// Sets algorithm from <SignatureMethod Algorithm="...">.
void setSignatureMethod(svl::crypto::SignatureMethodAlgorithm eAlgorithmID);
void switchGpgSignature();
+ bool haveReferenceForId(OUString const& rId) const;
void addReference(
const OUString& ouUri,
sal_Int32 nDigestID,
@@ -262,18 +263,21 @@ private:
sal_Int32 nDigestID );
void setReferenceCount() const;
- void setX509IssuerName( OUString const & ouX509IssuerName );
- void setX509SerialNumber( OUString const & ouX509SerialNumber );
- void setX509Certificate( OUString const & ouX509Certificate );
+ void setX509Data(
+ std::vector<std::pair<OUString, OUString>> & rX509IssuerSerials,
+ std::vector<OUString> const& rX509Certificates);
+ void setX509CertDigest(
+ OUString const& rCertDigest, sal_Int32 const nReferenceDigestID,
+ OUString const& rX509IssuerName, OUString const& rX509SerialNumber);
+
void setSignatureValue( OUString const & ouSignatureValue );
void setDigestValue( sal_Int32 nDigestID, OUString const & ouDigestValue );
void setGpgKeyID( OUString const & ouKeyID );
void setGpgCertificate( OUString const & ouGpgCert );
void setGpgOwner( OUString const & ouGpgOwner );
- void setDate( OUString const & ouDate );
- void setDescription(const OUString& rDescription);
- void setCertDigest(const OUString& rCertDigest);
+ void setDate(OUString const& rId, OUString const& ouDate);
+ void setDescription(OUString const& rId, OUString const& rDescription);
void setValidSignatureImage(const OUString& rValidSigImg);
void setInvalidSignatureImage(const OUString& rInvalidSigImg);
void setSignatureLineId(const OUString& rSignatureLineId);
@@ -283,7 +287,6 @@ public:
private:
void setId( OUString const & ouId );
- void setPropertyId( OUString const & ouPropertyId );
css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > prepareSignatureToRead(
sal_Int32 nSecurityId );
@@ -303,6 +306,9 @@ public:
SignatureInformation getSignatureInformation( sal_Int32 nSecurityId ) const;
SignatureInformations getSignatureInformations() const;
+ /// only verify can figure out which X509Data is the signing certificate
+ void UpdateSignatureInformation(sal_Int32 nSecurityId,
+ std::vector<SignatureInformation::X509Data> const& rDatas);
static void exportSignature(
const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler,
diff --git a/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt b/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
new file mode 100644
index 000000000000..d63e4b6b7b72
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/02_doc_macros_signed_by_attacker_manipulated.odt
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt
new file mode 100644
index 000000000000..0190abb00f23
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated.odt
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt
new file mode 100644
index 000000000000..f4b4198f94a6
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated2.odt
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
new file mode 100644
index 000000000000..558bdee47e59
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_attacker_manipulated_triple.odt
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_trusted_person_manipulated.odt b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_trusted_person_manipulated.odt
new file mode 100644
index 000000000000..4136b32e5610
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/02_doc_signed_by_trusted_person_manipulated.odt
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt b/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt
new file mode 100644
index 000000000000..5e519dd8b7e7
--- /dev/null
+++ b/xmlsecurity/qa/unit/signing/data/signed_with_x509certificate_chain.odt
Binary files differ
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index d25b87fdd7f3..2f869147db5f 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/security/CertificateValidity.hpp>
#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
#include <com/sun/star/xml/crypto/SEInitializer.hpp>
@@ -53,6 +54,7 @@
#include <sfx2/docfilt.hxx>
#include <officecfg/Office/Common.hxx>
#include <comphelper/configuration.hxx>
+#include <vcl/scheduler.hxx>
#include <svx/signaturelinehelper.hxx>
#include <sfx2/viewsh.hxx>
#include <comphelper/propertyvalue.hxx>
@@ -518,6 +520,127 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testODFNo)
static_cast<int>(pObjectShell->GetDocumentSignatureState()));
}
+// document has one signed timestamp and one unsigned timestamp
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFUnsignedTimestamp)
+{
+ createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+ + "02_doc_signed_by_trusted_person_manipulated.odt");
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+ CPPUNIT_ASSERT_MESSAGE(
+ (OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+ (nActual == SignatureState::NOTVALIDATED || nActual == SignatureState::OK));
+ uno::Sequence<security::DocumentSignatureInformation> const infos(
+ pObjectShell->GetDocumentSignatureInformation(false));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), infos.getLength());
+ // was: 66666666
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(20210126), infos[0].SignatureDate);
+ // was: 0
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(18183742), infos[0].SignatureTime);
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFX509CertificateChain)
+{
+ createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+ + "signed_with_x509certificate_chain.odt");
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+ CPPUNIT_ASSERT_MESSAGE(
+ (OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+ (nActual == SignatureState::NOTVALIDATED || nActual == SignatureState::OK));
+ uno::Sequence<security::DocumentSignatureInformation> const infos(
+ pObjectShell->GetDocumentSignatureInformation(false));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), infos.getLength());
+ // check that the signing certificate was picked, not one of the 2 CA ones
+ CPPUNIT_ASSERT_EQUAL(security::CertificateValidity::VALID, infos[0].CertificateStatus);
+ CPPUNIT_ASSERT(infos[0].Signer.is());
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("CN=Xmlsecurity RSA Test example Alice,O=Xmlsecurity RSA Test,ST=England,C=UK"),
+ infos[0].Signer->getSubjectName());
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFDoubleX509Data)
+{
+ createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+ + "02_doc_signed_by_attacker_manipulated.odt");
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+ CPPUNIT_ASSERT_MESSAGE(
+ (OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+ (nActual == SignatureState::NOTVALIDATED || nActual == SignatureState::OK));
+ uno::Sequence<security::DocumentSignatureInformation> const infos(
+ pObjectShell->GetDocumentSignatureInformation(false));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), infos.getLength());
+ CPPUNIT_ASSERT_EQUAL(security::CertificateValidity::INVALID, infos[0].CertificateStatus);
+ CPPUNIT_ASSERT(!infos[0].Signer.is());
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFTripleX509Data)
+{
+ createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+ + "02_doc_signed_by_attacker_manipulated_triple.odt");
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+ // here, libxmlsec will pick the 1st X509Data but signing key is the 2nd
+ CPPUNIT_ASSERT_EQUAL_MESSAGE((OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+ SignatureState::BROKEN, nActual);
+ uno::Sequence<security::DocumentSignatureInformation> const infos(
+ pObjectShell->GetDocumentSignatureInformation(false));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), infos.getLength());
+ CPPUNIT_ASSERT_EQUAL(security::CertificateValidity::INVALID, infos[0].CertificateStatus);
+ CPPUNIT_ASSERT(!infos[0].Signer.is());
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFMacroDoubleX509Data)
+{
+ createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+ + "02_doc_macros_signed_by_attacker_manipulated.odt");
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ SignatureState nActual = pObjectShell->GetScriptingSignatureState();
+ CPPUNIT_ASSERT_MESSAGE(
+ (OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+ (nActual == SignatureState::NOTVALIDATED || nActual == SignatureState::OK));
+ uno::Sequence<security::DocumentSignatureInformation> const infos(
+ pObjectShell->GetDocumentSignatureInformation(true));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), infos.getLength());
+ CPPUNIT_ASSERT_EQUAL(security::CertificateValidity::INVALID, infos[0].CertificateStatus);
+ CPPUNIT_ASSERT(!infos[0].Signer.is());
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testODFDoubleX509Certificate)
+{
+ createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
+ + "02_doc_signed_by_attacker_manipulated2.odt");
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ SignatureState nActual = pObjectShell->GetDocumentSignatureState();
+ CPPUNIT_ASSERT_MESSAGE(
+ (OString::number(o3tl::underlyingEnumValue(nActual)).getStr()),
+ (nActual == SignatureState::NOTVALIDATED || nActual == SignatureState::OK));
+ uno::Sequence<security::DocumentSignatureInformation> const infos(
+ pObjectShell->GetDocumentSignatureInformation(false));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), infos.getLength());
+ CPPUNIT_ASSERT_EQUAL(security::CertificateValidity::INVALID, infos[0].CertificateStatus);
+ CPPUNIT_ASSERT(!infos[0].Signer.is());
+}
+
/// Test a typical OOXML where a number of (but not all) streams are signed.
CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLPartial)
{
@@ -795,13 +918,13 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdESNotype)
// attribute", i.e. the signature without such an attribute was not preserved correctly.
assertXPathNoAttribute(pXmlDoc,
"/odfds:document-signatures/dsig:Signature[1]/dsig:SignedInfo/"
- "dsig:Reference[@URI='#idSignedProperties']",
+ "dsig:Reference[starts-with(@URI, '#idSignedProperties')]",
"Type");
// New signature always has the Type attribute.
assertXPath(pXmlDoc,
"/odfds:document-signatures/dsig:Signature[2]/dsig:SignedInfo/"
- "dsig:Reference[@URI='#idSignedProperties']",
+ "dsig:Reference[starts-with(@URI, '#idSignedProperties')]",
"Type", "http://uri.etsi.org/01903#SignedProperties");
}
@@ -860,12 +983,162 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdES)
// Assert that the digest of the signing certificate is included.
assertXPath(pXmlDoc, "//xd:CertDigest", 1);
- // Assert that the Type attribute on the idSignedProperties reference is
- // not missing.
- assertXPath(pXmlDoc,
- "/odfds:document-signatures/dsig:Signature/dsig:SignedInfo/"
- "dsig:Reference[@URI='#idSignedProperties']",
- "Type", "http://uri.etsi.org/01903#SignedProperties");
+ // Assert that the Type attribute is set on all URI's that start with #idSignedProperties
+ assertXPath(pXmlDoc, "//dsig:Reference[starts-with(@URI, '#idSignedProperties')]", "Type",
+ "http://uri.etsi.org/01903#SignedProperties");
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_ODT)
+{
+ createDoc("");
+
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("writer8");
+ xStorable->storeAsURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+
+ {
+ DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content);
+ CPPUNIT_ASSERT(aManager.init());
+ uno::Reference<embed::XStorage> xStorage
+ = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
+ ZIP_STORAGE_FORMAT_STRING, aTempFile.GetURL(), embed::ElementModes::READWRITE);
+ CPPUNIT_ASSERT(xStorage.is());
+ aManager.setStore(xStorage);
+ aManager.getSignatureHelper().SetStorage(xStorage, "1.2");
+
+ // Create a signature.
+ uno::Reference<security::XCertificate> xCertificate
+ = getCertificate(aManager, svl::crypto::SignatureMethodAlgorithm::RSA);
+
+ if (!xCertificate.is())
+ return;
+ sal_Int32 nSecurityId;
+ aManager.add(xCertificate, mxSecurityContext, /*rDescription=*/OUString(), nSecurityId,
+ /*bAdESCompliant=*/true);
+
+ // Read back the signature and make sure that it's valid.
+ aManager.read(/*bUseTempStream=*/true);
+ {
+ std::vector<SignatureInformation>& rInformations
+ = aManager.getCurrentSignatureInformations();
+ CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size());
+ CPPUNIT_ASSERT_EQUAL(css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED,
+ rInformations[0].nStatus);
+ }
+
+ aManager.add(xCertificate, mxSecurityContext, /*rDescription=*/OUString(), nSecurityId,
+ /*bAdESCompliant=*/true);
+ aManager.read(/*bUseTempStream=*/true);
+ {
+ std::vector<SignatureInformation>& rInformations
+ = aManager.getCurrentSignatureInformations();
+ CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), rInformations.size());
+ CPPUNIT_ASSERT_EQUAL(css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED,
+ rInformations[1].nStatus);
+ }
+
+ aManager.add(xCertificate, mxSecurityContext, /*rDescription=*/OUString(), nSecurityId,
+ /*bAdESCompliant=*/true);
+ aManager.read(/*bUseTempStream=*/true);
+ {
+ std::vector<SignatureInformation>& rInformations
+ = aManager.getCurrentSignatureInformations();
+ CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(3), rInformations.size());
+ CPPUNIT_ASSERT_EQUAL(css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED,
+ rInformations[2].nStatus);
+ }
+
+ aManager.write(/*bXAdESCompliantIfODF=*/true);
+ uno::Reference<embed::XTransactedObject> xTransactedObject(xStorage, uno::UNO_QUERY);
+ xTransactedObject->commit();
+ }
+
+ Scheduler::ProcessEventsToIdle();
+
+ createDoc(aTempFile.GetURL());
+
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ CPPUNIT_ASSERT_EQUAL(SignatureState::OK, pObjectShell->GetDocumentSignatureState());
+}
+
+CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_OOXML)
+{
+ createDoc("");
+
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ aMediaDescriptor["FilterName"] <<= OUString("MS Word 2007 XML");
+ xStorable->storeAsURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+
+ {
+ DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content);
+ CPPUNIT_ASSERT(aManager.init());
+ uno::Reference<embed::XStorage> xStorage
+ = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
+ ZIP_STORAGE_FORMAT_STRING, aTempFile.GetURL(), embed::ElementModes::READWRITE);
+ CPPUNIT_ASSERT(xStorage.is());
+ aManager.setStore(xStorage);
+ aManager.getSignatureHelper().SetStorage(xStorage, "1.2");
+
+ // Create a signature.
+ uno::Reference<security::XCertificate> xCertificate
+ = getCertificate(aManager, svl::crypto::SignatureMethodAlgorithm::ECDSA);
+ if (!xCertificate.is())
+ return;
+
+ sal_Int32 nSecurityId;
+ aManager.add(xCertificate, mxSecurityContext, "", nSecurityId, /*bAdESCompliant=*/false);
+ aManager.read(/*bUseTempStream=*/true);
+ {
+ std::vector<SignatureInformation>& rInformations
+ = aManager.getCurrentSignatureInformations();
+ CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), rInformations.size());
+ CPPUNIT_ASSERT_EQUAL(css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED,
+ rInformations[0].nStatus);
+ }
+
+ aManager.add(xCertificate, mxSecurityContext, "", nSecurityId, /*bAdESCompliant=*/false);
+ aManager.read(/*bUseTempStream=*/true);
+ {
+ std::vector<SignatureInformation>& rInformations
+ = aManager.getCurrentSignatureInformations();
+ CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), rInformations.size());
+ CPPUNIT_ASSERT_EQUAL(css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED,
+ rInformations[1].nStatus);
+ }
+
+ aManager.add(xCertificate, mxSecurityContext, "", nSecurityId, /*bAdESCompliant=*/false);
+ aManager.read(/*bUseTempStream=*/true);
+ {
+ std::vector<SignatureInformation>& rInformations
+ = aManager.getCurrentSignatureInformations();
+ CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(3), rInformations.size());
+ CPPUNIT_ASSERT_EQUAL(css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED,
+ rInformations[2].nStatus);
+ }
+
+ aManager.write(/*bXAdESCompliantIfODF=*/true);
+ uno::Reference<embed::XTransactedObject> xTransactedObject(xStorage, uno::UNO_QUERY);
+ xTransactedObject->commit();
+ }
+
+ Scheduler::ProcessEventsToIdle();
+
+ createDoc(aTempFile.GetURL());
+
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+ CPPUNIT_ASSERT_EQUAL(SignatureState::PARTIAL_OK, pObjectShell->GetDocumentSignatureState());
}
/// Works with an existing good XAdES signature.
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 2cd338cdc3e2..dd9192ead0bd 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -19,9 +19,10 @@
#include <resourcemanager.hxx>
-#include <digitalsignaturesdialog.hxx>
+#include <certificate.hxx>
#include <certificatechooser.hxx>
#include <certificateviewer.hxx>
+#include <digitalsignaturesdialog.hxx>
#include <macrosecurity.hxx>
#include <biginteger.hxx>
#include <strings.hrc>
@@ -429,19 +430,26 @@ bool DocumentDigitalSignatures::ImplViewSignatures(
DocumentSignatureMode eMode, bool bReadOnly )
{
bool bChanges = false;
- DigitalSignaturesDialog aSignaturesDialog(
+ auto xSignaturesDialog = std::make_shared<DigitalSignaturesDialog>(
Application::GetFrameWeld(mxParentWindow), mxCtx, eMode, bReadOnly, m_sODFVersion,
m_bHasDocumentSignature);
- bool bInit = aSignaturesDialog.Init();
+ bool bInit = xSignaturesDialog->Init();
SAL_WARN_IF( !bInit, "xmlsecurity.comp", "Error initializing security context!" );
if ( bInit )
{
- aSignaturesDialog.SetStorage(rxStorage);
+ xSignaturesDialog->SetStorage(rxStorage);
- aSignaturesDialog.SetSignatureStream( xSignStream );
- if (aSignaturesDialog.run() == RET_OK)
+ xSignaturesDialog->SetSignatureStream( xSignStream );
+
+ if (bReadOnly)
+ {
+ xSignaturesDialog->beforeRun();
+ weld::DialogController::runAsync(xSignaturesDialog, [] (sal_Int32) {});
+ return false;
+ }
+ else if (xSignaturesDialog->run() == RET_OK)
{
- if (aSignaturesDialog.SignaturesChanged())
+ if (xSignaturesDialog->SignaturesChanged())
{
bChanges = true;
// If we have a storage and no stream, we are responsible for commit
@@ -526,85 +534,93 @@ DocumentDigitalSignatures::ImplVerifySignatures(
Sequence< css::security::DocumentSignatureInformation > aInfos(nInfos);
css::security::DocumentSignatureInformation* arInfos = aInfos.getArray();
- if ( nInfos )
+ for (int n = 0; n < nInfos; ++n)
{
- for( int n = 0; n < nInfos; ++n )
- {
- DocumentSignatureAlgorithm mode = DocumentSignatureHelper::getDocumentAlgorithm(
- m_sODFVersion, aSignInfos[n]);
- const std::vector< OUString > aElementsToBeVerified =
- DocumentSignatureHelper::CreateElementList(
- rxStorage, eMode, mode);
+ DocumentSignatureAlgorithm mode
+ = DocumentSignatureHelper::getDocumentAlgorithm(m_sODFVersion, aSignInfos[n]);
+ const std::vector<OUString> aElementsToBeVerified
+ = DocumentSignatureHelper::CreateElementList(rxStorage, eMode, mode);
- const SignatureInformation& rInfo = aSignInfos[n];
- css::security::DocumentSignatureInformation& rSigInfo = arInfos[n];
+ const SignatureInformation& rInfo = aSignInfos[n];
+ css::security::DocumentSignatureInformation& rSigInfo = arInfos[n];
- if (rInfo.ouGpgCertificate.isEmpty()) // X.509
+ if (!rInfo.X509Datas.empty()) // X.509
+ {
+ std::vector<uno::Reference<XCertificate>> certs(
+ rSignatureHelper.CheckAndUpdateSignatureInformation(
+ xSecEnv, rInfo));
+ if (certs.empty())
{
- if (!rInfo.ouX509Certificate.isEmpty())
- rSigInfo.Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ;
- if (!rSigInfo.Signer.is())
- rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName,
- xmlsecurity::numericStringToBigInteger( rInfo.ouX509SerialNumber ) );
-
- // On Windows checking the certificate path is buggy. It does name matching (issuer, subject name)
- // to find the parent certificate. It does not take into account that there can be several certificates
- // with the same subject name.
-
- try {
- rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(rSigInfo.Signer,
- Sequence<Reference<css::security::XCertificate> >());
- } catch (SecurityException& ) {
- OSL_FAIL("Verification of certificate failed");
- rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID;
- }
+ rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID;
}
- else if (xGpgSecEnv.is()) // GPG
+ else
{
- // TODO not ideal to retrieve cert by keyID, might
- // collide, or PGPKeyID format might change - can't we
- // keep the xCert itself in rInfo?
- rSigInfo.Signer = xGpgSecEnv->getCertificate( rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger("") );
- rSigInfo.CertificateStatus = xGpgSecEnv->verifyCertificate(rSigInfo.Signer,
- Sequence<Reference<css::security::XCertificate> >());
+ rSigInfo.Signer = certs.back();
+ // get only intermediates
+ certs.pop_back();
+ // On Windows checking the certificate path is buggy. It does name matching (issuer, subject name)
+ // to find the parent certificate. It does not take into account that there can be several certificates
+ // with the same subject name.
+ try
+ {
+ rSigInfo.CertificateStatus = xSecEnv->verifyCertificate(
+ rSigInfo.Signer, comphelper::containerToSequence(certs));
+ }
+ catch (SecurityException&)
+ {
+ SAL_WARN("xmlsecurity.comp", "Verification of certificate failed");
+ rSigInfo.CertificateStatus = css::security::CertificateValidity::INVALID;
+ }
}
+ }
+ else if (!rInfo.ouGpgCertificate.isEmpty() && xGpgSecEnv.is()) // GPG
+ {
+ // TODO not ideal to retrieve cert by keyID, might
+ // collide, or PGPKeyID format might change - can't we
+ // keep the xCert itself in rInfo?
+ rSigInfo.Signer = xGpgSecEnv->getCertificate(
+ rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger(""));
+ rSigInfo.CertificateStatus = xGpgSecEnv->verifyCertificate(
+ rSigInfo.Signer, Sequence<Reference<css::security::XCertificate>>());
+ }
- // Time support again (#i38744#)
- Date aDate( rInfo.stDateTime.Day, rInfo.stDateTime.Month, rInfo.stDateTime.Year );
- tools::Time aTime( rInfo.stDateTime.Hours, rInfo.stDateTime.Minutes,
- rInfo.stDateTime.Seconds, rInfo.stDateTime.NanoSeconds );
- rSigInfo.SignatureDate = aDate.GetDate();
- rSigInfo.SignatureTime = aTime.GetTime() / tools::Time::nanoPerCenti;
-
- rSigInfo.SignatureIsValid = ( rInfo.nStatus == css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED );
+ // Time support again (#i38744#)
+ Date aDate(rInfo.stDateTime.Day, rInfo.stDateTime.Month, rInfo.stDateTime.Year);
+ tools::Time aTime(rInfo.stDateTime.Hours, rInfo.stDateTime.Minutes,
+ rInfo.stDateTime.Seconds, rInfo.stDateTime.NanoSeconds);
+ rSigInfo.SignatureDate = aDate.GetDate();
+ rSigInfo.SignatureTime = aTime.GetTime() / tools::Time::nanoPerCenti;
- // Signature line info (ID + Images)
- if (!rInfo.ouSignatureLineId.isEmpty())
- rSigInfo.SignatureLineId = rInfo.ouSignatureLineId;
+ rSigInfo.SignatureIsValid
+ = (rInfo.nStatus == css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED);
- if (rInfo.aValidSignatureImage.is())
- rSigInfo.ValidSignatureLineImage = rInfo.aValidSignatureImage;
+ // Signature line info (ID + Images)
+ if (!rInfo.ouSignatureLineId.isEmpty())
+ rSigInfo.SignatureLineId = rInfo.ouSignatureLineId;
- if (rInfo.aInvalidSignatureImage.is())
- rSigInfo.InvalidSignatureLineImage = rInfo.aInvalidSignatureImage;
+ if (rInfo.aValidSignatureImage.is())
+ rSigInfo.ValidSignatureLineImage = rInfo.aValidSignatureImage;
- // OOXML intentionally doesn't sign metadata.
- if ( rSigInfo.SignatureIsValid && aStreamHelper.nStorageFormat != embed::StorageFormats::OFOPXML)
- {
- rSigInfo.SignatureIsValid =
- DocumentSignatureHelper::checkIfAllFilesAreSigned(
- aElementsToBeVerified, rInfo, mode);
- }
- if (eMode == DocumentSignatureMode::Content)
- {
- if (aStreamHelper.nStorageFormat == embed::StorageFormats::OFOPXML)
- rSigInfo.PartialDocumentSignature = true;
- else
- rSigInfo.PartialDocumentSignature = !DocumentSignatureHelper::isOOo3_2_Signature(aSignInfos[n]);
- }
+ if (rInfo.aInvalidSignatureImage.is())
+ rSigInfo.InvalidSignatureLineImage = rInfo.aInvalidSignatureImage;
+ // OOXML intentionally doesn't sign metadata.
+ if (rSigInfo.SignatureIsValid
+ && aStreamHelper.nStorageFormat != embed::StorageFormats::OFOPXML)
+ {
+ rSigInfo.SignatureIsValid = DocumentSignatureHelper::checkIfAllFilesAreSigned(
+ aElementsToBeVerified, rInfo, mode);
+ }
+ if (eMode == DocumentSignatureMode::Content)
+ {
+ if (aStreamHelper.nStorageFormat == embed::StorageFormats::OFOPXML)
+ rSigInfo.PartialDocumentSignature = true;
+ else
+ rSigInfo.PartialDocumentSignature
+ = !DocumentSignatureHelper::isOOo3_2_Signature(aSignInfos[n]);
}
}
+
return aInfos;
}
@@ -643,16 +659,34 @@ void DocumentDigitalSignatures::showCertificate(
}
sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
- const Reference< css::security::XCertificate >& Author )
+ const Reference<css::security::XCertificate>& xAuthor)
{
- OUString sSerialNum = xmlsecurity::bigIntegerToNumericString( Author->getSerialNumber() );
+ if (!xAuthor.is())
+ {
+ return false;
+ }
+ OUString sSerialNum = xmlsecurity::bigIntegerToNumericString(xAuthor->getSerialNumber());
Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = SvtSecurityOptions().GetTrustedAuthors();
return std::any_of(aTrustedAuthors.begin(), aTrustedAuthors.end(),
- [&Author, &sSerialNum](const SvtSecurityOptions::Certificate& rAuthor) {
- return ( rAuthor[0] == Author->getIssuerName() )
- && ( rAuthor[1] == sSerialNum );
+ [this, &xAuthor, &sSerialNum](const SvtSecurityOptions::Certificate& rAuthor) {
+ if (!xmlsecurity::EqualDistinguishedNames(rAuthor[0], xAuthor->getIssuerName()))
+ return false;
+ if (rAuthor[1] != sSerialNum)
+ return false;
+
+ DocumentSignatureManager aSignatureManager(mxCtx, {});
+ if (!aSignatureManager.init())
+ return false;
+ uno::Reference<css::security::XCertificate> xCert = aSignatureManager.getSecurityEnvironment()->createCertificateFromAscii(rAuthor[2]);
+
+ auto pAuthor = dynamic_cast<xmlsecurity::Certificate*>(xAuthor.get());
+ auto pCert = dynamic_cast<xmlsecurity::Certificate*>(xCert.get());
+ if (pAuthor && pCert)
+ return pCert->getSHA256Thumbprint() == pAuthor->getSHA256Thumbprint();
+
+ return xCert->getSHA1Thumbprint() == xAuthor->getSHA1Thumbprint();
});
}
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 3807300e7b49..228cbfdc8a54 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -268,6 +268,12 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP(weld::Container* pParen
mxViewCertPB->connect_clicked( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) );
}
+CertificateViewerCertPathTP::~CertificateViewerCertPathTP()
+{
+ if (mxCertificateViewer)
+ mxCertificateViewer->response(RET_OK);
+}
+
void CertificateViewerCertPathTP::ActivatePage()
{
if ( !mbFirstActivateDone )
@@ -319,10 +325,13 @@ IMPL_LINK_NOARG(CertificateViewerCertPathTP, ViewCertHdl, weld::Button&, void)
std::unique_ptr<weld::TreeIter> xIter = mxCertPathLB->make_iterator();
if (mxCertPathLB->get_selected(xIter.get()))
{
+ if (mxCertificateViewer)
+ mxCertificateViewer->response(RET_OK);
+
CertPath_UserData* pData = reinterpret_cast<CertPath_UserData*>(mxCertPathLB->get_id(*xIter).toInt64());
- CertificateViewer aViewer(mpDlg->getDialog(), mpDlg->mxSecurityEnvironment,
+ mxCertificateViewer = std::make_shared<CertificateViewer>(mpDlg->getDialog(), mpDlg->mxSecurityEnvironment,
pData->mxCert, false, nullptr);
- aViewer.run();
+ weld::DialogController::runAsync(mxCertificateViewer, [this] (sal_Int32) { mxCertificateViewer = nullptr; });
}
}
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index ef67c7167c04..a27737668eba 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -52,6 +52,7 @@
#include <bitmaps.hlst>
#include <strings.hrc>
#include <resourcemanager.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/xmlsechelper.hxx>
#include <comphelper/processfactory.hxx>
@@ -188,10 +189,22 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
m_xHintPackageFT->show();
break;
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ m_xAddBtn->hide();
+ m_xRemoveBtn->hide();
+ m_xStartCertMgrBtn->hide();
+ }
}
DigitalSignaturesDialog::~DigitalSignaturesDialog()
{
+ if (m_xViewer)
+ m_xViewer->response(RET_OK);
+
+ if (m_xInfoBox)
+ m_xInfoBox->response(RET_OK);
}
bool DigitalSignaturesDialog::Init()
@@ -308,7 +321,7 @@ bool DigitalSignaturesDialog::canRemove()
return (bRet && canAddRemove());
}
-short DigitalSignaturesDialog::run()
+void DigitalSignaturesDialog::beforeRun()
{
// Verify Signatures and add certificates to ListBox...
mbVerifySignatures = true;
@@ -333,7 +346,11 @@ short DigitalSignaturesDialog::run()
// Only verify once, content will not change.
// But for refreshing signature information, StartVerifySignatureHdl will be called after each add/remove
mbVerifySignatures = false;
+}
+short DigitalSignaturesDialog::run()
+{
+ beforeRun();
return GenericDialogController::run();
}
@@ -588,7 +605,7 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
if (!rInfo.ouGpgCertificate.isEmpty())
aType = "OpenPGP";
// XML based: XAdES or not.
- else if (!rInfo.ouCertDigest.isEmpty())
+ else if (rInfo.GetSigningCertificate() && !rInfo.GetSigningCertificate()->CertDigest.isEmpty())
aType = "XAdES";
else
aType = "XML-DSig";
@@ -700,8 +717,8 @@ uno::Reference<security::XCertificate> DigitalSignaturesDialog::getCertificate(c
uno::Reference<security::XCertificate> xCert;
//First we try to get the certificate which is embedded in the XML Signature
- if (xSecEnv.is() && !rInfo.ouX509Certificate.isEmpty())
- xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate);
+ if (xSecEnv.is() && rInfo.GetSigningCertificate() && !rInfo.GetSigningCertificate()->X509Certificate.isEmpty())
+ xCert = xSecEnv->createCertificateFromAscii(rInfo.GetSigningCertificate()->X509Certificate);
else {
//There must be an embedded certificate because we use it to get the
//issuer name. We cannot use /Signature/KeyInfo/X509Data/X509IssuerName
@@ -713,9 +730,12 @@ uno::Reference<security::XCertificate> DigitalSignaturesDialog::getCertificate(c
}
//In case there is no embedded certificate we try to get it from a local store
- if (!xCert.is() && xSecEnv.is())
- xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xmlsecurity::numericStringToBigInteger( rInfo.ouX509SerialNumber ) );
- if (!xCert.is() && xGpgSecEnv.is())
+ if (!xCert.is() && xSecEnv.is() && rInfo.GetSigningCertificate())
+ {
+ xCert = xSecEnv->getCertificate(rInfo.GetSigningCertificate()->X509IssuerName,
+ xmlsecurity::numericStringToBigInteger(rInfo.GetSigningCertificate()->X509SerialNumber));
+ }
+ if (!xCert.is() && xGpgSecEnv.is() && !rInfo.ouGpgKeyID.isEmpty())
xCert = xGpgSecEnv->getCertificate( rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger("") );
SAL_WARN_IF( !xCert.is(), "xmlsecurity.dialogs", "Certificate not found and can't be created!" );
@@ -752,16 +772,22 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
if ( xCert.is() )
{
+ if (m_xViewer)
+ m_xViewer->response(RET_OK);
+
uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = getSecurityEnvironmentForCertificate(xCert);
- CertificateViewer aViewer(m_xDialog.get(), xSecEnv, xCert, false, nullptr);
- aViewer.run();
+ m_xViewer = std::make_shared<CertificateViewer>(m_xDialog.get(), xSecEnv, xCert, false, nullptr);
+ weld::DialogController::runAsync(m_xViewer, [this] (sal_Int32) { m_xViewer = nullptr; });
}
else
{
- std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(m_xDialog.get(),
+ if (m_xInfoBox)
+ m_xInfoBox->response(RET_OK);
+
+ m_xInfoBox = std::shared_ptr<weld::MessageDialog>(Application::CreateMessageDialog(m_xDialog.get(),
VclMessageType::Info, VclButtonsType::Ok,
XsResId(STR_XMLSECDLG_NO_CERT_FOUND)));
- xInfoBox->run();
+ m_xInfoBox->runAsync(m_xInfoBox, [this] (sal_Int32) { m_xInfoBox = nullptr; });
}
}
}
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index 482ae6cc4126..65135d758a1a 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -492,6 +492,29 @@ void DocumentSignatureHelper::writeDigestMethod(
xDocumentHandler->endElement("DigestMethod");
}
+static void WriteXadesCert(
+ uno::Reference<xml::sax::XDocumentHandler> const& xDocumentHandler,
+ SignatureInformation::X509CertInfo const& rCertInfo)
+{
+ xDocumentHandler->startElement("xd:Cert", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->startElement("xd:CertDigest", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ DocumentSignatureHelper::writeDigestMethod(xDocumentHandler);
+ xDocumentHandler->startElement("DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ assert(!rCertInfo.CertDigest.isEmpty());
+ xDocumentHandler->characters(rCertInfo.CertDigest);
+ xDocumentHandler->endElement("DigestValue");
+ xDocumentHandler->endElement("xd:CertDigest");
+ xDocumentHandler->startElement("xd:IssuerSerial", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->startElement("X509IssuerName", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters(rCertInfo.X509IssuerName);
+ xDocumentHandler->endElement("X509IssuerName");
+ xDocumentHandler->startElement("X509SerialNumber", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ xDocumentHandler->characters(rCertInfo.X509SerialNumber);
+ xDocumentHandler->endElement("X509SerialNumber");
+ xDocumentHandler->endElement("xd:IssuerSerial");
+ xDocumentHandler->endElement("xd:Cert");
+}
+
void DocumentSignatureHelper::writeSignedProperties(
const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler,
const SignatureInformation& signatureInfo,
@@ -499,7 +522,7 @@ void DocumentSignatureHelper::writeSignedProperties(
{
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- pAttributeList->AddAttribute("Id", "idSignedProperties");
+ pAttributeList->AddAttribute("Id", "idSignedProperties_" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement("xd:SignedProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
@@ -508,26 +531,26 @@ void DocumentSignatureHelper::writeSignedProperties(
xDocumentHandler->characters(sDate);
xDocumentHandler->endElement("xd:SigningTime");
xDocumentHandler->startElement("xd:SigningCertificate", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- xDocumentHandler->startElement("xd:Cert", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- xDocumentHandler->startElement("xd:CertDigest", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- writeDigestMethod(xDocumentHandler);
-
- xDocumentHandler->startElement("DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- // TODO: this is empty for gpg signatures currently
- //assert(!signatureInfo.ouCertDigest.isEmpty());
- xDocumentHandler->characters(signatureInfo.ouCertDigest);
- xDocumentHandler->endElement("DigestValue");
-
- xDocumentHandler->endElement("xd:CertDigest");
- xDocumentHandler->startElement("xd:IssuerSerial", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- xDocumentHandler->startElement("X509IssuerName", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- xDocumentHandler->characters(signatureInfo.ouX509IssuerName);
- xDocumentHandler->endElement("X509IssuerName");
- xDocumentHandler->startElement("X509SerialNumber", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- xDocumentHandler->characters(signatureInfo.ouX509SerialNumber);
- xDocumentHandler->endElement("X509SerialNumber");
- xDocumentHandler->endElement("xd:IssuerSerial");
- xDocumentHandler->endElement("xd:Cert");
+ assert(signatureInfo.GetSigningCertificate() || !signatureInfo.ouGpgKeyID.isEmpty());
+ if (signatureInfo.GetSigningCertificate())
+ {
+ // how should this deal with multiple X509Data elements?
+ // for now, let's write all of the certificates ...
+ for (auto const& rData : signatureInfo.X509Datas)
+ {
+ for (auto const& it : rData)
+ {
+ WriteXadesCert(xDocumentHandler, it);
+ }
+ }
+ }
+ else
+ {
+ // for PGP, write empty mandatory X509IssuerName, X509SerialNumber
+ SignatureInformation::X509CertInfo temp;
+ temp.CertDigest = signatureInfo.ouGpgKeyID;
+ WriteXadesCert(xDocumentHandler, temp);
+ }
xDocumentHandler->endElement("xd:SigningCertificate");
xDocumentHandler->startElement("xd:SignaturePolicyIdentifier", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
xDocumentHandler->startElement("xd:SignaturePolicyImplied", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index 9ff3faddd761..b604929f139a 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -586,6 +586,18 @@ void DocumentSignatureManager::read(bool bUseTempStream, bool bCacheLastSignatur
bCacheLastSignature);
maSignatureHelper.EndMission();
+ // this parses the XML independently from ImplVerifySignatures() - check
+ // certificates here too ...
+ for (auto const& it : maSignatureHelper.GetSignatureInformations())
+ {
+ if (!it.X509Datas.empty())
+ {
+ uno::Reference<xml::crypto::XSecurityEnvironment> const xSecEnv(
+ getSecurityEnvironment());
+ getSignatureHelper().CheckAndUpdateSignatureInformation(xSecEnv, it);
+ }
+ }
+
maCurrentSignatureInformations = maSignatureHelper.GetSignatureInformations();
}
else
diff --git a/xmlsecurity/source/helper/ooxmlsecexporter.cxx b/xmlsecurity/source/helper/ooxmlsecexporter.cxx
index cf87d6e1ad17..9267b5458783 100644
--- a/xmlsecurity/source/helper/ooxmlsecexporter.cxx
+++ b/xmlsecurity/source/helper/ooxmlsecexporter.cxx
@@ -62,6 +62,7 @@ public:
return m_xDocumentHandler;
}
+ void writeSignature();
void writeSignedInfo();
void writeCanonicalizationMethod();
void writeCanonicalizationTransform();
@@ -85,25 +86,19 @@ public:
bool OOXMLSecExporter::Impl::isOOXMLBlacklist(const OUString& rStreamName)
{
- static const std::initializer_list<OUStringLiteral> vBlacklist =
- {
- "/%5BContent_Types%5D.xml",
- "/docProps/app.xml",
- "/docProps/core.xml",
- // Don't attempt to sign other signatures for now.
- "/_xmlsignatures"
- };
+ static const std::initializer_list<OUStringLiteral> vBlacklist
+ = { "/%5BContent_Types%5D.xml", "/docProps/app.xml", "/docProps/core.xml",
+ // Don't attempt to sign other signatures for now.
+ "/_xmlsignatures" };
// Just check the prefix, as we don't care about the content type part of the stream name.
- return std::any_of(vBlacklist.begin(), vBlacklist.end(), [&](const OUStringLiteral& rLiteral)
- {
+ return std::any_of(vBlacklist.begin(), vBlacklist.end(), [&](const OUStringLiteral& rLiteral) {
return rStreamName.startsWith(rLiteral);
});
}
bool OOXMLSecExporter::Impl::isOOXMLRelationBlacklist(const OUString& rRelationName)
{
- static const std::initializer_list<OUStringLiteral> vBlacklist =
- {
+ static const std::initializer_list<OUStringLiteral> vBlacklist = {
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
"http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin"
@@ -113,7 +108,8 @@ bool OOXMLSecExporter::Impl::isOOXMLRelationBlacklist(const OUString& rRelationN
void OOXMLSecExporter::Impl::writeSignedInfo()
{
- m_xDocumentHandler->startElement("SignedInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignedInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
writeCanonicalizationMethod();
writeSignatureMethod();
@@ -126,18 +122,18 @@ void OOXMLSecExporter::Impl::writeCanonicalizationMethod()
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("Algorithm", ALGO_C14N);
- m_xDocumentHandler->startElement("CanonicalizationMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "CanonicalizationMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
m_xDocumentHandler->endElement("CanonicalizationMethod");
-
}
void OOXMLSecExporter::Impl::writeCanonicalizationTransform()
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("Algorithm", ALGO_C14N);
- m_xDocumentHandler->startElement("Transform", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "Transform", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
m_xDocumentHandler->endElement("Transform");
-
}
void OOXMLSecExporter::Impl::writeSignatureMethod()
@@ -149,7 +145,8 @@ void OOXMLSecExporter::Impl::writeSignatureMethod()
else
pAttributeList->AddAttribute("Algorithm", ALGO_RSASHA256);
- m_xDocumentHandler->startElement("SignatureMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "SignatureMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
m_xDocumentHandler->endElement("SignatureMethod");
}
@@ -162,22 +159,28 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences()
{
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- if (rReference.ouURI != "idSignedProperties")
- pAttributeList->AddAttribute("Type", "http://www.w3.org/2000/09/xmldsig#Object");
+ if (!rReference.ouURI.startsWith("idSignedProperties"))
+ pAttributeList->AddAttribute("Type",
+ "http://www.w3.org/2000/09/xmldsig#Object");
else
- pAttributeList->AddAttribute("Type", "http://uri.etsi.org/01903#SignedProperties");
+ pAttributeList->AddAttribute("Type",
+ "http://uri.etsi.org/01903#SignedProperties");
pAttributeList->AddAttribute("URI", "#" + rReference.ouURI);
- m_xDocumentHandler->startElement("Reference", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "Reference", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
- if (rReference.ouURI == "idSignedProperties")
+ if (rReference.ouURI.startsWith("idSignedProperties"))
{
- m_xDocumentHandler->startElement("Transforms", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "Transforms",
+ uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
writeCanonicalizationTransform();
m_xDocumentHandler->endElement("Transforms");
}
DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler);
- m_xDocumentHandler->startElement("DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters(rReference.ouDigestValue);
m_xDocumentHandler->endElement("DigestValue");
m_xDocumentHandler->endElement("Reference");
@@ -187,27 +190,40 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences()
void OOXMLSecExporter::Impl::writeSignatureValue()
{
- m_xDocumentHandler->startElement("SignatureValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters(m_rInformation.ouSignatureValue);
m_xDocumentHandler->endElement("SignatureValue");
}
void OOXMLSecExporter::Impl::writeKeyInfo()
{
- m_xDocumentHandler->startElement("KeyInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- m_xDocumentHandler->startElement("X509Data", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- m_xDocumentHandler->startElement("X509Certificate", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- m_xDocumentHandler->characters(m_rInformation.ouX509Certificate);
- m_xDocumentHandler->endElement("X509Certificate");
- m_xDocumentHandler->endElement("X509Data");
+ m_xDocumentHandler->startElement(
+ "KeyInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ assert(m_rInformation.GetSigningCertificate());
+ for (auto const& rData : m_rInformation.X509Datas)
+ {
+ m_xDocumentHandler->startElement(
+ "X509Data", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ for (auto const& it : rData)
+ {
+ m_xDocumentHandler->startElement(
+ "X509Certificate",
+ uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->characters(it.X509Certificate);
+ m_xDocumentHandler->endElement("X509Certificate");
+ }
+ m_xDocumentHandler->endElement("X509Data");
+ }
m_xDocumentHandler->endElement("KeyInfo");
}
void OOXMLSecExporter::Impl::writePackageObject()
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- pAttributeList->AddAttribute("Id", "idPackageObject");
- m_xDocumentHandler->startElement("Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ pAttributeList->AddAttribute("Id", "idPackageObject_" + m_rInformation.ouSignatureId);
+ m_xDocumentHandler->startElement(
+ "Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
writeManifest();
writePackageObjectSignatureProperties();
@@ -217,7 +233,8 @@ void OOXMLSecExporter::Impl::writePackageObject()
void OOXMLSecExporter::Impl::writeManifest()
{
- m_xDocumentHandler->startElement("Manifest", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "Manifest", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
const SignatureReferenceInformations& rReferences = m_rInformation.vSignatureReferenceInfors;
for (const SignatureReferenceInformation& rReference : rReferences)
{
@@ -234,15 +251,22 @@ void OOXMLSecExporter::Impl::writeManifest()
void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI)
{
- uno::Reference<embed::XHierarchicalStorageAccess> xHierarchicalStorageAccess(m_xRootStorage, uno::UNO_QUERY);
- uno::Reference<io::XInputStream> xRelStream(xHierarchicalStorageAccess->openStreamElementByHierarchicalName(rURI, embed::ElementModes::READ), uno::UNO_QUERY);
+ uno::Reference<embed::XHierarchicalStorageAccess> xHierarchicalStorageAccess(m_xRootStorage,
+ uno::UNO_QUERY);
+ uno::Reference<io::XInputStream> xRelStream(
+ xHierarchicalStorageAccess->openStreamElementByHierarchicalName(rURI,
+ embed::ElementModes::READ),
+ uno::UNO_QUERY);
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("Algorithm", ALGO_RELATIONSHIP);
- m_xDocumentHandler->startElement("Transform", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "Transform", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
- const uno::Sequence< uno::Sequence<beans::StringPair> > aRelationsInfo = comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(xRelStream, rURI, m_xComponentContext);
+ const uno::Sequence<uno::Sequence<beans::StringPair>> aRelationsInfo
+ = comphelper::OFOPXMLHelper::ReadRelationsInfoSequence(xRelStream, rURI,
+ m_xComponentContext);
for (const uno::Sequence<beans::StringPair>& rPairs : aRelationsInfo)
{
OUString aId;
@@ -261,7 +285,9 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI)
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("xmlns:mdssi", NS_MDSSI);
pAttributeList->AddAttribute("SourceId", aId);
- m_xDocumentHandler->startElement("mdssi:RelationshipReference", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "mdssi:RelationshipReference",
+ uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
m_xDocumentHandler->endElement("mdssi:RelationshipReference");
}
@@ -270,23 +296,29 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI)
void OOXMLSecExporter::Impl::writePackageObjectSignatureProperties()
{
- m_xDocumentHandler->startElement("SignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- pAttributeList->AddAttribute("Id", "idSignatureTime");
- pAttributeList->AddAttribute("Target", "#idPackageSignature");
- m_xDocumentHandler->startElement("SignatureProperty", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+
+ pAttributeList->AddAttribute("Id", "idSignatureTime_" + m_rInformation.ouSignatureId);
+ pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId);
+ m_xDocumentHandler->startElement(
+ "SignatureProperty", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("xmlns:mdssi", NS_MDSSI);
- m_xDocumentHandler->startElement("mdssi:SignatureTime", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "mdssi:SignatureTime", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
- m_xDocumentHandler->startElement("mdssi:Format", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "mdssi:Format", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("YYYY-MM-DDThh:mm:ssTZD");
m_xDocumentHandler->endElement("mdssi:Format");
- m_xDocumentHandler->startElement("mdssi:Value", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "mdssi:Value", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
if (!m_rInformation.ouDateTime.isEmpty())
m_aSignatureTimeValue = m_rInformation.ouDateTime;
else
@@ -312,10 +344,12 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("URI", rReference.ouURI);
- m_xDocumentHandler->startElement("Reference", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "Reference", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
// Transforms
- if (rReference.ouURI.endsWith("?ContentType=application/vnd.openxmlformats-package.relationships+xml"))
+ if (rReference.ouURI.endsWith(
+ "?ContentType=application/vnd.openxmlformats-package.relationships+xml"))
{
OUString aURI = rReference.ouURI;
// Ignore leading slash.
@@ -326,7 +360,8 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo
if (nQueryPos != -1)
aURI = aURI.copy(0, nQueryPos);
- m_xDocumentHandler->startElement("Transforms", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "Transforms", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
writeRelationshipTransform(aURI);
writeCanonicalizationTransform();
@@ -335,7 +370,8 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo
}
DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler);
- m_xDocumentHandler->startElement("DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters(rReference.ouDigestValue);
m_xDocumentHandler->endElement("DigestValue");
m_xDocumentHandler->endElement("Reference");
@@ -345,15 +381,18 @@ void OOXMLSecExporter::Impl::writeOfficeObject()
{
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- pAttributeList->AddAttribute("Id", "idOfficeObject");
- m_xDocumentHandler->startElement("Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ pAttributeList->AddAttribute("Id", "idOfficeObject_" + m_rInformation.ouSignatureId);
+ m_xDocumentHandler->startElement(
+ "Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
- m_xDocumentHandler->startElement("SignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- pAttributeList->AddAttribute("Id", "idOfficeV1Details");
- pAttributeList->AddAttribute("Target", "#idPackageSignature");
- m_xDocumentHandler->startElement("SignatureProperty", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ pAttributeList->AddAttribute("Id", "idOfficeV1Details_" + m_rInformation.ouSignatureId);
+ pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId);
+ m_xDocumentHandler->startElement(
+ "SignatureProperty", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
writeSignatureInfo();
m_xDocumentHandler->endElement("SignatureProperty");
@@ -365,49 +404,67 @@ void OOXMLSecExporter::Impl::writeSignatureInfo()
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("xmlns", "http://schemas.microsoft.com/office/2006/digsig");
- m_xDocumentHandler->startElement("SignatureInfoV1", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ m_xDocumentHandler->startElement(
+ "SignatureInfoV1", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
- m_xDocumentHandler->startElement("SetupID", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SetupID", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters(m_rInformation.ouSignatureLineId);
m_xDocumentHandler->endElement("SetupID");
- m_xDocumentHandler->startElement("SignatureText", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureText", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->endElement("SignatureText");
- m_xDocumentHandler->startElement("SignatureImage", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureImage", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->endElement("SignatureImage");
- m_xDocumentHandler->startElement("SignatureComments", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureComments", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters(m_rInformation.ouDescription);
m_xDocumentHandler->endElement("SignatureComments");
// Just hardcode something valid according to [MS-OFFCRYPTO].
- m_xDocumentHandler->startElement("WindowsVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "WindowsVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("6.1");
m_xDocumentHandler->endElement("WindowsVersion");
- m_xDocumentHandler->startElement("OfficeVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "OfficeVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("16.0");
m_xDocumentHandler->endElement("OfficeVersion");
- m_xDocumentHandler->startElement("ApplicationVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "ApplicationVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("16.0");
m_xDocumentHandler->endElement("ApplicationVersion");
- m_xDocumentHandler->startElement("Monitors", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "Monitors", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("1");
m_xDocumentHandler->endElement("Monitors");
- m_xDocumentHandler->startElement("HorizontalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "HorizontalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("1280");
m_xDocumentHandler->endElement("HorizontalResolution");
- m_xDocumentHandler->startElement("VerticalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "VerticalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("800");
m_xDocumentHandler->endElement("VerticalResolution");
- m_xDocumentHandler->startElement("ColorDepth", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "ColorDepth", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("32");
m_xDocumentHandler->endElement("ColorDepth");
- m_xDocumentHandler->startElement("SignatureProviderId", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureProviderId", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("{00000000-0000-0000-0000-000000000000}");
m_xDocumentHandler->endElement("SignatureProviderId");
- m_xDocumentHandler->startElement("SignatureProviderUrl", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureProviderUrl", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->endElement("SignatureProviderUrl");
- m_xDocumentHandler->startElement("SignatureProviderDetails", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
- m_xDocumentHandler->characters("9"); // This is what MSO 2016 writes, though [MS-OFFCRYPTO] doesn't document what the value means.
+ m_xDocumentHandler->startElement(
+ "SignatureProviderDetails",
+ uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->characters(
+ "9"); // This is what MSO 2016 writes, though [MS-OFFCRYPTO] doesn't document what the value means.
m_xDocumentHandler->endElement("SignatureProviderDetails");
- m_xDocumentHandler->startElement("SignatureType", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "SignatureType", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
m_xDocumentHandler->characters("2");
m_xDocumentHandler->endElement("SignatureType");
@@ -416,15 +473,19 @@ void OOXMLSecExporter::Impl::writeSignatureInfo()
void OOXMLSecExporter::Impl::writePackageSignature()
{
- m_xDocumentHandler->startElement("Object", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
+ m_xDocumentHandler->startElement(
+ "Object", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList()));
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
pAttributeList->AddAttribute("xmlns:xd", NS_XD);
- pAttributeList->AddAttribute("Target", "#idPackageSignature");
- m_xDocumentHandler->startElement("xd:QualifyingProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+ pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId);
+ m_xDocumentHandler->startElement(
+ "xd:QualifyingProperties",
+ uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
- DocumentSignatureHelper::writeSignedProperties(m_xDocumentHandler, m_rInformation, m_aSignatureTimeValue, false);
+ DocumentSignatureHelper::writeSignedProperties(m_xDocumentHandler, m_rInformation,
+ m_aSignatureTimeValue, false);
m_xDocumentHandler->endElement("xd:QualifyingProperties");
m_xDocumentHandler->endElement("Object");
@@ -460,32 +521,37 @@ void OOXMLSecExporter::Impl::writeSignatureLineImages()
}
}
-OOXMLSecExporter::OOXMLSecExporter(const uno::Reference<uno::XComponentContext>& xComponentContext,
- const uno::Reference<embed::XStorage>& xRootStorage,
- const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler,
- const SignatureInformation& rInformation)
- : m_pImpl(std::make_unique<Impl>(xComponentContext, xRootStorage, xDocumentHandler, rInformation))
+void OOXMLSecExporter::Impl::writeSignature()
{
+ rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
+ pAttributeList->AddAttribute("xmlns", NS_XMLDSIG);
+ pAttributeList->AddAttribute("Id", m_rInformation.ouSignatureId);
+ getDocumentHandler()->startElement(
+ "Signature", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
+
+ writeSignedInfo();
+ writeSignatureValue();
+ writeKeyInfo();
+ writePackageObject();
+ writeOfficeObject();
+ writePackageSignature();
+ writeSignatureLineImages();
+
+ getDocumentHandler()->endElement("Signature");
}
-OOXMLSecExporter::~OOXMLSecExporter() = default;
-
-void OOXMLSecExporter::writeSignature()
+OOXMLSecExporter::OOXMLSecExporter(
+ const uno::Reference<uno::XComponentContext>& xComponentContext,
+ const uno::Reference<embed::XStorage>& xRootStorage,
+ const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler,
+ const SignatureInformation& rInformation)
+ : m_pImpl(
+ std::make_unique<Impl>(xComponentContext, xRootStorage, xDocumentHandler, rInformation))
{
- rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- pAttributeList->AddAttribute("xmlns", NS_XMLDSIG);
- pAttributeList->AddAttribute("Id", "idPackageSignature");
- m_pImpl->getDocumentHandler()->startElement("Signature", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
-
- m_pImpl->writeSignedInfo();
- m_pImpl->writeSignatureValue();
- m_pImpl->writeKeyInfo();
- m_pImpl->writePackageObject();
- m_pImpl->writeOfficeObject();
- m_pImpl->writePackageSignature();
- m_pImpl->writeSignatureLineImages();
-
- m_pImpl->getDocumentHandler()->endElement("Signature");
}
+OOXMLSecExporter::~OOXMLSecExporter() = default;
+
+void OOXMLSecExporter::writeSignature() { m_pImpl->writeSignature(); }
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/helper/ooxmlsecparser.cxx b/xmlsecurity/source/helper/ooxmlsecparser.cxx
index c22e8c2261bf..42f226f57d14 100644
--- a/xmlsecurity/source/helper/ooxmlsecparser.cxx
+++ b/xmlsecurity/source/helper/ooxmlsecparser.cxx
@@ -11,32 +11,1241 @@
#include "ooxmlsecparser.hxx"
#include <xmlsignaturehelper.hxx>
#include <xsecctl.hxx>
+
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmlimp.hxx>
+
+#include <com/sun/star/xml/sax/SAXException.hpp>
+
#include <sal/log.hxx>
using namespace com::sun::star;
+class OOXMLSecParser::Context
+{
+ protected:
+ friend class OOXMLSecParser;
+ OOXMLSecParser & m_rParser;
+ private:
+ std::unique_ptr<SvXMLNamespaceMap> m_pOldNamespaceMap;
+
+ public:
+ Context(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : m_rParser(rParser)
+ , m_pOldNamespaceMap(std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual ~Context() = default;
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/)
+ {
+ }
+
+ virtual void EndElement()
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const /*nNamespace*/, OUString const& /*rName*/);
+
+ virtual void Characters(OUString const& /*rChars*/)
+ {
+ }
+};
+
+// it's possible that an unsupported element has an Id attribute and a
+// ds:Reference digesting it - probably this means XSecController needs to know
+// about it. (For known elements, the Id attribute is only processed according
+// to the schema.)
+class OOXMLSecParser::UnknownContext
+ : public OOXMLSecParser::Context
+{
+ public:
+ UnknownContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+ }
+};
+
+auto OOXMLSecParser::Context::CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const /*nNamespace*/, OUString const& /*rName*/)
+-> std::unique_ptr<Context>
+{
+ // default: create new base context
+ return std::make_unique<UnknownContext>(m_rParser, std::move(pOldNamespaceMap));
+}
+
+/**
+note: anything in ds:Object should be trusted *only* if there is a ds:Reference
+ to it so it is signed (exception: the xades:EncapsulatedX509Certificate).
+ ds:SignedInfo precedes all ds:Object.
+
+ There may be multiple ds:Signature for purpose of counter-signatures
+ but the way XAdES describes these, only the ds:SignatureValue element
+ would be referenced, so requiring a ds:Reference for anything in
+ ds:Object shouldn't cause issues.
+ */
+class OOXMLSecParser::ReferencedContextImpl
+ : public OOXMLSecParser::Context
+{
+ protected:
+ bool m_isReferenced;
+
+ public:
+ ReferencedContextImpl(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_isReferenced(isReferenced)
+ {
+ }
+
+ OUString CheckIdAttrReferenced(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs)
+ {
+ OUString const id(m_rParser.HandleIdAttr(xAttrs));
+ if (!id.isEmpty() && m_rParser.m_pXSecController->haveReferenceForId(id))
+ {
+ m_isReferenced = true;
+ }
+ return id;
+ }
+};
+
+class OOXMLSecParser::DsX509CertificateContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsX509CertificateContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class OOXMLSecParser::DsX509SerialNumberContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsX509SerialNumberContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class OOXMLSecParser::DsX509IssuerNameContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsX509IssuerNameContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class OOXMLSecParser::DsX509IssuerSerialContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rX509IssuerName;
+ OUString & m_rX509SerialNumber;
+
+ public:
+ DsX509IssuerSerialContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rIssuerName, OUString & rSerialNumber)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rX509IssuerName(rIssuerName)
+ , m_rX509SerialNumber(rSerialNumber)
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509IssuerName")
+ {
+ return std::make_unique<DsX509IssuerNameContext>(m_rParser, std::move(pOldNamespaceMap), m_rX509IssuerName);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509SerialNumber")
+ {
+ return std::make_unique<DsX509SerialNumberContext>(m_rParser, std::move(pOldNamespaceMap), m_rX509SerialNumber);
+ }
+ // missing: ds:X509SKI, ds:X509SubjectName, ds:X509CRL
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+/// can't be sure what is supposed to happen here because the spec is clear as mud
+class OOXMLSecParser::DsX509DataContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ // sigh... "No ordering is implied by the above constraints."
+ // so store the ball of mud in vectors and try to figure it out later.
+ std::vector<std::pair<OUString, OUString>> m_X509IssuerSerials;
+ std::vector<OUString> m_X509Certificates;
+
+ public:
+ DsX509DataContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setX509Data(m_X509IssuerSerials, m_X509Certificates);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509IssuerSerial")
+ {
+ m_X509IssuerSerials.emplace_back();
+ return std::make_unique<DsX509IssuerSerialContext>(m_rParser, std::move(pOldNamespaceMap), m_X509IssuerSerials.back().first, m_X509IssuerSerials.back().second);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509Certificate")
+ {
+ m_X509Certificates.emplace_back();
+ return std::make_unique<DsX509CertificateContext>(m_rParser, std::move(pOldNamespaceMap), m_X509Certificates.back());
+ }
+ // missing: ds:X509SKI, ds:X509SubjectName, ds:X509CRL
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::DsKeyInfoContext
+ : public OOXMLSecParser::Context
+{
+ public:
+ DsKeyInfoContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509Data")
+ {
+ return std::make_unique<DsX509DataContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ // missing: ds:PGPData
+ // missing: ds:KeyName, ds:KeyValue, ds:RetrievalMethod, ds:SPKIData, ds:MgmtData
+ // (old code would read ds:Transform inside ds:RetrievalMethod but
+ // presumably that was a bug)
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+
+};
+
+class OOXMLSecParser::DsSignatureValueContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString m_Value;
+
+ public:
+ DsSignatureValueContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+ }
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setSignatureValue(m_Value);
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+};
+
+class OOXMLSecParser::DsDigestValueContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsDigestValueContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/) override
+ {
+ m_rValue.clear();
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class OOXMLSecParser::DsDigestMethodContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ sal_Int32 & m_rReferenceDigestID;
+
+ public:
+ DsDigestMethodContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_Int32 & rReferenceDigestID)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rReferenceDigestID(rReferenceDigestID)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
+
+ SAL_WARN_IF( ouAlgorithm.isEmpty(), "xmlsecurity.helper", "no Algorithm in Reference" );
+ if (!ouAlgorithm.isEmpty())
+ {
+ SAL_WARN_IF( ouAlgorithm != ALGO_XMLDSIGSHA1
+ && ouAlgorithm != ALGO_XMLDSIGSHA256
+ && ouAlgorithm != ALGO_XMLDSIGSHA512,
+ "xmlsecurity.helper", "Algorithm neither SHA1, SHA256 nor SHA512");
+ if (ouAlgorithm == ALGO_XMLDSIGSHA1)
+ m_rReferenceDigestID = css::xml::crypto::DigestID::SHA1;
+ else if (ouAlgorithm == ALGO_XMLDSIGSHA256)
+ m_rReferenceDigestID = css::xml::crypto::DigestID::SHA256;
+ else if (ouAlgorithm == ALGO_XMLDSIGSHA512)
+ m_rReferenceDigestID = css::xml::crypto::DigestID::SHA512;
+ else
+ m_rReferenceDigestID = 0;
+ }
+ }
+};
+
+class OOXMLSecParser::DsTransformContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ bool & m_rIsC14N;
+
+ public:
+ DsTransformContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool & rIsC14N)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rIsC14N(rIsC14N)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString aAlgorithm = xAttrs->getValueByName("Algorithm");
+
+ if (aAlgorithm == ALGO_RELATIONSHIP)
+ {
+ m_rIsC14N = true;
+ }
+ }
+};
+
+class OOXMLSecParser::DsTransformsContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ bool & m_rIsC14N;
+
+ public:
+ DsTransformsContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool & rIsC14N)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rIsC14N(rIsC14N)
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Transform")
+ {
+ return std::make_unique<DsTransformContext>(m_rParser, std::move(pOldNamespaceMap), m_rIsC14N);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::DsReferenceContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString m_URI;
+ OUString m_Type;
+ OUString m_DigestValue;
+ bool m_IsC14N = false;
+ // Relevant for ODF. The digest algorithm selected by the DigestMethod
+ // element's Algorithm attribute. @see css::xml::crypto::DigestID.
+ sal_Int32 m_nReferenceDigestID = css::xml::crypto::DigestID::SHA256;
+
+ public:
+ DsReferenceContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+
+ m_URI = xAttrs->getValueByName("URI");
+ SAL_WARN_IF(m_URI.isEmpty(), "xmlsecurity.helper", "URI is empty");
+ // Remember the type of this reference.
+ m_Type = xAttrs->getValueByName("Type");
+ }
+
+ virtual void EndElement() override
+ {
+ if (m_URI.startsWith("#"))
+ {
+ /*
+ * remove the first character '#' from the attribute value
+ */
+ m_rParser.m_pXSecController->addReference(m_URI.copy(1), m_nReferenceDigestID, m_Type);
+ }
+ else
+ {
+ if (m_IsC14N) // this is determined by nested ds:Transform
+ {
+ m_rParser.m_pXSecController->addStreamReference(m_URI, false, m_nReferenceDigestID);
+ }
+ else
+ /*
+ * it must be an octet stream
+ */
+ {
+ m_rParser.m_pXSecController->addStreamReference(m_URI, true, m_nReferenceDigestID);
+ }
+ }
+
+ m_rParser.m_pXSecController->setDigestValue(m_nReferenceDigestID, m_DigestValue);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Transforms")
+ {
+ return std::make_unique<DsTransformsContext>(m_rParser, std::move(pOldNamespaceMap), m_IsC14N);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestMethod")
+ {
+ return std::make_unique<DsDigestMethodContext>(m_rParser, std::move(pOldNamespaceMap), m_nReferenceDigestID);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestValue")
+ {
+ return std::make_unique<DsDigestValueContext>(m_rParser, std::move(pOldNamespaceMap), m_DigestValue);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::DsSignatureMethodContext
+ : public OOXMLSecParser::Context
+{
+ public:
+ DsSignatureMethodContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
+ if (ouAlgorithm == ALGO_ECDSASHA1 || ouAlgorithm == ALGO_ECDSASHA256
+ || ouAlgorithm == ALGO_ECDSASHA512)
+ {
+ m_rParser.m_pXSecController->setSignatureMethod(svl::crypto::SignatureMethodAlgorithm::ECDSA);
+ }
+ }
+};
+
+class OOXMLSecParser::DsSignedInfoContext
+ : public OOXMLSecParser::Context
+{
+ public:
+ DsSignedInfoContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+ }
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setReferenceCount();
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureMethod")
+ {
+ return std::make_unique<DsSignatureMethodContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Reference")
+ {
+ return std::make_unique<DsReferenceContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ // missing: ds:CanonicalizationMethod
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::XadesCertDigestContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rDigestValue;
+ sal_Int32 & m_rReferenceDigestID;
+
+ public:
+ XadesCertDigestContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rDigestValue, sal_Int32 & rReferenceDigestID)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rDigestValue(rDigestValue)
+ , m_rReferenceDigestID(rReferenceDigestID)
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestMethod")
+ {
+ return std::make_unique<DsDigestMethodContext>(m_rParser, std::move(pOldNamespaceMap), m_rReferenceDigestID);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestValue")
+ {
+ return std::make_unique<DsDigestValueContext>(m_rParser, std::move(pOldNamespaceMap), m_rDigestValue);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::XadesCertContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ private:
+ sal_Int32 m_nReferenceDigestID = css::xml::crypto::DigestID::SHA1;
+ OUString m_CertDigest;
+ OUString m_X509IssuerName;
+ OUString m_X509SerialNumber;
+
+ public:
+ XadesCertContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void EndElement() override
+ {
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setX509CertDigest(m_CertDigest, m_nReferenceDigestID, m_X509IssuerName, m_X509SerialNumber);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned xades:Cert");
+ }
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "CertDigest")
+ {
+ return std::make_unique<XadesCertDigestContext>(m_rParser, std::move(pOldNamespaceMap), m_CertDigest, m_nReferenceDigestID);
+ }
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "IssuerSerial")
+ {
+ return std::make_unique<DsX509IssuerSerialContext>(m_rParser, std::move(pOldNamespaceMap), m_X509IssuerName, m_X509SerialNumber);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::XadesSigningCertificateContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ public:
+ XadesSigningCertificateContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "Cert")
+ {
+ return std::make_unique<XadesCertContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::XadesSigningTimeContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ private:
+ OUString m_Value;
+
+ public:
+ XadesSigningTimeContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void EndElement() override
+ {
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setDate("", m_Value);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SigningTime");
+ }
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+};
+
+class OOXMLSecParser::XadesSignedSignaturePropertiesContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ public:
+ XadesSignedSignaturePropertiesContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SigningTime")
+ {
+ return std::make_unique<XadesSigningTimeContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SigningCertificate")
+ {
+ return std::make_unique<XadesSigningCertificateContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ // missing: xades:SignaturePolicyIdentifier, xades:SignatureProductionPlace, xades:SignerRole
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::XadesSignedPropertiesContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ public:
+ XadesSignedPropertiesContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SignedSignatureProperties")
+ {
+ return std::make_unique<XadesSignedSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ // missing: xades:SignedDataObjectProperties
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::XadesQualifyingPropertiesContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ public:
+ XadesQualifyingPropertiesContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SignedProperties")
+ {
+ return std::make_unique<XadesSignedPropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ // missing: xades:UnsignedSignatureProperties
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::MsodigsigSetupIDContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ MsodigsigSetupIDContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class OOXMLSecParser::MsodigsigSignatureCommentsContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ MsodigsigSignatureCommentsContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class OOXMLSecParser::MsodigsigSignatureInfoV1Context
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ private:
+ OUString m_SetupID;
+ OUString m_SignatureComments;
+
+ public:
+ MsodigsigSignatureInfoV1Context(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_MSODIGSIG && rName == "SetupID")
+ {
+ return std::make_unique<MsodigsigSetupIDContext>(m_rParser, std::move(pOldNamespaceMap), m_SetupID);
+ }
+ if (nNamespace == XML_NAMESPACE_MSODIGSIG && rName == "SignatureComments")
+ {
+ return std::make_unique<MsodigsigSignatureCommentsContext>(m_rParser, std::move(pOldNamespaceMap), m_SignatureComments);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+
+ virtual void EndElement() override
+ {
+ if (m_isReferenced)
+ {
+ if (!m_SetupID.isEmpty())
+ {
+ m_rParser.m_pXSecController->setSignatureLineId(m_SetupID);
+ }
+ if (!m_SignatureComments.isEmpty())
+ {
+ m_rParser.m_pXSecController->setDescription("", m_SignatureComments);
+
+ }
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureInfoV1");
+ }
+ }
+};
+
+class OOXMLSecParser::MdssiValueContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ MdssiValueContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class OOXMLSecParser::MdssiSignatureTimeContext
+ : public OOXMLSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ MdssiSignatureTimeContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_MDSSI && rName == "Value")
+ {
+ return std::make_unique<MdssiValueContext>(m_rParser, std::move(pOldNamespaceMap), m_rValue);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+
+class OOXMLSecParser::DsSignaturePropertyContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ private:
+ enum class SignatureProperty { Unknown, Date, Info };
+ SignatureProperty m_Property = SignatureProperty::Unknown;
+ OUString m_Id;
+ OUString m_Value;
+
+ public:
+ DsSignaturePropertyContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_Id = CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual void EndElement() override
+ {
+ if (m_isReferenced)
+ {
+ switch (m_Property)
+ {
+ case SignatureProperty::Unknown:
+ SAL_INFO("xmlsecurity.helper", "Unknown property in ds:Object ignored");
+ break;
+ case SignatureProperty::Info:
+ break; // handled by child context
+ case SignatureProperty::Date:
+ m_rParser.m_pXSecController->setDate(m_Id, m_Value);
+ break;
+ }
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureProperty");
+ }
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_MDSSI && rName == "SignatureTime")
+ {
+ m_Property = SignatureProperty::Date;
+ return std::make_unique<MdssiSignatureTimeContext>(m_rParser, std::move(pOldNamespaceMap), m_Value);
+ }
+ if (nNamespace == XML_NAMESPACE_MSODIGSIG && rName == "SignatureInfoV1")
+ {
+ return std::make_unique<MsodigsigSignatureInfoV1Context>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::DsSignaturePropertiesContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ public:
+ DsSignaturePropertiesContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureProperty")
+ {
+ return std::make_unique<DsSignaturePropertyContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::DsManifestContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ public:
+ DsManifestContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+#if 0
+ ???
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setReferenceCount();
+ }
+#endif
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Reference")
+ {
+ return std::make_unique<DsReferenceContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ // missing: ds:CanonicalizationMethod
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::DsObjectContext
+ : public OOXMLSecParser::ReferencedContextImpl
+{
+ enum class Mode { Default, ValidSignatureLineImage, InvalidSignatureLineImage };
+ Mode m_Mode = Mode::Default;
+ OUString m_Value;
+
+ public:
+ DsObjectContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ // init with "false" here - the Signature element can't be referenced by its child
+ : OOXMLSecParser::ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), false)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString const id(CheckIdAttrReferenced(xAttrs));
+ if (id == "idValidSigLnImg")
+ {
+ m_Mode = Mode::ValidSignatureLineImage;
+ }
+ else if (id == "idInvalidSigLnImg")
+ {
+ m_Mode = Mode::InvalidSignatureLineImage;
+ }
+ }
+
+ virtual void EndElement() override
+ {
+ switch (m_Mode)
+ {
+ case Mode::ValidSignatureLineImage:
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setValidSignatureImage(m_Value);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineValidImage");
+ }
+ break;
+ case Mode::InvalidSignatureLineImage:
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setInvalidSignatureImage(m_Value);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineInvalidImage");
+ }
+ break;
+ case Mode::Default:
+ break;
+ }
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureProperties")
+ {
+ return std::make_unique<DsSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "QualifyingProperties")
+ {
+ return std::make_unique<XadesQualifyingPropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Manifest")
+ {
+ return std::make_unique<DsManifestContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class OOXMLSecParser::DsSignatureContext
+ : public OOXMLSecParser::Context
+{
+ public:
+ DsSignatureContext(OOXMLSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : OOXMLSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString const ouIdAttr(m_rParser.HandleIdAttr(xAttrs));
+ m_rParser.m_rXMLSignatureHelper.StartVerifySignatureElement();
+ m_rParser.m_pXSecController->addSignature();
+ if (!ouIdAttr.isEmpty())
+ {
+ m_rParser.m_pXSecController->setId( ouIdAttr );
+ }
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignedInfo")
+ {
+ return std::make_unique<DsSignedInfoContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureValue")
+ {
+ return std::make_unique<DsSignatureValueContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "KeyInfo")
+ {
+ return std::make_unique<DsKeyInfoContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Object")
+ {
+ return std::make_unique<DsObjectContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ return OOXMLSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+
OOXMLSecParser::OOXMLSecParser(XMLSignatureHelper& rXMLSignatureHelper, XSecController* pXSecController)
- : m_pXSecController(pXSecController)
- ,m_bInDigestValue(false)
- ,m_bInSignatureValue(false)
- ,m_bInX509Certificate(false)
- ,m_bInMdssiValue(false)
- ,m_bInSignatureComments(false)
- ,m_bInX509IssuerName(false)
- ,m_bInX509SerialNumber(false)
- ,m_bInCertDigest(false)
- ,m_bInValidSignatureImage(false)
- ,m_bInInvalidSignatureImage(false)
- ,m_bInSignatureLineId(false)
- ,m_bReferenceUnresolved(false)
+ : m_pNamespaceMap(new SvXMLNamespaceMap)
+ , m_pXSecController(pXSecController)
,m_rXMLSignatureHelper(rXMLSignatureHelper)
{
+ using namespace xmloff::token;
+ m_pNamespaceMap->Add( GetXMLToken(XML_XML), GetXMLToken(XML_N_XML), XML_NAMESPACE_XML );
+ m_pNamespaceMap->Add( "_ds", GetXMLToken(XML_N_DS), XML_NAMESPACE_DS );
+ m_pNamespaceMap->Add( "_xades132", GetXMLToken(XML_N_XADES132), XML_NAMESPACE_XADES132);
+ m_pNamespaceMap->Add( "_xades141", GetXMLToken(XML_N_XADES141), XML_NAMESPACE_XADES141);
+ m_pNamespaceMap->Add( "_dc", GetXMLToken(XML_N_DC), XML_NAMESPACE_DC );
+ m_pNamespaceMap->Add( "_mdssi", NS_MDSSI, XML_NAMESPACE_MDSSI );
+ m_pNamespaceMap->Add( "_msodigsig", "http://schemas.microsoft.com/office/2006/digsig", XML_NAMESPACE_MSODIGSIG );
+ m_pNamespaceMap->Add( "_office_libo",
+ GetXMLToken(XML_N_LO_EXT), XML_NAMESPACE_LO_EXT);
}
OOXMLSecParser::~OOXMLSecParser()
{
}
+OUString OOXMLSecParser::HandleIdAttr(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs)
+{
+ OUString const aId = xAttrs->getValueByName("Id");
+ if (!aId.isEmpty())
+ {
+ m_pXSecController->collectToVerify(aId);
+ }
+ return aId;
+}
+
void SAL_CALL OOXMLSecParser::startDocument()
{
if (m_xNextHandler.is())
@@ -51,217 +1260,69 @@ void SAL_CALL OOXMLSecParser::endDocument()
void SAL_CALL OOXMLSecParser::startElement(const OUString& rName, const uno::Reference<xml::sax::XAttributeList>& xAttribs)
{
- OUString aId = xAttribs->getValueByName("Id");
- if (!aId.isEmpty())
- m_pXSecController->collectToVerify(aId);
+ assert(m_pNamespaceMap);
+ std::unique_ptr<SvXMLNamespaceMap> pRewindMap(
+ SvXMLImport::processNSAttributes(m_pNamespaceMap, nullptr, xAttribs));
- if (rName == "Signature")
- {
- m_rXMLSignatureHelper.StartVerifySignatureElement();
- m_pXSecController->addSignature();
- if (!aId.isEmpty())
- m_pXSecController->setId(aId);
- }
- else if (rName == "SignatureMethod")
- {
- OUString ouAlgorithm = xAttribs->getValueByName("Algorithm");
- if (ouAlgorithm == ALGO_ECDSASHA1 || ouAlgorithm == ALGO_ECDSASHA256
- || ouAlgorithm == ALGO_ECDSASHA512)
- m_pXSecController->setSignatureMethod(svl::crypto::SignatureMethodAlgorithm::ECDSA);
- }
- else if (rName == "Reference")
- {
- OUString aURI = xAttribs->getValueByName("URI");
- if (aURI.startsWith("#"))
- m_pXSecController->addReference(aURI.copy(1), xml::crypto::DigestID::SHA1, OUString());
- else
- {
- m_aReferenceURI = aURI;
- m_bReferenceUnresolved = true;
- }
- }
- else if (rName == "Transform")
- {
- if (m_bReferenceUnresolved)
- {
- OUString aAlgorithm = xAttribs->getValueByName("Algorithm");
- if (aAlgorithm == ALGO_RELATIONSHIP)
- {
- m_pXSecController->addStreamReference(m_aReferenceURI, /*isBinary=*/false, /*nDigestID=*/xml::crypto::DigestID::SHA256);
- m_bReferenceUnresolved = false;
- }
- }
- }
- else if (rName == "DigestValue" && !m_bInCertDigest)
- {
- m_aDigestValue.clear();
- m_bInDigestValue = true;
- }
- else if (rName == "SignatureValue")
- {
- m_aSignatureValue.clear();
- m_bInSignatureValue = true;
- }
- else if (rName == "X509Certificate")
- {
- m_aX509Certificate.clear();
- m_bInX509Certificate = true;
- }
- else if (rName == "mdssi:Value")
- {
- m_aMdssiValue.clear();
- m_bInMdssiValue = true;
- }
- else if (rName == "SignatureComments")
- {
- m_aSignatureComments.clear();
- m_bInSignatureComments = true;
- }
- else if (rName == "X509IssuerName")
- {
- m_aX509IssuerName.clear();
- m_bInX509IssuerName = true;
- }
- else if (rName == "X509SerialNumber")
- {
- m_aX509SerialNumber.clear();
- m_bInX509SerialNumber = true;
- }
- else if (rName == "xd:CertDigest")
- {
- m_aCertDigest.clear();
- m_bInCertDigest = true;
- }
- else if (rName == "Object")
+ OUString localName;
+ sal_uInt16 const nPrefix(m_pNamespaceMap->GetKeyByAttrName(rName, &localName));
+
+ std::unique_ptr<Context> pContext;
+
+ if (m_ContextStack.empty())
{
- OUString sId = xAttribs->getValueByName("Id");
- if (sId == "idValidSigLnImg")
- {
- m_aValidSignatureImage.clear();
- m_bInValidSignatureImage = true;
- }
- else if (sId == "idInvalidSigLnImg")
+ if (nPrefix == XML_NAMESPACE_DS
+ && localName == "Signature")
{
- m_aInvalidSignatureImage.clear();
- m_bInInvalidSignatureImage = true;
+ pContext.reset(new DsSignatureContext(*this, std::move(pRewindMap)));
}
else
{
- SAL_INFO("xmlsecurity.ooxml", "Unknown 'Object' child element: " << rName);
+ throw css::xml::sax::SAXException(
+ "xmlsecurity: unexpected root element", nullptr,
+ css::uno::Any());
}
}
- else if (rName == "SetupID")
- {
- m_aSignatureLineId.clear();
- m_bInSignatureLineId = true;
- }
else
{
- SAL_INFO("xmlsecurity.ooxml", "Unknown xml element: " << rName);
+ pContext = m_ContextStack.top()->CreateChildContext(
+ std::move(pRewindMap), nPrefix, localName);
}
+ m_ContextStack.push(std::move(pContext));
+ assert(!pRewindMap);
+
+ m_ContextStack.top()->StartElement(xAttribs);
+
if (m_xNextHandler.is())
+ {
m_xNextHandler->startElement(rName, xAttribs);
+ }
+
}
void SAL_CALL OOXMLSecParser::endElement(const OUString& rName)
{
- if (rName == "SignedInfo")
- m_pXSecController->setReferenceCount();
- else if (rName == "Reference")
- {
- if (m_bReferenceUnresolved)
- {
- // No transform algorithm found, assume binary.
- m_pXSecController->addStreamReference(m_aReferenceURI, /*isBinary=*/true, /*nDigestID=*/xml::crypto::DigestID::SHA256);
- m_bReferenceUnresolved = false;
- }
- m_pXSecController->setDigestValue(xml::crypto::DigestID::SHA256, m_aDigestValue);
- }
- else if (rName == "DigestValue" && !m_bInCertDigest)
- m_bInDigestValue = false;
- else if (rName == "SignatureValue")
- {
- m_pXSecController->setSignatureValue(m_aSignatureValue);
- m_bInSignatureValue = false;
- }
- else if (rName == "X509Certificate")
- {
- m_pXSecController->setX509Certificate(m_aX509Certificate);
- m_bInX509Certificate = false;
- }
- else if (rName == "mdssi:Value")
- {
- m_pXSecController->setDate(m_aMdssiValue);
- m_bInMdssiValue = false;
- }
- else if (rName == "SignatureComments")
- {
- m_pXSecController->setDescription(m_aSignatureComments);
- m_bInSignatureComments = false;
- }
- else if (rName == "X509IssuerName")
- {
- m_pXSecController->setX509IssuerName(m_aX509IssuerName);
- m_bInX509IssuerName = false;
- }
- else if (rName == "X509SerialNumber")
- {
- m_pXSecController->setX509SerialNumber(m_aX509SerialNumber);
- m_bInX509SerialNumber = false;
- }
- else if (rName == "xd:CertDigest")
- {
- m_pXSecController->setCertDigest(m_aCertDigest);
- m_bInCertDigest = false;
- }
- else if (rName == "Object")
+ assert(!m_ContextStack.empty()); // this should be checked by sax parser?
+
+ m_ContextStack.top()->EndElement();
+
+ if (m_xNextHandler.is())
{
- if (m_bInValidSignatureImage)
- {
- m_pXSecController->setValidSignatureImage(m_aValidSignatureImage);
- m_bInValidSignatureImage = false;
- }
- else if (m_bInInvalidSignatureImage)
- {
- m_pXSecController->setInvalidSignatureImage(m_aInvalidSignatureImage);
- m_bInInvalidSignatureImage = false;
- }
+ m_xNextHandler->endElement(rName);
}
- else if (rName == "SetupID")
+
+ if (m_ContextStack.top()->m_pOldNamespaceMap)
{
- m_pXSecController->setSignatureLineId(m_aSignatureLineId);
- m_bInSignatureLineId = false;
+ m_pNamespaceMap = std::move(m_ContextStack.top()->m_pOldNamespaceMap);
}
-
- if (m_xNextHandler.is())
- m_xNextHandler->endElement(rName);
+ m_ContextStack.pop();
}
void SAL_CALL OOXMLSecParser::characters(const OUString& rChars)
{
- if (m_bInDigestValue && !m_bInCertDigest)
- m_aDigestValue += rChars;
- else if (m_bInSignatureValue)
- m_aSignatureValue += rChars;
- else if (m_bInX509Certificate)
- m_aX509Certificate += rChars;
- else if (m_bInMdssiValue)
- m_aMdssiValue += rChars;
- else if (m_bInSignatureComments)
- m_aSignatureComments += rChars;
- else if (m_bInX509IssuerName)
- m_aX509IssuerName += rChars;
- else if (m_bInX509SerialNumber)
- m_aX509SerialNumber += rChars;
- else if (m_bInCertDigest)
- m_aCertDigest += rChars;
- else if (m_bInValidSignatureImage)
- m_aValidSignatureImage += rChars;
- else if (m_bInInvalidSignatureImage)
- m_aInvalidSignatureImage += rChars;
- else if (m_bInSignatureLineId)
- m_aSignatureLineId += rChars;
+ assert(!m_ContextStack.empty()); // this should be checked by sax parser?
+ m_ContextStack.top()->Characters(rChars);
if (m_xNextHandler.is())
m_xNextHandler->characters(rChars);
diff --git a/xmlsecurity/source/helper/ooxmlsecparser.hxx b/xmlsecurity/source/helper/ooxmlsecparser.hxx
index d3c199147255..540028b22fc9 100644
--- a/xmlsecurity/source/helper/ooxmlsecparser.hxx
+++ b/xmlsecurity/source/helper/ooxmlsecparser.hxx
@@ -15,6 +15,10 @@
#include <cppuhelper/implbase.hxx>
+#include <xmloff/nmspmap.hxx>
+
+#include <stack>
+
class XSecController;
class XMLSignatureHelper;
@@ -25,38 +29,62 @@ class OOXMLSecParser: public cppu::WeakImplHelper
css::lang::XInitialization
>
{
+public:
+ class Context;
+private:
+ class UnknownContext;
+ class ReferencedContextImpl;
+ class DsX509CertificateContext;
+ class DsX509SerialNumberContext;
+ class DsX509IssuerNameContext;
+ class DsX509IssuerSerialContext;
+ class DsX509DataContext;
+ class DsKeyInfoContext;
+ class DsSignatureValueContext;
+ class DsDigestValueContext;
+ class DsDigestMethodContext;
+ class DsTransformContext;
+ class DsTransformsContext;
+ class DsReferenceContext;
+ class DsSignatureMethodContext;
+ class DsSignedInfoContext;
+ class XadesEncapsulatedX509CertificateContext;
+ class XadesCertificateValuesContext;
+ class XadesUnsignedSignaturePropertiesContext;
+ class XadesUnsignedPropertiesContext;
+ class XadesCertDigestContext;
+ class XadesCertContext;
+ class XadesSigningCertificateContext;
+ class XadesSigningTimeContext;
+ class XadesSignedSignaturePropertiesContext;
+ class XadesSignedPropertiesContext;
+ class XadesQualifyingPropertiesContext;
+ class MdssiValueContext;
+ class MdssiSignatureTimeContext;
+ class MsodigsigSetupIDContext;
+ class MsodigsigSignatureCommentsContext;
+ class MsodigsigSignatureInfoV1Context;
+ class DsSignaturePropertyContext;
+ class DsSignaturePropertiesContext;
+ class DsManifestContext;
+ class DsObjectContext;
+ class DsSignatureContext;
+ class DsigSignaturesContext;
+
+ std::stack<std::unique_ptr<Context>> m_ContextStack;
+ std::unique_ptr<SvXMLNamespaceMap> m_pNamespaceMap;
+
XSecController* m_pXSecController;
css::uno::Reference<css::xml::sax::XDocumentHandler> m_xNextHandler;
- bool m_bInDigestValue;
- OUString m_aDigestValue;
- bool m_bInSignatureValue;
- OUString m_aSignatureValue;
- bool m_bInX509Certificate;
- OUString m_aX509Certificate;
- bool m_bInMdssiValue;
- OUString m_aMdssiValue;
- bool m_bInSignatureComments;
- OUString m_aSignatureComments;
- bool m_bInX509IssuerName;
- OUString m_aX509IssuerName;
- bool m_bInX509SerialNumber;
- OUString m_aX509SerialNumber;
- bool m_bInCertDigest;
- OUString m_aCertDigest;
- bool m_bInValidSignatureImage;
- OUString m_aValidSignatureImage;
- bool m_bInInvalidSignatureImage;
- OUString m_aInvalidSignatureImage;
- bool m_bInSignatureLineId;
- OUString m_aSignatureLineId;
-
/// Last seen <Reference URI="...">.
OUString m_aReferenceURI;
/// Already called addStreamReference() for this reference.
bool m_bReferenceUnresolved;
XMLSignatureHelper& m_rXMLSignatureHelper;
+ OUString HandleIdAttr(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs);
+
public:
explicit OOXMLSecParser(XMLSignatureHelper& rXMLSignatureHelper, XSecController* pXSecController);
virtual ~OOXMLSecParser() override;
diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
index a029ee9d20d1..e5972c9878fc 100644
--- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
@@ -173,8 +173,12 @@ PDFSignatureHelper::GetDocumentSignatureInformations(
security::DocumentSignatureInformation& rExternal = aRet[i];
rExternal.SignatureIsValid
= rInternal.nStatus == xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED;
- if (!rInternal.ouX509Certificate.isEmpty())
- rExternal.Signer = xSecEnv->createCertificateFromAscii(rInternal.ouX509Certificate);
+ if (rInternal.GetSigningCertificate()
+ && !rInternal.GetSigningCertificate()->X509Certificate.isEmpty())
+ {
+ rExternal.Signer = xSecEnv->createCertificateFromAscii(
+ rInternal.GetSigningCertificate()->X509Certificate);
+ }
rExternal.PartialDocumentSignature = rInternal.bPartialDocumentSignature;
// Verify certificate.
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index 6ec834053a17..bcb79039e342 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -21,6 +21,7 @@
#include <xmlsignaturehelper.hxx>
#include <documentsignaturehelper.hxx>
#include <xsecctl.hxx>
+#include <biginteger.hxx>
#include <xmlsignaturehelper2.hxx>
@@ -45,6 +46,8 @@
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
+#include <optional>
+
#define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures"
#define NS_DOCUMENTSIGNATURES_ODF_1_2 "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0"
#define OOXML_SIGNATURE_ORIGIN "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin"
@@ -402,6 +405,7 @@ bool XMLSignatureHelper::ReadAndVerifySignatureStorageStream(const css::uno::Ref
catch(const uno::Exception&)
{
DBG_UNHANDLED_EXCEPTION("xmlsecurity.helper");
+ mbError = true;
}
mpXSecController->releaseSignatureReader();
@@ -546,4 +550,162 @@ void XMLSignatureHelper::CreateAndWriteOOXMLSignature(const uno::Reference<embed
xSaxWriter->endDocument();
}
+/** check this constraint from xmldsig-core 4.5.4:
+
+ All certificates appearing in an X509Data element MUST relate to the
+ validation key by either containing it or being part of a certification
+ chain that terminates in a certificate containing the validation key.
+ */
+static auto CheckX509Data(
+ uno::Reference<xml::crypto::XSecurityEnvironment> const& xSecEnv,
+ std::vector<SignatureInformation::X509CertInfo> const& rX509CertInfos,
+ std::vector<uno::Reference<security::XCertificate>> & rCerts,
+ std::vector<SignatureInformation::X509CertInfo> & rSorted) -> bool
+{
+ assert(rCerts.empty());
+ assert(rSorted.empty());
+ if (rX509CertInfos.empty())
+ {
+ SAL_WARN("xmlsecurity.comp", "no X509Data");
+ return false;
+ }
+ std::vector<uno::Reference<security::XCertificate>> certs;
+ for (SignatureInformation::X509CertInfo const& it : rX509CertInfos)
+ {
+ if (!it.X509Certificate.isEmpty())
+ {
+ certs.emplace_back(xSecEnv->createCertificateFromAscii(it.X509Certificate));
+ }
+ else
+ {
+ certs.emplace_back(xSecEnv->getCertificate(
+ it.X509IssuerName,
+ xmlsecurity::numericStringToBigInteger(it.X509SerialNumber)));
+ }
+ if (!certs.back().is())
+ {
+ SAL_WARN("xmlsecurity.comp", "X509Data cannot be parsed");
+ return false;
+ }
+ }
+
+ // first, search one whose issuer isn't in the list, or a self-signed one
+ std::optional<size_t> start;
+ for (size_t i = 0; i < certs.size(); ++i)
+ {
+ for (size_t j = 0; ; ++j)
+ {
+ if (j == certs.size())
+ {
+ if (start)
+ {
+ SAL_WARN("xmlsecurity.comp", "X509Data do not form a chain: certificate has no issuer but already have start of chain: " << certs[i]->getSubjectName());
+ return false;
+ }
+ start = i; // issuer isn't in the list
+ break;
+ }
+ if (xmlsecurity::EqualDistinguishedNames(certs[i]->getIssuerName(), certs[j]->getSubjectName()))
+ {
+ if (i == j) // self signed
+ {
+ if (start)
+ {
+ SAL_WARN("xmlsecurity.comp", "X509Data do not form a chain: certificate is self-signed but already have start of chain: " << certs[i]->getSubjectName());
+ return false;
+ }
+ start = i;
+ }
+ break;
+ }
+ }
+ }
+ std::vector<size_t> chain;
+ if (!start)
+ {
+ // this can only be a cycle?
+ SAL_WARN("xmlsecurity.comp", "X509Data do not form a chain: cycle detected");
+ return false;
+ }
+ chain.emplace_back(*start);
+
+ // second, check that there is a chain, no tree or cycle...
+ for (size_t i = 0; i < certs.size(); ++i)
+ {
+ assert(chain.size() == i + 1);
+ for (size_t j = 0; j < certs.size(); ++j)
+ {
+ if (chain[i] != j)
+ {
+ if (xmlsecurity::EqualDistinguishedNames(
+ certs[chain[i]]->getSubjectName(), certs[j]->getIssuerName()))
+ {
+ if (chain.size() != i + 1) // already found issuee?
+ {
+ SAL_WARN("xmlsecurity.comp", "X509Data do not form a chain: certificate issued 2 others: " << certs[chain[i]]->getSubjectName());
+ return false;
+ }
+ chain.emplace_back(j);
+ }
+ }
+ }
+ if (i == certs.size() - 1)
+ { // last one: must be a leaf
+ if (chain.size() != i + 1)
+ {
+ SAL_WARN("xmlsecurity.comp", "X509Data do not form a chain: certificate in cycle: " << certs[chain[i]]->getSubjectName());
+ return false;
+ }
+ }
+ else if (chain.size() != i + 2)
+ { // not issuer of another?
+ SAL_WARN("xmlsecurity.comp", "X509Data do not form a chain: certificate issued 0 others: " << certs[chain[i]]->getSubjectName());
+ return false;
+ }
+ }
+
+ // success
+ assert(chain.size() == rX509CertInfos.size());
+ for (auto const& it : chain)
+ {
+ rSorted.emplace_back(rX509CertInfos[it]);
+ rCerts.emplace_back(certs[it]);
+ }
+ return true;
+}
+
+std::vector<uno::Reference<security::XCertificate>>
+XMLSignatureHelper::CheckAndUpdateSignatureInformation(
+ uno::Reference<xml::crypto::XSecurityEnvironment> const& xSecEnv,
+ SignatureInformation const& rInfo)
+{
+ // if the check fails, it's not possible to determine which X509Data
+ // contained the signing certificate - the UI cannot display something
+ // useful in this case, so prevent anything misleading by clearing the
+ // X509Datas.
+
+ std::vector<uno::Reference<security::XCertificate>> certs;
+ std::vector<SignatureInformation::X509Data> datas;
+ // TODO: for now, just merge all X509Datas together for checking...
+ // (this will probably break round-trip of signature with multiple X509Data,
+ // no idea if that is a problem)
+ SignatureInformation::X509Data temp;
+ SignatureInformation::X509Data tempResult;
+ for (auto const& rData : rInfo.X509Datas)
+ {
+ for (auto const& it : rData)
+ {
+ temp.emplace_back(it);
+ }
+ }
+ if (CheckX509Data(xSecEnv, temp, certs, tempResult))
+ {
+ datas.emplace_back(tempResult);
+ }
+
+ // rInfo is a copy, update the original
+ mpXSecController->UpdateSignatureInformation(rInfo.nSecurityId, datas);
+ return certs;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index ab108d13c224..cdfe643bd0f7 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -41,10 +41,6 @@
#include "ooxmlsecexporter.hxx"
#include <xmlsignaturehelper2.hxx>
-namespace cssu = com::sun::star::uno;
-namespace cssl = com::sun::star::lang;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
using namespace com::sun::star;
namespace
@@ -53,11 +49,11 @@ OUString getDigestURI(sal_Int32 nID)
{
switch( nID )
{
- case cssxc::DigestID::SHA1:
+ case css::xml::crypto::DigestID::SHA1:
return ALGO_XMLDSIGSHA1;
- case cssxc::DigestID::SHA256:
+ case css::xml::crypto::DigestID::SHA256:
return ALGO_XMLDSIGSHA256;
- case cssxc::DigestID::SHA512:
+ case css::xml::crypto::DigestID::SHA512:
return ALGO_XMLDSIGSHA512;
default:
return ALGO_XMLDSIGSHA1;
@@ -71,13 +67,13 @@ OUString getSignatureURI(svl::crypto::SignatureMethodAlgorithm eAlgorithm, sal_I
{
switch (nDigestID)
{
- case cssxc::DigestID::SHA1:
+ case css::xml::crypto::DigestID::SHA1:
aRet = ALGO_ECDSASHA1;
break;
- case cssxc::DigestID::SHA256:
+ case css::xml::crypto::DigestID::SHA256:
aRet = ALGO_ECDSASHA256;
break;
- case cssxc::DigestID::SHA512:
+ case css::xml::crypto::DigestID::SHA512:
aRet = ALGO_ECDSASHA512;
break;
default:
@@ -90,11 +86,11 @@ OUString getSignatureURI(svl::crypto::SignatureMethodAlgorithm eAlgorithm, sal_I
switch (nDigestID)
{
- case cssxc::DigestID::SHA1:
+ case css::xml::crypto::DigestID::SHA1:
return ALGO_RSASHA1;
- case cssxc::DigestID::SHA256:
+ case css::xml::crypto::DigestID::SHA256:
return ALGO_RSASHA256;
- case cssxc::DigestID::SHA512:
+ case css::xml::crypto::DigestID::SHA512:
return ALGO_RSASHA512;
default:
return ALGO_RSASHA1;
@@ -102,7 +98,7 @@ OUString getSignatureURI(svl::crypto::SignatureMethodAlgorithm eAlgorithm, sal_I
}
}
-XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>& rxCtx )
+XSecController::XSecController( const css::uno::Reference<css::uno::XComponentContext>& rxCtx )
: mxCtx(rxCtx)
, m_nNextSecurityId(1)
, m_bIsPreviousNodeInitializable(false)
@@ -177,15 +173,15 @@ void XSecController::createXSecComponent( )
m_xXMLDocumentWrapper = nullptr;
m_xSAXEventKeeper = nullptr;
- cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
+ css::uno::Reference< css::lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
#if HAVE_FEATURE_GPGME
- uno::Reference< lang::XServiceInfo > xServiceInfo( m_xSecurityContext, cssu::UNO_QUERY );
+ uno::Reference< lang::XServiceInfo > xServiceInfo( m_xSecurityContext, css::uno::UNO_QUERY );
if (xServiceInfo->getImplementationName() == "com.sun.star.xml.security.gpg.XMLSecurityContext_GpgImpl")
m_xXMLSignature.set(new XMLSignature_GpgImpl());
else // xmlsec or mscrypt
#endif
- m_xXMLSignature.set(xMCF->createInstanceWithContext("com.sun.star.xml.crypto.XMLSignature", mxCtx), cssu::UNO_QUERY);
+ m_xXMLSignature.set(xMCF->createInstanceWithContext("com.sun.star.xml.crypto.XMLSignature", mxCtx), css::uno::UNO_QUERY);
bool bSuccess = m_xXMLSignature.is();
if ( bSuccess )
@@ -205,11 +201,11 @@ void XSecController::createXSecComponent( )
* SAXEventKeeper created successfully.
*/
{
- cssu::Sequence <cssu::Any> arg(1);
+ css::uno::Sequence <css::uno::Any> arg(1);
arg[0] <<= uno::Reference<xml::wrapper::XXMLDocumentWrapper>(m_xXMLDocumentWrapper.get());
m_xSAXEventKeeper->initialize(arg);
- cssu::Reference< cssxc::sax::XSAXEventKeeperStatusChangeListener >
+ css::uno::Reference< css::xml::crypto::sax::XSAXEventKeeperStatusChangeListener >
xStatusChangeListener = this;
m_xSAXEventKeeper->addSAXEventKeeperStatusChangeListener( xStatusChangeListener );
@@ -272,7 +268,7 @@ bool XSecController::chainOn()
*/
m_xSAXEventKeeper->setNextHandler( nullptr );
- cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::sax::XDocumentHandler > xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), css::uno::UNO_QUERY);
/*
* connects the previous document handler on the SAX chain
@@ -281,17 +277,17 @@ bool XSecController::chainOn()
{
if ( m_bIsPreviousNodeInitializable )
{
- cssu::Reference< cssl::XInitialization > xInitialization
- (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::lang::XInitialization > xInitialization
+ (m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
- cssu::Sequence<cssu::Any> aArgs( 1 );
+ css::uno::Sequence<css::uno::Any> aArgs( 1 );
aArgs[0] <<= xSEKHandler;
xInitialization->initialize(aArgs);
}
else
{
- cssu::Reference< cssxs::XParser > xParser
- (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::sax::XParser > xParser
+ (m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
xParser->setDocumentHandler( xSEKHandler );
}
}
@@ -327,16 +323,16 @@ void XSecController::chainOff()
{
if ( m_bIsPreviousNodeInitializable )
{
- cssu::Reference< cssl::XInitialization > xInitialization
- (m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::lang::XInitialization > xInitialization
+ (m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
- cssu::Sequence<cssu::Any> aArgs( 1 );
+ css::uno::Sequence<css::uno::Any> aArgs( 1 );
aArgs[0] <<= uno::Reference<xml::sax::XDocumentHandler>();
xInitialization->initialize(aArgs);
}
else
{
- cssu::Reference< cssxs::XParser > xParser(m_xPreviousNodeOnSAXChain, cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::sax::XParser > xParser(m_xPreviousNodeOnSAXChain, css::uno::UNO_QUERY);
xParser->setDocumentHandler(uno::Reference<xml::sax::XDocumentHandler>());
}
}
@@ -393,7 +389,7 @@ void XSecController::initializeSAXChain()
chainOff();
}
-cssu::Reference< css::io::XInputStream >
+css::uno::Reference< css::io::XInputStream >
XSecController::getObjectInputStream( const OUString& objectURL )
/****** XSecController/getObjectInputStream ************************************
*
@@ -410,7 +406,7 @@ cssu::Reference< css::io::XInputStream >
* xInputStream - the XInputStream interface
******************************************************************************/
{
- cssu::Reference< css::io::XInputStream > xObjectInputStream;
+ css::uno::Reference< css::io::XInputStream > xObjectInputStream;
SAL_WARN_IF( !m_xUriBinding.is(), "xmlsecurity.helper", "Need XUriBinding!" );
@@ -430,7 +426,7 @@ sal_Int32 XSecController::getNewSecurityId( )
return nId;
}
-void XSecController::startMission(const rtl::Reference<UriBindingHelper>& xUriBinding, const cssu::Reference< cssxc::XXMLSecurityContext >& xSecurityContext )
+void XSecController::startMission(const rtl::Reference<UriBindingHelper>& xUriBinding, const css::uno::Reference< css::xml::crypto::XXMLSecurityContext >& xSecurityContext )
/****** XSecController/startMission *******************************************
*
* NAME
@@ -456,7 +452,7 @@ void XSecController::startMission(const rtl::Reference<UriBindingHelper>& xUriBi
m_bVerifyCurrentSignature = false;
}
-void XSecController::setSAXChainConnector(const cssu::Reference< cssl::XInitialization >& xInitialization)
+void XSecController::setSAXChainConnector(const css::uno::Reference< css::lang::XInitialization >& xInitialization)
/****** XSecController/setSAXChainConnector ***********************************
*
* NAME
@@ -507,8 +503,8 @@ void XSecController::endMission()
* ResolvedListener only exist when the security components are created.
*/
{
- cssu::Reference< cssxc::sax::XMissionTaker > xMissionTaker
- ( m_vInternalSignatureInformations[i].xReferenceResolvedListener, cssu::UNO_QUERY );
+ css::uno::Reference< css::xml::crypto::sax::XMissionTaker > xMissionTaker
+ ( m_vInternalSignatureInformations[i].xReferenceResolvedListener, css::uno::UNO_QUERY );
/*
* asks the SignatureCreator/SignatureVerifier to release
@@ -536,7 +532,7 @@ void writeUnsignedProperties(
{
{
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList());
- pAttributeList->AddAttribute("Id", "idUnsignedProperties");
+ pAttributeList->AddAttribute("Id", "idUnsignedProperties_" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement("xd:UnsignedProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList.get()));
}
@@ -567,7 +563,7 @@ void writeUnsignedProperties(
}
void XSecController::exportSignature(
- const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler,
+ const css::uno::Reference<css::xml::sax::XDocumentHandler>& xDocumentHandler,
const SignatureInformation& signatureInfo,
bool bXAdESCompliantIfODF )
/****** XSecController/exportSignature ****************************************
@@ -601,19 +597,19 @@ void XSecController::exportSignature(
signatureInfo.ouSignatureId);
}
- xDocumentHandler->startElement( "Signature", cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ xDocumentHandler->startElement( "Signature", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
/* Write SignedInfo element */
xDocumentHandler->startElement(
"SignedInfo",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write CanonicalizationMethod element */
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
"Algorithm",
ALGO_C14N);
- xDocumentHandler->startElement( "CanonicalizationMethod", cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ xDocumentHandler->startElement( "CanonicalizationMethod", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "CanonicalizationMethod" );
/* Write SignatureMethod element */
@@ -627,7 +623,7 @@ void XSecController::exportSignature(
pAttributeList->AddAttribute(
"Algorithm",
getSignatureURI(signatureInfo.eAlgorithmID, vReferenceInfors[0].nDigestID));
- xDocumentHandler->startElement( "SignatureMethod", cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ xDocumentHandler->startElement( "SignatureMethod", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "SignatureMethod" );
/* Write Reference element */
@@ -653,20 +649,25 @@ void XSecController::exportSignature(
* same-document reference
*/
{
- pAttributeList->AddAttribute(
+ if (refInfor.ouURI.startsWith("idSignedProperties"))
+ {
+ pAttributeList->AddAttribute("URI", "#idSignedProperties_" + signatureInfo.ouSignatureId);
+ if (bXAdESCompliantIfODF && !refInfor.ouType.isEmpty())
+ {
+ // The reference which points to the SignedProperties
+ // shall have this specific type.
+ pAttributeList->AddAttribute("Type", refInfor.ouType);
+ }
+ }
+ else
+ {
+ pAttributeList->AddAttribute(
"URI",
"#" + refInfor.ouURI);
-
- if (bXAdESCompliantIfODF && refInfor.ouURI == "idSignedProperties" && !refInfor.ouType.isEmpty())
- {
- // The reference which points to the SignedProperties
- // shall have this specific type.
- pAttributeList->AddAttribute("Type",
- refInfor.ouType);
}
}
- xDocumentHandler->startElement( "Reference", cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ xDocumentHandler->startElement( "Reference", css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
{
/* Write Transforms element */
if (refInfor.nType == SignatureReferenceType::XMLSTREAM)
@@ -676,7 +677,7 @@ void XSecController::exportSignature(
{
xDocumentHandler->startElement(
"Transforms",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
@@ -684,7 +685,7 @@ void XSecController::exportSignature(
ALGO_C14N);
xDocumentHandler->startElement(
"Transform",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "Transform" );
}
xDocumentHandler->endElement( "Transforms" );
@@ -697,13 +698,13 @@ void XSecController::exportSignature(
getDigestURI(refInfor.nDigestID));
xDocumentHandler->startElement(
"DigestMethod",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList) );
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList) );
xDocumentHandler->endElement( "DigestMethod" );
/* Write DigestValue element */
xDocumentHandler->startElement(
"DigestValue",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( refInfor.ouDigestValue );
xDocumentHandler->endElement( "DigestValue" );
}
@@ -715,14 +716,14 @@ void XSecController::exportSignature(
/* Write SignatureValue element */
xDocumentHandler->startElement(
"SignatureValue",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouSignatureValue );
xDocumentHandler->endElement( "SignatureValue" );
/* Write KeyInfo element */
xDocumentHandler->startElement(
"KeyInfo",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
// GPG or X509 key?
if (!signatureInfo.ouGpgCertificate.isEmpty())
@@ -732,13 +733,13 @@ void XSecController::exportSignature(
/* Write PGPData element */
xDocumentHandler->startElement(
"PGPData",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
/* Write keyid element */
xDocumentHandler->startElement(
"PGPKeyID",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
- xDocumentHandler->characters( signatureInfo.ouCertDigest );
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
+ xDocumentHandler->characters(signatureInfo.ouGpgKeyID);
xDocumentHandler->endElement( "PGPKeyID" );
/* Write PGPKeyPacket element */
@@ -746,7 +747,7 @@ void XSecController::exportSignature(
{
xDocumentHandler->startElement(
"PGPKeyPacket",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouGpgCertificate );
xDocumentHandler->endElement( "PGPKeyPacket" );
}
@@ -754,7 +755,7 @@ void XSecController::exportSignature(
/* Write PGPOwner element */
xDocumentHandler->startElement(
"loext:PGPOwner",
- cssu::Reference< cssxs::XAttributeList >(new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList >(new SvXMLAttributeList()));
xDocumentHandler->characters( signatureInfo.ouGpgOwner );
xDocumentHandler->endElement( "loext:PGPOwner" );
}
@@ -762,43 +763,50 @@ void XSecController::exportSignature(
}
else
{
- /* Write X509Data element */
- xDocumentHandler->startElement(
- "X509Data",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ assert(signatureInfo.GetSigningCertificate());
+ for (auto const& rData : signatureInfo.X509Datas)
{
- /* Write X509IssuerSerial element */
+ /* Write X509Data element */
xDocumentHandler->startElement(
- "X509IssuerSerial",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ "X509Data",
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
- /* Write X509IssuerName element */
- xDocumentHandler->startElement(
- "X509IssuerName",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
- xDocumentHandler->characters( signatureInfo.ouX509IssuerName );
- xDocumentHandler->endElement( "X509IssuerName" );
-
- /* Write X509SerialNumber element */
- xDocumentHandler->startElement(
- "X509SerialNumber",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
- xDocumentHandler->characters( signatureInfo.ouX509SerialNumber );
- xDocumentHandler->endElement( "X509SerialNumber" );
- }
- xDocumentHandler->endElement( "X509IssuerSerial" );
-
- /* Write X509Certificate element */
- if (!signatureInfo.ouX509Certificate.isEmpty())
- {
- xDocumentHandler->startElement(
- "X509Certificate",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
- xDocumentHandler->characters( signatureInfo.ouX509Certificate );
- xDocumentHandler->endElement( "X509Certificate" );
+ for (auto const& it : rData)
+ {
+ /* Write X509IssuerSerial element */
+ xDocumentHandler->startElement(
+ "X509IssuerSerial",
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
+ {
+ /* Write X509IssuerName element */
+ xDocumentHandler->startElement(
+ "X509IssuerName",
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
+ xDocumentHandler->characters(it.X509IssuerName);
+ xDocumentHandler->endElement( "X509IssuerName" );
+
+ /* Write X509SerialNumber element */
+ xDocumentHandler->startElement(
+ "X509SerialNumber",
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
+ xDocumentHandler->characters(it.X509SerialNumber);
+ xDocumentHandler->endElement( "X509SerialNumber" );
+ }
+ xDocumentHandler->endElement( "X509IssuerSerial" );
+
+ /* Write X509Certificate element */
+ if (!it.X509Certificate.isEmpty())
+ {
+ xDocumentHandler->startElement(
+ "X509Certificate",
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
+ xDocumentHandler->characters(it.X509Certificate);
+ xDocumentHandler->endElement( "X509Certificate" );
+ }
+ }
}
+ xDocumentHandler->endElement( "X509Data" );
}
- xDocumentHandler->endElement( "X509Data" );
}
}
xDocumentHandler->endElement( "KeyInfo" );
@@ -808,24 +816,24 @@ void XSecController::exportSignature(
/* Write Object element */
xDocumentHandler->startElement(
"Object",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write SignatureProperties element */
xDocumentHandler->startElement(
"SignatureProperties",
- cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList()));
+ css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList()));
{
/* Write SignatureProperty element */
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute(
"Id",
- signatureInfo.ouPropertyId);
+ signatureInfo.ouDateTimePropertyId);
pAttributeList->AddAttribute(
"Target",
"#" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement(
"SignatureProperty",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
/* Write timestamp element */
@@ -836,7 +844,7 @@ void XSecController::exportSignature(
xDocumentHandler->startElement(
"dc:date",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
OUStringBuffer buffer;
//If the xml signature was already contained in the document,
@@ -894,13 +902,13 @@ void XSecController::exportSignature(
pAttributeList->AddAttribute("xmlns:xd", NS_XD);
xDocumentHandler->startElement(
"Object",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
{
pAttributeList = new SvXMLAttributeList();
pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement(
"xd:QualifyingProperties",
- cssu::Reference< cssxs::XAttributeList > (pAttributeList));
+ css::uno::Reference< css::xml::sax::XAttributeList > (pAttributeList));
DocumentSignatureHelper::writeSignedProperties(xDocumentHandler, signatureInfo, sDate, true);
writeUnsignedProperties(xDocumentHandler, signatureInfo);
xDocumentHandler->endElement( "xd:QualifyingProperties" );
@@ -917,6 +925,15 @@ void XSecController::exportOOXMLSignature(const uno::Reference<embed::XStorage>&
aExporter.writeSignature();
}
+void XSecController::UpdateSignatureInformation(sal_Int32 const nSecurityId,
+ std::vector<SignatureInformation::X509Data> const& rDatas)
+{
+ SignatureInformation aInf( 0 );
+ int const nIndex = findSignatureInfor(nSecurityId);
+ assert(nIndex != -1); // nothing should touch this between parsing and verify
+ m_vInternalSignatureInformations[nIndex].signatureInfor.X509Datas = rDatas;
+}
+
SignatureInformation XSecController::getSignatureInformation( sal_Int32 nSecurityId ) const
{
SignatureInformation aInf( 0 );
diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx
index 82f347bff976..f2e00fca99c9 100644
--- a/xmlsecurity/source/helper/xsecparser.cxx
+++ b/xmlsecurity/source/helper/xsecparser.cxx
@@ -21,134 +21,474 @@
#include "xsecparser.hxx"
#include <xsecctl.hxx>
#include <xmlsignaturehelper.hxx>
+
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmlimp.hxx>
+
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <sal/log.hxx>
-namespace cssu = com::sun::star::uno;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
-
-XSecParser::XSecParser(XMLSignatureHelper& rXMLSignatureHelper,
- XSecController* pXSecController)
- : m_bInX509IssuerName(false)
- , m_bInX509SerialNumber(false)
- , m_bInX509Certificate(false)
- , m_bInGpgCertificate(false)
- , m_bInGpgKeyID(false)
- , m_bInGpgOwner(false)
- , m_bInCertDigest(false)
- , m_bInEncapsulatedX509Certificate(false)
- , m_bInSigningTime(false)
- , m_bInDigestValue(false)
- , m_bInSignatureValue(false)
- , m_bInDate(false)
- , m_bInDescription(false)
- , m_bInSignatureLineId(false)
- , m_bInSignatureLineValidImage(false)
- , m_bInSignatureLineInvalidImage(false)
- , m_pXSecController(pXSecController)
- , m_bReferenceUnresolved(false)
- , m_nReferenceDigestID(cssxc::DigestID::SHA1)
- , m_rXMLSignatureHelper(rXMLSignatureHelper)
+class XSecParser::Context
{
-}
+ protected:
+ friend class XSecParser;
+ XSecParser & m_rParser;
+ private:
+ std::unique_ptr<SvXMLNamespaceMap> m_pOldNamespaceMap;
+
+ public:
+ Context(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : m_rParser(rParser)
+ , m_pOldNamespaceMap(std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual ~Context() = default;
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/)
+ {
+ }
+
+ virtual void EndElement()
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const /*nNamespace*/, OUString const& /*rName*/);
-OUString XSecParser::getIdAttr(const cssu::Reference< cssxs::XAttributeList >& xAttribs )
+ virtual void Characters(OUString const& /*rChars*/)
+ {
+ }
+};
+
+// it's possible that an unsupported element has an Id attribute and a
+// ds:Reference digesting it - probably this means XSecController needs to know
+// about it. (For known elements, the Id attribute is only processed according
+// to the schema.)
+class XSecParser::UnknownContext
+ : public XSecParser::Context
{
- OUString ouIdAttr = xAttribs->getValueByName("id");
+ public:
+ UnknownContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
- if (ouIdAttr.isEmpty())
- {
- ouIdAttr = xAttribs->getValueByName("Id");
- }
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+ }
+};
- return ouIdAttr;
+auto XSecParser::Context::CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const /*nNamespace*/, OUString const& /*rName*/)
+-> std::unique_ptr<Context>
+{
+ // default: create new base context
+ return std::make_unique<UnknownContext>(m_rParser, std::move(pOldNamespaceMap));
}
-/*
- * XDocumentHandler
+/**
+note: anything in ds:Object should be trusted *only* if there is a ds:Reference
+ to it so it is signed (exception: the xades:EncapsulatedX509Certificate).
+ ds:SignedInfo precedes all ds:Object.
+
+ There may be multiple ds:Signature for purpose of counter-signatures
+ but the way XAdES describes these, only the ds:SignatureValue element
+ would be referenced, so requiring a ds:Reference for anything in
+ ds:Object shouldn't cause issues.
*/
-void SAL_CALL XSecParser::startDocument( )
+class XSecParser::ReferencedContextImpl
+ : public XSecParser::Context
{
- m_bInX509IssuerName = false;
- m_bInX509SerialNumber = false;
- m_bInX509Certificate = false;
- m_bInGpgCertificate = false;
- m_bInGpgKeyID = false;
- m_bInGpgOwner = false;
- m_bInSignatureValue = false;
- m_bInDigestValue = false;
- m_bInDate = false;
- m_bInDescription = false;
+ protected:
+ bool m_isReferenced;
- if (m_xNextHandler.is())
- {
- m_xNextHandler->startDocument();
- }
-}
+ public:
+ ReferencedContextImpl(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_isReferenced(isReferenced)
+ {
+ }
-void SAL_CALL XSecParser::endDocument( )
+ OUString CheckIdAttrReferenced(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs)
+ {
+ OUString const id(m_rParser.HandleIdAttr(xAttrs));
+ if (!id.isEmpty() && m_rParser.m_pXSecController->haveReferenceForId(id))
+ {
+ m_isReferenced = true;
+ }
+ return id;
+ }
+};
+
+class XSecParser::LoPGPOwnerContext
+ : public XSecParser::Context
{
- if (m_xNextHandler.is())
- {
- m_xNextHandler->endDocument();
- }
-}
+ private:
+ OUString m_Value;
-void SAL_CALL XSecParser::startElement(
- const OUString& aName,
- const cssu::Reference< cssxs::XAttributeList >& xAttribs )
+ public:
+ LoPGPOwnerContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setGpgOwner(m_Value);
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+};
+
+class XSecParser::DsPGPKeyPacketContext
+ : public XSecParser::Context
{
- try
- {
- OUString ouIdAttr = getIdAttr(xAttribs);
- if (!ouIdAttr.isEmpty())
+ private:
+ OUString m_Value;
+
+ public:
+ DsPGPKeyPacketContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
{
- m_pXSecController->collectToVerify( ouIdAttr );
}
- if ( aName == "Signature" )
+ virtual void EndElement() override
{
- m_rXMLSignatureHelper.StartVerifySignatureElement();
- m_pXSecController->addSignature();
- if (!ouIdAttr.isEmpty())
+ m_rParser.m_pXSecController->setGpgCertificate(m_Value);
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+};
+
+class XSecParser::DsPGPKeyIDContext
+ : public XSecParser::Context
+{
+ private:
+ OUString m_Value;
+
+ public:
+ DsPGPKeyIDContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setGpgKeyID(m_Value);
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+};
+
+class XSecParser::DsPGPDataContext
+ : public XSecParser::Context
+{
+ public:
+ DsPGPDataContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/) override
+ {
+ m_rParser.m_pXSecController->switchGpgSignature();
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "PGPKeyID")
+ {
+ return std::make_unique<DsPGPKeyIDContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "PGPKeyPacket")
{
- m_pXSecController->setId( ouIdAttr );
+ return std::make_unique<DsPGPKeyPacketContext>(m_rParser, std::move(pOldNamespaceMap));
}
+ if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "PGPOwner")
+ {
+ return std::make_unique<LoPGPOwnerContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "SignatureMethod")
+};
+
+class XSecParser::DsX509CertificateContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsX509CertificateContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
{
- OUString ouAlgorithm = xAttribs->getValueByName("Algorithm");
- if (ouAlgorithm == ALGO_ECDSASHA1 || ouAlgorithm == ALGO_ECDSASHA256
- || ouAlgorithm == ALGO_ECDSASHA512)
- m_pXSecController->setSignatureMethod(svl::crypto::SignatureMethodAlgorithm::ECDSA);
}
- else if ( aName == "Reference" )
+
+ virtual void Characters(OUString const& rChars) override
{
- OUString ouUri = xAttribs->getValueByName("URI");
- SAL_WARN_IF( ouUri.isEmpty(), "xmlsecurity.helper", "URI is empty" );
- // Remember the type of this reference.
- OUString ouType = xAttribs->getValueByName("Type");
- if (ouUri.startsWith("#"))
+ m_rValue += rChars;
+ }
+};
+
+class XSecParser::DsX509SerialNumberContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsX509SerialNumberContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class XSecParser::DsX509IssuerNameContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsX509IssuerNameContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class XSecParser::DsX509IssuerSerialContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rX509IssuerName;
+ OUString & m_rX509SerialNumber;
+
+ public:
+ DsX509IssuerSerialContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rIssuerName, OUString & rSerialNumber)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rX509IssuerName(rIssuerName)
+ , m_rX509SerialNumber(rSerialNumber)
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509IssuerName")
{
- /*
- * remove the first character '#' from the attribute value
- */
- m_pXSecController->addReference( ouUri.copy(1), m_nReferenceDigestID, ouType );
+ return std::make_unique<DsX509IssuerNameContext>(m_rParser, std::move(pOldNamespaceMap), m_rX509IssuerName);
}
- else
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509SerialNumber")
{
- /*
- * remember the uri
- */
- m_currentReferenceURI = ouUri;
- m_bReferenceUnresolved = true;
+ return std::make_unique<DsX509SerialNumberContext>(m_rParser, std::move(pOldNamespaceMap), m_rX509SerialNumber);
}
+ // missing: ds:X509SKI, ds:X509SubjectName, ds:X509CRL
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+/// can't be sure what is supposed to happen here because the spec is clear as mud
+class XSecParser::DsX509DataContext
+ : public XSecParser::Context
+{
+ private:
+ // sigh... "No ordering is implied by the above constraints."
+ // so store the ball of mud in vectors and try to figure it out later.
+ std::vector<std::pair<OUString, OUString>> m_X509IssuerSerials;
+ std::vector<OUString> m_X509Certificates;
+
+ public:
+ DsX509DataContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
}
- else if (aName == "DigestMethod")
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setX509Data(m_X509IssuerSerials, m_X509Certificates);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- OUString ouAlgorithm = xAttribs->getValueByName("Algorithm");
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509IssuerSerial")
+ {
+ m_X509IssuerSerials.emplace_back();
+ return std::make_unique<DsX509IssuerSerialContext>(m_rParser, std::move(pOldNamespaceMap), m_X509IssuerSerials.back().first, m_X509IssuerSerials.back().second);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509Certificate")
+ {
+ m_X509Certificates.emplace_back();
+ return std::make_unique<DsX509CertificateContext>(m_rParser, std::move(pOldNamespaceMap), m_X509Certificates.back());
+ }
+ // missing: ds:X509SKI, ds:X509SubjectName, ds:X509CRL
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::DsKeyInfoContext
+ : public XSecParser::Context
+{
+ public:
+ DsKeyInfoContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "X509Data")
+ {
+ return std::make_unique<DsX509DataContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "PGPData")
+ {
+ return std::make_unique<DsPGPDataContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ // missing: ds:KeyName, ds:KeyValue, ds:RetrievalMethod, ds:SPKIData, ds:MgmtData
+ // (old code would read ds:Transform inside ds:RetrievalMethod but
+ // presumably that was a bug)
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+
+};
+
+class XSecParser::DsSignatureValueContext
+ : public XSecParser::Context
+{
+ private:
+ OUString m_Value;
+
+ public:
+ DsSignatureValueContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+ }
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->setSignatureValue(m_Value);
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+};
+
+class XSecParser::DsDigestValueContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DsDigestValueContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& /*xAttrs*/) override
+ {
+ m_rValue.clear();
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class XSecParser::DsDigestMethodContext
+ : public XSecParser::Context
+{
+ private:
+ sal_Int32 & m_rReferenceDigestID;
+
+ public:
+ DsDigestMethodContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_Int32 & rReferenceDigestID)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rReferenceDigestID(rReferenceDigestID)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
SAL_WARN_IF( ouAlgorithm.isEmpty(), "xmlsecurity.helper", "no Algorithm in Reference" );
if (!ouAlgorithm.isEmpty())
@@ -158,342 +498,1102 @@ void SAL_CALL XSecParser::startElement(
&& ouAlgorithm != ALGO_XMLDSIGSHA512,
"xmlsecurity.helper", "Algorithm neither SHA1, SHA256 nor SHA512");
if (ouAlgorithm == ALGO_XMLDSIGSHA1)
- m_nReferenceDigestID = cssxc::DigestID::SHA1;
+ m_rReferenceDigestID = css::xml::crypto::DigestID::SHA1;
else if (ouAlgorithm == ALGO_XMLDSIGSHA256)
- m_nReferenceDigestID = cssxc::DigestID::SHA256;
+ m_rReferenceDigestID = css::xml::crypto::DigestID::SHA256;
else if (ouAlgorithm == ALGO_XMLDSIGSHA512)
- m_nReferenceDigestID = cssxc::DigestID::SHA512;
+ m_rReferenceDigestID = css::xml::crypto::DigestID::SHA512;
else
- m_nReferenceDigestID = 0;
+ m_rReferenceDigestID = 0;
}
}
- else if (aName == "Transform")
+};
+
+class XSecParser::DsTransformContext
+ : public XSecParser::Context
+{
+ private:
+ bool & m_rIsC14N;
+
+ public:
+ DsTransformContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool & rIsC14N)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rIsC14N(rIsC14N)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
+
+ if (ouAlgorithm == ALGO_C14N)
+ /*
+ * a xml stream
+ */
+ {
+ m_rIsC14N = true;
+ }
+ }
+};
+
+class XSecParser::DsTransformsContext
+ : public XSecParser::Context
+{
+ private:
+ bool & m_rIsC14N;
+
+ public:
+ DsTransformsContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool & rIsC14N)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rIsC14N(rIsC14N)
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- if ( m_bReferenceUnresolved )
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Transform")
{
- OUString ouAlgorithm = xAttribs->getValueByName("Algorithm");
+ return std::make_unique<DsTransformContext>(m_rParser, std::move(pOldNamespaceMap), m_rIsC14N);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::DsReferenceContext
+ : public XSecParser::Context
+{
+ private:
+ OUString m_URI;
+ OUString m_Type;
+ OUString m_DigestValue;
+ bool m_IsC14N = false;
+ // Relevant for ODF. The digest algorithm selected by the DigestMethod
+ // element's Algorithm attribute. @see css::xml::crypto::DigestID.
+ sal_Int32 m_nReferenceDigestID = css::xml::crypto::DigestID::SHA1;
- if (ouAlgorithm == ALGO_C14N)
- /*
- * a xml stream
- */
+ public:
+ DsReferenceContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_rParser.HandleIdAttr(xAttrs);
+
+ m_URI = xAttrs->getValueByName("URI");
+ SAL_WARN_IF(m_URI.isEmpty(), "xmlsecurity.helper", "URI is empty");
+ // Remember the type of this reference.
+ m_Type = xAttrs->getValueByName("Type");
+ }
+
+ virtual void EndElement() override
+ {
+ if (m_URI.startsWith("#"))
+ {
+ /*
+ * remove the first character '#' from the attribute value
+ */
+ m_rParser.m_pXSecController->addReference(m_URI.copy(1), m_nReferenceDigestID, m_Type);
+ }
+ else
+ {
+ if (m_IsC14N) // this is determined by nested ds:Transform
{
- m_pXSecController->addStreamReference( m_currentReferenceURI, false, m_nReferenceDigestID );
- m_bReferenceUnresolved = false;
+ m_rParser.m_pXSecController->addStreamReference(m_URI, false, m_nReferenceDigestID);
+ }
+ else
+ /*
+ * it must be an octet stream
+ */
+ {
+ m_rParser.m_pXSecController->addStreamReference(m_URI, true, m_nReferenceDigestID);
}
}
+
+ m_rParser.m_pXSecController->setDigestValue(m_nReferenceDigestID, m_DigestValue);
}
- else if (aName == "X509IssuerName")
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_ouX509IssuerName.clear();
- m_bInX509IssuerName = true;
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Transforms")
+ {
+ return std::make_unique<DsTransformsContext>(m_rParser, std::move(pOldNamespaceMap), m_IsC14N);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestMethod")
+ {
+ return std::make_unique<DsDigestMethodContext>(m_rParser, std::move(pOldNamespaceMap), m_nReferenceDigestID);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestValue")
+ {
+ return std::make_unique<DsDigestValueContext>(m_rParser, std::move(pOldNamespaceMap), m_DigestValue);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "X509SerialNumber")
+};
+
+class XSecParser::DsSignatureMethodContext
+ : public XSecParser::Context
+{
+ public:
+ DsSignatureMethodContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
{
- m_ouX509SerialNumber.clear();
- m_bInX509SerialNumber = true;
}
- else if (aName == "X509Certificate")
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
{
- m_ouX509Certificate.clear();
- m_bInX509Certificate = true;
+ OUString ouAlgorithm = xAttrs->getValueByName("Algorithm");
+ if (ouAlgorithm == ALGO_ECDSASHA1 || ouAlgorithm == ALGO_ECDSASHA256
+ || ouAlgorithm == ALGO_ECDSASHA512)
+ {
+ m_rParser.m_pXSecController->setSignatureMethod(svl::crypto::SignatureMethodAlgorithm::ECDSA);
+ }
}
- else if (aName == "PGPData")
+};
+
+class XSecParser::DsSignedInfoContext
+ : public XSecParser::Context
+{
+ public:
+ DsSignedInfoContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
{
- m_pXSecController->switchGpgSignature();
}
- else if (aName == "PGPKeyID")
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
{
- m_ouGpgKeyID.clear();
- m_bInGpgKeyID = true;
+ m_rParser.HandleIdAttr(xAttrs);
}
- else if (aName == "PGPKeyPacket")
+
+ virtual void EndElement() override
{
- m_ouGpgCertificate.clear();
- m_bInGpgCertificate = true;
+ m_rParser.m_pXSecController->setReferenceCount();
}
- else if (aName == "loext:PGPOwner")
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_ouGpgOwner.clear();
- m_bInGpgOwner = true;
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureMethod")
+ {
+ return std::make_unique<DsSignatureMethodContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Reference")
+ {
+ return std::make_unique<DsReferenceContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ // missing: ds:CanonicalizationMethod
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "SignatureValue")
+};
+
+class XSecParser::XadesEncapsulatedX509CertificateContext
+ : public XSecParser::Context
+{
+ private:
+ OUString m_Value;
+
+ public:
+ XadesEncapsulatedX509CertificateContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
{
- m_ouSignatureValue.clear();
- m_bInSignatureValue = true;
}
- else if (aName == "DigestValue" && !m_bInCertDigest)
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
{
- m_ouDigestValue.clear();
- m_bInDigestValue = true;
+ m_rParser.HandleIdAttr(xAttrs);
}
- else if (aName == "xd:CertDigest")
+
+ virtual void EndElement() override
+ {
+ m_rParser.m_pXSecController->addEncapsulatedX509Certificate(m_Value);
+ }
+
+ virtual void Characters(OUString const& rChars) override
{
- m_ouCertDigest.clear();
- m_bInCertDigest = true;
+ m_Value += rChars;
}
- // FIXME: Existing code here in xmlsecurity uses "xd" as the namespace prefix for XAdES,
- // while the sample document attached to tdf#76142 uses "xades". So accept either here. Of
- // course this is idiotic and wrong, the right thing would be to use a proper way to parse
- // XML that would handle namespaces correctly. I have no idea how substantial re-plumbing of
- // this code that would require.
- else if (aName == "xd:EncapsulatedX509Certificate" || aName == "xades:EncapsulatedX509Certificate")
+};
+
+class XSecParser::XadesCertificateValuesContext
+ : public XSecParser::Context
+{
+ public:
+ XadesCertificateValuesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
{
- m_ouEncapsulatedX509Certificate.clear();
- m_bInEncapsulatedX509Certificate = true;
}
- else if (aName == "xd:SigningTime" || aName == "xades:SigningTime")
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
{
- m_ouDate.clear();
- m_bInSigningTime = true;
+ m_rParser.HandleIdAttr(xAttrs);
}
- else if ( aName == "SignatureProperty" )
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- if (!ouIdAttr.isEmpty())
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "EncapsulatedX509Certificate")
{
- m_pXSecController->setPropertyId( ouIdAttr );
+ return std::make_unique<XadesEncapsulatedX509CertificateContext>(m_rParser, std::move(pOldNamespaceMap));
}
+ // missing: xades:OtherCertificate
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "dc:date")
+};
+
+class XSecParser::XadesUnsignedSignaturePropertiesContext
+ : public XSecParser::Context
+{
+ public:
+ XadesUnsignedSignaturePropertiesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
{
- if (m_ouDate.isEmpty())
- m_bInDate = true;
}
- else if (aName == "dc:description")
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
{
- m_ouDescription.clear();
- m_bInDescription = true;
+ m_rParser.HandleIdAttr(xAttrs);
}
- else if (aName == "loext:SignatureLineId")
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_ouSignatureLineId.clear();
- m_bInSignatureLineId = true;
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "CertificateValues")
+ {
+ return std::make_unique<XadesCertificateValuesContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ // missing:
+ // xades:CounterSignature
+ // ^ old code would read a ds:Signature inside it?
+ // xades:SignatureTimeStamp
+ // xades:CompleteCertificateRefs
+ // xades:CompleteRevocationRefs
+ // xades:AttributeCertificateRefs
+ // xades:AttributeRevocationRefs
+ // xades:SigAndRefsTimeStamp
+ // xades:RefsOnlyTimeStamp
+ // xades:RevocationValues
+ // xades:AttrAuthoritiesCertValues
+ // ^ old code: was equivalent to CertificateValues ???
+ // xades:AttributeRevocationValues
+ // xades:ArchiveTimeStamp
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "loext:SignatureLineValidImage")
+};
+
+class XSecParser::XadesUnsignedPropertiesContext
+ : public XSecParser::Context
+{
+ public:
+ XadesUnsignedPropertiesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
{
- m_ouSignatureLineValidImage.clear();
- m_bInSignatureLineValidImage = true;
}
- else if (aName == "loext:SignatureLineInvalidImage")
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
{
- m_ouSignatureLineInvalidImage.clear();
- m_bInSignatureLineInvalidImage = true;
+ m_rParser.HandleIdAttr(xAttrs);
}
- if (m_xNextHandler.is())
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_xNextHandler->startElement(aName, xAttribs);
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "UnsignedSignatureProperties")
+ {
+ return std::make_unique<XadesUnsignedSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ // missing: xades:UnsignedDataObjectProperties
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- }
- catch (cssu::Exception& )
- {//getCaughtException MUST be the first line in the catch block
- cssu::Any exc = cppu::getCaughtException();
- throw cssxs::SAXException(
- "xmlsecurity: Exception in XSecParser::startElement",
- nullptr, exc);
- }
- catch (...)
- {
- throw cssxs::SAXException(
- "xmlsecurity: unexpected exception in XSecParser::startElement", nullptr,
- cssu::Any());
- }
-}
+};
-void SAL_CALL XSecParser::endElement( const OUString& aName )
+class XSecParser::LoSignatureLineIdContext
+ : public XSecParser::ReferencedContextImpl
{
- try
- {
- if (aName == "DigestValue" && !m_bInCertDigest)
+ private:
+ OUString m_Value;
+
+ public:
+ LoSignatureLineIdContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
{
- m_bInDigestValue = false;
}
- else if ( aName == "Reference" )
+
+ virtual void EndElement() override
{
- if ( m_bReferenceUnresolved )
- /*
- * it must be an octet stream
- */
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setSignatureLineId(m_Value);
+ }
+ else
{
- m_pXSecController->addStreamReference( m_currentReferenceURI, true, m_nReferenceDigestID );
- m_bReferenceUnresolved = false;
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineId");
}
+ }
- m_pXSecController->setDigestValue( m_nReferenceDigestID, m_ouDigestValue );
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
}
- else if ( aName == "SignedInfo" )
+};
+
+class XSecParser::LoSignatureLineValidImageContext
+ : public XSecParser::ReferencedContextImpl
+{
+ private:
+ OUString m_Value;
+
+ public:
+ LoSignatureLineValidImageContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
{
- m_pXSecController->setReferenceCount();
}
- else if ( aName == "SignatureValue" )
+
+ virtual void EndElement() override
{
- m_pXSecController->setSignatureValue( m_ouSignatureValue );
- m_bInSignatureValue = false;
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setValidSignatureImage(m_Value);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineValidImage");
+ }
}
- else if (aName == "X509IssuerName")
+
+ virtual void Characters(OUString const& rChars) override
{
- m_pXSecController->setX509IssuerName( m_ouX509IssuerName );
- m_bInX509IssuerName = false;
+ m_Value += rChars;
}
- else if (aName == "X509SerialNumber")
+};
+
+class XSecParser::LoSignatureLineInvalidImageContext
+ : public XSecParser::ReferencedContextImpl
+{
+ private:
+ OUString m_Value;
+
+ public:
+ LoSignatureLineInvalidImageContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
{
- m_pXSecController->setX509SerialNumber( m_ouX509SerialNumber );
- m_bInX509SerialNumber = false;
}
- else if (aName == "X509Certificate")
+
+ virtual void EndElement() override
{
- m_pXSecController->setX509Certificate( m_ouX509Certificate );
- m_bInX509Certificate = false;
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setInvalidSignatureImage(m_Value);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureLineInvalidImage");
+ }
}
- else if (aName == "PGPKeyID")
+
+ virtual void Characters(OUString const& rChars) override
{
- m_pXSecController->setGpgKeyID( m_ouGpgKeyID );
- m_bInGpgKeyID = false;
+ m_Value += rChars;
}
- else if (aName == "PGPKeyPacket")
+};
+
+class XSecParser::LoSignatureLineContext
+ : public XSecParser::ReferencedContextImpl
+{
+ public:
+ LoSignatureLineContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
{
- m_pXSecController->setGpgCertificate( m_ouGpgCertificate );
- m_bInGpgCertificate = false;
}
- else if (aName == "loext:PGPOwner")
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_pXSecController->setGpgOwner( m_ouGpgOwner );
- m_bInGpgOwner = false;
+ if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLineId")
+ {
+ return std::make_unique<LoSignatureLineIdContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLineValidImage")
+ {
+ return std::make_unique<LoSignatureLineValidImageContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLineInvalidImage")
+ {
+ return std::make_unique<LoSignatureLineInvalidImageContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "xd:CertDigest")
+};
+
+class XSecParser::XadesCertDigestContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rDigestValue;
+ sal_Int32 & m_rReferenceDigestID;
+
+ public:
+ XadesCertDigestContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rDigestValue, sal_Int32 & rReferenceDigestID)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rDigestValue(rDigestValue)
+ , m_rReferenceDigestID(rReferenceDigestID)
{
- m_pXSecController->setCertDigest( m_ouCertDigest );
- m_bInCertDigest = false;
}
- else if (aName == "xd:EncapsulatedX509Certificate" || aName == "xades:EncapsulatedX509Certificate")
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_pXSecController->addEncapsulatedX509Certificate( m_ouEncapsulatedX509Certificate );
- m_bInEncapsulatedX509Certificate = false;
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestMethod")
+ {
+ return std::make_unique<DsDigestMethodContext>(m_rParser, std::move(pOldNamespaceMap), m_rReferenceDigestID);
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "DigestValue")
+ {
+ return std::make_unique<DsDigestValueContext>(m_rParser, std::move(pOldNamespaceMap), m_rDigestValue);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "xd:SigningTime" || aName == "xades:SigningTime")
+};
+
+class XSecParser::XadesCertContext
+ : public XSecParser::ReferencedContextImpl
+{
+ private:
+ sal_Int32 m_nReferenceDigestID = css::xml::crypto::DigestID::SHA1;
+ OUString m_CertDigest;
+ OUString m_X509IssuerName;
+ OUString m_X509SerialNumber;
+
+ public:
+ XadesCertContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
{
- m_pXSecController->setDate( m_ouDate );
- m_bInSigningTime = false;
}
- else if (aName == "dc:date")
+
+ virtual void EndElement() override
{
- if (m_bInDate)
+ if (m_isReferenced)
{
- m_pXSecController->setDate( m_ouDate );
- m_bInDate = false;
+ m_rParser.m_pXSecController->setX509CertDigest(m_CertDigest, m_nReferenceDigestID, m_X509IssuerName, m_X509SerialNumber);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned xades:Cert");
}
}
- else if (aName == "dc:description")
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_pXSecController->setDescription( m_ouDescription );
- m_bInDescription = false;
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "CertDigest")
+ {
+ return std::make_unique<XadesCertDigestContext>(m_rParser, std::move(pOldNamespaceMap), m_CertDigest, m_nReferenceDigestID);
+ }
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "IssuerSerial")
+ {
+ return std::make_unique<DsX509IssuerSerialContext>(m_rParser, std::move(pOldNamespaceMap), m_X509IssuerName, m_X509SerialNumber);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "loext:SignatureLineId")
+};
+
+class XSecParser::XadesSigningCertificateContext
+ : public XSecParser::ReferencedContextImpl
+{
+ public:
+ XadesSigningCertificateContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
{
- m_pXSecController->setSignatureLineId( m_ouSignatureLineId );
- m_bInSignatureLineId = false;
}
- else if (aName == "loext:SignatureLineValidImage")
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
{
- m_pXSecController->setValidSignatureImage( m_ouSignatureLineValidImage );
- m_bInSignatureLineValidImage = false;
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "Cert")
+ {
+ return std::make_unique<XadesCertContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
}
- else if (aName == "loext:SignatureLineInvalidImage")
+};
+
+class XSecParser::XadesSigningTimeContext
+ : public XSecParser::ReferencedContextImpl
+{
+ private:
+ OUString m_Value;
+
+ public:
+ XadesSigningTimeContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
{
- m_pXSecController->setInvalidSignatureImage( m_ouSignatureLineInvalidImage );
- m_bInSignatureLineInvalidImage = false;
}
- if (m_xNextHandler.is())
+ virtual void EndElement() override
{
- m_xNextHandler->endElement(aName);
+ if (m_isReferenced)
+ {
+ m_rParser.m_pXSecController->setDate("", m_Value);
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SigningTime");
+ }
}
- }
- catch (cssu::Exception& )
- {//getCaughtException MUST be the first line in the catch block
- cssu::Any exc = cppu::getCaughtException();
- throw cssxs::SAXException(
- "xmlsecurity: Exception in XSecParser::endElement",
- nullptr, exc);
- }
- catch (...)
- {
- throw cssxs::SAXException(
- "xmlsecurity: unexpected exception in XSecParser::endElement", nullptr,
- cssu::Any());
- }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_Value += rChars;
+ }
+};
+
+class XSecParser::XadesSignedSignaturePropertiesContext
+ : public XSecParser::ReferencedContextImpl
+{
+ public:
+ XadesSignedSignaturePropertiesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SigningTime")
+ {
+ return std::make_unique<XadesSigningTimeContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SigningCertificate")
+ {
+ return std::make_unique<XadesSigningCertificateContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_LO_EXT && rName == "SignatureLine")
+ {
+ return std::make_unique<LoSignatureLineContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ // missing: xades:SignaturePolicyIdentifier, xades:SignatureProductionPlace, xades:SignerRole
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::XadesSignedPropertiesContext
+ : public XSecParser::ReferencedContextImpl
+{
+ public:
+ XadesSignedPropertiesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SignedSignatureProperties")
+ {
+ return std::make_unique<XadesSignedSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ // missing: xades:SignedDataObjectProperties
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::XadesQualifyingPropertiesContext
+ : public XSecParser::ReferencedContextImpl
+{
+ public:
+ XadesQualifyingPropertiesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "SignedProperties")
+ {
+ return std::make_unique<XadesSignedPropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "UnsignedProperties")
+ {
+ return std::make_unique<XadesUnsignedPropertiesContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::DcDateContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DcDateContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class XSecParser::DcDescriptionContext
+ : public XSecParser::Context
+{
+ private:
+ OUString & m_rValue;
+
+ public:
+ DcDescriptionContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ OUString & rValue)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ , m_rValue(rValue)
+ {
+ }
+
+ virtual void Characters(OUString const& rChars) override
+ {
+ m_rValue += rChars;
+ }
+};
+
+class XSecParser::DsSignaturePropertyContext
+ : public XSecParser::ReferencedContextImpl
+{
+ private:
+ enum class SignatureProperty { Unknown, Date, Description };
+ SignatureProperty m_Property = SignatureProperty::Unknown;
+ OUString m_Id;
+ OUString m_Value;
+
+ public:
+ DsSignaturePropertyContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ m_Id = CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual void EndElement() override
+ {
+ if (m_isReferenced)
+ {
+ switch (m_Property)
+ {
+ case SignatureProperty::Unknown:
+ SAL_INFO("xmlsecurity.helper", "Unknown property in ds:Object ignored");
+ break;
+ case SignatureProperty::Date:
+ m_rParser.m_pXSecController->setDate(m_Id, m_Value);
+ break;
+ case SignatureProperty::Description:
+ m_rParser.m_pXSecController->setDescription(m_Id, m_Value);
+ break;
+ }
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "ignoring unsigned SignatureProperty");
+ }
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DC && rName == "date")
+ {
+ m_Property = SignatureProperty::Date;
+ return std::make_unique<DcDateContext>(m_rParser, std::move(pOldNamespaceMap), m_Value);
+ }
+ if (nNamespace == XML_NAMESPACE_DC && rName == "description")
+ {
+ m_Property = SignatureProperty::Description;
+ return std::make_unique<DcDescriptionContext>(m_rParser, std::move(pOldNamespaceMap), m_Value);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::DsSignaturePropertiesContext
+ : public XSecParser::ReferencedContextImpl
+{
+ public:
+ DsSignaturePropertiesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ bool const isReferenced)
+ : ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), isReferenced)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureProperty")
+ {
+ return std::make_unique<DsSignaturePropertyContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::DsObjectContext
+ : public XSecParser::ReferencedContextImpl
+{
+ public:
+ DsObjectContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ // init with "false" here - the Signature element can't be referenced by its child
+ : XSecParser::ReferencedContextImpl(rParser, std::move(pOldNamespaceMap), false)
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ CheckIdAttrReferenced(xAttrs);
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureProperties")
+ {
+ return std::make_unique<DsSignaturePropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ if (nNamespace == XML_NAMESPACE_XADES132 && rName == "QualifyingProperties")
+ {
+ return std::make_unique<XadesQualifyingPropertiesContext>(m_rParser, std::move(pOldNamespaceMap), m_isReferenced);
+ }
+ // missing: ds:Manifest
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::DsSignatureContext
+ : public XSecParser::Context
+{
+ public:
+ DsSignatureContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual void StartElement(
+ css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs) override
+ {
+ OUString const ouIdAttr(m_rParser.HandleIdAttr(xAttrs));
+ m_rParser.m_rXMLSignatureHelper.StartVerifySignatureElement();
+ m_rParser.m_pXSecController->addSignature();
+ if (!ouIdAttr.isEmpty())
+ {
+ m_rParser.m_pXSecController->setId( ouIdAttr );
+ }
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignedInfo")
+ {
+ return std::make_unique<DsSignedInfoContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "SignatureValue")
+ {
+ return std::make_unique<DsSignatureValueContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "KeyInfo")
+ {
+ return std::make_unique<DsKeyInfoContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Object")
+ {
+ return std::make_unique<DsObjectContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+class XSecParser::DsigSignaturesContext
+ : public XSecParser::Context
+{
+ public:
+ DsigSignaturesContext(XSecParser & rParser,
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap)
+ : XSecParser::Context(rParser, std::move(pOldNamespaceMap))
+ {
+ }
+
+ virtual std::unique_ptr<Context> CreateChildContext(
+ std::unique_ptr<SvXMLNamespaceMap> pOldNamespaceMap,
+ sal_uInt16 const nNamespace, OUString const& rName) override
+ {
+ if (nNamespace == XML_NAMESPACE_DS && rName == "Signature")
+ {
+ return std::make_unique<DsSignatureContext>(m_rParser, std::move(pOldNamespaceMap));
+ }
+ return XSecParser::Context::CreateChildContext(std::move(pOldNamespaceMap), nNamespace, rName);
+ }
+};
+
+
+XSecParser::XSecParser(XMLSignatureHelper& rXMLSignatureHelper,
+ XSecController* pXSecController)
+ : m_pNamespaceMap(new SvXMLNamespaceMap)
+ , m_pXSecController(pXSecController)
+ , m_rXMLSignatureHelper(rXMLSignatureHelper)
+{
+ using namespace xmloff::token;
+ m_pNamespaceMap->Add( GetXMLToken(XML_XML), GetXMLToken(XML_N_XML), XML_NAMESPACE_XML );
+ m_pNamespaceMap->Add( "_dsig_ooo", GetXMLToken(XML_N_DSIG_OOO), XML_NAMESPACE_DSIG_OOO );
+ m_pNamespaceMap->Add( "_dsig", GetXMLToken(XML_N_DSIG), XML_NAMESPACE_DSIG );
+ m_pNamespaceMap->Add( "_ds", GetXMLToken(XML_N_DS), XML_NAMESPACE_DS );
+ m_pNamespaceMap->Add( "_xades132", GetXMLToken(XML_N_XADES132), XML_NAMESPACE_XADES132);
+ m_pNamespaceMap->Add( "_xades141", GetXMLToken(XML_N_XADES141), XML_NAMESPACE_XADES141);
+ m_pNamespaceMap->Add( "_dc", GetXMLToken(XML_N_DC), XML_NAMESPACE_DC );
+ m_pNamespaceMap->Add( "_office_libo",
+ GetXMLToken(XML_N_LO_EXT), XML_NAMESPACE_LO_EXT);
}
-void SAL_CALL XSecParser::characters( const OUString& aChars )
+OUString XSecParser::HandleIdAttr(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs)
{
- if (m_bInX509IssuerName)
- {
- m_ouX509IssuerName += aChars;
- }
- else if (m_bInX509SerialNumber)
- {
- m_ouX509SerialNumber += aChars;
- }
- else if (m_bInX509Certificate)
+ OUString ouIdAttr = getIdAttr(xAttrs);
+ if (!ouIdAttr.isEmpty())
{
- m_ouX509Certificate += aChars;
+ m_pXSecController->collectToVerify( ouIdAttr );
}
- else if (m_bInGpgCertificate)
- {
- m_ouGpgCertificate += aChars;
- }
- else if (m_bInGpgKeyID)
+ return ouIdAttr;
+}
+
+OUString XSecParser::getIdAttr(const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs )
+{
+ OUString ouIdAttr = xAttribs->getValueByName("id");
+
+ if (ouIdAttr.isEmpty())
{
- m_ouGpgKeyID += aChars;
+ ouIdAttr = xAttribs->getValueByName("Id");
}
- else if (m_bInGpgOwner)
+
+ return ouIdAttr;
+}
+
+/*
+ * XDocumentHandler
+ */
+void SAL_CALL XSecParser::startDocument( )
+{
+ if (m_xNextHandler.is())
{
- m_ouGpgOwner += aChars;
+ m_xNextHandler->startDocument();
}
- else if (m_bInSignatureValue)
+}
+
+void SAL_CALL XSecParser::endDocument( )
+{
+ if (m_xNextHandler.is())
{
- m_ouSignatureValue += aChars;
+ m_xNextHandler->endDocument();
}
- else if (m_bInDigestValue && !m_bInCertDigest)
+}
+
+void SAL_CALL XSecParser::startElement(
+ const OUString& rName,
+ const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs )
+{
+ assert(m_pNamespaceMap);
+ std::unique_ptr<SvXMLNamespaceMap> pRewindMap(
+ SvXMLImport::processNSAttributes(m_pNamespaceMap, nullptr, xAttribs));
+
+ OUString localName;
+ sal_uInt16 const nPrefix(m_pNamespaceMap->GetKeyByAttrName(rName, &localName));
+
+ std::unique_ptr<Context> pContext;
+
+ if (m_ContextStack.empty())
{
- m_ouDigestValue += aChars;
+ if ((nPrefix == XML_NAMESPACE_DSIG || nPrefix == XML_NAMESPACE_DSIG_OOO)
+ && localName == "document-signatures")
+ {
+ pContext.reset(new DsigSignaturesContext(*this, std::move(pRewindMap)));
+ }
+ else
+ {
+ throw css::xml::sax::SAXException(
+ "xmlsecurity: unexpected root element", nullptr,
+ css::uno::Any());
+ }
}
- else if (m_bInDate)
+ else
{
- m_ouDate += aChars;
+ pContext = m_ContextStack.top()->CreateChildContext(
+ std::move(pRewindMap), nPrefix, localName);
}
- else if (m_bInDescription)
+
+ m_ContextStack.push(std::move(pContext));
+ assert(!pRewindMap);
+
+ try
{
- m_ouDescription += aChars;
+ m_ContextStack.top()->StartElement(xAttribs);
+
+ if (m_xNextHandler.is())
+ {
+ m_xNextHandler->startElement(rName, xAttribs);
+ }
}
- else if (m_bInCertDigest)
- {
- m_ouCertDigest += aChars;
+ catch (css::uno::Exception& )
+ {//getCaughtException MUST be the first line in the catch block
+ css::uno::Any exc = cppu::getCaughtException();
+ throw css::xml::sax::SAXException(
+ "xmlsecurity: Exception in XSecParser::startElement",
+ nullptr, exc);
}
- else if (m_bInEncapsulatedX509Certificate)
+ catch (...)
{
- m_ouEncapsulatedX509Certificate += aChars;
+ throw css::xml::sax::SAXException(
+ "xmlsecurity: unexpected exception in XSecParser::startElement", nullptr,
+ css::uno::Any());
}
- else if (m_bInSigningTime)
+}
+
+void SAL_CALL XSecParser::endElement(const OUString& rName)
+{
+ assert(!m_ContextStack.empty()); // this should be checked by sax parser?
+
+ try
{
- m_ouDate += aChars;
+ m_ContextStack.top()->EndElement();
+
+ if (m_xNextHandler.is())
+ {
+ m_xNextHandler->endElement(rName);
+ }
}
- else if (m_bInSignatureLineId)
- {
- m_ouSignatureLineId += aChars;
+ catch (css::uno::Exception& )
+ {//getCaughtException MUST be the first line in the catch block
+ css::uno::Any exc = cppu::getCaughtException();
+ throw css::xml::sax::SAXException(
+ "xmlsecurity: Exception in XSecParser::endElement",
+ nullptr, exc);
}
- else if (m_bInSignatureLineValidImage)
+ catch (...)
{
- m_ouSignatureLineValidImage += aChars;
+ throw css::xml::sax::SAXException(
+ "xmlsecurity: unexpected exception in XSecParser::endElement", nullptr,
+ css::uno::Any());
}
- else if (m_bInSignatureLineInvalidImage)
+
+ if (m_ContextStack.top()->m_pOldNamespaceMap)
{
- m_ouSignatureLineInvalidImage += aChars;
+ m_pNamespaceMap = std::move(m_ContextStack.top()->m_pOldNamespaceMap);
}
+ m_ContextStack.pop();
+}
+
+void SAL_CALL XSecParser::characters(const OUString& rChars)
+{
+ assert(!m_ContextStack.empty()); // this should be checked by sax parser?
+ m_ContextStack.top()->Characters(rChars);
if (m_xNextHandler.is())
{
- m_xNextHandler->characters(aChars);
+ m_xNextHandler->characters(rChars);
}
}
@@ -513,7 +1613,7 @@ void SAL_CALL XSecParser::processingInstruction( const OUString& aTarget, const
}
}
-void SAL_CALL XSecParser::setDocumentLocator( const cssu::Reference< cssxs::XLocator >& xLocator )
+void SAL_CALL XSecParser::setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& xLocator )
{
if (m_xNextHandler.is())
{
@@ -525,7 +1625,7 @@ void SAL_CALL XSecParser::setDocumentLocator( const cssu::Reference< cssxs::XLoc
* XInitialization
*/
void SAL_CALL XSecParser::initialize(
- const cssu::Sequence< cssu::Any >& aArguments )
+ const css::uno::Sequence< css::uno::Any >& aArguments )
{
aArguments[0] >>= m_xNextHandler;
}
diff --git a/xmlsecurity/source/helper/xsecparser.hxx b/xmlsecurity/source/helper/xsecparser.hxx
index d9b079aa3116..7674bf28b84d 100644
--- a/xmlsecurity/source/helper/xsecparser.hxx
+++ b/xmlsecurity/source/helper/xsecparser.hxx
@@ -25,6 +25,10 @@
#include <cppuhelper/implbase.hxx>
+#include <xmloff/nmspmap.hxx>
+
+#include <stack>
+
class XMLSignatureHelper;
class XSecController;
@@ -48,47 +52,54 @@ class XSecParser: public cppu::WeakImplHelper
******************************************************************************/
{
friend class XSecController;
+public:
+ class Context;
private:
- /*
- * the following members are used to reserve the signature information,
- * including X509IssuerName, X509SerialNumber, and X509Certificate,etc.
- */
- OUString m_ouX509IssuerName;
- OUString m_ouX509SerialNumber;
- OUString m_ouX509Certificate;
- OUString m_ouGpgCertificate;
- OUString m_ouGpgKeyID;
- OUString m_ouGpgOwner;
- OUString m_ouCertDigest;
- OUString m_ouEncapsulatedX509Certificate;
- OUString m_ouDigestValue;
- OUString m_ouSignatureValue;
- OUString m_ouDate;
- /// Characters of a <dc:description> element, as just read from XML.
- OUString m_ouDescription;
- OUString m_ouSignatureLineId;
- OUString m_ouSignatureLineValidImage;
- OUString m_ouSignatureLineInvalidImage;
-
- /*
- * whether inside a particular element
- */
- bool m_bInX509IssuerName;
- bool m_bInX509SerialNumber;
- bool m_bInX509Certificate;
- bool m_bInGpgCertificate;
- bool m_bInGpgKeyID;
- bool m_bInGpgOwner;
- bool m_bInCertDigest;
- bool m_bInEncapsulatedX509Certificate;
- bool m_bInSigningTime;
- bool m_bInDigestValue;
- bool m_bInSignatureValue;
- bool m_bInDate;
- bool m_bInDescription;
- bool m_bInSignatureLineId;
- bool m_bInSignatureLineValidImage;
- bool m_bInSignatureLineInvalidImage;
+ class UnknownContext;
+ class ReferencedContextImpl;
+ class LoPGPOwnerContext;
+ class DsPGPKeyPacketContext;
+ class DsPGPKeyIDContext;
+ class DsPGPDataContext;
+ class DsX509CertificateContext;
+ class DsX509SerialNumberContext;
+ class DsX509IssuerNameContext;
+ class DsX509IssuerSerialContext;
+ class DsX509DataContext;
+ class DsKeyInfoContext;
+ class DsSignatureValueContext;
+ class DsDigestValueContext;
+ class DsDigestMethodContext;
+ class DsTransformContext;
+ class DsTransformsContext;
+ class DsReferenceContext;
+ class DsSignatureMethodContext;
+ class DsSignedInfoContext;
+ class XadesEncapsulatedX509CertificateContext;
+ class XadesCertificateValuesContext;
+ class XadesUnsignedSignaturePropertiesContext;
+ class XadesUnsignedPropertiesContext;
+ class LoSignatureLineIdContext;
+ class LoSignatureLineValidImageContext;
+ class LoSignatureLineInvalidImageContext;
+ class LoSignatureLineContext;
+ class XadesCertDigestContext;
+ class XadesCertContext;
+ class XadesSigningCertificateContext;
+ class XadesSigningTimeContext;
+ class XadesSignedSignaturePropertiesContext;
+ class XadesSignedPropertiesContext;
+ class XadesQualifyingPropertiesContext;
+ class DcDateContext;
+ class DcDescriptionContext;
+ class DsSignaturePropertyContext;
+ class DsSignaturePropertiesContext;
+ class DsObjectContext;
+ class DsSignatureContext;
+ class DsigSignaturesContext;
+
+ std::stack<std::unique_ptr<Context>> m_ContextStack;
+ std::unique_ptr<SvXMLNamespaceMap> m_pNamespaceMap;
/*
* the XSecController collaborating with XSecParser
@@ -101,22 +112,9 @@ private:
css::uno::Reference<
css::xml::sax::XDocumentHandler > m_xNextHandler;
- /*
- * this string is used to remember the current handled reference's URI,
- *
- * because it can be decided whether a stream reference is xml based or binary based
- * only after the Transforms element is read in, so we have to reserve the reference's
- * URI when the startElement event is met.
- */
- OUString m_currentReferenceURI;
- bool m_bReferenceUnresolved;
-
- // Relevant for ODF. The digest algorithm selected by the current DigestMethod element's
- // Algorithm attribute in the current Reference element. From css::xml::crypto::DigestID.
- sal_Int32 m_nReferenceDigestID;
XMLSignatureHelper& m_rXMLSignatureHelper;
-private:
+ OUString HandleIdAttr(css::uno::Reference<css::xml::sax::XAttributeList> const& xAttrs);
static OUString getIdAttr(const css::uno::Reference<
css::xml::sax::XAttributeList >& xAttribs );
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index 4d1b89949feb..8676f70c1041 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -33,10 +33,6 @@ namespace com::sun::star::graphic { class XGraphic; }
using namespace css;
using namespace css::uno;
using namespace css::graphic;
-namespace cssu = com::sun::star::uno;
-namespace cssl = com::sun::star::lang;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
/* protected: for signature generation */
OUString XSecController::createId()
@@ -54,7 +50,7 @@ OUString XSecController::createId()
return OUString::createFromAscii(str);
}
-cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepareSignatureToWrite(
+css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > XSecController::prepareSignatureToWrite(
InternalSignatureInformation& internalSignatureInfor,
sal_Int32 nStorageFormat,
bool bXAdESCompliantIfODF)
@@ -65,13 +61,13 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
sal_Int32 nIdOfSignatureElementCollector;
nIdOfSignatureElementCollector =
- m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_AFTERMODIFY, true );
+ m_xSAXEventKeeper->addSecurityElementCollector( css::xml::crypto::sax::ElementMarkPriority_AFTERMODIFY, true );
m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId);
rtl::Reference<SignatureCreatorImpl> xSignatureCreator(new SignatureCreatorImpl);
- cssu::Sequence<cssu::Any> args(5);
+ css::uno::Sequence<css::uno::Any> args(5);
args[0] <<= OUString::number(nSecurityId);
args[1] <<= uno::Reference<xml::crypto::sax::XSecuritySAXEventKeeper>(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
args[2] <<= OUString::number(nIdOfSignatureElementCollector);
@@ -116,7 +112,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
{
const SignatureReferenceInformation& refInfor = vReferenceInfors[i];
- cssu::Reference< css::io::XInputStream > xInputStream
+ css::uno::Reference< css::io::XInputStream > xInputStream
= getObjectInputStream( refInfor.ouURI );
if (xInputStream.is())
@@ -127,19 +123,20 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
// use sha512 for gpg signing unconditionally
const sal_Int32 digestID = !internalSignatureInfor.signatureInfor.ouGpgCertificate.isEmpty()?
- cssxc::DigestID::SHA512 : (bXAdESCompliantIfODF ? cssxc::DigestID::SHA256 : cssxc::DigestID::SHA1);
+ css::xml::crypto::DigestID::SHA512 : (bXAdESCompliantIfODF ? css::xml::crypto::DigestID::SHA256 : css::xml::crypto::DigestID::SHA1);
if (nStorageFormat != embed::StorageFormats::OFOPXML)
{
internalSignatureInfor.signatureInfor.ouSignatureId = createId();
- internalSignatureInfor.signatureInfor.ouPropertyId = createId();
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, internalSignatureInfor.signatureInfor.ouPropertyId, -1, OUString() );
+ internalSignatureInfor.signatureInfor.ouDateTimePropertyId = createId();
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, internalSignatureInfor.signatureInfor.ouDateTimePropertyId, -1, OUString() );
size++;
if (bXAdESCompliantIfODF)
{
+ OUString aId = "idSignedProperties_" + internalSignatureInfor.signatureInfor.ouSignatureId;
// We write a new reference, so it's possible to use the correct type URI.
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, "idSignedProperties", -1, "http://uri.etsi.org/01903#SignedProperties");
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, aId, -1, "http://uri.etsi.org/01903#SignedProperties");
size++;
}
@@ -151,13 +148,16 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
size++;
}
}
- else
+ else // OOXML
{
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, "idPackageObject", -1, OUString());
+ OUString aID = createId();
+ internalSignatureInfor.signatureInfor.ouSignatureId = aID;
+
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, "idPackageObject_" + aID, -1, OUString());
size++;
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, "idOfficeObject", -1, OUString());
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, "idOfficeObject_" + aID, -1, OUString());
size++;
- internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, "idSignedProperties", -1, OUString());
+ internalSignatureInfor.addReference(SignatureReferenceType::SAMEDOCUMENT, digestID, "idSignedProperties_" + aID, -1, OUString());
size++;
}
@@ -178,7 +178,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
void XSecController::signAStream( sal_Int32 securityId, const OUString& uri, bool isBinary, bool bXAdESCompliantIfODF)
{
const SignatureReferenceType type = isBinary ? SignatureReferenceType::BINARYSTREAM : SignatureReferenceType::XMLSTREAM;
- sal_Int32 digestID = bXAdESCompliantIfODF ? cssxc::DigestID::SHA256 : cssxc::DigestID::SHA1;
+ sal_Int32 digestID = bXAdESCompliantIfODF ? css::xml::crypto::DigestID::SHA256 : css::xml::crypto::DigestID::SHA1;
int index = findSignatureInfor( securityId );
@@ -192,11 +192,12 @@ void XSecController::signAStream( sal_Int32 securityId, const OUString& uri, boo
{
// use sha512 for gpg signing unconditionally
if (!m_vInternalSignatureInformations[index].signatureInfor.ouGpgCertificate.isEmpty())
- digestID = cssxc::DigestID::SHA512;
+ digestID = css::xml::crypto::DigestID::SHA512;
m_vInternalSignatureInformations[index].addReference(type, digestID, uri, -1, OUString());
}
}
+// note: this is called when creating a new signature from scratch
void XSecController::setX509Certificate(
sal_Int32 nSecurityId,
const OUString& ouX509IssuerName,
@@ -210,10 +211,13 @@ void XSecController::setX509Certificate(
if ( index == -1 )
{
InternalSignatureInformation isi(nSecurityId, nullptr);
- isi.signatureInfor.ouX509IssuerName = ouX509IssuerName;
- isi.signatureInfor.ouX509SerialNumber = ouX509SerialNumber;
- isi.signatureInfor.ouX509Certificate = ouX509Cert;
- isi.signatureInfor.ouCertDigest = ouX509CertDigest;
+ isi.signatureInfor.X509Datas.clear();
+ isi.signatureInfor.X509Datas.emplace_back();
+ isi.signatureInfor.X509Datas.back().emplace_back();
+ isi.signatureInfor.X509Datas.back().back().X509IssuerName = ouX509IssuerName;
+ isi.signatureInfor.X509Datas.back().back().X509SerialNumber = ouX509SerialNumber;
+ isi.signatureInfor.X509Datas.back().back().X509Certificate = ouX509Cert;
+ isi.signatureInfor.X509Datas.back().back().CertDigest = ouX509CertDigest;
isi.signatureInfor.eAlgorithmID = eAlgorithmID;
m_vInternalSignatureInformations.push_back( isi );
}
@@ -221,16 +225,19 @@ void XSecController::setX509Certificate(
{
SignatureInformation &si
= m_vInternalSignatureInformations[index].signatureInfor;
- si.ouX509IssuerName = ouX509IssuerName;
- si.ouX509SerialNumber = ouX509SerialNumber;
- si.ouX509Certificate = ouX509Cert;
- si.ouCertDigest = ouX509CertDigest;
+ si.X509Datas.clear();
+ si.X509Datas.emplace_back();
+ si.X509Datas.back().emplace_back();
+ si.X509Datas.back().back().X509IssuerName = ouX509IssuerName;
+ si.X509Datas.back().back().X509SerialNumber = ouX509SerialNumber;
+ si.X509Datas.back().back().X509Certificate = ouX509Cert;
+ si.X509Datas.back().back().CertDigest = ouX509CertDigest;
}
}
void XSecController::setGpgCertificate(
sal_Int32 nSecurityId,
- const OUString& ouCertDigest,
+ const OUString& ouKeyDigest,
const OUString& ouCert,
const OUString& ouOwner)
{
@@ -241,16 +248,17 @@ void XSecController::setGpgCertificate(
InternalSignatureInformation isi(nSecurityId, nullptr);
isi.signatureInfor.ouGpgCertificate = ouCert;
isi.signatureInfor.ouGpgOwner = ouOwner;
- isi.signatureInfor.ouCertDigest = ouCertDigest;
+ isi.signatureInfor.ouGpgKeyID = ouKeyDigest;
m_vInternalSignatureInformations.push_back( isi );
}
else
{
SignatureInformation &si
= m_vInternalSignatureInformations[index].signatureInfor;
+ si.X509Datas.clear(); // it is a PGP signature now
si.ouGpgCertificate = ouCert;
si.ouGpgOwner = ouOwner;
- si.ouCertDigest = ouCertDigest;
+ si.ouGpgKeyID = ouKeyDigest;
}
}
@@ -347,7 +355,7 @@ void XSecController::setSignatureLineInvalidGraphic(
}
bool XSecController::WriteSignature(
- const cssu::Reference<cssxs::XDocumentHandler>& xDocumentHandler,
+ const css::uno::Reference<css::xml::sax::XDocumentHandler>& xDocumentHandler,
bool bXAdESCompliantIfODF )
{
bool rc = false;
@@ -373,7 +381,7 @@ bool XSecController::WriteSignature(
/*
* export the signature template
*/
- cssu::Reference<cssxs::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()),cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::sax::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()),css::uno::UNO_QUERY);
int i;
int sigNum = m_vInternalSignatureInformations.size();
@@ -394,7 +402,7 @@ bool XSecController::WriteSignature(
rc = true;
}
- catch( cssu::Exception& )
+ catch( css::uno::Exception& )
{
}
@@ -422,7 +430,7 @@ bool XSecController::WriteOOXMLSignature(const uno::Reference<embed::XStorage>&
try
{
// Export the signature template.
- cssu::Reference<xml::sax::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
+ css::uno::Reference<xml::sax::XDocumentHandler> xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
for (InternalSignatureInformation & rInformation : m_vInternalSignatureInformations)
{
diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx
index 1f7fa9ac8ca8..89141ed1dfd4 100644
--- a/xmlsecurity/source/helper/xsecverify.cxx
+++ b/xmlsecurity/source/helper/xsecverify.cxx
@@ -22,6 +22,7 @@
#include <xsecctl.hxx>
#include "xsecparser.hxx"
#include "ooxmlsecparser.hxx"
+#include <biginteger.hxx>
#include <framework/signatureverifierimpl.hxx>
#include <framework/saxeventkeeperimpl.hxx>
#include <gpg/xmlsignature_gpgimpl.hxx>
@@ -46,13 +47,9 @@ namespace com::sun::star::graphic { class XGraphic; }
using namespace css;
using namespace css::uno;
using namespace css::beans;
-namespace cssu = com::sun::star::uno;
-namespace cssl = com::sun::star::lang;
-namespace cssxc = com::sun::star::xml::crypto;
-namespace cssxs = com::sun::star::xml::sax;
/* protected: for signature verify */
-cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepareSignatureToRead(
+css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > XSecController::prepareSignatureToRead(
sal_Int32 nSecurityId)
{
if ( m_eStatusOfSecurityComponents != InitializationState::INITIALIZED )
@@ -61,10 +58,10 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
}
sal_Int32 nIdOfSignatureElementCollector;
- cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener;
+ css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > xReferenceResolvedListener;
nIdOfSignatureElementCollector =
- m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_BEFOREMODIFY, false);
+ m_xSAXEventKeeper->addSecurityElementCollector( css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY, false);
m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId);
@@ -73,9 +70,9 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
*/
xReferenceResolvedListener = new SignatureVerifierImpl;
- cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::lang::XInitialization> xInitialization(xReferenceResolvedListener, css::uno::UNO_QUERY);
- cssu::Sequence<cssu::Any> args(5);
+ css::uno::Sequence<css::uno::Any> args(5);
args[0] <<= OUString::number(nSecurityId);
args[1] <<= uno::Reference<xml::crypto::sax::XSecuritySAXEventKeeper>(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), uno::UNO_QUERY);
args[2] <<= OUString::number(nIdOfSignatureElementCollector);
@@ -83,8 +80,8 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
args[4] <<= m_xXMLSignature;
xInitialization->initialize(args);
- cssu::Reference< cssxc::sax::XSignatureVerifyResultBroadcaster >
- signatureVerifyResultBroadcaster(xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference< css::xml::crypto::sax::XSignatureVerifyResultBroadcaster >
+ signatureVerifyResultBroadcaster(xReferenceResolvedListener, css::uno::UNO_QUERY);
signatureVerifyResultBroadcaster->addSignatureVerifyResultListener( this );
@@ -92,7 +89,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
nIdOfSignatureElementCollector,
xReferenceResolvedListener);
- cssu::Reference<cssxc::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::crypto::sax::XKeyCollector> keyCollector (xReferenceResolvedListener, css::uno::UNO_QUERY);
keyCollector->setKeyId(0);
return xReferenceResolvedListener;
@@ -100,7 +97,7 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
void XSecController::addSignature()
{
- cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener;
+ css::uno::Reference< css::xml::crypto::sax::XReferenceResolvedListener > xReferenceResolvedListener;
sal_Int32 nSignatureId = 0;
@@ -147,6 +144,25 @@ void XSecController::switchGpgSignature()
#endif
}
+bool XSecController::haveReferenceForId(OUString const& rId) const
+{
+ if (m_vInternalSignatureInformations.empty())
+ {
+ SAL_INFO("xmlsecurity.helper","XSecController::haveReferenceForId: no signature");
+ return false;
+ }
+ InternalSignatureInformation const& rIsi(m_vInternalSignatureInformations.back());
+ for (SignatureReferenceInformation const& rSri : rIsi.signatureInfor.vSignatureReferenceInfors)
+ {
+ if (rSri.nType == SignatureReferenceType::SAMEDOCUMENT
+ && rSri.ouURI == rId) // ouUri has # stripped
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
void XSecController::addReference( const OUString& ouUri, sal_Int32 nDigestID, const OUString& ouType )
{
if (m_vInternalSignatureInformations.empty())
@@ -177,13 +193,13 @@ void XSecController::addStreamReference(
/*
* get the input stream
*/
- cssu::Reference< css::io::XInputStream > xObjectInputStream
+ css::uno::Reference< css::io::XInputStream > xObjectInputStream
= getObjectInputStream( ouUri );
if ( xObjectInputStream.is() )
{
- cssu::Reference<cssxc::XUriBinding> xUriBinding
- (isi.xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::crypto::XUriBinding> xUriBinding
+ (isi.xReferenceResolvedListener, css::uno::UNO_QUERY);
xUriBinding->setUriBinding(ouUri, xObjectInputStream);
}
}
@@ -219,13 +235,15 @@ void XSecController::setReferenceCount() const
}
}
- cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
- (isi.xReferenceResolvedListener, cssu::UNO_QUERY);
+ css::uno::Reference<css::xml::crypto::sax::XReferenceCollector> xReferenceCollector
+ (isi.xReferenceResolvedListener, css::uno::UNO_QUERY);
xReferenceCollector->setReferenceCount( referenceCount );
}
}
-void XSecController::setX509IssuerName( OUString const & ouX509IssuerName )
+void XSecController::setX509Data(
+ std::vector<std::pair<OUString, OUString>> & rX509IssuerSerials,
+ std::vector<OUString> const& rX509Certificates)
{
if (m_vInternalSignatureInformations.empty())
{
@@ -233,29 +251,52 @@ void XSecController::setX509IssuerName( OUString const & ouX509IssuerName )
return;
}
InternalSignatureInformation &isi = m_vInternalSignatureInformations.back();
- isi.signatureInfor.ouX509IssuerName = ouX509IssuerName;
-}
-
-void XSecController::setX509SerialNumber( OUString const & ouX509SerialNumber )
-{
- if (m_vInternalSignatureInformations.empty())
+ SignatureInformation::X509Data data;
+ // due to the excessive flexibility of the spec it's possible that there
+ // is both a reference to a cert and the cert itself in one X509Data
+ for (OUString const& it : rX509Certificates)
{
- SAL_INFO("xmlsecurity.helper","XSecController::setX509SerialNumber: no signature");
- return;
+ try
+ {
+ data.emplace_back();
+ data.back().X509Certificate = it;
+ uno::Reference<xml::crypto::XSecurityEnvironment> const xSecEnv(m_xSecurityContext->getSecurityEnvironment());
+ uno::Reference<security::XCertificate> const xCert(xSecEnv->createCertificateFromAscii(it));
+ if (!xCert.is())
+ {
+ SAL_INFO("xmlsecurity.helper", "cannot parse X509Certificate");
+ continue; // will be handled in CheckX509Data
+ }
+ OUString const issuerName(xCert->getIssuerName());
+ OUString const serialNumber(xmlsecurity::bigIntegerToNumericString(xCert->getSerialNumber()));
+ auto const iter = std::find_if(rX509IssuerSerials.begin(), rX509IssuerSerials.end(),
+ [&](auto const& rX509IssuerSerial) {
+ return xmlsecurity::EqualDistinguishedNames(issuerName, rX509IssuerSerial.first)
+ && serialNumber == rX509IssuerSerial.second;
+ });
+ if (iter != rX509IssuerSerials.end())
+ {
+ data.back().X509IssuerName = iter->first;
+ data.back().X509SerialNumber = iter->second;
+ rX509IssuerSerials.erase(iter);
+ }
+ }
+ catch (uno::Exception const&)
+ {
+ SAL_INFO("xmlsecurity.helper", "cannot parse X509Certificate");
+ }
}
- InternalSignatureInformation &isi = m_vInternalSignatureInformations.back();
- isi.signatureInfor.ouX509SerialNumber = ouX509SerialNumber;
-}
-
-void XSecController::setX509Certificate( OUString const & ouX509Certificate )
-{
- if (m_vInternalSignatureInformations.empty())
+ // now handle any that are left...
+ for (auto const& it : rX509IssuerSerials)
{
- SAL_INFO("xmlsecurity.helper","XSecController::setX509Certificate: no signature");
- return;
+ data.emplace_back();
+ data.back().X509IssuerName = it.first;
+ data.back().X509SerialNumber = it.second;
+ }
+ if (!data.empty())
+ {
+ isi.signatureInfor.X509Datas.push_back(data);
}
- InternalSignatureInformation &isi = m_vInternalSignatureInformations.back();
- isi.signatureInfor.ouX509Certificate = ouX509Certificate;
}
void XSecController::setSignatureValue( OUString const & ouSignatureValue )
@@ -321,7 +362,7 @@ void XSecController::setGpgOwner( OUString const & ouGpgOwner )
isi.signatureInfor.ouGpgOwner = ouGpgOwner;
}
-void XSecController::setDate( OUString const & ouDate )
+void XSecController::setDate(OUString const& rId, OUString const& ouDate)
{
if (m_vInternalSignatureInformations.empty())
{
@@ -329,17 +370,31 @@ void XSecController::setDate( OUString const & ouDate )
return;
}
InternalSignatureInformation &isi = m_vInternalSignatureInformations.back();
+ // there may be multiple timestamps in a signature - check them for consistency
+ if (!isi.signatureInfor.ouDateTime.isEmpty()
+ && isi.signatureInfor.ouDateTime != ouDate)
+ {
+ isi.signatureInfor.hasInconsistentSigningTime = true;
+ }
(void)utl::ISO8601parseDateTime( ouDate, isi.signatureInfor.stDateTime);
isi.signatureInfor.ouDateTime = ouDate;
+ if (!rId.isEmpty())
+ {
+ isi.signatureInfor.ouDateTimePropertyId = rId;
+ }
}
-void XSecController::setDescription(const OUString& rDescription)
+void XSecController::setDescription(OUString const& rId, OUString const& rDescription)
{
if (m_vInternalSignatureInformations.empty())
return;
InternalSignatureInformation& rInformation = m_vInternalSignatureInformations.back();
rInformation.signatureInfor.ouDescription = rDescription;
+ if (!rId.isEmpty())
+ {
+ rInformation.signatureInfor.ouDescriptionPropertyId = rId;
+ }
}
void XSecController::setSignatureBytes(const uno::Sequence<sal_Int8>& rBytes)
@@ -351,13 +406,67 @@ void XSecController::setSignatureBytes(const uno::Sequence<sal_Int8>& rBytes)
rInformation.signatureInfor.aSignatureBytes = rBytes;
}
-void XSecController::setCertDigest(const OUString& rCertDigest)
+void XSecController::setX509CertDigest(
+ OUString const& rCertDigest, sal_Int32 const /*TODO nReferenceDigestID*/,
+ OUString const& rX509IssuerName, OUString const& rX509SerialNumber)
{
if (m_vInternalSignatureInformations.empty())
return;
InternalSignatureInformation& rInformation = m_vInternalSignatureInformations.back();
- rInformation.signatureInfor.ouCertDigest = rCertDigest;
+ for (auto & rData : rInformation.signatureInfor.X509Datas)
+ {
+ for (auto & it : rData)
+ {
+ if (xmlsecurity::EqualDistinguishedNames(it.X509IssuerName, rX509IssuerName)
+ && it.X509SerialNumber == rX509SerialNumber)
+ {
+ it.CertDigest = rCertDigest;
+ return;
+ }
+ }
+ }
+ // fall-back: read the actual certificates
+ for (auto & rData : rInformation.signatureInfor.X509Datas)
+ {
+ for (auto & it : rData)
+ {
+ if (!it.X509Certificate.isEmpty())
+ {
+ try
+ {
+ uno::Reference<xml::crypto::XSecurityEnvironment> const xSecEnv(m_xSecurityContext->getSecurityEnvironment());
+ uno::Reference<security::XCertificate> const xCert(xSecEnv->createCertificateFromAscii(it.X509Certificate));
+ if (!xCert.is())
+ {
+ SAL_INFO("xmlsecurity.helper", "cannot parse X509Certificate");
+ }
+ else if (xmlsecurity::EqualDistinguishedNames(xCert->getIssuerName(),rX509IssuerName)
+ && xmlsecurity::bigIntegerToNumericString(xCert->getSerialNumber()) == rX509SerialNumber)
+ {
+ it.CertDigest = rCertDigest;
+ // note: testInsertCertificate_PEM_DOCX requires these!
+ it.X509SerialNumber = rX509SerialNumber;
+ it.X509IssuerName = rX509IssuerName;
+ return;
+ }
+ }
+ catch (uno::Exception const&)
+ {
+ SAL_INFO("xmlsecurity.helper", "cannot parse X509Certificate");
+ }
+ }
+ }
+ }
+ if (!rInformation.signatureInfor.ouGpgCertificate.isEmpty())
+ {
+ SAL_INFO_IF(rCertDigest != rInformation.signatureInfor.ouGpgKeyID,
+ "xmlsecurity.helper", "PGPKeyID vs CertDigest mismatch");
+ }
+ else
+ {
+ SAL_INFO("xmlsecurity.helper", "cannot find X509Data for CertDigest");
+ }
}
namespace {
@@ -433,27 +542,6 @@ void XSecController::setId( OUString const & ouId )
isi.signatureInfor.ouSignatureId = ouId;
}
-void XSecController::setPropertyId( OUString const & ouPropertyId )
-{
- if (m_vInternalSignatureInformations.empty())
- {
- SAL_INFO("xmlsecurity.helper","XSecController::setPropertyId: no signature");
- return;
- }
- InternalSignatureInformation &isi = m_vInternalSignatureInformations.back();
-
- if (isi.signatureInfor.ouPropertyId.isEmpty())
- {
- // <SignatureProperty> ID attribute is for the date.
- isi.signatureInfor.ouPropertyId = ouPropertyId;
- }
- else
- {
- // <SignatureProperty> ID attribute is for the description.
- isi.signatureInfor.ouDescriptionPropertyId = ouPropertyId;
- }
-}
-
/* public: for signature verify */
void XSecController::collectToVerify( const OUString& referenceId )
{
@@ -465,7 +553,7 @@ void XSecController::collectToVerify( const OUString& referenceId )
*/
{
bool bJustChainingOn = false;
- cssu::Reference< cssxs::XDocumentHandler > xHandler;
+ css::uno::Reference< css::xml::sax::XDocumentHandler > xHandler;
int i,j;
int sigNum = m_vInternalSignatureInformations.size();
@@ -489,10 +577,10 @@ void XSecController::collectToVerify( const OUString& referenceId )
}
sal_Int32 nKeeperId = m_xSAXEventKeeper->addSecurityElementCollector(
- cssxc::sax::ElementMarkPriority_BEFOREMODIFY, false );
+ css::xml::crypto::sax::ElementMarkPriority_BEFOREMODIFY, false );
- cssu::Reference<cssxc::sax::XReferenceCollector> xReferenceCollector
- ( isi.xReferenceResolvedListener, cssu::UNO_QUERY );
+ css::uno::Reference<css::xml::crypto::sax::XReferenceCollector> xReferenceCollector
+ ( isi.xReferenceResolvedListener, css::uno::UNO_QUERY );
m_xSAXEventKeeper->setSecurityId(nKeeperId, isi.signatureInfor.nSecurityId);
m_xSAXEventKeeper->addReferenceResolvedListener( nKeeperId, isi.xReferenceResolvedListener);
@@ -506,7 +594,6 @@ void XSecController::collectToVerify( const OUString& referenceId )
if ( bJustChainingOn )
{
- cssu::Reference< cssxs::XDocumentHandler > xSEKHandler(static_cast<cppu::OWeakObject*>(m_xSAXEventKeeper.get()), cssu::UNO_QUERY);
m_xSAXEventKeeper->setNextHandler(xHandler);
}
}
@@ -520,13 +607,13 @@ void XSecController::addSignature( sal_Int32 nSignatureId )
m_bVerifyCurrentSignature = true;
}
-cssu::Reference< cssxs::XDocumentHandler > const & XSecController::createSignatureReader(XMLSignatureHelper& rXMLSignatureHelper, sal_Int32 nType)
+css::uno::Reference< css::xml::sax::XDocumentHandler > const & XSecController::createSignatureReader(XMLSignatureHelper& rXMLSignatureHelper, sal_Int32 nType)
{
if (nType == embed::StorageFormats::OFOPXML)
m_xSecParser = new OOXMLSecParser(rXMLSignatureHelper, this);
else
m_xSecParser = new XSecParser(rXMLSignatureHelper, this);
- cssu::Reference< cssl::XInitialization > xInitialization(m_xSecParser, uno::UNO_QUERY);
+ css::uno::Reference< css::lang::XInitialization > xInitialization(m_xSecParser, uno::UNO_QUERY);
setSAXChainConnector(xInitialization);
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index d9b657891b96..4031df289f44 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -755,7 +755,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
const uno::Reference< css::security::XCertificate >& aCert,
const uno::Sequence< uno::Reference< css::security::XCertificate > >& seqCerts)
{
- sal_Int32 validity = 0;
+ sal_Int32 validity = css::security::CertificateValidity::INVALID;
PCCERT_CHAIN_CONTEXT pChainContext = nullptr;
PCCERT_CONTEXT pCertContext = nullptr;
@@ -899,7 +899,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
}
else
{
- SAL_INFO("xmlsecurity.xmlsec", "CertGetCertificateChaine failed.");
+ SAL_INFO("xmlsecurity.xmlsec", "CertGetCertificateChain failed.");
}
}
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index 0e619b2802f8..244cd46ac564 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -26,6 +26,7 @@
#include <cppuhelper/supportsservice.hxx>
#include "x509certificate_mscryptimpl.hxx"
#include <certificateextension_xmlsecimpl.hxx>
+#include <biginteger.hxx>
#include "sanextension_mscryptimpl.hxx"
#include "oid.hxx"
@@ -649,4 +650,50 @@ Sequence<OUString> SAL_CALL X509Certificate_MSCryptImpl::getSupportedServiceName
return { OUString() };
}
+namespace xmlsecurity {
+
+static bool EncodeDistinguishedName(OUString const& rName, CERT_NAME_BLOB & rBlob)
+{
+ LPCWSTR pszError;
+ if (!CertStrToNameW(X509_ASN_ENCODING,
+ reinterpret_cast<LPCWSTR>(rName.getStr()), CERT_X500_NAME_STR,
+ nullptr, nullptr, &rBlob.cbData, &pszError))
+ {
+ SAL_INFO("xmlsecurity.xmlsec", "CertStrToNameW failed: " << WindowsErrorString(GetLastError()) << "; " << reinterpret_cast<char16_t const*>(pszError));
+ return false;
+ }
+ rBlob.pbData = new BYTE[rBlob.cbData];
+ if (!CertStrToNameW(X509_ASN_ENCODING,
+ reinterpret_cast<LPCWSTR>(rName.getStr()), CERT_X500_NAME_STR,
+ nullptr, rBlob.pbData, &rBlob.cbData, &pszError))
+ {
+ SAL_INFO("xmlsecurity.xmlsec", "CertStrToNameW failed: " << WindowsErrorString(GetLastError()) << "; " << reinterpret_cast<char16_t const*>(pszError));
+ return false;
+ }
+ return true;
+}
+
+bool EqualDistinguishedNames(
+ OUString const& rName1, OUString const& rName2)
+{
+ CERT_NAME_BLOB blob1;
+ if (!EncodeDistinguishedName(rName1, blob1))
+ {
+ return false;
+ }
+ CERT_NAME_BLOB blob2;
+ if (!EncodeDistinguishedName(rName2, blob2))
+ {
+ delete[] blob1.pbData;
+ return false;
+ }
+ bool const ret(CertCompareCertificateName(X509_ASN_ENCODING,
+ &blob1, &blob2) == TRUE);
+ delete[] blob2.pbData;
+ delete[] blob1.pbData;
+ return ret;
+}
+
+} // namespace xmlsecurity
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
index a0acd81786d7..6e4ca3d4e2c0 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
@@ -18,6 +18,7 @@
*/
#include <sal/config.h>
+#include <sal/log.hxx>
#include <rtl/uuid.h>
#include <com/sun/star/xml/crypto/SecurityOperationStatus.hpp>
@@ -228,6 +229,10 @@ SAL_CALL XMLSignature_MSCryptImpl::validate(
// We do certificate verification ourselves.
pDsigCtx->keyInfoReadCtx.flags |= XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS;
+ // limit possible key data to valid X509 certificates only, no KeyValues
+ if (xmlSecPtrListAdd(&(pDsigCtx->keyInfoReadCtx.enabledKeyData), BAD_CAST xmlSecMSCngKeyDataX509GetKlass()) < 0)
+ throw RuntimeException("failed to limit allowed key data");
+
//Verify signature
//The documentation says that the signature is only valid if the return value is 0 (that is, not < 0)
//AND pDsigCtx->status == xmlSecDSigStatusSucceeded. That is, we must not make any assumptions, if
@@ -250,6 +255,7 @@ SAL_CALL XMLSignature_MSCryptImpl::validate(
++nReferenceGood;
}
}
+ SAL_INFO("xmlsecurity.xmlsec", "xmlSecDSigCtxVerify status " << pDsigCtx->status << ", references good " << nReferenceGood << " of " << nReferenceCount);
if (rs == 0 && nReferenceCount == nReferenceGood)
{
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index 1a323d33f32f..d6143a81883c 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -31,6 +31,7 @@
#include <rtl/ref.hxx>
#include "x509certificate_nssimpl.hxx"
+#include <biginteger.hxx>
#include <certificateextension_xmlsecimpl.hxx>
#include "sanextension_nssimpl.hxx"
@@ -533,4 +534,28 @@ sal_Bool SAL_CALL X509Certificate_NssImpl::supportsService(const OUString& servi
/* XServiceInfo */
Sequence<OUString> SAL_CALL X509Certificate_NssImpl::getSupportedServiceNames() { return { OUString() }; }
+namespace xmlsecurity {
+
+bool EqualDistinguishedNames(
+ OUString const& rName1, OUString const& rName2)
+{
+ CERTName *const pName1(CERT_AsciiToName(OUStringToOString(rName1, RTL_TEXTENCODING_UTF8).getStr()));
+ if (pName1 == nullptr)
+ {
+ return false;
+ }
+ CERTName *const pName2(CERT_AsciiToName(OUStringToOString(rName2, RTL_TEXTENCODING_UTF8).getStr()));
+ if (pName2 == nullptr)
+ {
+ CERT_DestroyName(pName1);
+ return false;
+ }
+ bool const ret(CERT_CompareName(pName1, pName2) == SECEqual);
+ CERT_DestroyName(pName2);
+ CERT_DestroyName(pName1);
+ return ret;
+}
+
+} // namespace xmlsecurity
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
index c39f6cc72f76..6f70f76d23be 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
@@ -26,6 +26,9 @@
#include "securityenvironment_nssimpl.hxx"
#include <xmlsec-wrapper.h>
+
+#include <sal/log.hxx>
+
#include <com/sun/star/xml/crypto/XXMLSignature.hpp>
#include <memory>
@@ -241,6 +244,10 @@ SAL_CALL XMLSignature_NssImpl::validate(
// We do certificate verification ourselves.
pDsigCtx->keyInfoReadCtx.flags |= XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS;
+ // limit possible key data to valid X509 certificates only, no KeyValues
+ if (xmlSecPtrListAdd(&(pDsigCtx->keyInfoReadCtx.enabledKeyData), BAD_CAST xmlSecNssKeyDataX509GetKlass()) < 0)
+ throw RuntimeException("failed to limit allowed key data");
+
//Verify signature
int rs = xmlSecDSigCtxVerify( pDsigCtx.get() , pNode );
@@ -257,6 +264,7 @@ SAL_CALL XMLSignature_NssImpl::validate(
++nReferenceGood;
}
}
+ SAL_INFO("xmlsecurity.xmlsec", "xmlSecDSigCtxVerify status " << pDsigCtx->status << ", references good " << nReferenceGood << " of " << nReferenceCount);
if (rs == 0 && pDsigCtx->status == xmlSecDSigStatusSucceeded && nReferenceCount == nReferenceGood)
{