summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/docfile.cxx
AgeCommit message (Collapse)Author
2020-11-16Avoid unused parameter 'pImpl'Tor Lillqvist
Change-Id: I8dd30ed3ffffa0e5340b32ce4399dd05cc57e2b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105962 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-06-29sd signature line: pass the model down to xmlsecurityMiklos Vajna
So it can avoid SfxObjectShell::Current(), which is only correct when a single document is open. Also add an sfx2::DigitalSignatures interface so this can be done without UNO API changes. (cherry picked from commit c3f8702241b625db994bcb059d8c91c25fd43e53) Conflicts: xmlsecurity/source/component/documentdigitalsignatures.cxx xmlsecurity/source/helper/documentsignaturemanager.cxx Change-Id: Ie81996b8f1e8851975b27c43a53f9d23e316004e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97258 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-16sw reqif-xhtml export: add a new RTFOLEMimeType parameterMiklos Vajna
This is similar to commit e0f20211a8048a87b078aa4cf0f28c0c847487ad (sw reqif-xhtml import: add a new AllowedRTFOLEMimeTypes parameter, 2019-12-16), except that was for the import and this is for the import. The situation was similar, SfxBaseModel::impl_store() still had the custom store parameters, but later functions lost it, so at the end OutHTML_FrameFormatOLENodeGrf() in the sw HTML export could not respect it. Fix the problem in a similar way, so the SfxMedium instance created for the duration of the export provides the custom options via SfxMedium::GetArgs(). Change-Id: I71d2c7920f42d98133f345703cfdfd50f0e8550c Reviewed-on: https://gerrit.libreoffice.org/85321 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96477 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2020-03-31tdf#128662 Fix exception when accessing empty lock listJulian Kalinowski
This fixes an Access Violation Exception when a WebDAV server says a resource is locked but does return an empty lockdiscovery element on WebDAV Propfind. Without this patch, the code only checks that a list exists, but it should also check if it contains elements before accessing it. Change-Id: I5f555a9b5805102242392b018ab5a8009c7a203c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91412 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91392 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-11-29tdf#128898 import text from file with text-decode failedNoel Grandin
regression from commit 8f6f9e4217d03d874fb1ce391730a1c893ab6844 tdf#127958 crash adding 2 or more files into writer master document just make SfxMedium use shared_ptr, rather than the sometimes yes, sometimes no, ownership. Reviewed-on: https://gerrit.libreoffice.org/83930 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit cc4dbe473b0b68dbe120065c1d6a64a087f41ba2) Resolves: tdf#129082 insert sheet from file fails since... tdf#127958 crash adding 2 or more files into writer master document commit 8f6f9e4217d03d874fb1ce391730a1c893ab6844 Date: Mon Oct 7 09:40:41 2019 +0200 used the SfxItemSet copy ctor to make a copy of the itemset, but the orig itemset was a SfxAllItemSet not a SfxItemSet. an SfxAllItemSet allows all items to be added but a plain SfxItemSet only allows items in certain ranges to be inserted. Upshot is that later on the filename property cannot be set in the itemset, so file can't be opened. since... tdf#128898 import text from file with text-decode failed commit cc4dbe473b0b68dbe120065c1d6a64a087f41ba2 Date: Wed Nov 27 11:47:57 2019 +0200 tdf#128898 import text from file with text-decode failed these are std::shared_ptr so we can return to passing in the original SfxAllItemSet again to fix the problem Reviewed-on: https://gerrit.libreoffice.org/84024 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Change-Id: I77559e9f766d84aca0f9dc0bd1b856c69f0f62f1 Reviewed-on: https://gerrit.libreoffice.org/84025 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21Fix parameter nameSamuel Mehrbrodt
Change-Id: Ic82e0806c4654dedf615e12ddbd000cc709527e8 Reviewed-on: https://gerrit.libreoffice.org/81199 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-08-27loplugin:constmethod in sfx2Noel Grandin
Change-Id: Ic129a8e136dc3f3b0a36fdb83e7aa71027ada59a Reviewed-on: https://gerrit.libreoffice.org/78190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16use more TOOLS_WARN_EXCEPTIONNoel Grandin
Change-Id: Ic21ea11ff106e0732bb8fa600ef39a549d7bda86 Reviewed-on: https://gerrit.libreoffice.org/77569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-15loplugin:sequenceloop in sdext..sfx2Noel Grandin
Change-Id: If9924566b21e50cad7a12d781ac5d337de0684ab Reviewed-on: https://gerrit.libreoffice.org/77526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-29Simplify Sequence iterations in sfx2Arkadiy Illarionov
Use range-based loops, STL and comphelper functions Change-Id: I6a0d18493db7a25e8b41925f2d45cb221b5065a7 Reviewed-on: https://gerrit.libreoffice.org/76074 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-07-29Fix typosAndrea Gelmini
Change-Id: I94bfbfef24be46583c5c2877e468ed65c2bd5eb0 Reviewed-on: https://gerrit.libreoffice.org/76513 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-20loplugin:referencecasting in sfx2Noel Grandin
Change-Id: I97cd8821aa9a6f462f9b271940483738655ee9cf Reviewed-on: https://gerrit.libreoffice.org/75979 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-05Fix !HAVE_FEATURE_MULTIUSER_ENVIRONMENT buildJan-Marek Glogowski
The Android-ARM_24-Bytemark-Hosting build currentl< fails with: error: unused parameter ´pLockData´ [-Werror,-Wunused-parameter] Regression from commit 0f9599b687c1 ("Show who has locked the document when reopening a read-only document"). Change-Id: I6d8f900957d79a9c5bf70645e2021995e8a28d43 Reviewed-on: https://gerrit.libreoffice.org/75145 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-07-05Show who has locked the document when reopening a read-only documentMike Kaganski
Pass the locking data from SfxMedium::LockOrigFileOnDemand, to allow clients to show it themselves when required. Change-Id: I6afe46a1896e1b60771c080efa2f58794dbed8a6 Reviewed-on: https://gerrit.libreoffice.org/75113 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-28tdf#126121: WebDAV redirection detectionMike Kaganski
This rewrites URI of a document opened from a WebDAV mapped UNC path on Windows (like "file://server/DavWWWRoot/Dir/Doc.odt") into HTTP URI (like "http://server/Dir/Doc.odt"). This allows using WebDAV protocol for these files, and e.g. get information about other user who locked the document to show when asking if open read-only or a copy. Change-Id: I643fa8df30d4b163783b279b1b973304fcafff37 Reviewed-on: https://gerrit.libreoffice.org/71746 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-17loplugin:logexceptionnicely in sfx2Noel Grandin
Change-Id: Ia638b94a7859c5dddca82111e7cbe753d7dde631 Reviewed-on: https://gerrit.libreoffice.org/74114 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-03tdf#67538 XTypeDetection::queryTypeByDescriptor poor performance, part2Noel Grandin
SfxMedium was creating a temporary file and copying the input file, when CloseInStream_Impl was called from the destructor. Very very bad for performance. This is specifically fixing the performance of queryTypeByDescriptor when called from a basic macro on a local test file. This takes my test macro from 16.1s to 9s. Change-Id: If52f8e0587c7b11666893f6cb79b3180d45cce43 Reviewed-on: https://gerrit.libreoffice.org/73375 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-15tdf#42949 Fix IWYU warnings in unotools/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Also recheck include/unotools/* Change-Id: I3b8489aca69fbe80fa4a21748ac3c872d0d266c4 Reviewed-on: https://gerrit.libreoffice.org/71883 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-10an is used before a vowel soundCaolán McNamara
not before vowels with a consonant sound so its a url not an url Change-Id: Ic27ff3bee67469284d460c31ced6f63cb3633db2 Reviewed-on: https://gerrit.libreoffice.org/72062 Reviewed-by: Jens Carl <j.carl43@gmx.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-02Warn when getFileURLFromSystemPath() fails, not when it succeedsTor Lillqvist
Also, display the name that the call failed for in the warning message. Change-Id: I0b6b7baca1d534b5bada5286b2b0e5b8e94f1832
2019-04-01tdf#42949 Fix IWYU warnings in include/sfx2/[sS]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I4a3baffa8944b522b16b50975185759081662020 Reviewed-on: https://gerrit.libreoffice.org/69945 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-27MSO lockfiles: Deduplicate MSO lock file reading codeTamás Zolnai
The removed code was extracted to MSODocumentLockFile class so use that class here too. Use openStreamNoLock() for reading MSO lockfiles, because otherwise we can not read lock files written by MSO. Change-Id: Ib31cb9f3783d0b0ce784f900821047b9d32156f2 Reviewed-on: https://gerrit.libreoffice.org/69759 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-26Generate MSO lock files when the related MSO compat. option is setTamás Zolnai
Added a new compatibility option to the Tools -> Load / Save -> Microsoft. When this option is set on the UI or or set in the configuration files LO generates lock files for MSO supported file formats, similar to the lock files MSO generates itself. Change-Id: I2f882723841162add01be9d3f7285a5162a60331 Reviewed-on: https://gerrit.libreoffice.org/69678 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-03-25tdf#42949 Fix IWYU warnings in include/sfx2/[a-D]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I444cb71bc3d045072a4b1f9eed279ed7e425a0d4 Reviewed-on: https://gerrit.libreoffice.org/69481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-07log nice exception messages whereever possibleNoel Grandin
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1 Reviewed-on: https://gerrit.libreoffice.org/68579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-14weld DigitalSignaturesDialogCaolán McNamara
Change-Id: I197f4805558b07aeb9e66734d0fb5c250c41ad3e Reviewed-on: https://gerrit.libreoffice.org/67796 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-07loplugin:flatten in sfx2Noel Grandin
Change-Id: If4e07d497ead58a2ff58b5fdedd282b8784be421 Reviewed-on: https://gerrit.libreoffice.org/67435 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-28o3tl::make_unique -> std::make_unique in sax...svtools (except sc)Gabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I6eea0877eaa1886b64c0cce06a43b8088cbccd8e Reviewed-on: https://gerrit.libreoffice.org/66751 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-10Fix typoAndrea Gelmini
Change-Id: I39bec0dffbd1f89a49484eff335fdf66b78f1ec5 Reviewed-on: https://gerrit.libreoffice.org/66059 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-20use unique_ptr in sfx2Noel Grandin
Change-Id: I4e0bba9b8bebdeb9263ad71d3ab505d8beed17b7 Reviewed-on: https://gerrit.libreoffice.org/65441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-18Simplify ShowLockedDocumentDialog argument listMike Kaganski
No need to pass file URL explicitly - it's available as GetURLObject(). commit 607b80ca3cddc239a35580470944a438ce144fc8 follow-up. Change-Id: I6a2ceb6d3ae78c277f40215082af22112f9e2d27 Reviewed-on: https://gerrit.libreoffice.org/65300 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-18tdf#116320: properly decode file name for File Locked dialogMike Kaganski
Change-Id: I51bd7c6695ef52b08e0b6d809160d74daebb8505 Reviewed-on: https://gerrit.libreoffice.org/65298 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-05loplugin:singlevalfields in svlNoel Grandin
Change-Id: I26d11f60f486f3cfe4615828a410789f8e22af48 Reviewed-on: https://gerrit.libreoffice.org/64602 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-04tdf#34171: check foreign lockfiles to tell who has locked documentMike Kaganski
MS Office (Word/Excel/PowerPoint) lockfiles are supported now. Note that Excel does *not* create lockfiles for pre-OOXML files. This changes osl_openFile implementation on Windows, to treat osl_File_OpenFlag_NoLock to also include FILE_SHARE_DELETE flag for CreateFileW. This is required to allow opening files created with FILE_FLAG_DELETE_ON_CLOSE flag, such as Excel's owner files. The shange should be consistent with the overall meaning of the osl_File_OpenFlag_NoLock to not impose any locking constraints to the file being opened. Change-Id: I7b99012f4bd60ab3821fb91d5166a286031b7e93 Reviewed-on: https://gerrit.libreoffice.org/64496 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-01sfx2: fix Android build, check HAVE_FEATURE_MULTIUSER_ENVIRONMENTMichael Stahl
Change-Id: I2d78f35898cc514b20500018a7d360e3c78127aa
2018-12-01Option to turn off WebDAV file lockingKatarina Behrens
Locking files on WebDAV shares was implemented in tdf#82744, in particular: commit 26e6d4b05ab444e6a7529ffcac7fbe592fc94833 tdf#82744: fix WebDAV lock/unlock behaviour - part 1 commit bc9a8ddbb7081f79e915c841e56fd1c40f0df6f9 tdf#82744: fix WebDAV lock/unlock behaviour - part 2 commit b4576f3da4d90139fc5140962d13cb91dab98797 tdf#82744: fix WebDAV lock/unlock behaviour - part 3 commit fed2984281a85a5a2f308841ec810f218c75f2ab tdf#82744: fix WebDAV lock/unlock behaviour - part 4 Before that, files on WebDAV shares were accessed w/o locking since the beginning of [OOo] time. This option allows to revert to the old behaviour i.e. non-locking WebDAV access. For concurrent read-write WebDAV access by multiple users it is recommended to keep UseWebDAVFileLocking at default value (true) Change-Id: Id92177631d4854d6c7bf412164acbd9740db9592 Reviewed-on: https://gerrit.libreoffice.org/64116 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-11-22Don't create temp file in save destination folder when sandboxedTor Lillqvist
In a sandboxed environment we don't want to attempt to create temporary files in the same directory where the user has selected an output file to be stored. The sandboxed process has permission only to create the specifically named output file that the user chose in the system file dialog in that directory. Change-Id: I65274b4c433bd66b436429bea4b287a0505b72c9
2018-11-10tdf#121288: ReplaceFile WinAPI doesn't play nicely with WebDAV mapped drivesMike Kaganski
Change-Id: I0d7a64459de283dc10448e0086c66bedbf132553 Reviewed-on: https://gerrit.libreoffice.org/63133 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com> Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-28lokit: add funct. to insert, sign and verify signatureTomaž Vajngerl
A lot of signing code paths trigger a GUI dialog (to select the certificate for example) which aren't acceptable when triggering through the LOKit. This code paths needed to be duplicated and reworked to not trigger any GUI action. Change-Id: I2f0d6038fb1bcd00adcdf86e432f9df8858cc21c Reviewed-on: https://gerrit.libreoffice.org/61780 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-10-28tdf#120703 PVS: V547 Expression is always true/falseMike Kaganski
Change-Id: Ic92cc594979cac2edac04a085957398672a5dfcc Reviewed-on: https://gerrit.libreoffice.org/62450 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24clang-tidy performance-unnecessary-copy-init in sfx2..svtoolsNoel Grandin
Change-Id: I1e92472b4aaeca1eb1372bd18d10cc9e0766dc39 Reviewed-on: https://gerrit.libreoffice.org/62251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-misleading-indentationNoel Grandin
Change-Id: I4673fc7c694924b41d048a1918ddb8b0e0af1f79 Reviewed-on: https://gerrit.libreoffice.org/61935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27tdf#119238: keep replaced file's identity when renaming docfileMike Kaganski
Regression from 2157a3536f97ff5ae7c82611a801fef7e3708983 sfx2 store: try rename before copying Rename is cheaper then copying the content over manually, so try that first. On Windows, we need to keep the file's dentity, including metadata (e.g., creation time, which is kept in FS). WinAPI has ReplaceFileW specifically for this, and it keeps ACLs of the original file, and otherwise makes the changed file not a separate entry, but updated old file from system's PoV. Eventually, we could try to restructure creating backup copies (e.g., for documents when configured so) to take advantage of this function being able to do that. Change-Id: I6001a2a3af5e10bc010f5ef129f4bb6f83ee1581 Reviewed-on: https://gerrit.libreoffice.org/60163 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2018-09-13tdf#42949 Fix IWYU warnings in include/ucbhelper/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7bfeef47abaf94cfb355db95c0fdb928ce36c0a6 Reviewed-on: https://gerrit.libreoffice.org/60232 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-11loplugin:unusedfieldsNoel Grandin
Change-Id: I876183559a7d9f1e6d914fbf37d7ffe91459144e Reviewed-on: https://gerrit.libreoffice.org/60278 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11tdf#119316 sfx2 store: no move on macOSMiklos Vajna
osl::FileStatus::getAttributes() and osl::File::setAttributes() doesn't preserve all the necessary file properties (at least "Hide extension" is not handled), so always copy on macOS instead. Change-Id: I529467cc3d432d04e593f936c13ed4656a18150c Reviewed-on: https://gerrit.libreoffice.org/60294 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-10loplugin:simplifyconstruct in sfx2..starmathNoel Grandin
Change-Id: I9fbdd23ad61773e57aaf7d70fd19d05a50b8d399 Reviewed-on: https://gerrit.libreoffice.org/60238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>