Kaydet (Commit) a5089710 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

replace originURL with GraphicExternalLink class (internally)

For now just introduce the GraphicExternalLink internally in
ImpGraphic, and use it for the origin URL. In a future patch this
will store additional data about the link.

Change-Id: I7b4edac80d0e71603d37243ff28bcac1b18fdc01
Reviewed-on: https://gerrit.libreoffice.org/52393Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 11163faa
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_VCL_GRAPHIC_EXTERNAL_LINK_HXX
#define INCLUDED_VCL_GRAPHIC_EXTERNAL_LINK_HXX
#include <memory>
#include <vcl/dllapi.h>
class VCL_DLLPUBLIC GraphicExternalLink
{
public:
OUString msURL;
GraphicExternalLink() {}
GraphicExternalLink(OUString const& rURL)
: msURL(rURL)
{
}
};
#endif // INCLUDED_VCL_GRAPHIC_EXTERNAL_LINK_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#ifndef INCLUDED_VCL_INC_IMPGRAPH_HXX #ifndef INCLUDED_VCL_INC_IMPGRAPH_HXX
#define INCLUDED_VCL_INC_IMPGRAPH_HXX #define INCLUDED_VCL_INC_IMPGRAPH_HXX
#include <vcl/GraphicExternalLink.hxx>
struct ImpSwapInfo struct ImpSwapInfo
{ {
MapMode maPrefMapMode; MapMode maPrefMapMode;
...@@ -76,8 +78,8 @@ private: ...@@ -76,8 +78,8 @@ private:
bool mbDummyContext; bool mbDummyContext;
VectorGraphicDataPtr maVectorGraphicData; VectorGraphicDataPtr maVectorGraphicData;
css::uno::Sequence<sal_Int8> maPdfData; css::uno::Sequence<sal_Int8> maPdfData;
OUString msOriginURL;
std::unique_ptr<GraphicID> mpGraphicID; std::unique_ptr<GraphicID> mpGraphicID;
GraphicExternalLink maGraphicExternalLink;
private: private:
...@@ -100,12 +102,12 @@ private: ...@@ -100,12 +102,12 @@ private:
OUString getOriginURL() const OUString getOriginURL() const
{ {
return msOriginURL; return maGraphicExternalLink.msURL;
} }
void setOriginURL(OUString const & rOriginURL) void setOriginURL(OUString const & rOriginURL)
{ {
msOriginURL = rOriginURL; maGraphicExternalLink.msURL = rOriginURL;
} }
OString getUniqueID() OString getUniqueID()
......
...@@ -191,7 +191,7 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic) ...@@ -191,7 +191,7 @@ ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic)
, mbDummyContext(rImpGraphic.mbDummyContext) , mbDummyContext(rImpGraphic.mbDummyContext)
, maVectorGraphicData(rImpGraphic.maVectorGraphicData) , maVectorGraphicData(rImpGraphic.maVectorGraphicData)
, maPdfData(rImpGraphic.maPdfData) , maPdfData(rImpGraphic.maPdfData)
, msOriginURL(rImpGraphic.msOriginURL) , maGraphicExternalLink(rImpGraphic.maGraphicExternalLink)
{ {
if( rImpGraphic.mpGfxLink ) if( rImpGraphic.mpGfxLink )
mpGfxLink = o3tl::make_unique<GfxLink>( *rImpGraphic.mpGfxLink ); mpGfxLink = o3tl::make_unique<GfxLink>( *rImpGraphic.mpGfxLink );
...@@ -217,7 +217,7 @@ ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic) ...@@ -217,7 +217,7 @@ ImpGraphic::ImpGraphic(ImpGraphic&& rImpGraphic)
, mbDummyContext(rImpGraphic.mbDummyContext) , mbDummyContext(rImpGraphic.mbDummyContext)
, maVectorGraphicData(std::move(rImpGraphic.maVectorGraphicData)) , maVectorGraphicData(std::move(rImpGraphic.maVectorGraphicData))
, maPdfData(std::move(rImpGraphic.maPdfData)) , maPdfData(std::move(rImpGraphic.maPdfData))
, msOriginURL(rImpGraphic.msOriginURL) , maGraphicExternalLink(rImpGraphic.maGraphicExternalLink)
{ {
rImpGraphic.ImplClear(); rImpGraphic.ImplClear();
rImpGraphic.mbDummyContext = false; rImpGraphic.mbDummyContext = false;
...@@ -284,7 +284,7 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic ) ...@@ -284,7 +284,7 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
maSwapInfo = rImpGraphic.maSwapInfo; maSwapInfo = rImpGraphic.maSwapInfo;
mpContext = rImpGraphic.mpContext; mpContext = rImpGraphic.mpContext;
mbDummyContext = rImpGraphic.mbDummyContext; mbDummyContext = rImpGraphic.mbDummyContext;
msOriginURL = rImpGraphic.msOriginURL; maGraphicExternalLink = rImpGraphic.maGraphicExternalLink;
mpAnimation.reset(); mpAnimation.reset();
...@@ -328,7 +328,7 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic) ...@@ -328,7 +328,7 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& rImpGraphic)
mpGfxLink = std::move(rImpGraphic.mpGfxLink); mpGfxLink = std::move(rImpGraphic.mpGfxLink);
maVectorGraphicData = std::move(rImpGraphic.maVectorGraphicData); maVectorGraphicData = std::move(rImpGraphic.maVectorGraphicData);
maPdfData = std::move(rImpGraphic.maPdfData); maPdfData = std::move(rImpGraphic.maPdfData);
msOriginURL = rImpGraphic.msOriginURL; maGraphicExternalLink = rImpGraphic.maGraphicExternalLink;
rImpGraphic.ImplClear(); rImpGraphic.ImplClear();
rImpGraphic.mbDummyContext = false; rImpGraphic.mbDummyContext = false;
...@@ -448,7 +448,7 @@ void ImpGraphic::ImplClear() ...@@ -448,7 +448,7 @@ void ImpGraphic::ImplClear()
ImplClearGraphics(); ImplClearGraphics();
meType = GraphicType::NONE; meType = GraphicType::NONE;
mnSizeBytes = 0; mnSizeBytes = 0;
msOriginURL.clear(); maGraphicExternalLink.msURL.clear();
} }
void ImpGraphic::ImplSetDefaultType() void ImpGraphic::ImplSetDefaultType()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment