summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-13 11:12:50 -0400
committerAndras Timar <andras.timar@collabora.com>2014-07-15 23:44:08 +0200
commit388f2fa9fcabe1b2adaff282fa9509216f3af6de (patch)
tree7f3f9bf662aaafbdcf8ed80c29cbeed8418042f5 /sw
parent1c269727b470c03f0ea538cad7e1331fd569a579 (diff)
fdo#71076, fdo#71767: Preserve number formats when charts are copied.
(cherry picked from commit 1d38cb365543924f9c50014e6b2227e77de1d0c9) Signed-off-by: Andras Timar <andras.timar@collabora.com> Conflicts: xmloff/source/chart/SchXMLExport.cxx sd/source/ui/view/sdview3.cxx chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx chart2/source/controller/main/ChartTransferable.cxx chart2/source/controller/main/ChartTransferable.hxx chart2/source/model/main/Axis.cxx chart2/source/model/template/ChartTypeTemplate.cxx chart2/source/tools/AxisHelper.cxx chart2/source/view/main/ChartView.cxx comphelper/source/container/embeddedobjectcontainer.cxx dbaccess/source/ui/browser/dbexchange.cxx dbaccess/source/ui/inc/JoinExchange.hxx dbaccess/source/ui/inc/TableRowExchange.hxx dbaccess/source/ui/inc/dbexchange.hxx dbaccess/source/ui/querydesign/JoinExchange.cxx dbaccess/source/ui/tabledesign/TableRowExchange.cxx embeddedobj/source/commonembedding/persistence.cxx embeddedobj/source/inc/commonembobj.hxx include/comphelper/embeddedobjectcontainer.hxx include/svtools/embedtransfer.hxx include/svtools/stringtransfer.hxx include/svtools/transfer.hxx include/svx/dbaexchange.hxx include/svx/dbaobjectex.hxx include/svx/fmview.hxx include/svx/galmisc.hxx include/svx/svdobj.hxx include/svx/svdoole2.hxx include/svx/svdxcgv.hxx include/svx/view3d.hxx include/svx/xmlexchg.hxx include/xmloff/xmlexp.hxx reportdesign/source/ui/dlg/GroupExchange.cxx reportdesign/source/ui/dlg/GroupExchange.hxx reportdesign/source/ui/inc/dlgedclip.hxx reportdesign/source/ui/report/dlgedclip.cxx sc/inc/column.hxx sc/source/ui/app/drwtrans.cxx sc/source/ui/app/lnktrans.cxx sc/source/ui/app/seltrans.cxx sc/source/ui/app/transobj.cxx sc/source/ui/inc/drwtrans.hxx sc/source/ui/inc/lnktrans.hxx sc/source/ui/inc/seltrans.hxx sc/source/ui/inc/transobj.hxx sc/source/ui/inc/viewfunc.hxx sc/source/ui/view/viewfun5.cxx sc/source/ui/view/viewfun7.cxx sd/source/ui/app/sdxfer.cxx sd/source/ui/dlg/sdtreelb.cxx sd/source/ui/inc/TabControl.hxx sd/source/ui/inc/View.hxx sd/source/ui/inc/sdtreelb.hxx sd/source/ui/inc/sdxfer.hxx sd/source/ui/view/sdview2.cxx sd/source/ui/view/tabcontr.cxx sfx2/source/doc/objxtor.cxx svtools/source/misc/embedtransfer.cxx svtools/source/misc/stringtransfer.cxx svtools/source/misc/transfer.cxx svtools/source/misc/transfer2.cxx svx/source/engine3d/view3d.cxx svx/source/fmcomp/dbaexchange.cxx svx/source/fmcomp/dbaobjectex.cxx svx/source/fmcomp/xmlexchg.cxx svx/source/form/fmexch.cxx svx/source/form/fmview.cxx svx/source/gallery2/galmisc.cxx svx/source/inc/fmexch.hxx svx/source/svdraw/svdoole2.cxx svx/source/svdraw/svdxcgv.cxx svx/source/tbxctrls/colrctrl.cxx sw/source/core/uibase/dochdl/swdtflvr.cxx sw/source/core/uibase/inc/swdtflvr.hxx sw/source/core/undo/unins.cxx Change-Id: If5ae8852152012483237e7602e56a0c46ea8748a (cherry picked from commit 4ee53683df4beda260aff26d2c9e56fe643f45bb) Signed-off-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/frmedt/fecopy.cxx2
-rw-r--r--sw/source/core/ole/ndole.cxx4
-rw-r--r--sw/source/core/undo/unins.cxx2
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx17
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx2
5 files changed, 18 insertions, 9 deletions
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 24743125d5f7..8c5b6b9bd862 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1509,7 +1509,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
// #i50824#
// method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel );
- pView->Paste( *pModel, aPos );
+ pView->Paste(*pModel, aPos, NULL, 0, OUString(), OUString());
sal_uLong nCnt = pView->GetMarkedObjectList().GetMarkCount();
if( nCnt )
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 0941fdbd7129..e9055853bcdb 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -458,7 +458,9 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
pPersistShell->GetEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
pSrc->GetEmbeddedObjectContainer(),
pSrc->GetEmbeddedObjectContainer().GetEmbeddedObject( aOLEObj.aName ),
- aNewName );
+ aNewName,
+ OUString(),
+ OUString());
SwOLENode* pOLENd = pDoc->GetNodes().MakeOLENode( rIdx, aNewName, GetAspect(),
(SwGrfFmtColl*)pDoc->GetDfltGrfFmtColl(),
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index f71d3f592493..b1a460b2b60c 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -460,7 +460,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
// TODO/LATER: Copying through the container would copy the replacement image as well
comphelper::EmbeddedObjectContainer aCnt;
OUString aName = aCnt.CreateUniqueObjectName();
- if ( aCnt.StoreEmbeddedObject( rSwOLE.GetOleRef(), aName, sal_True ) )
+ if (aCnt.StoreEmbeddedObject(rSwOLE.GetOleRef(), aName, true, OUString(), OUString()))
{
uno::Reference < embed::XEmbeddedObject > aNew = aCnt.GetEmbeddedObject( aName );
rDoc.Insert( rContext.GetRepeatPaM(),
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 028e7ba6c4e1..2b7ee20e76fd 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -392,7 +392,7 @@ namespace
}
}
-sal_Bool SwTransferable::GetData( const DataFlavor& rFlavor )
+sal_Bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
@@ -488,7 +488,7 @@ sal_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 );
}
@@ -1713,7 +1713,13 @@ int 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
@@ -1780,8 +1786,9 @@ int 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/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index 0b30053bf639..e03625e166df 100644
--- a/sw/source/ui/inc/swdtflvr.hxx
+++ b/sw/source/ui/inc/swdtflvr.hxx
@@ -138,7 +138,7 @@ class SW_DLLPUBLIC SwTransferable : public TransferableHelper
protected:
virtual void AddSupportedFormats();
- virtual sal_Bool GetData( const css::datatransfer::DataFlavor& rFlavor );
+ virtual sal_Bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm,
void* pUserObject,
sal_uInt32 nUserObjectId,