documentLoadWithOptions takes URLs
m_aDocPath is set in lok_doc_view_set_property from data coming from gtv_application_open's calls to g_file_get_path. So the path is not a proper file URL, which is expected by documentLoadWithOptions. Some Linux paths can happen to be able to convert to absolute URL in rtl::Uri::convertRelToAbs, but not all, and not e.g. Windows paths. Change-Id: I0a17cb84000603336a6809b0179bbda3d54aec23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141579 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
848f9b2c56
commit
84552eaf8c
1 changed files with 7 additions and 1 deletions
|
@ -2349,7 +2349,13 @@ openDocumentInThread (gpointer data)
|
|||
}
|
||||
|
||||
priv->m_pOffice->pClass->registerCallback(priv->m_pOffice, globalCallbackWorker, pDocView);
|
||||
priv->m_pDocument = priv->m_pOffice->pClass->documentLoadWithOptions( priv->m_pOffice, priv->m_aDocPath.c_str(), "en-US" );
|
||||
std::string url = priv->m_aDocPath;
|
||||
if (gchar* pURL = g_filename_to_uri(url.c_str(), nullptr, nullptr))
|
||||
{
|
||||
url = pURL;
|
||||
g_free(pURL);
|
||||
}
|
||||
priv->m_pDocument = priv->m_pOffice->pClass->documentLoadWithOptions( priv->m_pOffice, url.c_str(), "en-US" );
|
||||
if ( !priv->m_pDocument )
|
||||
{
|
||||
char *pError = priv->m_pOffice->pClass->getError( priv->m_pOffice );
|
||||
|
|
Loading…
Reference in a new issue