summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-05-08 16:49:06 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-05-08 17:12:53 +0200
commit12bb6a054d697efddee76269605ed2450a2fae9c (patch)
tree80710148c5f9a59f51162c4a20eb8ff3ce59200f /dbaccess
parent40ad68bbe7cd1c86a8ebefb1539fb7b403506792 (diff)
dbaccess, sw: use vnd.sun.star.pkg:// for embedded data source handling
Change-Id: I69eaf2e4dd051d62f56caef962d40889cc3a3876
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 4e6c185e1943..2332ced91a30 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -315,9 +315,15 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rNa
OUString _sURL(rURL);
INetURLObject aURL( _sURL );
- OUString aMark = aURL.GetMark(INetURLObject::DECODE_WITH_CHARSET);
- if (!aMark.isEmpty())
- _sURL = aURL.GetURLNoMark();
+ OUString sStreamRelPath;
+ if (_sURL.startsWithIgnoreAsciiCase("vnd.sun.star.pkg:"))
+ {
+ // In this case the host contains the real path, and the the path is the embedded stream name.
+ _sURL = aURL.GetHost(INetURLObject::DECODE_WITH_CHARSET);
+ sStreamRelPath = aURL.GetURLPath(INetURLObject::DECODE_WITH_CHARSET);
+ if (sStreamRelPath.startsWith("/"))
+ sStreamRelPath = sStreamRelPath.copy(1);
+ }
if ( aURL.GetProtocol() == INetProtocol::NotValid )
throw NoSuchElementException( _rName, *this );
@@ -367,8 +373,8 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rNa
aArgs.put( "URL", _sURL );
aArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG );
aArgs.put( "InteractionHandler", task::InteractionHandler::createWithParent(m_aContext, 0) );
- if (!aMark.isEmpty())
- aArgs.put("StreamRelPath", aMark);
+ if (!sStreamRelPath.isEmpty())
+ aArgs.put("StreamRelPath", sStreamRelPath);
Sequence< PropertyValue > aResource( aArgs.getPropertyValues() );
xLoad->load( aResource );