[Libreoffice-commits] core.git: include/svtools svtools/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Sun Jan 7 02:24:47 UTC 2018
include/svtools/grfmgr.hxx | 4 +++-
svtools/source/graphic/grfmgr.cxx | 13 ++++++++++---
2 files changed, 13 insertions(+), 4 deletions(-)
New commits:
commit 0189792bd8837057e853a48499b4d59f9149490f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Thu Jan 4 15:13:59 2018 +0900
SAL_WARN when using the interal GraphicObject URL
Write a warn if a URL is created from a internal GraphicObject
URL as this is now deprecated.
Extract the way to determine if a URL is internal to its own
function, so it can be used to check and rewrite places that use
it.
Change-Id: Iedf13a596eab839094ea98e41787865bf6783adf
Reviewed-on: https://gerrit.libreoffice.org/47495
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index f5208d7f04f5..993d13dd117a 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -465,7 +465,9 @@ public:
void StopAnimation( OutputDevice* pOut = nullptr, long nExtraData = 0 );
- static GraphicObject CreateGraphicObjectFromURL( const OUString &rURL );
+ static bool isGraphicObjectUniqueIdURL(OUString const & rURL);
+ static GraphicObject CreateGraphicObjectFromURL(OUString const & rURL);
+
// will inspect an object ( e.g. a control ) for any 'ImageURL'
// properties and return these in a vector. Note: this implementation
// will cater for XNameContainer objects and deep inspect any containers
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 5d20b4128c6a..210206d52553 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1039,11 +1039,18 @@ IMPL_LINK_NOARG(GraphicObject, ImplAutoSwapOutHdl, Timer *, void)
#define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
-GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL )
+bool GraphicObject::isGraphicObjectUniqueIdURL(OUString const & rURL)
{
- const OUString aPrefix( UNO_NAME_GRAPHOBJ_URLPREFIX );
- if( rURL.startsWith( aPrefix ) )
+ const OUString aPrefix(UNO_NAME_GRAPHOBJ_URLPREFIX);
+ return rURL.startsWith(aPrefix);
+}
+
+GraphicObject GraphicObject::CreateGraphicObjectFromURL(OUString const & rURL)
+{
+ if (GraphicObject::isGraphicObjectUniqueIdURL(rURL))
{
+ SAL_WARN("vcl", "Deprecated URL '" << rURL << "' was used to create a GraphicObject");
+
// graphic manager url
OString aUniqueID(OUStringToOString(rURL.copy(sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX) - 1), RTL_TEXTENCODING_UTF8));
return GraphicObject( aUniqueID );
More information about the Libreoffice-commits
mailing list