summaryrefslogtreecommitdiff
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
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>
-rw-r--r--chart2/source/controller/chartapiwrapper/AxisWrapper.cxx5
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx5
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx66
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx9
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx9
-rw-r--r--chart2/source/controller/main/ChartDropTargetHelper.cxx4
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx2
-rw-r--r--chart2/source/controller/main/ChartTransferable.hxx2
-rw-r--r--chart2/source/model/filter/XMLFilter.cxx5
-rw-r--r--chart2/source/model/inc/XMLFilter.hxx3
-rw-r--r--chart2/source/model/main/Axis.cxx17
-rw-r--r--chart2/source/model/main/DataPointProperties.cxx11
-rw-r--r--chart2/source/model/main/DataPointProperties.hxx1
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx10
-rw-r--r--chart2/source/tools/AxisHelper.cxx15
-rw-r--r--chart2/source/view/main/ChartView.cxx18
-rw-r--r--comphelper/source/container/embeddedobjectcontainer.cxx23
-rw-r--r--dbaccess/source/ui/browser/dbexchange.cxx4
-rw-r--r--dbaccess/source/ui/inc/JoinExchange.hxx2
-rw-r--r--dbaccess/source/ui/inc/TableRowExchange.hxx2
-rw-r--r--dbaccess/source/ui/inc/dbexchange.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/JoinExchange.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableRowExchange.cxx2
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx54
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx12
-rw-r--r--include/comphelper/embeddedobjectcontainer.hxx8
-rw-r--r--include/sfx2/objsh.hxx2
-rw-r--r--include/svtools/embedtransfer.hxx6
-rw-r--r--include/svtools/stringtransfer.hxx2
-rw-r--r--include/svtools/transfer.hxx31
-rw-r--r--include/svx/dbaexchange.hxx6
-rw-r--r--include/svx/dbaobjectex.hxx2
-rw-r--r--include/svx/fmview.hxx2
-rw-r--r--include/svx/galmisc.hxx2
-rw-r--r--include/svx/svdobj.hxx7
-rw-r--r--include/svx/svdoole2.hxx3
-rw-r--r--include/svx/svdxcgv.hxx5
-rw-r--r--include/svx/view3d.hxx4
-rw-r--r--include/svx/xmlexchg.hxx2
-rw-r--r--include/xmloff/SchXMLExportHelper.hxx3
-rw-r--r--include/xmloff/xmlexp.hxx3
-rwxr-xr-xoffapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/datatransfer/XTransferable2.idl41
-rw-r--r--reportdesign/source/ui/dlg/GroupExchange.cxx4
-rw-r--r--reportdesign/source/ui/dlg/GroupExchange.hxx2
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx4
-rw-r--r--reportdesign/source/ui/inc/dlgedclip.hxx2
-rw-r--r--reportdesign/source/ui/report/dlgedclip.cxx8
-rw-r--r--sc/inc/column.hxx6
-rw-r--r--sc/inc/document.hxx1
-rw-r--r--sc/inc/table.hxx6
-rw-r--r--sc/source/core/data/column.cxx14
-rw-r--r--sc/source/core/data/document.cxx6
-rw-r--r--sc/source/core/data/table2.cxx5
-rw-r--r--sc/source/ui/app/drwtrans.cxx54
-rw-r--r--sc/source/ui/app/lnktrans.cxx3
-rw-r--r--sc/source/ui/app/seltrans.cxx5
-rw-r--r--sc/source/ui/app/transobj.cxx2
-rw-r--r--sc/source/ui/inc/drwtrans.hxx7
-rw-r--r--sc/source/ui/inc/lnktrans.hxx2
-rw-r--r--sc/source/ui/inc/seltrans.hxx2
-rw-r--r--sc/source/ui/inc/transobj.hxx2
-rw-r--r--sc/source/ui/inc/viewfunc.hxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx8
-rw-r--r--sc/source/ui/view/viewfun3.cxx11
-rw-r--r--sc/source/ui/view/viewfun5.cxx22
-rw-r--r--sc/source/ui/view/viewfun7.cxx6
-rw-r--r--sd/source/core/drawdoc3.cxx2
-rw-r--r--sd/source/ui/app/sdxfer.cxx4
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx3
-rw-r--r--sd/source/ui/inc/TabControl.hxx2
-rw-r--r--sd/source/ui/inc/View.hxx4
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx2
-rw-r--r--sd/source/ui/inc/sdxfer.hxx2
-rw-r--r--sd/source/ui/view/sdview2.cxx6
-rw-r--r--sd/source/ui/view/sdview3.cxx29
-rw-r--r--sd/source/ui/view/tabcontr.cxx2
-rw-r--r--sfx2/source/doc/objxtor.cxx19
-rw-r--r--starmath/source/view.cxx6
-rw-r--r--svtools/source/contnr/treelistbox.cxx5
-rw-r--r--svtools/source/dialogs/insdlg.cxx2
-rw-r--r--svtools/source/misc/embedtransfer.cxx15
-rw-r--r--svtools/source/misc/stringtransfer.cxx3
-rw-r--r--svtools/source/misc/transfer.cxx121
-rw-r--r--svtools/source/misc/transfer2.cxx4
-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
-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
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx50
-rw-r--r--xmloff/source/core/xmlexp.cxx37
104 files changed, 687 insertions, 350 deletions
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 665ea5301656..28226dcce600 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -637,9 +637,8 @@ const std::vector< WrappedProperty* > AxisWrapper::createWrappedProperties()
aWrappedProperties.push_back( new WrappedProperty("Visible","Show") );
aWrappedProperties.push_back( new WrappedDirectStateProperty("DisplayLabels","DisplayLabels") );
aWrappedProperties.push_back( new WrappedDirectStateProperty("TextBreak","TextBreak") );
- WrappedNumberFormatProperty* pWrappedNumberFormatProperty = new WrappedNumberFormatProperty( m_spChart2ModelContact );
- aWrappedProperties.push_back( pWrappedNumberFormatProperty );
- aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(pWrappedNumberFormatProperty) );
+ aWrappedProperties.push_back( new WrappedNumberFormatProperty(m_spChart2ModelContact) );
+ aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(m_spChart2ModelContact) );
aWrappedProperties.push_back( new WrappedProperty("StackedText","StackCharacters") );
aWrappedProperties.push_back( new WrappedDirectStateProperty("CrossoverPosition","CrossoverPosition") );
{
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index 9b5b622c5d7e..a50778214083 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -698,9 +698,8 @@ const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedPrope
WrappedStatisticProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
aWrappedProperties.push_back( new WrappedAttachedAxisProperty( m_spChart2ModelContact ) );
- WrappedNumberFormatProperty* pWrappedNumberFormatProperty = new WrappedNumberFormatProperty( m_spChart2ModelContact );
- aWrappedProperties.push_back( pWrappedNumberFormatProperty );
- aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(pWrappedNumberFormatProperty) );
+ aWrappedProperties.push_back( new WrappedNumberFormatProperty(m_spChart2ModelContact) );
+ aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(m_spChart2ModelContact) );
}
WrappedSymbolProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
index a4010a81e4e2..5370d117e39f 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
@@ -33,16 +33,10 @@ WrappedNumberFormatProperty::WrappedNumberFormatProperty( ::boost::shared_ptr< C
: WrappedDirectStateProperty( "NumberFormat", "NumberFormat" )
, m_spChart2ModelContact(spChart2ModelContact)
{
- m_aOuterValue = getPropertyDefault( 0 );
}
WrappedNumberFormatProperty::~WrappedNumberFormatProperty()
{
- if( m_pWrappedLinkNumberFormatProperty )
- {
- if( m_pWrappedLinkNumberFormatProperty->m_pWrappedNumberFormatProperty == this )
- m_pWrappedLinkNumberFormatProperty->m_pWrappedNumberFormatProperty = 0;
- }
}
void WrappedNumberFormatProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -52,19 +46,8 @@ void WrappedNumberFormatProperty::setPropertyValue( const Any& rOuterValue, cons
if( ! (rOuterValue >>= nFormat) )
throw lang::IllegalArgumentException( "Property 'NumberFormat' requires value of type sal_Int32", 0, 0 );
- m_aOuterValue = rOuterValue;
if(xInnerPropertySet.is())
- {
- bool bUseSourceFormat = !xInnerPropertySet->getPropertyValue( "NumberFormat" ).hasValue();
- if( bUseSourceFormat )
- {
- uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
- if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() )
- bUseSourceFormat = false;
- }
- if( !bUseSourceFormat )
- xInnerPropertySet->setPropertyValue( m_aInnerName, this->convertOuterToInnerValue( rOuterValue ) );
- }
+ xInnerPropertySet->setPropertyValue(getInnerName(), this->convertOuterToInnerValue(rOuterValue));
}
Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -75,7 +58,7 @@ Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XProp
OSL_FAIL("missing xInnerPropertySet in WrappedNumberFormatProperty::getPropertyValue");
return Any();
}
- Any aRet( xInnerPropertySet->getPropertyValue( m_aInnerName ));
+ Any aRet( xInnerPropertySet->getPropertyValue(getInnerName()));
if( !aRet.hasValue() )
{
sal_Int32 nKey = 0;
@@ -98,23 +81,14 @@ Any WrappedNumberFormatProperty::getPropertyDefault( const Reference< beans::XPr
return uno::makeAny( sal_Int32( 0 ) );
}
-WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty )
- : WrappedProperty( "LinkNumberFormatToSource", OUString() )
- , m_pWrappedNumberFormatProperty( pWrappedNumberFormatProperty )
+WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( const boost::shared_ptr<Chart2ModelContact>& pChart2ModelContact ) :
+ WrappedDirectStateProperty("LinkNumberFormatToSource", "LinkNumberFormatToSource"),
+ m_pChart2ModelContact(pChart2ModelContact)
{
- if( m_pWrappedNumberFormatProperty )
- {
- m_pWrappedNumberFormatProperty->m_pWrappedLinkNumberFormatProperty = this;
- }
}
WrappedLinkNumberFormatProperty::~WrappedLinkNumberFormatProperty()
{
- if( m_pWrappedNumberFormatProperty )
- {
- if( m_pWrappedNumberFormatProperty->m_pWrappedLinkNumberFormatProperty == this )
- m_pWrappedNumberFormatProperty->m_pWrappedLinkNumberFormatProperty = 0;
- }
}
void WrappedLinkNumberFormatProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -126,31 +100,7 @@ void WrappedLinkNumberFormatProperty::setPropertyValue( const Any& rOuterValue,
return;
}
- bool bLinkFormat = false;
- if( rOuterValue >>= bLinkFormat )
- {
- Any aValue;
- if( bLinkFormat )
- {
- if( m_pWrappedNumberFormatProperty )
- {
- uno::Reference< chart2::XChartDocument > xChartDoc( m_pWrappedNumberFormatProperty->m_spChart2ModelContact->getChart2Document() );
- if( xChartDoc.is() && xChartDoc->hasInternalDataProvider() )
- return;
- }
- }
- else
- {
- if( m_pWrappedNumberFormatProperty )
- {
- aValue = m_pWrappedNumberFormatProperty->getPropertyValue( xInnerPropertySet );
- }
- else
- aValue <<= sal_Int32( 0 );
- }
-
- xInnerPropertySet->setPropertyValue( "NumberFormat", aValue );
- }
+ xInnerPropertySet->setPropertyValue(getInnerName(), rOuterValue);
}
Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
@@ -161,8 +111,8 @@ Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::X
OSL_FAIL("missing xInnerPropertySet in WrappedNumberFormatProperty::getPropertyValue");
return getPropertyDefault(0);
}
- bool bLink = ! xInnerPropertySet->getPropertyValue( "NumberFormat" ).hasValue();
- return uno::makeAny( bLink );
+
+ return xInnerPropertySet->getPropertyValue(getInnerName());
}
Any WrappedLinkNumberFormatProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
index 63a562c72e87..96020808e9c9 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx
@@ -49,14 +49,12 @@ public:
friend class WrappedLinkNumberFormatProperty;
private:
::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
- mutable ::com::sun::star::uno::Any m_aOuterValue;
- WrappedLinkNumberFormatProperty* m_pWrappedLinkNumberFormatProperty;
};
-class WrappedLinkNumberFormatProperty : public WrappedProperty
+class WrappedLinkNumberFormatProperty : public WrappedDirectStateProperty
{
public:
- WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty );
+ WrappedLinkNumberFormatProperty( const boost::shared_ptr<Chart2ModelContact>& pChart2ModelContact );
virtual ~WrappedLinkNumberFormatProperty();
virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
@@ -68,9 +66,8 @@ public:
virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
- friend class WrappedNumberFormatProperty;
private:
- WrappedNumberFormatProperty* m_pWrappedNumberFormatProperty;
+ boost::shared_ptr<Chart2ModelContact> m_pChart2ModelContact;
};
} //namespace wrapper
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index 328dd8cad1b0..7974dc185c7c 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -425,8 +425,9 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
case SID_ATTR_NUMBERFORMAT_SOURCE:
{
- bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat" ).hasValue());
- rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
+ bool bLinkToSource = true;
+ GetPropertySet()->getPropertyValue("LinkNumberFormatToSource") >>= bLinkToSource;
+ rOutItemSet.Put(SfxBoolItem(nWhichId, bLinkToSource));
}
break;
@@ -932,7 +933,9 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
bool bUseSourceFormat =
(static_cast< const SfxBoolItem & >(
rItemSet.Get( nWhichId )).GetValue() );
- bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat").hasValue());
+ GetPropertySet()->setPropertyValue("LinkNumberFormatToSource", uno::makeAny(bUseSourceFormat));
+
+ bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue("NumberFormat").hasValue();
bChangedOtherwise = (bUseSourceFormat == bNumberFormatIsSet);
if( bChangedOtherwise )
diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx b/chart2/source/controller/main/ChartDropTargetHelper.cxx
index 154db84f5955..0857de3f1612 100644
--- a/chart2/source/controller/main/ChartDropTargetHelper.cxx
+++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx
@@ -103,8 +103,8 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
if( aDataHelper.HasFormat( SOT_FORMATSTR_ID_LINK ))
{
- Sequence< sal_Int8 > aBytes;
- if( aDataHelper.GetSequence( SOT_FORMATSTR_ID_LINK, aBytes ))
+ Sequence<sal_Int8> aBytes = aDataHelper.GetSequence(SOT_FORMATSTR_ID_LINK, OUString());
+ if (aBytes.getLength())
{
::std::vector< OUString > aStrings( lcl_getStringsFromByteSequence( aBytes ));
if( aStrings.size() >= 3 && aStrings[0] == "soffice" )
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index f072b2122a48..e7d7d2b91613 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -75,7 +75,7 @@ void ChartTransferable::AddSupportedFormats()
AddFormat( SOT_FORMAT_BITMAP );
}
-sal_Bool ChartTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool ChartTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
sal_Bool bResult = sal_False;
diff --git a/chart2/source/controller/main/ChartTransferable.hxx b/chart2/source/controller/main/ChartTransferable.hxx
index efbd1b3b9a53..9ae5aaf183fd 100644
--- a/chart2/source/controller/main/ChartTransferable.hxx
+++ b/chart2/source/controller/main/ChartTransferable.hxx
@@ -43,7 +43,7 @@ protected:
// implementation of TransferableHelper methods
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 );
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index cee36faa2378..ce44fd7b64dc 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -548,6 +548,7 @@ sal_Int32 XMLFilter::impl_Export(
const Reference< lang::XComponent > & xDocumentComp,
const Sequence< beans::PropertyValue > & rMediaDescriptor )
{
+ m_aMediaDescriptor = rMediaDescriptor;
//save
sal_Int32 nWarning = 0;
@@ -751,9 +752,7 @@ sal_Int32 XMLFilter::impl_ExportStream(
if ( !xFilter.is() )
return ERRCODE_SFX_GENERAL;
- uno::Sequence < beans::PropertyValue > aMediaDesc(0);
- //@todo? filter properties? ... url? ...
- xFilter->filter( aMediaDesc );
+ xFilter->filter(m_aMediaDescriptor);
}
catch (const uno::Exception& rEx)
{
diff --git a/chart2/source/model/inc/XMLFilter.hxx b/chart2/source/model/inc/XMLFilter.hxx
index 648e25f45f5c..d8bb956f50d2 100644
--- a/chart2/source/model/inc/XMLFilter.hxx
+++ b/chart2/source/model/inc/XMLFilter.hxx
@@ -152,6 +152,9 @@ private:
::com::sun::star::lang::XComponent > m_xTargetDoc;
::com::sun::star::uno::Reference<
::com::sun::star::lang::XComponent > m_xSourceDoc;
+
+ css::uno::Sequence<css::beans::PropertyValue> m_aMediaDescriptor;
+
OUString m_sDocumentHandler; // when set it will be set as doc handler
volatile bool m_bCancelOperation;
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index f8a3b90448f1..c4780684271c 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -65,7 +65,8 @@ enum
PROP_AXIS_CROSSOVER_POSITION,
PROP_AXIS_CROSSOVER_VALUE,
PROP_AXIS_DISPLAY_LABELS,
- PROP_AXIS_NUMBER_FORMAT,
+ PROP_AXIS_NUMBERFORMAT,
+ PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
PROP_AXIS_LABEL_POSITION,
PROP_AXIS_TEXT_ROTATION,
PROP_AXIS_TEXT_BREAK,
@@ -110,10 +111,17 @@ void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( "NumberFormat",
- PROP_AXIS_NUMBER_FORMAT,
- ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
+ PROP_AXIS_NUMBERFORMAT,
+ cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEVOID ));
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( "LinkNumberFormatToSource",
+ PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
Property( "LabelPosition",
@@ -199,6 +207,7 @@ private:
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_DISPLAY_LABELS, true );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, true );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_LABEL_POSITION, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS );
::chart::PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_AXIS_TEXT_ROTATION, 0.0 );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_TEXT_BREAK, false );
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index 443101d3556e..2aa4ca9af789 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -281,7 +281,14 @@ void DataPointProperties::AddPropertiesToVector(
PROP_DATAPOINT_NUMBER_FORMAT,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEVOID ));
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( "LinkNumberFormatToSource",
+ PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE,
+ ::getBooleanCppuType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
//additional 'PercentageNumberFormat'
rOutProperties.push_back(
@@ -409,6 +416,8 @@ void DataPointProperties::AddDefaultsToMap(
PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_PERCENT_DIAGONAL, 0 );
PropertyHelper::setPropertyValueDefault< double >( rOutMap, PROP_DATAPOINT_TEXT_ROTATION, 0.0 );
+
+ PropertyHelper::setPropertyValueDefault(rOutMap, PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE, true);
}
} // namespace chart
diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx
index 596adf88451b..2d7258aca510 100644
--- a/chart2/source/model/main/DataPointProperties.hxx
+++ b/chart2/source/model/main/DataPointProperties.hxx
@@ -62,6 +62,7 @@ public:
PROP_DATAPOINT_LABEL,
PROP_DATAPOINT_LABEL_SEPARATOR,
PROP_DATAPOINT_NUMBER_FORMAT,
+ PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE,
PROP_DATAPOINT_PERCENTAGE_NUMBER_FORMAT,
PROP_DATAPOINT_LABEL_PLACEMENT,
PROP_DATAPOINT_REFERENCE_DIAGRAM_SIZE,
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index b1ac7d22436d..8ff85632f802 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -454,9 +454,8 @@ void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram
if( xAxisProp.is())
{
// set number format to source format
- uno::Any aValue( xAxisProp->getPropertyValue("NumberFormat"));
- if( aValue.hasValue())
- xAxisProp->setPropertyValue("NumberFormat", uno::Any());
+ xAxisProp->setPropertyValue("LinkNumberFormatToSource", uno::makeAny(true));
+ xAxisProp->setPropertyValue("NumberFormat", uno::Any());
}
}
}
@@ -754,9 +753,8 @@ void ChartTypeTemplate::adaptAxes(
if( xAxisProp.is())
{
// set number format to source format
- uno::Any aValue( xAxisProp->getPropertyValue("NumberFormat"));
- if( aValue.hasValue())
- xAxisProp->setPropertyValue("NumberFormat", uno::Any());
+ xAxisProp->setPropertyValue("LinkNumberFormatToSource", uno::makeAny(true));
+ xAxisProp->setPropertyValue("NumberFormat", uno::Any());
}
}
}
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index 4b372ca4275e..8291ca6145e1 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -145,7 +145,16 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY );
Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY );
- if( xProp.is() && !( xProp->getPropertyValue( "NumberFormat" ) >>= nNumberFormatKey ) )
+ if (!xProp.is())
+ return 0;
+
+ bool bLinkToSource = true;
+ xProp->getPropertyValue("LinkNumberFormatToSource") >>= bLinkToSource;
+ xProp->getPropertyValue("NumberFormat") >>= nNumberFormatKey;
+
+ sal_Int32 nOldNumberFormat = nNumberFormatKey;
+
+ if (bLinkToSource)
{
bool bFormatSet = false;
//check whether we have a percent scale -> use percent format
@@ -314,7 +323,11 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
}
}
}
+
+ if (nOldNumberFormat != nNumberFormatKey)
+ xProp->setPropertyValue("NumberFormat", uno::makeAny(nNumberFormatKey));
}
+
return nNumberFormatKey;
}
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index f501aa956d75..c519aef18d85 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1787,8 +1787,16 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
if( !xSeriesOrPointProp.is() )
return nFormat;
- OUString aPropName( "NumberFormat" );
- if( !(xSeriesOrPointProp->getPropertyValue(aPropName) >>= nFormat) )
+ bool bLinkToSource = true;
+ try
+ {
+ xSeriesOrPointProp->getPropertyValue("LinkNumberFormatToSource") >>= bLinkToSource;
+ }
+ catch ( const beans::UnknownPropertyException& ) {}
+
+ xSeriesOrPointProp->getPropertyValue("NumberFormat") >>= nFormat;
+ sal_Int32 nOldFormat = nFormat;
+ if (bLinkToSource)
{
uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) );
@@ -1796,7 +1804,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
if( ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( xChartType ) )
{
uno::Reference< beans::XPropertySet > xAttachedAxisProps( DiagramHelper::getAttachedAxis( xSeries, xDiagram ), uno::UNO_QUERY );
- if( xAttachedAxisProps.is() && ( xAttachedAxisProps->getPropertyValue( aPropName ) >>= nFormat ) )
+ if( xAttachedAxisProps.is() && ( xAttachedAxisProps->getPropertyValue("NumberFormat") >>= nFormat ) )
bFormatFound = true;
}
if( !bFormatFound )
@@ -1813,7 +1821,11 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
nFormat = xValues->getNumberFormatKeyByIndex( nPointIndex );
}
}
+
+ if (nFormat >= 0 && nOldFormat != nFormat)
+ xSeriesOrPointProp->setPropertyValue("NumberFormat", uno::makeAny(nFormat));
}
+
if(nFormat<0)
nFormat=0;
return nFormat;
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 2d7df99a0e25..c3b4338e2561 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -493,7 +493,9 @@ void EmbeddedObjectContainer::AddEmbeddedObject( const ::com::sun::star::uno::Re
}
}
-sal_Bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName, sal_Bool bCopy )
+bool EmbeddedObjectContainer::StoreEmbeddedObject(
+ const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName, bool bCopy,
+ const OUString& rSrcShellID, const OUString& rDestShellID )
{
SAL_INFO( "comphelper.container", "comphelper (mv76033) comphelper::EmbeddedObjectContainer::StoreEmbeddedObject" );
@@ -514,7 +516,14 @@ sal_Bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < em
{
uno::Sequence < beans::PropertyValue > aSeq;
if ( bCopy )
- xPersist->storeToEntry( pImpl->mxStorage, rName, aSeq, aSeq );
+ {
+ uno::Sequence<beans::PropertyValue> aObjArgs(2);
+ aObjArgs[0].Name = "SourceShellID";
+ aObjArgs[0].Value <<= rSrcShellID;
+ aObjArgs[1].Name = "DestinationShellID";
+ aObjArgs[1].Value <<= rDestShellID;
+ xPersist->storeToEntry(pImpl->mxStorage, rName, aSeq, aObjArgs);
+ }
else
{
//TODO/LATER: possible optimisation, don't store immediately
@@ -538,7 +547,7 @@ sal_Bool EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < e
{
SAL_INFO( "comphelper.container", "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedObject( Object )" );
// store it into the container storage
- if ( StoreEmbeddedObject( xObj, rName, sal_False ) )
+ if (StoreEmbeddedObject(xObj, rName, false, OUString(), OUString()))
{
// remember object
AddEmbeddedObject( xObj, rName );
@@ -700,7 +709,9 @@ sal_Bool EmbeddedObjectContainer::TryToCopyGraphReplacement( EmbeddedObjectConta
return bResult;
}
-uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmbeddedObject( EmbeddedObjectContainer& rSrc, const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName )
+uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmbeddedObject(
+ EmbeddedObjectContainer& rSrc, const uno::Reference <embed::XEmbeddedObject>& xObj, OUString& rName,
+ const OUString& rSrcShellID, const OUString& rDestShellID )
{
SAL_INFO( "comphelper.container", "comphelper (mv76033) comphelper::EmbeddedObjectContainer::CopyAndGetEmbeddedObject" );
@@ -721,8 +732,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
if ( rName.isEmpty() )
rName = CreateUniqueObjectName();
- // objects without persistance are not really stored by the method
- if ( xObj.is() && StoreEmbeddedObject( xObj, rName, sal_True ) )
+ // objects without persistence are not really stored by the method
+ if (xObj.is() && StoreEmbeddedObject(xObj, rName, true, rSrcShellID, rDestShellID))
{
xResult = Get_Impl( rName, xObj);
if ( !xResult.is() )
diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx
index 32c05ce9608f..47e4d2f31faf 100644
--- a/dbaccess/source/ui/browser/dbexchange.cxx
+++ b/dbaccess/source/ui/browser/dbexchange.cxx
@@ -159,7 +159,7 @@ namespace dbaui
ODataAccessObjectTransferable::AddSupportedFormats();
}
- sal_Bool ODataClipboard::GetData( const DataFlavor& rFlavor )
+ sal_Bool ODataClipboard::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc )
{
const sal_uLong nFormat = SotExchange::GetFormat(rFlavor);
switch (nFormat)
@@ -175,7 +175,7 @@ namespace dbaui
return m_pHtml.is() && SetObject( m_pHtml.get(), SOT_FORMATSTR_ID_HTML, rFlavor );
}
- return ODataAccessObjectTransferable::GetData( rFlavor );
+ return ODataAccessObjectTransferable::GetData(rFlavor, rDestDoc);
}
void ODataClipboard::ObjectReleased()
diff --git a/dbaccess/source/ui/inc/JoinExchange.hxx b/dbaccess/source/ui/inc/JoinExchange.hxx
index 2bf549a507e3..d7053007d796 100644
--- a/dbaccess/source/ui/inc/JoinExchange.hxx
+++ b/dbaccess/source/ui/inc/JoinExchange.hxx
@@ -61,7 +61,7 @@ namespace dbaui
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 void DragFinished( sal_Int8 nDropAction );
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
diff --git a/dbaccess/source/ui/inc/TableRowExchange.hxx b/dbaccess/source/ui/inc/TableRowExchange.hxx
index 0f034744115c..a298a5b02ea8 100644
--- a/dbaccess/source/ui/inc/TableRowExchange.hxx
+++ b/dbaccess/source/ui/inc/TableRowExchange.hxx
@@ -34,7 +34,7 @@ namespace dbaui
OTableRowExchange(const ::std::vector< ::boost::shared_ptr<OTableRow> >& _rvTableRow);
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 );
virtual void ObjectReleased();
};
diff --git a/dbaccess/source/ui/inc/dbexchange.hxx b/dbaccess/source/ui/inc/dbexchange.hxx
index f1942130be10..c8d98522c265 100644
--- a/dbaccess/source/ui/inc/dbexchange.hxx
+++ b/dbaccess/source/ui/inc/dbexchange.hxx
@@ -73,7 +73,7 @@ namespace dbaui
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 void ObjectReleased();
virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
};
diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx
index 70007d70601a..8efc79660943 100644
--- a/dbaccess/source/ui/querydesign/JoinExchange.cxx
+++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx
@@ -116,7 +116,7 @@ namespace dbaui
AddFormat( SOT_FORMATSTR_ID_SBA_TABID );
}
- sal_Bool OJoinExchObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+ sal_Bool OJoinExchObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uInt32 nFormat = SotExchange::GetFormat(rFlavor);
if ( SOT_FORMATSTR_ID_SBA_JOIN == nFormat )
diff --git a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx
index 3a14971d7dc3..a593b0902b3c 100644
--- a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx
@@ -52,7 +52,7 @@ namespace dbaui
if ( !m_vTableRow.empty() )
AddFormat(SOT_FORMATSTR_ID_SBA_TABED);
}
- sal_Bool OTableRowExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+ sal_Bool OTableRowExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uLong nFormat = SotExchange::GetFormat(rFlavor);
if(nFormat == SOT_FORMATSTR_ID_SBA_TABED)
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 36741eba63dd..48916563d2d9 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -723,12 +723,33 @@ void OCommonEmbeddedObject::SwitchDocToStorage_Impl( const uno::Reference< docum
m_xRecoveryStorage.clear();
}
-//------------------------------------------------------
-void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed::XStorage >& xStorage,
- sal_Int32 nStorageFormat,
- const OUString& aBaseURL,
- const OUString& aHierarchName,
- sal_Bool bAttachToTheStorage )
+namespace {
+
+OUString getStringPropertyValue( const uno::Sequence<beans::PropertyValue>& rProps, const OUString& rName )
+{
+ OUString aStr;
+
+ for (sal_Int32 i = 0; i < rProps.getLength(); ++i)
+ {
+ if (rProps[i].Name == rName)
+ {
+ rProps[i].Value >>= aStr;
+ break;
+ }
+ }
+
+ return aStr;
+}
+
+}
+
+void OCommonEmbeddedObject::StoreDocToStorage_Impl(
+ const uno::Reference<embed::XStorage>& xStorage,
+ const uno::Sequence<beans::PropertyValue>& rMediaArgs,
+ const uno::Sequence<beans::PropertyValue>& rObjArgs,
+ sal_Int32 nStorageFormat,
+ const OUString& aHierarchName,
+ bool bAttachToTheStorage )
{
SAL_WARN_IF( !xStorage.is(), "embeddedobj.common", "No storage is provided for storing!" );
@@ -742,6 +763,8 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed:
xDoc = uno::Reference< document::XStorageBasedDocument >( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
}
+ OUString aBaseURL = GetBaseURLFrom_Impl(rMediaArgs, rObjArgs);
+
if ( xDoc.is() )
{
OUString aFilterName = GetFilterName( nStorageFormat );
@@ -750,13 +773,17 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed:
if ( aFilterName.isEmpty() )
throw io::IOException(); // TODO:
- uno::Sequence< beans::PropertyValue > aArgs( 3 );
+ uno::Sequence<beans::PropertyValue> aArgs(5);
aArgs[0].Name = "FilterName";
aArgs[0].Value <<= aFilterName;
- aArgs[2].Name = "DocumentBaseURL";
- aArgs[2].Value <<= aBaseURL;
aArgs[1].Name = "HierarchicalDocumentName";
aArgs[1].Value <<= aHierarchName;
+ aArgs[2].Name = "DocumentBaseURL";
+ aArgs[2].Value <<= aBaseURL;
+ aArgs[3].Name = "SourceShellID";
+ aArgs[3].Value <<= getStringPropertyValue(rObjArgs, "SourceShellID");
+ aArgs[4].Name = "DestinationShellID";
+ aArgs[4].Value <<= getStringPropertyValue(rObjArgs, "DestinationShellID");
xDoc->storeToStorage( xStorage, aArgs );
if ( bAttachToTheStorage )
@@ -1241,7 +1268,8 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed::
aGuard.clear();
// TODO/LATER: support hierarchical name for embedded objects in embedded objects
- StoreDocToStorage_Impl( xSubStorage, nTargetStorageFormat, GetBaseURLFrom_Impl( lArguments, lObjArgs ), sEntName, sal_False );
+ StoreDocToStorage_Impl(
+ xSubStorage, lArguments, lObjArgs, nTargetStorageFormat, sEntName, false );
aGuard.reset();
if ( bSwitchBackToLoaded )
@@ -1380,7 +1408,8 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed::
{
aGuard.clear();
// TODO/LATER: support hierarchical name for embedded objects in embedded objects
- StoreDocToStorage_Impl( xSubStorage, nTargetStorageFormat, GetBaseURLFrom_Impl( lArguments, lObjArgs ), sEntName, sal_False );
+ StoreDocToStorage_Impl(
+ xSubStorage, lArguments, lObjArgs, nTargetStorageFormat, sEntName, false );
aGuard.reset();
if ( bSwitchBackToLoaded )
@@ -1609,7 +1638,8 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn()
}
aGuard.clear();
- StoreDocToStorage_Impl( m_xObjectStorage, nStorageFormat, GetBaseURL_Impl(), m_aEntryName, sal_True );
+ uno::Sequence<beans::PropertyValue> aEmpty;
+ StoreDocToStorage_Impl( m_xObjectStorage, aEmpty, aEmpty, nStorageFormat, m_aEntryName, true );
aGuard.reset();
}
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx
index fba8d218d928..83e4445dfda8 100644
--- a/embeddedobj/source/inc/commonembobj.hxx
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -197,11 +197,13 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > InitNewDocument_Impl();
- void StoreDocToStorage_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- sal_Int32 nStorageVersion,
- const OUString& aBaseURL,
- const OUString& aHierarchName,
- sal_Bool bAttachToStorage );
+ void StoreDocToStorage_Impl(
+ const css::uno::Reference<css::embed::XStorage>& xStorage,
+ const css::uno::Sequence<css::beans::PropertyValue>& rMediaArgs,
+ const css::uno::Sequence<css::beans::PropertyValue>& rObjArgs,
+ sal_Int32 nStorageVersion,
+ const OUString& aHierarchName,
+ bool bAttachToStorage );
void SwitchDocToStorage_Impl(
const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageBasedDocument >& xDoc,
diff --git a/include/comphelper/embeddedobjectcontainer.hxx b/include/comphelper/embeddedobjectcontainer.hxx
index 7ce0566c926c..616ca0f908dc 100644
--- a/include/comphelper/embeddedobjectcontainer.hxx
+++ b/include/comphelper/embeddedobjectcontainer.hxx
@@ -58,7 +58,9 @@ class COMPHELPER_DLLPUBLIC EmbeddedObjectContainer
public:
// add an embedded object to the container storage
- sal_Bool StoreEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString&, sal_Bool );
+ bool StoreEmbeddedObject(
+ const css::uno::Reference<css::embed::XEmbeddedObject>& xObj, OUString& rName, bool bCopy,
+ const OUString& rSrcShellID, const OUString& rDestShellID );
// add an embedded object that has been imported from the container storage - should only be called by filters!
void AddEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, const OUString& );
@@ -119,7 +121,9 @@ public:
InsertEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >&, OUString& );
// copy an embedded object into the storage, open the new copy and return it
- ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > CopyAndGetEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, /* TODO const OUString& aOrigName,*/ OUString& rName );
+ css::uno::Reference <css::embed::XEmbeddedObject> CopyAndGetEmbeddedObject(
+ EmbeddedObjectContainer& rSrc, const css::uno::Reference <css::embed::XEmbeddedObject>& xObj, OUString& rName,
+ const OUString& rSrcShellID, const OUString& rDestShellID );
// move an embedded object from one container to another one
sal_Bool MoveEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString& );
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index de041fbf3bc7..05aa6a7404a9 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -239,6 +239,8 @@ public:
using SotObject::GetInterface;
+ static OUString CreateShellID( const SfxObjectShell* pShell );
+
// Document-Shell Iterator
static SfxObjectShell* GetFirst( const TypeId* pType = 0,
sal_Bool bOnlyVisible = sal_True );
diff --git a/include/svtools/embedtransfer.hxx b/include/svtools/embedtransfer.hxx
index 2649188d0a80..186bc0c0c804 100644
--- a/include/svtools/embedtransfer.hxx
+++ b/include/svtools/embedtransfer.hxx
@@ -33,10 +33,12 @@ private:
Graphic* m_pGraphic;
sal_Int64 m_nAspect;
+ OUString maParentShellID;
+
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 void ObjectReleased();
public:
@@ -46,6 +48,8 @@ public:
sal_Int64 nAspect );
~SvEmbedTransferHelper();
+ void SetParentShellID( const OUString& rShellID );
+
static void FillTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject >& xObj,
const Graphic* pGraphic,
diff --git a/include/svtools/stringtransfer.hxx b/include/svtools/stringtransfer.hxx
index 12d6fdaf204a..60d2ced63ffe 100644
--- a/include/svtools/stringtransfer.hxx
+++ b/include/svtools/stringtransfer.hxx
@@ -42,7 +42,7 @@ namespace svt
protected:
// TransferableHelper overridables
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 );
};
//====================================================================
diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
index 2a8ce2950fb4..76c192f715b2 100644
--- a/include/svtools/transfer.hxx
+++ b/include/svtools/transfer.hxx
@@ -28,7 +28,7 @@
#include <cppuhelper/implbase4.hxx>
#include <com/sun/star/frame/XTerminateListener.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/datatransfer/XTransferable2.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
@@ -127,7 +127,7 @@ struct ExecuteDropEvent
mbDefault( sal_False ) {}
};
-class SVT_DLLPUBLIC TransferableHelper : public ::cppu::WeakImplHelper4< ::com::sun::star::datatransfer::XTransferable,
+class SVT_DLLPUBLIC TransferableHelper : public ::cppu::WeakImplHelper4< ::com::sun::star::datatransfer::XTransferable2,
::com::sun::star::datatransfer::clipboard::XClipboardOwner,
::com::sun::star::datatransfer::dnd::XDragSourceListener,
::com::sun::star::lang::XUnoTunnel >
@@ -178,6 +178,11 @@ private:
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::uno::RuntimeException);
+ // Transferable2
+ virtual css::uno::Any SAL_CALL getTransferData2(
+ const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
+ throw (css::datatransfer::UnsupportedFlavorException, css::io::IOException, css::uno::RuntimeException);
+
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
@@ -236,7 +241,7 @@ protected:
protected:
virtual void AddSupportedFormats() = 0;
- virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) = 0;
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) = 0;
virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
virtual void DragFinished( sal_Int8 nDropAction );
virtual void ObjectReleased();
@@ -312,8 +317,8 @@ public:
public:
- ::com::sun::star::uno::Any GetAny( SotFormatStringId nFormat ) const;
- ::com::sun::star::uno::Any GetAny( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) const;
+ css::uno::Any GetAny( SotFormatStringId nFormat, const OUString& rDestDoc ) const;
+ css::uno::Any GetAny( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) const;
sal_Bool GetString( SotFormatStringId nFormat, OUString& rStr );
sal_Bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, OUString& rStr );
@@ -342,16 +347,16 @@ public:
sal_Bool GetFileList( SotFormatStringId nFormat, FileList& rFileList );
sal_Bool GetFileList( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, FileList& rFileList );
- sal_Bool GetSequence( SotFormatStringId nFormat, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
- sal_Bool GetSequence( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
+ css::uno::Sequence<sal_Int8> GetSequence( SotFormatStringId nFormat, const OUString& rDestDoc );
+ css::uno::Sequence<sal_Int8> GetSequence( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
- sal_Bool GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rStreamRef );
- sal_Bool GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, SotStorageStreamRef& rStreamRef );
+ bool GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rStreamRef );
+ bool GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, SotStorageStreamRef& rStreamRef );
- sal_Bool GetInputStream( SotFormatStringId nFormat, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
- sal_Bool GetInputStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
+ css::uno::Reference<css::io::XInputStream> GetInputStream( SotFormatStringId nFormat, const OUString& rDestDoc );
+ css::uno::Reference<css::io::XInputStream> GetInputStream( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
- sal_Bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf );
+ bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf );
public:
@@ -485,7 +490,7 @@ class SVT_DLLPUBLIC TransferDataContainer : public TransferableHelper
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 void DragFinished( sal_Int8 nDropAction );
public:
diff --git a/include/svx/dbaexchange.hxx b/include/svx/dbaexchange.hxx
index e6fef351163f..1761df1ae7b4 100644
--- a/include/svx/dbaexchange.hxx
+++ b/include/svx/dbaexchange.hxx
@@ -148,7 +148,7 @@ namespace svx
protected:
// TransferableHelper overridables
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 );
static sal_uInt32 getDescriptorFormatId();
@@ -226,7 +226,7 @@ namespace svx
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 void ObjectReleased();
protected:
@@ -276,7 +276,7 @@ namespace svx
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 void ObjectReleased();
static sal_uInt32 getDescriptorFormatId();
};
diff --git a/include/svx/dbaobjectex.hxx b/include/svx/dbaobjectex.hxx
index 429477e7a825..efd6c0e09279 100644
--- a/include/svx/dbaobjectex.hxx
+++ b/include/svx/dbaobjectex.hxx
@@ -64,7 +64,7 @@ namespace svx
protected:
// TransferableHelper overridables
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 );
static sal_uInt32 getDescriptorFormatId(sal_Bool _bExtractForm);
};
diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx
index af984addf64f..6c5c5234f89f 100644
--- a/include/svx/fmview.hxx
+++ b/include/svx/fmview.hxx
@@ -108,8 +108,6 @@ public:
// for copying complete form structures, not only control models
virtual SdrModel* GetMarkedObjModel() const;
- using E3dView::Paste;
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
virtual sal_Bool MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin );
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx
index 7045a51390ed..af7ae185d27e 100644
--- a/include/svx/galmisc.hxx
+++ b/include/svx/galmisc.hxx
@@ -174,7 +174,7 @@ protected:
// TransferableHelper
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 );
virtual void DragFinished( sal_Int8 nDropAction );
virtual void ObjectReleased();
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index f1b3dbbad506..25b83b6fd130 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -599,9 +599,10 @@ public:
Note that this function uses operator= internally.
*/
virtual SdrObject* Clone() const;
- /**
- Implemented mainly for the purposes of Clone().
- */
+
+ virtual SdrObject* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const;
+
+ // implemented mainly for the purposes of Clone()
SdrObject& operator=(const SdrObject& rObj);
// TakeObjName...() ist fuer die Anzeige in der UI, z.B. "3 Rahmen selektiert".
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 0f1df144d862..149dc6126aa9 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -145,6 +145,9 @@ public:
virtual OUString TakeObjNamePlural() const;
SdrOle2Obj* Clone() const;
+ virtual SdrOle2Obj* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const;
+
+ SdrOle2Obj& assignFrom( const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID );
SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
virtual void NbcMove(const Size& rSize);
diff --git a/include/svx/svdxcgv.hxx b/include/svx/svdxcgv.hxx
index 010df2e0af0e..3043f0f86e20 100644
--- a/include/svx/svdxcgv.hxx
+++ b/include/svx/svdxcgv.hxx
@@ -103,7 +103,10 @@ public:
// View angezeigt wird.
// Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und
// SDRINSERT_ADDMARK (siehe svdedtv.hxx).
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ virtual sal_Bool Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID );
+
sal_Bool Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
sal_Bool Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
diff --git a/include/svx/view3d.hxx b/include/svx/view3d.hxx
index 943cdb39cbbe..dfda739afa80 100644
--- a/include/svx/view3d.hxx
+++ b/include/svx/view3d.hxx
@@ -98,7 +98,9 @@ public:
// On Paste: We need to insert the objects of the Scene, but not the Scene itself
using SdrView::Paste;
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ virtual sal_Bool Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID );
// #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
diff --git a/include/svx/xmlexchg.hxx b/include/svx/xmlexchg.hxx
index 64de636dc1bb..d1ce6d35de89 100644
--- a/include/svx/xmlexchg.hxx
+++ b/include/svx/xmlexchg.hxx
@@ -69,7 +69,7 @@ namespace svx
// TransferableHelper overridables
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 );
OXFormsDescriptor m_aDescriptor;
diff --git a/include/xmloff/SchXMLExportHelper.hxx b/include/xmloff/SchXMLExportHelper.hxx
index d46663f10cee..af866be30304 100644
--- a/include/xmloff/SchXMLExportHelper.hxx
+++ b/include/xmloff/SchXMLExportHelper.hxx
@@ -52,6 +52,9 @@ public:
/// returns the string corresponding to the current FileFormat CLSID for Chart
const OUString& getChartCLSID();
+ void SetSourceShellID( const OUString& rShellID );
+ void SetDestinationShellID( const OUString& rShellID );
+
private:
SchXMLExportHelper(); // not defined
SchXMLExportHelper(SchXMLExportHelper &); // not defined
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index 7ef8f3f7fd73..3612a7a5bcc5 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -212,6 +212,9 @@ protected:
void SetExtended( sal_Bool bSet=sal_True ) { mbExtended = bSet; }
+ OUString GetSourceShellID() const;
+ OUString GetDestinationShellID() const;
+
// save linked sections? (may be false in global documents)
sal_Bool mbSaveLinkedSections;
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index d42a0e7b770f..3c1d92e5f5ff 100755
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -2100,6 +2100,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/datatransfer,\
XSystemTransferable \
XTransferDataAccess \
XTransferable \
+ XTransferable2 \
XTransferableEx \
XTransferableSource \
XTransferableSupplier \
diff --git a/offapi/com/sun/star/datatransfer/XTransferable2.idl b/offapi/com/sun/star/datatransfer/XTransferable2.idl
new file mode 100644
index 000000000000..5ff7d58dc826
--- /dev/null
+++ b/offapi/com/sun/star/datatransfer/XTransferable2.idl
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 __com_sun_star_datatransfer_XTransferable2_idl__
+#define __com_sun_star_datatransfer_XTransferable2_idl__
+
+#include <com/sun/star/datatransfer/XTransferable2.idl>
+
+module com { module sun { module star { module datatransfer {
+
+interface XTransferable2 : com::sun::star::datatransfer::XTransferable
+{
+ /** This is equivalent of getTransferData of XTransferable, but takes an
+ additional parameter that specifies the destination document type.
+
+ @param aFlavor requested data format
+ @param aDestShellID destination document shell ID. The ID of each
+ individual shell must be unique.
+
+ @returns data in specified data format.
+
+ @throws com::sun::star::io::IOException
+ if the data is no longer available in the requested flavor.
+
+ @throws com::sun::star::datatransfer::UnsupportedFlavorException
+ if the requested DataFlavor is not supported.
+ */
+ any getTransferData2( [in] DataFlavor aFlavor, [in] string aDestShellID )
+ raises ( UnsupportedFlavorException, com::sun::star::io::IOException );
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
diff --git a/reportdesign/source/ui/dlg/GroupExchange.cxx b/reportdesign/source/ui/dlg/GroupExchange.cxx
index 06753d8d7653..2e1397993917 100644
--- a/reportdesign/source/ui/dlg/GroupExchange.cxx
+++ b/reportdesign/source/ui/dlg/GroupExchange.cxx
@@ -48,8 +48,8 @@ namespace rptui
AddFormat(OGroupExchange::getReportGroupId());
}
}
- // -----------------------------------------------------------------------------
- sal_Bool OGroupExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+
+ sal_Bool OGroupExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uLong nFormat = SotExchange::GetFormat(rFlavor);
if(nFormat == OGroupExchange::getReportGroupId() )
diff --git a/reportdesign/source/ui/dlg/GroupExchange.hxx b/reportdesign/source/ui/dlg/GroupExchange.hxx
index 01eb4373718e..f45ce9974c53 100644
--- a/reportdesign/source/ui/dlg/GroupExchange.hxx
+++ b/reportdesign/source/ui/dlg/GroupExchange.hxx
@@ -37,7 +37,7 @@ namespace rptui
static sal_uInt32 getReportGroupId();
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 void ObjectReleased();
};
}
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 0bfdd4652cb8..09b5e3c835ad 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -278,7 +278,7 @@ sal_Int8 OFieldExpressionControl::ExecuteDrop( const BrowserExecuteDropEvent& rE
SetNoSelection();
TransferableDataHelper aDropped( rEvt.maDropEvent.Transferable );
- uno::Any aDrop = aDropped.GetAny(OGroupExchange::getReportGroupId());
+ uno::Any aDrop = aDropped.GetAny(OGroupExchange::getReportGroupId(), OUString());
uno::Sequence< uno::Any > aGroups;
aDrop >>= aGroups;
if ( aGroups.getLength() )
@@ -881,7 +881,7 @@ void OFieldExpressionControl::InsertRows( long nRow )
SotExchange::GetFormatDataFlavor(OGroupExchange::getReportGroupId(), aFlavor);
uno::Sequence< uno::Any > aGroups;
- if( (aTransferData.GetAny(aFlavor) >>= aGroups) && aGroups.getLength() )
+ if ((aTransferData.GetAny(aFlavor, OUString()) >>= aGroups) && aGroups.getLength())
{
m_bIgnoreEvent = false;
{
diff --git a/reportdesign/source/ui/inc/dlgedclip.hxx b/reportdesign/source/ui/inc/dlgedclip.hxx
index 52b7f8d8372f..5ea8eb5fc3eb 100644
--- a/reportdesign/source/ui/inc/dlgedclip.hxx
+++ b/reportdesign/source/ui/inc/dlgedclip.hxx
@@ -70,7 +70,7 @@ public:
protected:
// TransferableHelper overridables
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 );
private:
TSectionElements m_aCopyElements;
};
diff --git a/reportdesign/source/ui/report/dlgedclip.cxx b/reportdesign/source/ui/report/dlgedclip.cxx
index 48b334e9cbd5..5bcebc9e5570 100644
--- a/reportdesign/source/ui/report/dlgedclip.cxx
+++ b/reportdesign/source/ui/report/dlgedclip.cxx
@@ -51,15 +51,15 @@ void OReportExchange::AddSupportedFormats()
{
AddFormat(getDescriptorFormatId());
}
-//--------------------------------------------------------------------
-sal_Bool OReportExchange::GetData( const datatransfer::DataFlavor& _rFlavor )
+
+sal_Bool OReportExchange::GetData( const datatransfer::DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
{
const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
return (nFormatId == getDescriptorFormatId()) ?
SetAny( uno::Any(m_aCopyElements), _rFlavor )
: sal_False;
}
-// -----------------------------------------------------------------------------
+
sal_Bool OReportExchange::canExtract(const DataFlavorExVector& _rFlavor)
{
return IsFormatSupported(_rFlavor,getDescriptorFormatId());
@@ -78,7 +78,7 @@ OReportExchange::TSectionElements OReportExchange::extractCopies(const Transfera
SotExchange::GetFormatDataFlavor(nKnownFormatId, aFlavor);
OSL_ENSURE(bSuccess, "OReportExchange::extractCopies: invalid data format (no flavor)!");
- uno::Any aDescriptor = _rData.GetAny(aFlavor);
+ uno::Any aDescriptor = _rData.GetAny(aFlavor, OUString());
TSectionElements aCopies;
#if OSL_DEBUG_LEVEL > 0
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index bfc7a54598de..1cac0446f5f2 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -27,6 +27,7 @@
#include "types.hxx"
#include "mtvelements.hxx"
#include "formula/types.hxx"
+#include <svl/zforlist.hxx>
#include <set>
#include <vector>
@@ -226,7 +227,10 @@ public:
SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag, bool bBroadcast = true );
void CopyToClip(
sc::CopyToClipContext& rCxt, SCROW nRow1, SCROW nRow2, ScColumn& rColumn ) const;
- void CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol);
+
+ void CopyStaticToDocument(
+ SCROW nRow1, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScColumn& rDestCol );
+
void CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDestCol );
bool InitBlockPosition( sc::ColumnBlockPosition& rBlockPos );
bool InitBlockPosition( sc::ColumnBlockConstPosition& rBlockPos ) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 339bbb00c047..a2aea94fa79a 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -39,6 +39,7 @@
#include "calcmacros.hxx"
#include <tools/fract.hxx>
#include <tools/gen.hxx>
+#include <svl/zforlist.hxx>
#include <memory>
#include <map>
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index ba7745d21555..fe8adb6a6446 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -412,7 +412,11 @@ public:
void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nDelFlag);
void CopyToClip( sc::CopyToClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pTable );
void CopyToClip( sc::CopyToClipContext& rCxt, const ScRangeList& rRanges, ScTable* pTable );
- void CopyStaticToDocument(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pDestTab);
+
+ void CopyStaticToDocument(
+ SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const SvNumberFormatterMergeMap& rMap,
+ ScTable* pDestTab );
+
void CopyCellToDocument( SCCOL nSrcCol, SCROW nSrcRow, SCCOL nDestCol, SCROW nDestRow, ScTable& rDestTab );
bool InitColumnBlockPosition( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol );
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 5e5cf430f0b2..2d0a01872303 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1061,7 +1061,8 @@ void ScColumn::CopyToClip(
rColumn.CellStorageModified();
}
-void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol)
+void ScColumn::CopyStaticToDocument(
+ SCROW nRow1, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScColumn& rDestCol )
{
if (nRow1 > nRow2)
return;
@@ -1170,6 +1171,17 @@ void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol
break;
}
+ // Dont' forget to copy the number formats over. Charts may reference them.
+ for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+ {
+ sal_uInt32 nNumFmt = GetNumberFormat(nRow);
+ SvNumberFormatterMergeMap::const_iterator itNum = rMap.find(nNumFmt);
+ if (itNum != rMap.end())
+ nNumFmt = itNum->second;
+
+ rDestCol.SetNumberFormat(nRow, nNumFmt);
+ }
+
rDestCol.CellStorageModified();
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 2ec7d6838b35..b739df779a3d 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2148,8 +2148,12 @@ void ScDocument::CopyStaticToDocument(const ScRange& rSrcRange, SCTAB nDestTab,
if (!pSrcTab || !pDestTab)
return;
+ pDestDoc->GetFormatTable()->MergeFormatter(*GetFormatTable());
+ SvNumberFormatterMergeMap aMap = pDestDoc->GetFormatTable()->ConvertMergeTableToMap();
+
pSrcTab->CopyStaticToDocument(
- rSrcRange.aStart.Col(), rSrcRange.aStart.Row(), rSrcRange.aEnd.Col(), rSrcRange.aEnd.Row(), pDestTab);
+ rSrcRange.aStart.Col(), rSrcRange.aStart.Row(), rSrcRange.aEnd.Col(), rSrcRange.aEnd.Row(),
+ aMap, pDestTab);
}
void ScDocument::CopyCellToDocument( const ScAddress& rSrcPos, const ScAddress& rDestPos, ScDocument& rDestDoc )
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index b858a1c7404a..3f0d190be7bd 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -554,7 +554,8 @@ void ScTable::CopyToClip(
}
}
-void ScTable::CopyStaticToDocument(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScTable* pDestTab)
+void ScTable::CopyStaticToDocument(
+ SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const SvNumberFormatterMergeMap& rMap, ScTable* pDestTab )
{
if (nCol1 > nCol2)
return;
@@ -563,7 +564,7 @@ void ScTable::CopyStaticToDocument(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
{
ScColumn& rSrcCol = aCol[i];
ScColumn& rDestCol = pDestTab->aCol[i];
- rSrcCol.CopyStaticToDocument(nRow1, nRow2, rDestCol);
+ rSrcCol.CopyStaticToDocument(nRow1, nRow2, rMap, rDestCol);
}
}
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 63a81c04ef13..9cb5a22fe784 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -95,7 +95,8 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
pDragSourceView( NULL ),
nDragSourceFlags( 0 ),
bDragWasInternal( false ),
- nSourceDocID( 0 )
+ nSourceDocID( 0 ),
+ maShellID(SfxObjectShell::CreateShellID(pContainerShell))
{
//
// check what kind of objects are contained
@@ -339,12 +340,8 @@ void ScDrawTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
AddFormat( SOT_FORMAT_GDIMETAFILE );
- if ( !aOleData.GetTransferable().is() )
- {
- SdrOle2Obj* pObj = GetSingleObject();
- if ( pObj && pObj->GetObjRef().is() )
- aOleData = TransferableDataHelper( new SvEmbedTransferHelper( pObj->GetObjRef(), pObj->GetGraphic(), pObj->GetAspect() ) ) ;
- }
+ CreateOLEData();
+
if ( aOleData.GetTransferable().is() )
{
// get format list from object snapshot
@@ -376,19 +373,15 @@ void ScDrawTransferObj::AddSupportedFormats()
// AddFormat( SOT_FORMATSTR_ID_SVIM );
}
-sal_Bool ScDrawTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool ScDrawTransferObj::GetData(
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
{
sal_Bool bOK = false;
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
if ( bOleObj && nFormat != SOT_FORMAT_GDIMETAFILE )
{
- if ( !aOleData.GetTransferable().is() )
- {
- SdrOle2Obj* pObj = GetSingleObject();
- if ( pObj && pObj->GetObjRef().is() )
- aOleData = TransferableDataHelper( new SvEmbedTransferHelper( pObj->GetObjRef(), pObj->GetGraphic(), pObj->GetAspect() ) ) ;
- }
+ CreateOLEData();
if( aOleData.GetTransferable().is() && aOleData.HasFormat( rFlavor ) )
{
@@ -400,7 +393,7 @@ sal_Bool ScDrawTransferObj::GetData( const ::com::sun::star::datatransfer::DataF
pModel->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_PURGE );
}
- bOK = SetAny( aOleData.GetAny( rFlavor ), rFlavor );
+ bOK = SetAny( aOleData.GetAny(rFlavor, rDestDoc), rFlavor );
if( pModel )
pModel->SetSwapGraphicsMode( nOldSwapMode );
@@ -701,6 +694,11 @@ void ScDrawTransferObj::SetDragWasInternal()
bDragWasInternal = sal_True;
}
+OUString ScDrawTransferObj::GetShellID() const
+{
+ return maShellID;
+}
+
SdrOle2Obj* ScDrawTransferObj::GetSingleObject()
{
// if single OLE object was copied, get its object
@@ -719,7 +717,26 @@ SdrOle2Obj* ScDrawTransferObj::GetSingleObject()
return NULL;
}
-//
+void ScDrawTransferObj::CreateOLEData()
+{
+ if (aOleData.GetTransferable().is())
+ // Already created.
+ return;
+
+ SdrOle2Obj* pObj = GetSingleObject();
+ if (!pObj || !pObj->GetObjRef().is())
+ // No OLE object present.
+ return;
+
+ SvEmbedTransferHelper* pEmbedTransfer =
+ new SvEmbedTransferHelper(
+ pObj->GetObjRef(), pObj->GetGraphic(), pObj->GetAspect());
+
+ pEmbedTransfer->SetParentShellID(maShellID);
+
+ aOleData = TransferableDataHelper(pEmbedTransfer);
+}
+
// initialize aDocShellRef with a live document from the ClipDoc
//
@@ -740,7 +757,10 @@ void ScDrawTransferObj::InitDocShell()
// SdrExchangeView aDestView( pDestModel );
SdrView aDestView( pDestModel );
aDestView.ShowSdrPage(aDestView.GetModel()->GetPage(0));
- aDestView.Paste( *pModel, Point( aSrcSize.Width()/2, aSrcSize.Height()/2 ) );
+ aDestView.Paste(
+ *pModel,
+ Point(aSrcSize.Width()/2, aSrcSize.Height()/2),
+ NULL, 0, OUString(), OUString());
// put objects to right layer (see ScViewFunc::PasteDataFormat for SOT_FORMATSTR_ID_DRAWING)
diff --git a/sc/source/ui/app/lnktrans.cxx b/sc/source/ui/app/lnktrans.cxx
index 5733b14523c0..d830e42c3e6e 100644
--- a/sc/source/ui/app/lnktrans.cxx
+++ b/sc/source/ui/app/lnktrans.cxx
@@ -55,7 +55,8 @@ void ScLinkTransferObj::AddSupportedFormats()
}
}
-sal_Bool ScLinkTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool ScLinkTransferObj::GetData(
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_Bool bOK = false;
if ( !aLinkURL.isEmpty() )
diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index 679a21e9e0c3..9bedf0cca06b 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -385,7 +385,8 @@ ScDrawTransferObj* ScSelectionTransferObj::GetDrawData()
return pDrawData;
}
-sal_Bool ScSelectionTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool ScSelectionTransferObj::GetData(
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
{
sal_Bool bOK = false;
@@ -412,7 +413,7 @@ sal_Bool ScSelectionTransferObj::GetData( const ::com::sun::star::datatransfer::
if ( xSource.is() )
{
TransferableDataHelper aHelper( xSource );
- uno::Any aAny = aHelper.GetAny( rFlavor );
+ uno::Any aAny = aHelper.GetAny(rFlavor, rDestDoc);
bOK = SetAny( aAny, rFlavor );
}
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index ec6bb4a211f1..ba1aec8524c4 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -246,7 +246,7 @@ void ScTransferObj::AddSupportedFormats()
AddFormat( SOT_FORMATSTR_ID_EDITENGINE );
}
-sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
+sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
bool bOK = false;
diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx
index 81b7b9060e77..7f4a2c6e045f 100644
--- a/sc/source/ui/inc/drwtrans.hxx
+++ b/sc/source/ui/inc/drwtrans.hxx
@@ -63,17 +63,20 @@ private:
ScRangeListVector m_aProtectedChartRangesVector;
+ OUString maShellID;
void InitDocShell();
SdrOle2Obj* GetSingleObject();
+ void CreateOLEData();
+
public:
ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell,
const TransferableObjectDescriptor& rDesc );
virtual ~ScDrawTransferObj();
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 );
virtual void ObjectReleased();
@@ -87,6 +90,8 @@ public:
void SetDragSourceFlags( sal_uInt16 nFlags );
void SetDragWasInternal();
+ OUString GetShellID() const;
+
SdrView* GetDragSourceView() { return pDragSourceView; }
sal_uInt16 GetDragSourceFlags() const { return nDragSourceFlags; }
diff --git a/sc/source/ui/inc/lnktrans.hxx b/sc/source/ui/inc/lnktrans.hxx
index d9ccdebd06aa..1f13e8a72bf0 100644
--- a/sc/source/ui/inc/lnktrans.hxx
+++ b/sc/source/ui/inc/lnktrans.hxx
@@ -36,7 +36,7 @@ public:
void SetLinkURL( const OUString& rURL, const OUString& rText );
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 void ObjectReleased();
virtual void DragFinished( sal_Int8 nDropAction );
};
diff --git a/sc/source/ui/inc/seltrans.hxx b/sc/source/ui/inc/seltrans.hxx
index ba4e184a5086..ec2b6ac52382 100644
--- a/sc/source/ui/inc/seltrans.hxx
+++ b/sc/source/ui/inc/seltrans.hxx
@@ -65,7 +65,7 @@ public:
ScDrawTransferObj* GetDrawData();
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 void ObjectReleased();
};
diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx
index 9bd0d12afa1d..5ae33d069eff 100644
--- a/sc/source/ui/inc/transobj.hxx
+++ b/sc/source/ui/inc/transobj.hxx
@@ -72,7 +72,7 @@ public:
virtual ~ScTransferObj();
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 );
virtual void ObjectReleased();
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 0e28bb5fd992..c59888467e52 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -115,8 +115,8 @@ public:
::com::sun::star::datatransfer::XTransferable >& rxTransferable );
void PasteDraw();
- void PasteDraw( const Point& rLogicPos, SdrModel* pModel,
- sal_Bool bGroup = false, sal_Bool bSameDocClipboard = false );
+ void PasteDraw( const Point& rLogicPos, SdrModel* pModel, bool bGroup,
+ const OUString& rSrcShellID, const OUString& rDestShellID );
sal_Bool PasteOnDrawObject( const ::com::sun::star::uno::Reference<
::com::sun::star::datatransfer::XTransferable >& rxTransferable,
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 1fa83c563e6e..cd38c6d24783 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4412,7 +4412,8 @@ sal_Int8 ScGridWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
bPasteIsMove = bIsMove;
- pViewData->GetView()->PasteDraw( aLogicPos, rData.pDrawTransfer->GetModel() );
+ pViewData->GetView()->PasteDraw(
+ aLogicPos, rData.pDrawTransfer->GetModel(), false, "A", "B");
if (bPasteIsMove)
rData.pDrawTransfer->SetDragWasInternal();
@@ -4517,8 +4518,9 @@ void ScGridWindow::PasteSelection( const Point& rPosPixel )
// bSameDocClipboard argument for PasteDraw is needed
// because only DragData is checked directly inside PasteDraw
- pViewData->GetView()->PasteDraw( aLogicPos, pDrawTransfer->GetModel(), false,
- pDrawTransfer->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+ pViewData->GetView()->PasteDraw(
+ aLogicPos, pDrawTransfer->GetModel(), false,
+ pDrawTransfer->GetShellID(), SfxObjectShell::CreateShellID(pViewData->GetDocShell()));
}
}
}
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index f8454d3570c5..5cb568d5298e 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -449,8 +449,11 @@ void ScViewFunc::PasteDraw()
pViewData->GetActivePart() ) );
ScDrawTransferObj* pDrawClip = ScDrawTransferObj::GetOwnClipboard( pWin );
if (pDrawClip)
- PasteDraw( aPos, pDrawClip->GetModel(), false,
- pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+ {
+ OUString aSrcShellID = pDrawClip->GetShellID();
+ OUString aDestShellID = SfxObjectShell::CreateShellID(pViewData->GetDocShell());
+ PasteDraw(aPos, pDrawClip->GetModel(), false, aSrcShellID, aDestShellID);
+ }
}
void ScViewFunc::PasteFromSystem()
@@ -586,7 +589,9 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
SCROW nPosY = pViewData->GetCurY();
Window* pWin = GetActiveWin();
Point aPos = pWin->PixelToLogic( pViewData->GetScrPos( nPosX, nPosY, pViewData->GetActivePart() ) );
- PasteDraw( aPos, pDrawClip->GetModel(), false, pDrawClip->GetSourceDocID() == pViewData->GetDocument()->GetDocumentID() );
+ PasteDraw(
+ aPos, pDrawClip->GetModel(), false,
+ pDrawClip->GetShellID(), SfxObjectShell::CreateShellID(pViewData->GetDocShell()));
}
else
{
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 9319bd6d5126..d5c32980f2a2 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -120,8 +120,10 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
uno::Reference < io::XInputStream > xStm;
TransferableObjectDescriptor aObjDesc;
- if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) &&
- aDataHelper.GetInputStream( nFormatId, xStm ) )
+ if (aDataHelper.GetTransferableObjectDescriptor(SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc))
+ xStm = aDataHelper.GetInputStream(nFormatId, OUString());
+
+ if (xStm.is())
{
if ( aObjDesc.maClassName == SvGlobalName( SO3_SC_CLASSID_60 ) )
{
@@ -205,9 +207,11 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
{
OUString aName;
uno::Reference < embed::XEmbeddedObject > xObj;
+ xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, OUString());
+ if (!xStm.is())
+ aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, OUString());
- if ( aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, xStm )
- || aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, xStm ) )
+ if (xStm.is())
{
xObj = GetViewData()->GetDocShell()->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName );
}
@@ -515,7 +519,7 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
nObjCount += pPage->GetObjCount(); // count group object only once
}
- PasteDraw( aPos, pModel, (nObjCount > 1) ); // grouped if more than 1 object
+ PasteDraw(aPos, pModel, (nObjCount > 1), "A", "B"); // grouped if more than 1 object
delete pModel;
aDragShellRef->DoClose();
bRet = sal_True;
@@ -525,8 +529,8 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
{
// do excel import into a clipboard document
//TODO/MBA: testing
- uno::Reference < io::XInputStream > xStm;
- if( aDataHelper.GetInputStream( nFormatId, xStm ) )
+ uno::Reference <io::XInputStream> xStm = aDataHelper.GetInputStream(nFormatId, OUString());
+ if (xStm.is())
{
ScDocument* pInsDoc = new ScDocument( SCDOCMODE_CLIP );
SCTAB nSrcTab = 0; // Biff5 in clipboard: always sheet 0
@@ -626,8 +630,8 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r
// get link data from transferable before string data,
// so the source knows it will be used for a link
- uno::Sequence<sal_Int8> aSequence;
- if ( !aDataHelper.GetSequence( SOT_FORMATSTR_ID_LINK, aSequence ) )
+ uno::Sequence<sal_Int8> aSequence = aDataHelper.GetSequence(SOT_FORMATSTR_ID_LINK, OUString());
+ if (!aSequence.getLength())
{
OSL_FAIL("DDE Data not found.");
return false;
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 1904bcec5c77..7506f029cc2f 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -73,8 +73,10 @@ static void lcl_AdjustInsertPos( ScViewData* pData, Point& rPos, Size& rSize )
}
void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
- sal_Bool bGroup, sal_Bool bSameDocClipboard )
+ bool bGroup, const OUString& rSrcShellID, const OUString& rDestShellID )
{
+ bool bSameDocClipboard = rSrcShellID == rDestShellID;
+
MakeDrawLayer();
Point aPos( rLogicPos );
@@ -219,7 +221,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
if ( !bSameDocClipboard )
GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( sal_True );
- pScDrawView->Paste( *pModel, aPos, NULL, nOptions );
+ pScDrawView->Paste(*pModel, aPos, NULL, nOptions, rSrcShellID, rDestShellID);
if ( !bSameDocClipboard )
GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( false );
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 2dcf5fa8a57a..2a24f4eb44e1 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1049,7 +1049,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
pBMView->GetDoc().SetAllocDocSh(true);
SdDrawDocument* pTmpDoc = (SdDrawDocument*) pBMView->GetMarkedObjModel();
- bOK = pView->Paste(*pTmpDoc, aObjPos, pPage);
+ bOK = pView->Paste(*pTmpDoc, aObjPos, pPage, 0, OUString(), OUString());
if (bOLEObjFound)
pBMView->GetDoc().SetAllocDocSh(false);
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index d618df4229f0..bd538b0b91b8 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -439,7 +439,7 @@ void SdTransferable::AddSupportedFormats()
}
}
-sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor )
+sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc )
{
if (SD_MOD()==NULL)
return sal_False;
@@ -467,7 +467,7 @@ sal_Bool SdTransferable::GetData( const DataFlavor& rFlavor )
if( nFormat == FORMAT_GDIMETAFILE && mpGraphic )
bOK = SetGDIMetaFile( mpGraphic->GetGDIMetaFile(), rFlavor );
else
- bOK = SetAny( mpOLEDataHelper->GetAny( rFlavor ), rFlavor );
+ bOK = SetAny( mpOLEDataHelper->GetAny(rFlavor, rDestDoc), rFlavor );
if( mpSdDrawDocumentIntern )
mpSdDrawDocumentIntern->SetSwapGraphicsMode( nOldSwapMode );
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 311d17846bca..641da0a8ca7c 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -124,7 +124,8 @@ void SdPageObjsTLB::SdPageObjsTransferable::AddSupportedFormats()
// -----------------------------------------------------------------------------
-sal_Bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool SdPageObjsTLB::SdPageObjsTransferable::GetData(
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uLong nFormatId = SotExchange::GetFormat( rFlavor );
switch (nFormatId)
diff --git a/sd/source/ui/inc/TabControl.hxx b/sd/source/ui/inc/TabControl.hxx
index 4f45c09f5348..1fa16bc609a6 100644
--- a/sd/source/ui/inc/TabControl.hxx
+++ b/sd/source/ui/inc/TabControl.hxx
@@ -93,7 +93,7 @@ private:
virtual ~TabControlTransferable();
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 void DragFinished( sal_Int8 nDropAction );
};
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 239b8fa4c70a..3b2c99ae078e 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -172,7 +172,9 @@ public:
virtual void onAccessibilityOptionsChanged();
virtual SdrModel* GetMarkedObjModel() const;
- virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
+ virtual sal_Bool Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID );
using SdrExchangeView::Paste;
/** returns true if we have an undo manager and there is an open list undo action */
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 252a40384144..4b1fb6f88b4c 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -97,7 +97,7 @@ public:
SAL_DLLPRIVATE virtual ~SdPageObjsTransferable();
SAL_DLLPRIVATE virtual void AddSupportedFormats();
- SAL_DLLPRIVATE virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ SAL_DLLPRIVATE virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc );
SAL_DLLPRIVATE virtual void DragFinished( sal_Int8 nDropAction );
SAL_DLLPRIVATE virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index 40c624e1c8f9..299f87660646 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -109,7 +109,7 @@ public:
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 );
virtual void ObjectReleased();
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 2572576edf26..148fa45ae3ee 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -977,9 +977,11 @@ SdrModel* View::GetMarkedObjModel() const
return FmFormView::GetMarkedObjModel();;
}
-sal_Bool View::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */)
+sal_Bool View::Paste(
+ const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
+ const OUString& rSrcShellID, const OUString& rDestShellID )
{
- return FmFormView::Paste( rMod, rPos, pLst,nOptions );;
+ return FmFormView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
}
} // end of namespace sd
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 0aecf6ad2afa..9987aa5e857e 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -602,7 +602,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
SdDrawDocument* pSourceDoc = (SdDrawDocument*) pSourceView->GetModel();
pSourceDoc->CreatingDataObj( pOwnData );
SdDrawDocument* pModel = (SdDrawDocument*) pSourceView->GetMarkedObjModel();
- bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
if( !pPage )
pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -643,7 +643,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
pWorkModel->DeletePage( (sal_uInt16) i );
}
- bReturn = Paste( *pWorkModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pWorkModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
if( !pPage )
pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -802,7 +802,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
maDropPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
}
- bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
}
xShell->DoClose();
@@ -843,9 +843,15 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
uno::Reference < io::XInputStream > xStm;
TransferableObjectDescriptor aObjDesc;
- if( aDataHelper.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) &&
- ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, xStm ) ||
- aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ, xStm ) ) )
+ if (aDataHelper.GetTransferableObjectDescriptor(SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc))
+ {
+ OUString aDocShellID = SfxObjectShell::CreateShellID(mrDoc.GetDocSh());
+ xStm = aDataHelper.GetInputStream(nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE, aDocShellID);
+ if (!xStm.is())
+ xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ, aDocShellID);
+ }
+
+ if (xStm.is())
{
if( mrDoc.GetDocSh() && ( mrDoc.GetDocSh()->GetClassName() == aObjDesc.maClassName ) )
{
@@ -879,7 +885,7 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
pModel->DeletePage( (sal_uInt16) i );
}
- bReturn = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
if( !pPage )
pPage = (SdPage*) GetSdrPageView()->GetPage();
@@ -1028,8 +1034,11 @@ sal_Bool View::InsertData( const TransferableDataHelper& rDataHelper,
uno::Reference < embed::XEmbeddedObject > xObj;
OUString aName;
- if ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, xStm ) ||
- aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, xStm ) )
+ xStm = aDataHelper.GetInputStream(nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, OUString());
+ if (!xStm.is())
+ xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, OUString());
+
+ if (xStm.is())
{
xObj = mpDocSh->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName );
}
@@ -1505,7 +1514,7 @@ bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nP
pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
CreateTableFromRTF( *xStm, pModel );
- bool bRet = Paste( *pModel, maDropPos, pPage, nPasteOptions );
+ bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
xComponent->dispose();
xComponent.clear();
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 0dec8d62bf2a..f963d334d55d 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -62,7 +62,7 @@ void TabControl::TabControlTransferable::AddSupportedFormats()
// -----------------------------------------------------------------------------
-sal_Bool TabControl::TabControlTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& )
+sal_Bool TabControl::TabControlTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor&, const OUString& /*rDestDoc*/ )
{
return sal_False;
}
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index befa7aef21ce..91a20e322f97 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -480,7 +480,24 @@ bool SfxObjectShell::Close()
return true;
}
-//--------------------------------------------------------------------
+OUString SfxObjectShell::CreateShellID( const SfxObjectShell* pShell )
+{
+ if (!pShell)
+ return OUString();
+
+ OUString aShellID;
+
+ SfxMedium* pMedium = pShell->GetMedium();
+ if (pMedium)
+ aShellID = pMedium->GetBaseURL();
+
+ if (!aShellID.isEmpty())
+ return aShellID;
+
+ sal_Int64 nShellID = reinterpret_cast<sal_Int64>(pShell);
+ aShellID = "0x" + OUString::number(nShellID, 16);
+ return aShellID;
+}
// returns a pointer the first SfxDocument of specified type
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 445b0be2bc76..0bc05d1caba6 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1607,8 +1607,10 @@ void SmViewShell::Execute(SfxRequest& rReq)
if( aData.GetTransferable().is() &&
( aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBEDDED_OBJ ) ||
(aData.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) &&
- aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBED_SOURCE ))) &&
- aData.GetInputStream( nId, xStrm ) && xStrm.is() )
+ aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBED_SOURCE ))))
+ xStrm = aData.GetInputStream(nId, OUString());
+
+ if (xStrm.is())
{
try
{
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index ec2960850fe6..7729ae28541f 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1301,9 +1301,8 @@ sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox
TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
if( aData.HasFormat( SOT_FORMATSTR_ID_TREELISTBOX ))
{
- ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
- if( aData.GetSequence( SOT_FORMATSTR_ID_TREELISTBOX, aSeq ) &&
- sizeof(SvLBoxDDInfo) == aSeq.getLength() )
+ css::uno::Sequence<sal_Int8> aSeq = aData.GetSequence(SOT_FORMATSTR_ID_TREELISTBOX, OUString());
+ if (sizeof(SvLBoxDDInfo) == aSeq.getLength())
{
memcpy( &aDDInfo, aSeq.getConstArray(), sizeof(SvLBoxDDInfo) );
nRet = rEvt.mnAction;
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index a9e441a6b319..4f33480a01b1 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -294,7 +294,7 @@ sal_Bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rDat
uno::Any aAny;
if( rData.HasFormat( aFlavor ) &&
- ( aAny = rData.GetAny( aFlavor ) ).hasValue() )
+ ( aAny = rData.GetAny(aFlavor, OUString()) ).hasValue() )
{
uno::Sequence< sal_Int8 > anySequence;
aAny >>= anySequence;
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index 7ccbfe5c274c..e7a572e053c7 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -65,7 +65,10 @@ SvEmbedTransferHelper::~SvEmbedTransferHelper()
}
}
-// -----------------------------------------------------------------------------
+void SvEmbedTransferHelper::SetParentShellID( const OUString& rShellID )
+{
+ maParentShellID = rShellID;
+}
void SvEmbedTransferHelper::AddSupportedFormats()
{
@@ -76,7 +79,8 @@ void SvEmbedTransferHelper::AddSupportedFormats()
// -----------------------------------------------------------------------------
-sal_Bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool SvEmbedTransferHelper::GetData(
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
{
sal_Bool bRet = sal_False;
@@ -109,7 +113,12 @@ sal_Bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::D
SvStream* pStream = NULL;
sal_Bool bDeleteStream = sal_False;
uno::Sequence < beans::PropertyValue > aEmpty;
- xPers->storeToEntry( xStg, aName, aEmpty, aEmpty );
+ uno::Sequence<beans::PropertyValue> aObjArgs(2);
+ aObjArgs[0].Name = "SourceShellID";
+ aObjArgs[0].Value <<= maParentShellID;
+ aObjArgs[1].Name = "DestinationShellID";
+ aObjArgs[1].Value <<= rDestDoc;
+ xPers->storeToEntry(xStg, aName, aEmpty, aObjArgs);
if ( xStg->isStreamElement( aName ) )
{
uno::Reference < io::XStream > xStm = xStg->cloneStreamElement( aName );
diff --git a/svtools/source/misc/stringtransfer.cxx b/svtools/source/misc/stringtransfer.cxx
index 579a9998d2e7..687b1a9225df 100644
--- a/svtools/source/misc/stringtransfer.cxx
+++ b/svtools/source/misc/stringtransfer.cxx
@@ -43,8 +43,7 @@ namespace svt
AddFormat(SOT_FORMAT_STRING);
}
- //--------------------------------------------------------------------
- sal_Bool OStringTransferable::GetData( const DataFlavor& _rFlavor )
+ sal_Bool OStringTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
{
sal_uInt32 nFormat = SotExchange::GetFormat( _rFlavor );
if (SOT_FORMAT_STRING == nFormat)
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 73537b636cb8..dd5e54c4163a 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -45,6 +45,7 @@
#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
#include <com/sun/star/datatransfer/MimeContentTypeFactory.hpp>
#include <com/sun/star/datatransfer/XMimeContentType.hpp>
+#include <com/sun/star/datatransfer/XTransferable2.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
@@ -338,6 +339,12 @@ TransferableHelper::~TransferableHelper()
Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) throw( UnsupportedFlavorException, IOException, RuntimeException )
{
+ return getTransferData2(rFlavor, OUString());
+}
+
+Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, const OUString& rDestDoc )
+ throw (UnsupportedFlavorException, IOException, RuntimeException)
+{
if( !maAny.hasValue() || !mpFormats->size() || ( maLastFormat != rFlavor.MimeType ) )
{
const SolarMutexGuard aGuard;
@@ -358,21 +365,21 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
if( SotExchange::GetFormatDataFlavor( FORMAT_STRING, aSubstFlavor ) &&
TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor ) )
{
- GetData( aSubstFlavor );
+ GetData(aSubstFlavor, rDestDoc);
bDone = maAny.hasValue();
}
else if(SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_BMP, aSubstFlavor )
&& TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor )
&& SotExchange::GetFormatDataFlavor(FORMAT_BITMAP, aSubstFlavor))
{
- GetData( aSubstFlavor );
- bDone = sal_True;
+ GetData(aSubstFlavor, rDestDoc);
+ bDone = true;
}
else if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_EMF, aSubstFlavor ) &&
TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor ) &&
SotExchange::GetFormatDataFlavor( FORMAT_GDIMETAFILE, aSubstFlavor ) )
{
- GetData( aSubstFlavor );
+ GetData(aSubstFlavor, rDestDoc);
if( maAny.hasValue() )
{
@@ -402,7 +409,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor ) &&
SotExchange::GetFormatDataFlavor( FORMAT_GDIMETAFILE, aSubstFlavor ) )
{
- GetData( aSubstFlavor );
+ GetData(aSubstFlavor, rDestDoc);
if( maAny.hasValue() )
{
@@ -435,7 +442,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
// if any is not yet filled, use standard format
if( !maAny.hasValue() )
- GetData( rFlavor );
+ GetData(rFlavor, rDestDoc);
#ifdef DEBUG
if( maAny.hasValue() && ::com::sun::star::uno::TypeClass_STRING != maAny.getValueType().getTypeClass() )
@@ -1573,13 +1580,13 @@ Reference< XTransferable > TransferableDataHelper::GetXTransferable() const
// -----------------------------------------------------------------------------
-Any TransferableDataHelper::GetAny( SotFormatStringId nFormat ) const
+Any TransferableDataHelper::GetAny( SotFormatStringId nFormat, const OUString& rDestDoc ) const
{
Any aReturn;
DataFlavor aFlavor;
if ( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) )
- aReturn = GetAny( aFlavor );
+ aReturn = GetAny(aFlavor, rDestDoc);
return aReturn;
}
@@ -1587,7 +1594,7 @@ Any TransferableDataHelper::GetAny( SotFormatStringId nFormat ) const
// -----------------------------------------------------------------------------
-Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor ) const
+Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor, const OUString& rDestDoc ) const
{
::osl::MutexGuard aGuard( mpImpl->maMutex );
Any aRet;
@@ -1598,13 +1605,20 @@ Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor ) const
{
const SotFormatStringId nRequestFormat = SotExchange::GetFormat( rFlavor );
+ Reference<css::datatransfer::XTransferable2> xTransfer2(mxTransfer, UNO_QUERY);
+
if( nRequestFormat )
{
// try to get alien format first
for (DataFlavorExVector::const_iterator aIter( mpFormats->begin() ), aEnd( mpFormats->end() ); aIter != aEnd ; ++aIter)
{
if( ( nRequestFormat == (*aIter).mnSotId ) && !rFlavor.MimeType.equalsIgnoreAsciiCase( (*aIter).MimeType ) )
- aRet = mxTransfer->getTransferData( *aIter );
+ {
+ if (xTransfer2.is())
+ aRet = xTransfer2->getTransferData2(*aIter, rDestDoc);
+ else
+ aRet = mxTransfer->getTransferData(*aIter);
+ }
if( aRet.hasValue() )
break;
@@ -1612,7 +1626,12 @@ Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor ) const
}
if( !aRet.hasValue() )
- aRet = mxTransfer->getTransferData( rFlavor );
+ {
+ if (xTransfer2.is())
+ aRet = xTransfer2->getTransferData2(rFlavor, rDestDoc);
+ else
+ aRet = mxTransfer->getTransferData(rFlavor);
+ }
}
}
catch( const ::com::sun::star::uno::Exception& )
@@ -1634,8 +1653,8 @@ sal_Bool TransferableDataHelper::GetString( SotFormatStringId nFormat, OUString&
sal_Bool TransferableDataHelper::GetString( const DataFlavor& rFlavor, OUString& rStr )
{
- Any aAny( GetAny( rFlavor ) );
- sal_Bool bRet = sal_False;
+ Any aAny = GetAny(rFlavor, OUString());
+ bool bRet = false;
if( aAny.hasValue() )
{
@@ -2003,9 +2022,9 @@ sal_Bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatr
case( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ):
{
- Sequence< sal_Int8 > aSeq;
+ Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString());
- if( GetSequence( rFlavor, aSeq ) && ( 2048 == aSeq.getLength() ) )
+ if (2048 == aSeq.getLength())
{
const sal_Char* p1 = reinterpret_cast< const sal_Char* >( aSeq.getConstArray() );
const sal_Char* p2 = reinterpret_cast< const sal_Char* >( aSeq.getConstArray() ) + 1024;
@@ -2019,9 +2038,9 @@ sal_Bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatr
#ifdef WNT
case SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR:
{
- Sequence< sal_Int8 > aSeq;
+ Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString());
- if( GetSequence( rFlavor, aSeq ) && aSeq.getLength() )
+ if (aSeq.getLength())
{
FILEGROUPDESCRIPTOR* pFDesc = (FILEGROUPDESCRIPTOR*) aSeq.getConstArray();
@@ -2041,14 +2060,14 @@ sal_Bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatr
aSeq.realloc( 0 );
delete pStream;
+ pStream = NULL;
- if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_FILECONTENT, aFileContentFlavor ) &&
- GetSequence( aFileContentFlavor, aSeq ) && aSeq.getLength() )
+ if (SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_FILECONTENT, aFileContentFlavor))
{
- pStream = new SvMemoryStream( (sal_Char*) aSeq.getConstArray(), aSeq.getLength(), STREAM_STD_READ );
+ aSeq = GetSequence(aFileContentFlavor, OUString());
+ if (aSeq.getLength())
+ pStream = new SvMemoryStream( (sal_Char*) aSeq.getConstArray(), aSeq.getLength(), STREAM_STD_READ );
}
- else
- pStream = NULL;
}
if( pStream )
@@ -2153,70 +2172,70 @@ sal_Bool TransferableDataHelper::GetFileList(
// -----------------------------------------------------------------------------
-sal_Bool TransferableDataHelper::GetSequence( SotFormatStringId nFormat, Sequence< sal_Int8 >& rSeq )
+
+Sequence<sal_Int8> TransferableDataHelper::GetSequence( SotFormatStringId nFormat, const OUString& rDestDoc )
{
DataFlavor aFlavor;
- return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetSequence( aFlavor, rSeq ) );
-}
+ if (!SotExchange::GetFormatDataFlavor(nFormat, aFlavor))
+ return Sequence<sal_Int8>();
-// -----------------------------------------------------------------------------
+ return GetSequence(aFlavor, rDestDoc);
+}
-sal_Bool TransferableDataHelper::GetSequence( const DataFlavor& rFlavor, Sequence< sal_Int8 >& rSeq )
+Sequence<sal_Int8> TransferableDataHelper::GetSequence( const DataFlavor& rFlavor, const OUString& rDestDoc )
{
#ifdef DEBUG
fprintf( stderr, "TransferableDataHelper requests sequence of data\n" );
#endif
- const Any aAny( GetAny( rFlavor ) );
- return( aAny.hasValue() && ( aAny >>= rSeq ) );
-}
+ const Any aAny = GetAny(rFlavor, rDestDoc);
+ Sequence<sal_Int8> aSeq;
+ if (aAny.hasValue())
+ aAny >>= aSeq;
-// -----------------------------------------------------------------------------
+ return aSeq;
+}
-sal_Bool TransferableDataHelper::GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rxStream )
+bool TransferableDataHelper::GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rxStream )
{
DataFlavor aFlavor;
return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetSotStorageStream( aFlavor, rxStream ) );
}
-// -----------------------------------------------------------------------------
-
-sal_Bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, SotStorageStreamRef& rxStream )
+bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, SotStorageStreamRef& rxStream )
{
- Sequence< sal_Int8 > aSeq;
- sal_Bool bRet = GetSequence( rFlavor, aSeq );
+ Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString());
- if( bRet )
+ if (aSeq.getLength())
{
rxStream = new SotStorageStream( "" );
rxStream->Write( aSeq.getConstArray(), aSeq.getLength() );
rxStream->Seek( 0 );
}
- return bRet;
+ return aSeq.getLength();
}
-sal_Bool TransferableDataHelper::GetInputStream( SotFormatStringId nFormat, Reference < XInputStream >& rxStream )
+Reference<XInputStream> TransferableDataHelper::GetInputStream( SotFormatStringId nFormat, const OUString& rDestDoc )
{
DataFlavor aFlavor;
- return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetInputStream( aFlavor, rxStream ) );
-}
+ if (!SotExchange::GetFormatDataFlavor(nFormat, aFlavor))
+ return Reference<XInputStream>();
-// -----------------------------------------------------------------------------
+ return GetInputStream(aFlavor, rDestDoc);
+}
-sal_Bool TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, Reference < XInputStream >& rxStream )
+Reference<XInputStream> TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, const OUString& rDestDoc )
{
- Sequence< sal_Int8 > aSeq;
- sal_Bool bRet = GetSequence( rFlavor, aSeq );
+ Sequence<sal_Int8> aSeq = GetSequence(rFlavor, rDestDoc);
- if( bRet )
- rxStream = new ::comphelper::SequenceInputStream( aSeq );
+ if (!aSeq.getLength())
+ return Reference<XInputStream>();
- return bRet;
+ Reference<XInputStream> xStream(new comphelper::SequenceInputStream(aSeq));
+ return xStream;
}
-// -----------------------------------------------------------------------------
-
void TransferableDataHelper::Rebind( const Reference< XTransferable >& _rxNewContent )
{
mxTransfer = _rxNewContent;
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index eb282c13f6b6..9c4cc6823712 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -415,8 +415,8 @@ void TransferDataContainer::AddSupportedFormats()
// -----------------------------------------------------------------------------
-sal_Bool TransferDataContainer::GetData( const
- ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+sal_Bool TransferDataContainer::GetData(
+ const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
TDataCntnrEntryList::iterator aIter( pImpl->aFmtList.begin() ),
aEnd( pImpl->aFmtList.end() );
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;
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,
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 1647e33f02bd..1ffd3c660308 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -268,6 +268,9 @@ public:
OUString msCLSID;
+ OUString maSrcShellID;
+ OUString maDestShellID;
+
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes;
tDataSequenceCont m_aDataSequencesToExport;
@@ -1009,6 +1012,16 @@ const OUString& SchXMLExportHelper::getChartCLSID()
return m_pImpl->msCLSID;
}
+void SchXMLExportHelper::SetSourceShellID( const OUString& rShellID )
+{
+ m_pImpl->maSrcShellID = rShellID;
+}
+
+void SchXMLExportHelper::SetDestinationShellID( const OUString& rShellID )
+{
+ m_pImpl->maDestShellID = rShellID;
+}
+
UniReference< XMLPropertySetMapper > SchXMLExportHelper_Impl::GetPropertySetMapper() const
{
return mxPropertySetMapper;
@@ -2297,6 +2310,32 @@ bool lcl_exportAxisType( const Reference< chart2::XAxis > xChart2Axis, SvXMLExpo
return bExportDateScale;
}
+void disableLinkedNumberFormat(
+ std::vector<XMLPropertyState>& rPropStates, const UniReference<XMLPropertySetMapper>& rMapper )
+{
+ for (size_t i = 0; i < rPropStates.size(); ++i)
+ {
+ XMLPropertyState& rState = rPropStates[i];
+ if (rState.mnIndex < 0 || rMapper->GetEntryCount() <= rState.mnIndex)
+ continue;
+
+ OUString aXMLName = rMapper->GetEntryXMLName(rState.mnIndex);
+
+ if (aXMLName != "link-data-style-to-source")
+ continue;
+
+ // Entry found. Set the value to false and bail out.
+ rState.maValue <<= false;
+ return;
+ }
+
+ // Entry not found. Insert a new entry for this.
+ sal_Int32 nIndex = rMapper->GetEntryIndex(XML_NAMESPACE_CHART, "link-data-style-to-source", 0);
+ XMLPropertyState aState(nIndex);
+ aState.maValue <<= false;
+ rPropStates.push_back(aState);
+}
+
}
void SchXMLExportHelper_Impl::exportAxis(
@@ -2317,6 +2356,14 @@ void SchXMLExportHelper_Impl::exportAxis(
{
lcl_exportNumberFormat( sNumFormat, xAxisProps, mrExport );
aPropertyStates = mxExpPropMapper->Filter( xAxisProps );
+
+ if (!maSrcShellID.isEmpty() && !maDestShellID.isEmpty() && maSrcShellID != maDestShellID)
+ {
+ // Disable link to source number format property when pasting to
+ // a different doc shell. These shell ID's should be both empty
+ // during real ODF export.
+ disableLinkedNumberFormat(aPropertyStates, mxExpPropMapper->getPropertySetMapper());
+ }
}
bool bExportDateScale = false;
@@ -3556,6 +3603,9 @@ SchXMLExport::~SchXMLExport()
sal_uInt32 SchXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
+ maExportHelper.SetSourceShellID(GetSourceShellID());
+ maExportHelper.SetDestinationShellID(GetDestinationShellID());
+
Reference< chart2::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY );
maExportHelper.m_pImpl->InitRangeSegmentationProperties( xChartDoc );
return SvXMLExport::exportDoc( eClass );
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 3459747cdf4b..f91d921a88ad 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -257,6 +257,9 @@ public:
/// name of stream in package, e.g., "content.xml"
OUString mStreamName;
+ OUString maSrcShellID;
+ OUString maDestShellID;
+
/// stack of backed up namespace maps
/// long: depth at which namespace map has been backed up into the stack
::std::stack< ::std::pair< SvXMLNamespaceMap *, long > > mNamespaceMaps;
@@ -794,15 +797,16 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue
try
{
+ const sal_Int32 nPropCount = aDescriptor.getLength();
+
const sal_uInt32 nTest =
EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS;
if( (mnExportFlags & nTest) == nTest && msOrigFileName.isEmpty() )
{
// evaluate descriptor only for flat files and if a base URI
// has not been provided already
- const sal_Int32 nPropCount = aDescriptor.getLength();
- const beans::PropertyValue* pProps = aDescriptor.getConstArray();
+ const beans::PropertyValue* pProps = aDescriptor.getConstArray();
for( sal_Int32 nIndex = 0; nIndex < nPropCount; nIndex++, pProps++ )
{
const OUString& rPropName = pProps->Name;
@@ -821,6 +825,25 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue
}
}
+ const beans::PropertyValue* pProps = aDescriptor.getConstArray();
+ for (sal_Int32 nIndex = 0; nIndex < nPropCount; ++nIndex, ++pProps)
+ {
+ const OUString& rPropName = pProps->Name;
+ const Any& rValue = pProps->Value;
+
+ if (rPropName == "SourceShellID")
+ {
+ if (!(rValue >>= mpImpl->maSrcShellID))
+ return false;
+ }
+ else if (rPropName == "DestinationShellID")
+ {
+ if (!(rValue >>= mpImpl->maDestShellID))
+ return false;
+ }
+ }
+
+
exportDoc( meClass );
}
catch(const uno::Exception& e)
@@ -1510,6 +1533,16 @@ void SvXMLExport::ResetNamespaceMap()
delete mpNamespaceMap; mpNamespaceMap = new SvXMLNamespaceMap;
}
+OUString SvXMLExport::GetSourceShellID() const
+{
+ return mpImpl->maSrcShellID;
+}
+
+OUString SvXMLExport::GetDestinationShellID() const
+{
+ return mpImpl->maDestShellID;
+}
+
void SvXMLExport::_ExportMeta()
{
OUString generator( ::utl::DocInfoHelper::GetGeneratorString() );