summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-10-13 14:42:33 +0200
committerGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-10-13 15:03:50 +0000
commitf8857f30cbf7124ca01355f32998c11cb1843950 (patch)
tree918a3e06c2a84f2db8c865335a3b2e29b079bf48
parent3cac16941b775e02159af75d9b390b7dcc08d7ec (diff)
Related: tdf#90700, fix the link validity check in ww8 sw filter
As written, it would never have worked with http links. This function seems only used in DOC import documents. Change-Id: Ibc02f41245ea4c9e9155fc838e67404b34c5fa8f Reviewed-on: https://gerrit.libreoffice.org/29772 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 486845083f0f..327368f584ec 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2328,10 +2328,21 @@ bool CanUseRemoteLink(const OUString &rGrfName)
::ucbhelper::Content aCnt(rGrfName,
static_cast< ucb::XCommandEnvironment* >(pCommandEnv),
comphelper::getProcessComponentContext());
- OUString aTitle;
- aCnt.getPropertyValue("Title") >>= aTitle;
- bUseRemote = !aTitle.isEmpty();
+ if ( !INetURLObject( rGrfName ).isAnyKnownWebDAVScheme() )
+ {
+ OUString aTitle;
+ aCnt.getPropertyValue("Title") >>= aTitle;
+ bUseRemote = !aTitle.isEmpty();
+ }
+ else
+ {
+ // is a link to a WebDAV resource
+ // need to use MediaType to check for link usability
+ OUString aMediaType;
+ aCnt.getPropertyValue("MediaType") >>= aMediaType;
+ bUseRemote = !aMediaType.isEmpty();
+ }
}
catch ( ... )
{