[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - chart2/source comphelper/source dbaccess/source embeddedobj/source include/comphelper include/sfx2 include/svtools include/svx include/xmloff offapi/com offapi/UnoApi_offapi.mk reportdesign/source sc/inc sc/source sd/source sfx2/source starmath/source svtools/source svx/source sw/source xmloff/source
Kohei Yoshida
kohei.yoshida at collabora.com
Thu Jun 19 20:31:05 PDT 2014
chart2/source/controller/chartapiwrapper/AxisWrapper.cxx | 5
chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx | 5
chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx | 66 -----
chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.hxx | 9
chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx | 9
chart2/source/controller/main/ChartDropTargetHelper.cxx | 4
chart2/source/controller/main/ChartTransferable.cxx | 2
chart2/source/controller/main/ChartTransferable.hxx | 2
chart2/source/model/filter/XMLFilter.cxx | 5
chart2/source/model/inc/XMLFilter.hxx | 3
chart2/source/model/main/Axis.cxx | 17 +
chart2/source/model/main/DataPointProperties.cxx | 11
chart2/source/model/main/DataPointProperties.hxx | 1
chart2/source/model/template/ChartTypeTemplate.cxx | 10
chart2/source/tools/AxisHelper.cxx | 15 +
chart2/source/view/main/ChartView.cxx | 18 +
comphelper/source/container/embeddedobjectcontainer.cxx | 23 +
dbaccess/source/ui/browser/dbexchange.cxx | 4
dbaccess/source/ui/inc/JoinExchange.hxx | 2
dbaccess/source/ui/inc/TableRowExchange.hxx | 2
dbaccess/source/ui/inc/dbexchange.hxx | 2
dbaccess/source/ui/querydesign/JoinExchange.cxx | 2
dbaccess/source/ui/tabledesign/TableRowExchange.cxx | 2
embeddedobj/source/commonembedding/persistence.cxx | 54 +++-
embeddedobj/source/inc/commonembobj.hxx | 12
include/comphelper/embeddedobjectcontainer.hxx | 8
include/sfx2/objsh.hxx | 2
include/svtools/embedtransfer.hxx | 6
include/svtools/stringtransfer.hxx | 2
include/svtools/transfer.hxx | 31 +-
include/svx/dbaexchange.hxx | 6
include/svx/dbaobjectex.hxx | 2
include/svx/fmview.hxx | 2
include/svx/galmisc.hxx | 2
include/svx/svdobj.hxx | 7
include/svx/svdoole2.hxx | 3
include/svx/svdxcgv.hxx | 5
include/svx/view3d.hxx | 4
include/svx/xmlexchg.hxx | 2
include/xmloff/SchXMLExportHelper.hxx | 3
include/xmloff/xmlexp.hxx | 3
offapi/UnoApi_offapi.mk | 1
offapi/com/sun/star/datatransfer/XTransferable2.idl | 41 +++
reportdesign/source/ui/dlg/GroupExchange.cxx | 4
reportdesign/source/ui/dlg/GroupExchange.hxx | 2
reportdesign/source/ui/dlg/GroupsSorting.cxx | 4
reportdesign/source/ui/inc/dlgedclip.hxx | 2
reportdesign/source/ui/report/dlgedclip.cxx | 8
sc/inc/column.hxx | 6
sc/inc/document.hxx | 1
sc/inc/table.hxx | 6
sc/source/core/data/column.cxx | 14 +
sc/source/core/data/document.cxx | 6
sc/source/core/data/table2.cxx | 5
sc/source/ui/app/drwtrans.cxx | 54 +++-
sc/source/ui/app/lnktrans.cxx | 3
sc/source/ui/app/seltrans.cxx | 5
sc/source/ui/app/transobj.cxx | 2
sc/source/ui/inc/drwtrans.hxx | 7
sc/source/ui/inc/lnktrans.hxx | 2
sc/source/ui/inc/seltrans.hxx | 2
sc/source/ui/inc/transobj.hxx | 2
sc/source/ui/inc/viewfunc.hxx | 4
sc/source/ui/view/gridwin.cxx | 8
sc/source/ui/view/viewfun3.cxx | 11
sc/source/ui/view/viewfun5.cxx | 22 +
sc/source/ui/view/viewfun7.cxx | 6
sd/source/core/drawdoc3.cxx | 2
sd/source/ui/app/sdxfer.cxx | 4
sd/source/ui/dlg/sdtreelb.cxx | 3
sd/source/ui/inc/TabControl.hxx | 2
sd/source/ui/inc/View.hxx | 4
sd/source/ui/inc/sdtreelb.hxx | 2
sd/source/ui/inc/sdxfer.hxx | 2
sd/source/ui/view/sdview2.cxx | 6
sd/source/ui/view/sdview3.cxx | 29 +-
sd/source/ui/view/tabcontr.cxx | 2
sfx2/source/doc/objxtor.cxx | 19 +
starmath/source/view.cxx | 6
svtools/source/contnr/treelistbox.cxx | 5
svtools/source/dialogs/insdlg.cxx | 2
svtools/source/misc/embedtransfer.cxx | 15 -
svtools/source/misc/stringtransfer.cxx | 3
svtools/source/misc/transfer.cxx | 121 +++++-----
svtools/source/misc/transfer2.cxx | 4
svx/source/engine3d/view3d.cxx | 6
svx/source/fmcomp/dbaexchange.cxx | 16 -
svx/source/fmcomp/dbaobjectex.cxx | 5
svx/source/fmcomp/xmlexchg.cxx | 2
svx/source/form/fmexch.cxx | 11
svx/source/form/fmview.cxx | 7
svx/source/gallery2/galmisc.cxx | 2
svx/source/inc/fmexch.hxx | 4
svx/source/svdraw/svdobj.cxx | 5
svx/source/svdraw/svdoole2.cxx | 23 +
svx/source/svdraw/svdxcgv.cxx | 6
svx/source/tbxctrls/colrctrl.cxx | 4
sw/source/core/frmedt/fecopy.cxx | 2
sw/source/core/ole/ndole.cxx | 4
sw/source/core/undo/unins.cxx | 2
sw/source/ui/dochdl/swdtflvr.cxx | 17 -
sw/source/ui/inc/swdtflvr.hxx | 2
xmloff/source/chart/SchXMLExport.cxx | 50 ++++
xmloff/source/core/xmlexp.cxx | 37 ++-
104 files changed, 687 insertions(+), 350 deletions(-)
New commits:
commit 4ee53683df4beda260aff26d2c9e56fe643f45bb
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Jun 13 11:12:50 2014 -0400
fdo#71076, fdo#71767: Preserve number formats when charts are copied.
(cherry picked from commit 1d38cb365543924f9c50014e6b2227e77de1d0c9)
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
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 665ea53..28226dc 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 9b5b622..a507782 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 a4010a8..5370d117 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 63a562c..9602080 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 328dd8c..7974dc1 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 154db84..0857de3 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 f072b21..e7d7d2b 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 efbd1b3..9ae5aaf 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 cee36fa..ce44fd7 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 648e25f..d8bb956 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 f8a3b90..c478068 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 443101d..2aa4ca9 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 596adf8..2d7258a 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 b1ac7d22..8ff8563 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 4b372ca..8291ca6 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 f501aa9..c519aef 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 2d7df99..c3b4338 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 32c05ce..47e4d2f 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 2bf549a..d705300 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 0f03474..a298a5b 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 f194213..c8d9852 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 70007d7..8efc796 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 3a14971..a593b09 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 36741eb..4891656 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 fba8d21..83e4445 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 7ce0566..616ca0f 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 de041fbf..05aa6a7 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 2649188..186bc0c 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 12d6fda..60d2ced 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 2a8ce29..76c192f 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 e6fef35..1761df1 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 429477e..efd6c0e 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 af984ad..6c5c523 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 7045a51..af7ae18 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 f1b3dbb..25b83b6 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 e909990..fb95b8d 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -146,6 +146,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 010df2e..3043f0f 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 943cdb3..dfda739 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 64de636..d1ce6d3 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 d46663f..af866be 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 7ef8f3f..3612a7a 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 d73807e..e03bae2 100755
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -2098,6 +2098,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 0000000..5ff7d58
--- /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 06753d8..2e13979 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 01eb437..f45ce99 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 0bfdd46..09b5e3c 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 52b7f8d..5ea8eb5 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 48b334e..5bcebc9 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 bfc7a54..1cac044 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 0d08d80..c70b0a2 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 c8c9164..8de7420 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 5e5cf43..2d0a018 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 a57746d..12e0ff1 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2147,8 +2147,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 1420c37..5986a8e 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 63a81c0..9cb5a22 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 5733b14..d830e42 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 679a21e..9bedf0c 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 ec6bb4a..ba1aec8 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 81b7b90..7f4a2c6 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 d9ccdeb..1f13e8a 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 ba4e184..ec2b6ac 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 9bd0d12..5ae33d0 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 4736964..8fcfaf1 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 d1cbde0..4121f7d 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4451,7 +4451,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();
@@ -4556,8 +4557,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 f8454d3..5cb568d 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 9319bd6..d5c3298 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 1904bce..7506f02 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 2dcf5fa..2a24f4e 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 d618df4..bd538b0 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 da8f014..95ed2b2 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -125,7 +125,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 da35355..1c8fce5 100644
--- a/sd/source/ui/inc/TabControl.hxx
+++ b/sd/source/ui/inc/TabControl.hxx
@@ -95,7 +95,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 239b8fa..3b2c99a 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 4200282..d0c1449 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -101,7 +101,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 40c624e1..299f876 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 2572576..148fa45 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 0aecf6a..9987aa5 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())
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list