summaryrefslogtreecommitdiffstats
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-13 11:12:50 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-06-19 14:46:56 -0400
commit1d38cb365543924f9c50014e6b2227e77de1d0c9 (patch)
tree1e77d0d2f82330f16c09cda60864824397d132c4 /sw/source/uibase
parentUse define constant to keep track of all NumberFormat property usage. (diff)
downloadcore-1d38cb365543924f9c50014e6b2227e77de1d0c9.tar.gz
core-1d38cb365543924f9c50014e6b2227e77de1d0c9.zip
fdo#71076, fdo#71767: Preserve number formats when charts are copied.
Change-Id: If5ae8852152012483237e7602e56a0c46ea8748a
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx17
-rw-r--r--sw/source/uibase/inc/swdtflvr.hxx2
2 files changed, 13 insertions, 6 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 13cf00612798..9d33a7068e09 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -396,7 +396,7 @@ namespace
}
}
-bool SwTransferable::GetData( const DataFlavor& rFlavor )
+bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
@@ -492,7 +492,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor )
if( xObj.is() )
{
TransferableDataHelper aD( new SvEmbedTransferHelper( xObj, pOLEGraph, nAspect ) );
- uno::Any aAny( aD.GetAny( rFlavor ));
+ uno::Any aAny = aD.GetAny(rFlavor, rDestDoc);
if( aAny.hasValue() )
bOK = SetAny( aAny, rFlavor );
}
@@ -1716,7 +1716,13 @@ bool SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
else
nId = 0;
- if( nId && rData.GetInputStream( nId, xStrm ) && xStrm.is() )
+ if (nId)
+ {
+ SwDocShell* pDocSh = rSh.GetDoc()->GetDocShell();
+ xStrm = rData.GetInputStream(nId, SfxObjectShell::CreateShellID(pDocSh));
+ }
+
+ if (xStrm.is())
{
// if there is an embedded object, first try if it's a writer object
// this will be inserted into the document by using a Reader
@@ -1783,8 +1789,9 @@ bool SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
{
if( rData.HasFormat( nFmt = SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE ) && rData.GetTransferableObjectDescriptor( nFmt, aObjDesc ) )
{
- if ( !rData.GetInputStream( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, xStrm ) )
- rData.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, xStrm );
+ xStrm = rData.GetInputStream(SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, OUString());
+ if (!xStrm.is())
+ xStrm = rData.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, OUString());
if ( !xStrm.is() )
{
diff --git a/sw/source/uibase/inc/swdtflvr.hxx b/sw/source/uibase/inc/swdtflvr.hxx
index c5d3b6e6a6ec..de20e748dca0 100644
--- a/sw/source/uibase/inc/swdtflvr.hxx
+++ b/sw/source/uibase/inc/swdtflvr.hxx
@@ -137,7 +137,7 @@ class SW_DLLPUBLIC SwTransferable : public TransferableHelper
protected:
virtual void AddSupportedFormats() SAL_OVERRIDE;
- virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
+ virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
virtual bool WriteObject( SotStorageStreamRef& rxOStm,
void* pUserObject,
sal_uInt32 nUserObjectId,