summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-06 15:04:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-07 06:58:42 +0000
commit20ab6da2ce6ed5728683b6cfc1dbe11a2f676ae0 (patch)
tree528855f6d9379afe57f8225cc1985beeacd13ee8 /sd
parent2f4ccccc6b2256450b49ba9c8871fb5fc967b199 (diff)
no need to allocate these separately
they are all one or two words in size Change-Id: I701be7fd8bd4402af9c7b1473c9f4b3c8a9c0e90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148339 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/app/sdxfer.cxx18
-rw-r--r--sd/source/ui/inc/sdxfer.hxx4
2 files changed, 11 insertions, 11 deletions
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 2e048542f9b6..a6cf586eef65 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -130,7 +130,7 @@ SdTransferable::~SdTransferable()
delete mpSdDrawDocumentIntern;
moGraphic.reset();
- mpBookmark.reset();
+ moBookmark.reset();
mpImageMap.reset();
mpVDev.disposeAndClear();
@@ -147,7 +147,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
mpOLEDataHelper.reset();
moGraphic.reset();
- mpBookmark.reset();
+ moBookmark.reset();
mpImageMap.reset();
if( auto pOleObj = dynamic_cast< SdrOle2Obj* >( pObj ) )
@@ -200,7 +200,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
xPropSet->getPropertyValue( "Label" ) >>= aLabel;
xPropSet->getPropertyValue( "TargetURL" ) >>= aURL;
- mpBookmark.reset( new INetBookmark( aURL, aLabel ) );
+ moBookmark.emplace( aURL, aLabel );
}
}
}
@@ -226,7 +226,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
// when both are unused
if(!pObj->HasFillStyle() && !pObj->HasLineStyle())
{
- mpBookmark.reset( new INetBookmark( pURL->GetURL(), pURL->GetRepresentation() ) );
+ moBookmark.emplace( pURL->GetURL(), pURL->GetRepresentation() );
}
}
}
@@ -413,7 +413,7 @@ void SdTransferable::AddSupportedFormats()
AddFormat( SotClipboardFormatId::BITMAP );
}
}
- else if( mpBookmark )
+ else if( moBookmark )
{
AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
AddFormat( SotClipboardFormatId::STRING );
@@ -518,9 +518,9 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
mpSdDrawDocumentIntern->SetOnlineSpell(true);
}
}
- else if( ( nFormat == SotClipboardFormatId::STRING ) && mpBookmark )
+ else if( ( nFormat == SotClipboardFormatId::STRING ) && moBookmark )
{
- bOK = SetString( mpBookmark->GetURL() );
+ bOK = SetString( moBookmark->GetURL() );
}
else if( ( nFormat == SotClipboardFormatId::SVXB ) && moGraphic )
{
@@ -530,9 +530,9 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
{
bOK = SetImageMap( *mpImageMap );
}
- else if( mpBookmark )
+ else if( moBookmark )
{
- bOK = SetINetBookmark( *mpBookmark, rFlavor );
+ bOK = SetINetBookmark( *moBookmark, rFlavor );
}
else if( nFormat == SotClipboardFormatId::EMBED_SOURCE )
{
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index fd949aef5400..46418992ba1d 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -24,11 +24,11 @@
#include <vcl/vclptr.hxx>
#include <sfx2/objsh.hxx>
#include <svl/lstner.hxx>
+#include <svl/urlbmk.hxx>
// SdTransferable
class SdDrawDocument;
class SdrObject;
-class INetBookmark;
class ImageMap;
class VirtualDevice;
@@ -122,7 +122,7 @@ private:
SdDrawDocument* mpSdDrawDocumentIntern;
SdDrawDocument* mpSourceDoc;
VclPtr<VirtualDevice> mpVDev;
- std::unique_ptr<INetBookmark> mpBookmark;
+ std::optional<INetBookmark> moBookmark;
std::optional<Graphic> moGraphic;
std::unique_ptr<ImageMap> mpImageMap;
::tools::Rectangle maVisArea;