[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 2 commits - solenv/bin sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 18:31:51 UTC 2018


 solenv/bin/native-code.py         |    3 ++-
 sw/source/uibase/uiview/view2.cxx |   25 ++++++++++++++++++++-----
 2 files changed, 22 insertions(+), 6 deletions(-)

New commits:
commit e1d8a49f22974d872689bda954142169657b8f2b
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Nov 29 15:04:06 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Nov 29 19:27:28 2018 +0200

    Make use of SwView::InsertGraphicDlg() in the mobile app case work
    
    Despite the name of the function, when inserting an image that we
    already know the file name for, we don't actually need to invoke any
    interactive file dialog (file picker). We don't build any file picker
    for non-desktop platforms anyway, so make sure this code does not
    crash in trying to access a such.
    
    Change-Id: I91cc8c4d9dac26e66f4f852c3d84f5c778c90644

diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 2aa049792735..838eedb603ea 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -284,13 +284,21 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
 {
     bool bReturn = false;
     SwDocShell* pDocShell = GetDocShell();
-    const sal_uInt16 nHtmlMode = ::GetHtmlMode(pDocShell);
+    SwDoc* pDoc = pDocShell->GetDoc();
+
+    OUString sGraphicFormat = SwResId(STR_POOLFRM_GRAPHIC);
+
+// No file pickers in a non-desktop (mobile app) build.
+
+#if HAVE_FEATURE_DESKTOP
     // when in HTML mode insert only as a link
+    const sal_uInt16 nHtmlMode = ::GetHtmlMode(pDocShell);
     std::unique_ptr<FileDialogHelper> pFileDlg(new FileDialogHelper(
         ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE,
         FileDialogFlags::Graphic, GetWindow()));
     pFileDlg->SetTitle(SwResId(STR_INSERT_GRAPHIC ));
     pFileDlg->SetContext( FileDialogHelper::SW_INSERT_GRAPHIC );
+
     uno::Reference < XFilePicker3 > xFP = pFileDlg->GetFilePicker();
     uno::Reference < XFilePickerControlAccess > xCtrlAcc(xFP, UNO_QUERY);
     if(nHtmlMode & HTMLMODE_ON)
@@ -300,7 +308,6 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
     }
 
     std::vector<OUString> aFormats;
-    SwDoc* pDoc = pDocShell->GetDoc();
     const size_t nArrLen = pDoc->GetFrameFormats()->size();
     for( size_t i = 0; i < nArrLen; ++i )
     {
@@ -325,7 +332,6 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
     Sequence<OUString> aListBoxEntries(aFormats.size());
     OUString* pEntries = aListBoxEntries.getArray();
     sal_Int16 nSelect = 0;
-    OUString sGraphicFormat = SwResId(STR_POOLFRM_GRAPHIC);
     for( size_t i = 0; i < aFormats.size(); ++i )
     {
         pEntries[i] = aFormats[i];
@@ -347,10 +353,15 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
     {
         OSL_FAIL("control access failed");
     }
+#endif
 
     const SfxStringItem* pName = rReq.GetArg<SfxStringItem>(SID_INSERT_GRAPHIC);
     bool bShowError = !pName;
-    if( pName || ERRCODE_NONE == pFileDlg->Execute() )
+    if( pName
+#if HAVE_FEATURE_DESKTOP
+        || ERRCODE_NONE == pFileDlg->Execute()
+#endif
+        )
     {
 
         OUString aFileName, aFilterName;
@@ -361,6 +372,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
             if ( pFilter )
                 aFilterName = pFilter->GetValue();
         }
+#if HAVE_FEATURE_DESKTOP
         else
         {
             aFileName = pFileDlg->GetPath();
@@ -392,11 +404,13 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
             }
             rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
         }
-
         const SfxBoolItem* pAsLink = rReq.GetArg<SfxBoolItem>(FN_PARAM_1);
         const SfxStringItem* pStyle = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
+#endif
 
         bool bAsLink = false;
+
+#if HAVE_FEATURE_DESKTOP
         if( nHtmlMode & HTMLMODE_ON )
             bAsLink = true;
         else
@@ -432,6 +446,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
                     bAsLink=false; // don't store as link
             }
         }
+#endif
 
         SwWrtShell& rSh = GetWrtShell();
         rSh.LockPaint();
commit 10881c6163ad37d4cfbe0670525a5ce300fdb0a7
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Nov 29 15:33:31 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Nov 29 19:27:21 2018 +0200

    We need svt, too, in the iOS app, for the image insertion feature
    
    Change-Id: I5a656ab159eec44a537fc22da03763913372bc8f

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 82c030ff79b5..ab321135dd78 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -61,7 +61,8 @@ core_factory_list = [
     ("libxmlscriptlo.a", "xmlscript_component_getFactory"),
     ("libmcnttype.a", "mcnttype_component_getFactory"),
     ("libvcllo.a", "vcl_component_getFactory"),
-    ("libspelllo.a", "spell_component_getFactory")
+    ("libspelllo.a", "spell_component_getFactory"),
+    ("libsvtlo.a", "svt_component_getFactory")
     ]
 
 core_constructor_list = [


More information about the Libreoffice-commits mailing list