[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sfx2/source

Tor Lillqvist tml at collabora.com
Wed May 23 11:23:11 UTC 2018


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

New commits:
commit 30bdedc49f7007ce0305d013ac89c910c6cb1ae4
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue May 22 11:00:35 2018 +0300

    Open template read-only
    
    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<com::sun::star::ucb::XCommandEnvironment> 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<com::sun::star::ucb::XCommandEnvironment> 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<filter::config::FlatDetectionInfo, std::allocator<filter::config::FlatDetectionInfo> > const&, bool, std::__debug::vector<rtl::OUString, std::allocator<rtl::OUString> >&, 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<com::sun::star::beans::PropertyValue>&, 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<com::sun::star::beans::PropertyValue>&, 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<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> 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<com::sun::star::beans::PropertyValue> 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<com::sun::star::beans::PropertyValue> 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
    
    Change-Id: Iaa5cc2bd4c80bc239b8f1bf7ed8aa62d89151d62
    (cherry picked from commit e439816281f9fe24c7332b5f1e16df845f5213f2)
    Reviewed-on: https://gerrit.libreoffice.org/54686
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c5612f1b6c0b..8861f89c7c8d 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -673,7 +673,7 @@ IMPL_LINK(SfxTemplateManagerDlg, CreateContextMenuHdl, ThumbnailViewItem*, pItem
 
 IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem, void)
 {
-    uno::Sequence< PropertyValue > aArgs(4);
+    uno::Sequence< PropertyValue > aArgs(5);
     aArgs[0].Name = "AsTemplate";
     aArgs[0].Value <<= true;
     aArgs[1].Name = "MacroExecutionMode";
@@ -682,6 +682,8 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem, voi
     aArgs[2].Value <<= UpdateDocMode::ACCORDING_TO_CONFIG;
     aArgs[3].Name = "InteractionHandler";
     aArgs[3].Value <<= task::InteractionHandler::createWithParent( ::comphelper::getProcessComponentContext(), nullptr );
+    aArgs[4].Name = "ReadOnly";
+    aArgs[4].Value <<= true;
 
     TemplateViewItem *pTemplateItem = static_cast<TemplateViewItem*>(pItem);
 


More information about the Libreoffice-commits mailing list