Open template read-only

Desktop / LibreOffice - Tor Lillqvist [collabora.com] - 22 May 2018 15:17 EDT

Otherwise when creating a new docuent based on a template, the template document file is opened read-write eventually (after first being opened read-only five times, and closed again...). Sure, LibreOffice probably doesn't actually write anything to it, but still, just opening read-write when you are going to only read is silly.

Stack trace from the read-write opening:

#0 0x00007f063dea0047 in openFilePath(char const*, void**, unsigned int, unsigned int) (cpFilePath=0x7ffeacc7d610 "/ssd1/lo/fedora/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", pHandle=0x342af78, uFlags=3, mode=438) at /ssd1/lo/fedora/sal/osl/unx/file.cxx:1039 #1 0x00007f063dea027b in openFile(_rtl_uString*, void**, unsigned int, unsigned int) (ustrFileURL=0x33ff7e0, pHandle=0x342af78, uFlags=3, mode=4294967295) at /ssd1/lo/fedora/sal/osl/unx/file.cxx:1071 #2 0x00007f063dea01a8 in osl_openFile(rtl_uString*, oslFileHandle*, sal_uInt32) (ustrFileURL=0x33ff7e0, pHandle=0x342af78, uFlags=3) at /ssd1/lo/fedora/sal/osl/unx/file.cxx:1050 #3 0x00007f060aec5f1a in osl::File::open(unsigned int) (this=0x342af78, uFlags=3) at /ssd1/lo/fedora/include/osl/file.hxx:975 #4 0x00007f060aec5a8f in fileaccess::ReconnectingFile::open(unsigned int) (this=0x342af78, uFlags=3) at /ssd1/lo/fedora/ucb/source/ucp/file/filrec.cxx:50 #5 0x00007f060aee0324 in fileaccess::XStream_impl::XStream_impl(rtl::OUString const&, bool) (this=0x342af10, aUncPath="file:///ssd1/lo/fedora/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", bLock=true) at /ssd1/lo/fedora/ucb/source/ucp/file/filstr.cxx:58 #6 0x00007f060aee8bac in fileaccess::TaskManager::open_rw(int, rtl::OUString const&, bool) (this=0x2c5ded0, CommandId=231, aUnqPath="file:///ssd1/lo/fedora/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", bLock=true) at /ssd1/lo/fedora/ucb/source/ucp/file/filtask.cxx:766 #7 0x00007f060ae9ba9b in fileaccess::BaseContent::open(int, com::sun::star::ucb::OpenCommandArgument2 const&) (this=0x3428810, nMyCommandIdentifier=231, aCommandArgument=...) at /ssd1/lo/fedora/ucb/source/ucp/file/bc.cxx:937 #8 0x00007f060ae99dfa in fileaccess::BaseContent::execute(com::sun::star::ucb::Command const&, int, com::sun::star::uno::Reference const&) (this=0x3428810, aCommand=..., CommandId=231, Environment=uno::Reference to (ucbhelper::CommandEnvironment *) 0x341d088) at /ssd1/lo/fedora/ucb/source/ucp/file/bc.cxx:331 #9 0x00007f060ae9d001 in non-virtual thunk to fileaccess::BaseContent::execute(com::sun::star::ucb::Command const&, int, com::sun::star::uno::Reference const&) () at /ssd1/lo/fedora/instdir/program/../program/libucpfile1.so #10 0x00007f06337395da in ucbhelper::Content_Impl::executeCommand(com::sun::star::ucb::Command const&) (this=0x3427f70, rCommand=...) at /ssd1/lo/fedora/ucbhelper/source/client/content.cxx:1258 #11 0x00007f063373be55 in ucbhelper::Content::openWriteableStream() (this=0x7ffeacc7f030) at /ssd1/lo/fedora/ucbhelper/source/client/content.cxx:751 #12 0x00007f06333f56c0 in utl::MediaDescriptor::impl_openStreamWithURL(rtl::OUString const&, bool) (this=0x7ffeacc801d0, sURL="file:///ssd1/lo/fedora/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", bLockFile=true) at /ssd1/lo/fedora/unotools/source/misc/mediadescriptor.cxx:666 #13 0x00007f06333f3e01 in utl::MediaDescriptor::impl_addInputStream(bool) (this=0x7ffeacc801d0, bLockFile=true) at /ssd1/lo/fedora/unotools/source/misc/mediadescriptor.cxx:521 #14 0x00007f06333f4051 in utl::MediaDescriptor::addInputStreamOwnLock() (this=0x7ffeacc801d0) at /ssd1/lo/fedora/unotools/source/misc/mediadescriptor.cxx:490 #15 0x00007f05b132f0bf in filter::config::TypeDetection::impl_openStream(utl::MediaDescriptor&) (this=0x33caa10, rDescriptor=...) at /ssd1/lo/fedora/filter/source/config/cache/typedetection.cxx:1127 #16 0x00007f05b132e9ac in filter::config::TypeDetection::impl_askDetectService(rtl::OUString const&, utl::MediaDescriptor&) (this=0x33caa10, sDetectService="com.sun.star.comp.filters.StorageFilterDetect", rDescriptor=...) at /ssd1/lo/fedora/filter/source/config/cache/typedetection.cxx:981 #17 0x00007f05b132b7a4 in filter::config::TypeDetection::impl_detectTypeFlatAndDeep(utl::MediaDescriptor&, std::__debug::vector > const&, bool, std::__debug::vector >&, rtl::OUString&) (this=0x33caa10, rDescriptor=..., lFlatTypes=std::__debug::vector of length 168, capacity 256 = {...}, bAllowDeep=true, rUsedDetectors=std::__debug::vector of length 1, capacity 1 = {...}, rLastChance="") at /ssd1/lo/fedora/filter/source/config/cache/typedetection.cxx:934 #18 0x00007f05b1329b7c in filter::config::TypeDetection::queryTypeByDescriptor(com::sun::star::uno::Sequence&, unsigned char) (this=0x33caa10, lDescriptor=uno::Sequence of length 6 = {...}, bAllowDeep=1 '\001') at /ssd1/lo/fedora/filter/source/config/cache/typedetection.cxx:429 #19 0x00007f05b132d321 in non-virtual thunk to filter::config::TypeDetection::queryTypeByDescriptor(com::sun::star::uno::Sequence&, unsigned char) () at /usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/stl_pair.h:331 #20 0x00007f060df5acdd in framework::LoadEnv::impl_detectTypeAndFilter() (this=0x7ffeacc80c48) at /ssd1/lo/fedora/framework/source/loadenv/loadenv.cxx:739 #21 0x00007f060df58796 in framework::LoadEnv::startLoading() (this=0x7ffeacc80c48) at /ssd1/lo/fedora/framework/source/loadenv/loadenv.cxx:357 #22 0x00007f060df57280 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) (xLoader=uno::Reference to (framework::Desktop *) 0x282bf98, xContext=uno::Reference to (cppu::ComponentContext *) 0x145b790, sURL="file:///ssd1/lo/fedora/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", sTarget="_default", nFlags=0, lArgs=uno::Sequence of length 4 = {...}) at /ssd1/lo/fedora/framework/source/loadenv/loadenv.cxx:160 #23 0x00007f060dfaef40 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) (this=0x282bf20, sURL="file:///ssd1/lo/fedora/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", sTargetFrameName="_default", nSearchFlags=0, lArguments=uno::Sequence of length 4 = {...}) at /ssd1/lo/fedora/framework/source/services/desktop.cxx:617 #24 0x00007f060dfaeffb in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) () at /ssd1/lo/fedora/include/rtl/stringutils.hxx:170 #25 0x00007f06381ee762 in SfxTemplateManagerDlg::OpenTemplateHdl(ThumbnailViewItem*) (this=0x310e160, pItem=0x33925d0) at /ssd1/lo/fedora/sfx2/source/doc/templatedlg.cxx:690

e439816281f9 Open template read-only
sfx2/source/doc/templatedlg.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share