summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/engine3d/view3d.cxx6
-rw-r--r--svx/source/fmcomp/dbaexchange.cxx16
-rw-r--r--svx/source/fmcomp/dbaobjectex.cxx5
-rw-r--r--svx/source/fmcomp/xmlexchg.cxx2
-rw-r--r--svx/source/form/fmexch.cxx11
-rw-r--r--svx/source/form/fmview.cxx7
-rw-r--r--svx/source/gallery2/galmisc.cxx2
-rw-r--r--svx/source/inc/fmexch.hxx4
-rw-r--r--svx/source/svdraw/svdobj.cxx5
-rw-r--r--svx/source/svdraw/svdoole2.cxx23
-rw-r--r--svx/source/svdraw/svdxcgv.cxx6
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx4
12 files changed, 53 insertions, 38 deletions
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 3aee208d33ae..f0bbd32b40f8 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -441,7 +441,9 @@ SdrModel* E3dView::GetMarkedObjModel() const
// When pasting objects have to integrated if a scene is inserted, but
// not the scene itself
-sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+sal_Bool E3dView::Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID )
{
sal_Bool bRetval = sal_False;
@@ -486,7 +488,7 @@ sal_Bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLs
else
{
// call parent
- bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions);
+ bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
}
return bRetval;
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index ff0e74f6584e..01a78453c3f2 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -223,8 +223,7 @@ namespace svx
AddFormat(getDescriptorFormatId());
}
- //--------------------------------------------------------------------
- sal_Bool OColumnTransferable::GetData( const DataFlavor& _rFlavor )
+ sal_Bool OColumnTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
{
const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
switch (nFormatId)
@@ -276,7 +275,7 @@ namespace svx
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(), aFlavor);
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
- Any aDescriptor = _rData.GetAny(aFlavor);
+ Any aDescriptor = _rData.GetAny(aFlavor, OUString());
// extract the property value sequence
Sequence< PropertyValue > aDescriptorProps;
@@ -468,8 +467,7 @@ namespace svx
AddFormat(SOT_FORMATSTR_ID_SBA_DATAEXCHANGE);
}
- // -----------------------------------------------------------------------------
- sal_Bool ODataAccessObjectTransferable::GetData( const DataFlavor& rFlavor )
+ sal_Bool ODataAccessObjectTransferable::GetData( const DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uIntPtr nFormat = SotExchange::GetFormat(rFlavor);
switch (nFormat)
@@ -524,7 +522,7 @@ namespace svx
SotExchange::GetFormatDataFlavor(nKnownFormatId, aFlavor);
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
- Any aDescriptor = _rData.GetAny(aFlavor);
+ Any aDescriptor = _rData.GetAny(aFlavor, OUString());
// extract the property value sequence
Sequence< PropertyValue > aDescriptorProps;
@@ -643,8 +641,8 @@ namespace svx
{
AddFormat(getDescriptorFormatId());
}
- //--------------------------------------------------------------------
- sal_Bool OMultiColumnTransferable::GetData( const DataFlavor& _rFlavor )
+
+ sal_Bool OMultiColumnTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
{
const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
if (nFormatId == getDescriptorFormatId())
@@ -682,7 +680,7 @@ namespace svx
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(), aFlavor);
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
- _rData.GetAny(aFlavor) >>= aList;
+ _rData.GetAny(aFlavor, OUString()) >>= aList;
} // if (_rData.HasFormat(getDescriptorFormatId()))
return aList;
}
diff --git a/svx/source/fmcomp/dbaobjectex.cxx b/svx/source/fmcomp/dbaobjectex.cxx
index 2d5be88f04b0..353465940b7c 100644
--- a/svx/source/fmcomp/dbaobjectex.cxx
+++ b/svx/source/fmcomp/dbaobjectex.cxx
@@ -89,8 +89,7 @@ namespace svx
AddFormat(getDescriptorFormatId(bForm));
}
- //--------------------------------------------------------------------
- sal_Bool OComponentTransferable::GetData( const DataFlavor& _rFlavor )
+ sal_Bool OComponentTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
{
const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
if ( nFormatId == getDescriptorFormatId(sal_True) || nFormatId == getDescriptorFormatId(sal_False) )
@@ -131,7 +130,7 @@ namespace svx
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(bForm), aFlavor);
OSL_ENSURE(bSuccess, "OComponentTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
- Any aDescriptor = _rData.GetAny(aFlavor);
+ Any aDescriptor = _rData.GetAny(aFlavor, OUString());
// extract the property value sequence
Sequence< PropertyValue > aDescriptorProps;
diff --git a/svx/source/fmcomp/xmlexchg.cxx b/svx/source/fmcomp/xmlexchg.cxx
index fecc0e6f158f..fe94b029234f 100644
--- a/svx/source/fmcomp/xmlexchg.cxx
+++ b/svx/source/fmcomp/xmlexchg.cxx
@@ -43,7 +43,7 @@ namespace svx
AddFormat( SOT_FORMATSTR_ID_XFORMS );
}
//--------------------------------------------------------------------
- sal_Bool OXFormsTransferable::GetData( const DataFlavor& _rFlavor )
+ sal_Bool OXFormsTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
{
const sal_uInt32 nFormatId = SotExchange::GetFormat( _rFlavor );
if ( SOT_FORMATSTR_ID_XFORMS == nFormatId )
diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx
index c137183caf2f..6a074a4370d7 100644
--- a/svx/source/form/fmexch.cxx
+++ b/svx/source/form/fmexch.cxx
@@ -115,7 +115,7 @@ namespace svxform
}
//--------------------------------------------------------------------
- sal_Bool OLocalExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& /*_rFlavor*/ )
+ sal_Bool OLocalExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& /*_rFlavor*/, const OUString& /*rDestDoc*/ )
{
return sal_False; // do not have any formats by default
}
@@ -139,7 +139,7 @@ namespace svxform
if ( OControlExchange::hasControlPathFormat( aExchangedData.GetDataFlavorExVector() ) )
{ // paths to the controls, relative to a root
Sequence< Any > aControlPathData;
- if ( aExchangedData.GetAny( OControlExchange::getControlPathFormatId() ) >>= aControlPathData )
+ if ( aExchangedData.GetAny(OControlExchange::getControlPathFormatId(), OUString()) >>= aControlPathData )
{
DBG_ASSERT( aControlPathData.getLength() >= 2, "OControlTransferData::OControlTransferData: invalid data for the control path format!" );
if ( aControlPathData.getLength() >= 2 )
@@ -155,7 +155,7 @@ namespace svxform
}
if ( OControlExchange::hasHiddenControlModelsFormat( aExchangedData.GetDataFlavorExVector() ) )
{ // sequence of models of hidden controls
- aExchangedData.GetAny( OControlExchange::getHiddenControlModelsFormatId() ) >>= m_aHiddenControlModels;
+ aExchangedData.GetAny(OControlExchange::getHiddenControlModelsFormatId(), OUString()) >>= m_aHiddenControlModels;
}
updateFormats( );
@@ -289,8 +289,7 @@ namespace svxform
{
}
- //--------------------------------------------------------------------
- sal_Bool OControlExchange::GetData( const DataFlavor& _rFlavor )
+ sal_Bool OControlExchange::GetData( const DataFlavor& _rFlavor, const OUString& rDestDoc )
{
const sal_uInt32 nFormatId = SotExchange::GetFormat( _rFlavor );
@@ -310,7 +309,7 @@ namespace svxform
SetAny( makeAny( m_aHiddenControlModels ), _rFlavor );
}
else
- return OLocalExchange::GetData( _rFlavor );
+ return OLocalExchange::GetData(_rFlavor, rDestDoc);
return sal_True;
}
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 83c6709f3476..3f5b8f1c1c98 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -379,13 +379,6 @@ SdrModel* FmFormView::GetMarkedObjModel() const
return E3dView::GetMarkedObjModel();
}
-//------------------------------------------------------------------------
-sal_Bool FmFormView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
-{
- return E3dView::Paste(rMod, rPos, pLst, nOptions);
-}
-
-//------------------------------------------------------------------------
void FmFormView::ActivateControls(SdrPageView* pPageView)
{
if (!pPageView)
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index fca950f8660f..8adad0dbd473 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -512,7 +512,7 @@ void GalleryTransferable::AddSupportedFormats()
}
}
-sal_Bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor )
+sal_Bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
sal_Bool bRet = sal_False;
diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx
index e2c9a84e412a..6c59ffb0316d 100644
--- a/svx/source/inc/fmexch.hxx
+++ b/svx/source/inc/fmexch.hxx
@@ -79,7 +79,7 @@ namespace svxform
// TransferableHelper
virtual void DragFinished( sal_Int8 nDropAction );
- virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
private:
void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions, sal_Int32 nDragPointer = DND_POINTER_NONE, sal_Int32 nDragImage = DND_IMAGE_NONE )
@@ -222,7 +222,7 @@ namespace svxform
inline static sal_Bool hasHiddenControlModelsFormat( const DataFlavorExVector& _rFormats );
protected:
- virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
virtual void AddSupportedFormats();
};
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index b495c5b98b8f..d821757035d3 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1064,6 +1064,11 @@ SdrObject* SdrObject::Clone() const
return CloneHelper< SdrObject >();
}
+SdrObject* SdrObject::CloneWithShellIDs( const OUString& /*rSrcShellID*/, const OUString& /*rDestShellID*/ ) const
+{
+ return Clone();
+}
+
SdrObject& SdrObject::operator=(const SdrObject& rObj)
{
if( this == &rObj )
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 1102de8c9325..f68f5d795623 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1621,7 +1621,20 @@ SdrOle2Obj* SdrOle2Obj::Clone() const
return CloneHelper< SdrOle2Obj >();
}
-SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
+SdrOle2Obj* SdrOle2Obj::CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const
+{
+ SdrOle2Obj* pObj =
+ dynamic_cast<SdrOle2Obj*>(
+ SdrObjFactory::MakeNewObject(GetObjInventor(), GetObjIdentifier(), NULL));
+
+ if (pObj)
+ pObj->assignFrom(*this, rSrcShellID, rDestShellID);
+
+ return pObj;
+}
+
+SdrOle2Obj& SdrOle2Obj::assignFrom(
+ const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID )
{
//TODO/LATER: who takes over control of my old object?!
if( &rObj != this )
@@ -1668,7 +1681,8 @@ SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
if ( xObj.is() )
{
OUString aTmp;
- xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject( rContainer, xObj, aTmp ), rOle2Obj.GetAspect() );
+ xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
+ rContainer, xObj, aTmp, rSrcShellID, rDestShellID), rOle2Obj.GetAspect());
m_bTypeAsked = false;
mpImpl->aPersistName = aTmp;
CheckFileLink_Impl();
@@ -1681,7 +1695,10 @@ SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
return *this;
}
-// -----------------------------------------------------------------------------
+SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
+{
+ return assignFrom(rObj, OUString(), OUString());
+}
void SdrOle2Obj::ImpSetVisAreaSize()
{
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 374f9a9f4e26..fe62e91219b5 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -223,7 +223,9 @@ sal_Bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_
return sal_True;
}
-sal_Bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
+sal_Bool SdrExchangeView::Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID )
{
const SdrModel* pSrcMod=&rMod;
if (pSrcMod==pMod)
@@ -298,7 +300,7 @@ sal_Bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjL
{
const SdrObject* pSrcOb=pSrcPg->GetObj(nOb);
- SdrObject* pNeuObj = pSrcOb->Clone();
+ SdrObject* pNeuObj = pSrcOb->CloneWithShellIDs(rSrcShellID, rDestShellID);
if (pNeuObj!=NULL)
{
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 959123536811..61e5bf12010f 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -49,7 +49,7 @@ private:
protected:
virtual void AddSupportedFormats();
- virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
public:
@@ -67,7 +67,7 @@ void SvxColorValueSetData::AddSupportedFormats()
// -----------------------------------------------------------------------------
-sal_Bool SvxColorValueSetData::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool SvxColorValueSetData::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_Bool bRet = sal_False;