fdo#71076, fdo#71767: Preserve number formats when charts are copied.
Change-Id: If5ae8852152012483237e7602e56a0c46ea8748a
This commit is contained in:
parent
2538e30ccc
commit
1d38cb3655
@ -656,9 +656,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") );
|
||||
{
|
||||
|
@ -697,9 +697,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 );
|
||||
|
@ -33,18 +33,11 @@ namespace wrapper
|
||||
WrappedNumberFormatProperty::WrappedNumberFormatProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
|
||||
: WrappedDirectStateProperty( CHART_UNONAME_NUMFMT, CHART_UNONAME_NUMFMT )
|
||||
, m_spChart2ModelContact(spChart2ModelContact)
|
||||
, m_pWrappedLinkNumberFormatProperty(NULL)
|
||||
{
|
||||
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
|
||||
@ -54,19 +47,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(CHART_UNONAME_NUMFMT).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
|
||||
@ -77,7 +59,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;
|
||||
@ -100,23 +82,14 @@ Any WrappedNumberFormatProperty::getPropertyDefault( const Reference< beans::XPr
|
||||
return uno::makeAny( sal_Int32( 0 ) );
|
||||
}
|
||||
|
||||
WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty ) :
|
||||
WrappedProperty( CHART_UNONAME_LINK_TO_SRC_NUMFMT, OUString() ),
|
||||
m_pWrappedNumberFormatProperty( pWrappedNumberFormatProperty )
|
||||
WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( const boost::shared_ptr<Chart2ModelContact>& pChart2ModelContact ) :
|
||||
WrappedDirectStateProperty(CHART_UNONAME_LINK_TO_SRC_NUMFMT, CHART_UNONAME_LINK_TO_SRC_NUMFMT),
|
||||
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
|
||||
@ -128,31 +101,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(CHART_UNONAME_NUMFMT, aValue);
|
||||
}
|
||||
xInnerPropertySet->setPropertyValue(getInnerName(), rOuterValue);
|
||||
}
|
||||
|
||||
Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::XPropertySet >& xInnerPropertySet ) const
|
||||
@ -163,8 +112,8 @@ Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::X
|
||||
OSL_FAIL("missing xInnerPropertySet in WrappedNumberFormatProperty::getPropertyValue");
|
||||
return getPropertyDefault(0);
|
||||
}
|
||||
bool bLink = ! xInnerPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
|
||||
return uno::makeAny( bLink );
|
||||
|
||||
return xInnerPropertySet->getPropertyValue(getInnerName());
|
||||
}
|
||||
|
||||
Any WrappedLinkNumberFormatProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /*xInnerPropertyState*/ ) const
|
||||
|
@ -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) SAL_OVERRIDE;
|
||||
|
||||
friend class WrappedNumberFormatProperty;
|
||||
private:
|
||||
WrappedNumberFormatProperty* m_pWrappedNumberFormatProperty;
|
||||
boost::shared_ptr<Chart2ModelContact> m_pChart2ModelContact;
|
||||
};
|
||||
|
||||
} //namespace wrapper
|
||||
|
@ -423,8 +423,9 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
|
||||
|
||||
case SID_ATTR_NUMBERFORMAT_SOURCE:
|
||||
{
|
||||
bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue());
|
||||
rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet ));
|
||||
bool bLinkToSource = true;
|
||||
GetPropertySet()->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
|
||||
rOutItemSet.Put(SfxBoolItem(nWhichId, bLinkToSource));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -930,6 +931,8 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet
|
||||
bool bUseSourceFormat =
|
||||
(static_cast< const SfxBoolItem & >(
|
||||
rItemSet.Get( nWhichId )).GetValue() );
|
||||
GetPropertySet()->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(bUseSourceFormat));
|
||||
|
||||
bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue();
|
||||
|
||||
bChangedOtherwise = (bUseSourceFormat == bNumberFormatIsSet);
|
||||
|
@ -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" )
|
||||
|
@ -73,7 +73,7 @@ void ChartTransferable::AddSupportedFormats()
|
||||
AddFormat( SOT_FORMAT_BITMAP );
|
||||
}
|
||||
|
||||
bool ChartTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool ChartTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
|
||||
bool bResult = false;
|
||||
|
@ -43,7 +43,7 @@ protected:
|
||||
|
||||
// implementation of TransferableHelper methods
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
|
||||
const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
|
||||
|
@ -541,6 +541,7 @@ sal_Int32 XMLFilter::impl_Export(
|
||||
const Reference< lang::XComponent > & xDocumentComp,
|
||||
const Sequence< beans::PropertyValue > & rMediaDescriptor )
|
||||
{
|
||||
m_aMediaDescriptor = rMediaDescriptor;
|
||||
//save
|
||||
|
||||
sal_Int32 nWarning = 0;
|
||||
@ -744,9 +745,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)
|
||||
{
|
||||
|
@ -151,6 +151,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;
|
||||
|
@ -67,7 +67,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,
|
||||
@ -115,10 +116,17 @@ void lcl_AddPropertiesToVector(
|
||||
|
||||
rOutProperties.push_back(
|
||||
Property( CHART_UNONAME_NUMFMT,
|
||||
PROP_AXIS_NUMBER_FORMAT,
|
||||
PROP_AXIS_NUMBERFORMAT,
|
||||
cppu::UnoType<sal_Int32>::get(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEVOID ));
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
||||
|
||||
rOutProperties.push_back(
|
||||
Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
|
||||
PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE,
|
||||
::getBooleanCppuType(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
||||
|
||||
rOutProperties.push_back(
|
||||
Property( "LabelPosition",
|
||||
@ -220,6 +228,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 );
|
||||
|
@ -282,7 +282,14 @@ void DataPointProperties::AddPropertiesToVector(
|
||||
PROP_DATAPOINT_NUMBER_FORMAT,
|
||||
cppu::UnoType<sal_Int32>::get(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEVOID ));
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
||||
|
||||
rOutProperties.push_back(
|
||||
Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT,
|
||||
PROP_DATAPOINT_LINK_NUMBERFORMAT_TO_SOURCE,
|
||||
::getBooleanCppuType(),
|
||||
beans::PropertyAttribute::BOUND
|
||||
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
||||
|
||||
//additional 'PercentageNumberFormat'
|
||||
rOutProperties.push_back(
|
||||
@ -410,6 +417,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
|
||||
|
@ -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,
|
||||
|
@ -458,8 +458,7 @@ void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram
|
||||
if( xAxisProp.is())
|
||||
{
|
||||
// set number format to source format
|
||||
uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
|
||||
if( aValue.hasValue())
|
||||
xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(true));
|
||||
xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
|
||||
}
|
||||
}
|
||||
@ -758,8 +757,7 @@ void ChartTypeTemplate::adaptAxes(
|
||||
if( xAxisProp.is())
|
||||
{
|
||||
// set number format to source format
|
||||
uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT);
|
||||
if( aValue.hasValue())
|
||||
xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::makeAny(true));
|
||||
xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any());
|
||||
}
|
||||
}
|
||||
|
@ -143,7 +143,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(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey ) )
|
||||
if (!xProp.is())
|
||||
return 0;
|
||||
|
||||
bool bLinkToSource = true;
|
||||
xProp->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
|
||||
xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey;
|
||||
|
||||
sal_Int32 nOldNumberFormat = nNumberFormatKey;
|
||||
|
||||
if (bLinkToSource)
|
||||
{
|
||||
bool bFormatSet = false;
|
||||
//check whether we have a percent scale -> use percent format
|
||||
@ -316,7 +325,11 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nOldNumberFormat != nNumberFormatKey)
|
||||
xProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(nNumberFormatKey));
|
||||
}
|
||||
|
||||
return nNumberFormatKey;
|
||||
}
|
||||
|
||||
|
@ -1870,7 +1870,16 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
|
||||
if( !xSeriesOrPointProp.is() )
|
||||
return nFormat;
|
||||
|
||||
if (!(xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat))
|
||||
bool bLinkToSource = true;
|
||||
try
|
||||
{
|
||||
xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkToSource;
|
||||
}
|
||||
catch ( const beans::UnknownPropertyException& ) {}
|
||||
|
||||
xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat;
|
||||
sal_Int32 nOldFormat = nFormat;
|
||||
if (bLinkToSource)
|
||||
{
|
||||
uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) );
|
||||
|
||||
@ -1895,7 +1904,11 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
|
||||
nFormat = xValues->getNumberFormatKeyByIndex( nPointIndex );
|
||||
}
|
||||
}
|
||||
|
||||
if (nFormat >= 0 && nOldFormat != nFormat)
|
||||
xSeriesOrPointProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(nFormat));
|
||||
}
|
||||
|
||||
if(nFormat<0)
|
||||
nFormat=0;
|
||||
return nFormat;
|
||||
|
@ -487,7 +487,9 @@ void EmbeddedObjectContainer::AddEmbeddedObject( const ::com::sun::star::uno::Re
|
||||
}
|
||||
}
|
||||
|
||||
bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName, bool bCopy )
|
||||
bool EmbeddedObjectContainer::StoreEmbeddedObject(
|
||||
const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName, bool bCopy,
|
||||
const OUString& rSrcShellID, const OUString& rDestShellID )
|
||||
{
|
||||
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
|
||||
if ( rName.isEmpty() )
|
||||
@ -506,7 +508,14 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < embed:
|
||||
{
|
||||
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 optimization, don't store immediately
|
||||
@ -529,7 +538,7 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject( const uno::Reference < embed:
|
||||
bool EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName )
|
||||
{
|
||||
// store it into the container storage
|
||||
if ( StoreEmbeddedObject( xObj, rName, false ) )
|
||||
if (StoreEmbeddedObject(xObj, rName, false, OUString(), OUString()))
|
||||
{
|
||||
// remember object
|
||||
AddEmbeddedObject( xObj, rName );
|
||||
@ -683,7 +692,9 @@ bool EmbeddedObjectContainer::TryToCopyGraphReplacement( EmbeddedObjectContainer
|
||||
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 )
|
||||
{
|
||||
uno::Reference< embed::XEmbeddedObject > xResult;
|
||||
|
||||
@ -703,7 +714,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb
|
||||
rName = CreateUniqueObjectName();
|
||||
|
||||
// objects without persistence are not really stored by the method
|
||||
if ( xObj.is() && StoreEmbeddedObject( xObj, rName, true ) )
|
||||
if (xObj.is() && StoreEmbeddedObject(xObj, rName, true, rSrcShellID, rDestShellID))
|
||||
{
|
||||
xResult = Get_Impl( rName, xObj);
|
||||
if ( !xResult.is() )
|
||||
|
@ -159,7 +159,7 @@ namespace dbaui
|
||||
ODataAccessObjectTransferable::AddSupportedFormats();
|
||||
}
|
||||
|
||||
bool ODataClipboard::GetData( const DataFlavor& rFlavor )
|
||||
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()
|
||||
|
@ -61,7 +61,7 @@ namespace dbaui
|
||||
|
||||
protected:
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
||||
|
||||
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
|
||||
|
@ -34,7 +34,7 @@ namespace dbaui
|
||||
OTableRowExchange(const ::std::vector< ::boost::shared_ptr<OTableRow> >& _rvTableRow);
|
||||
protected:
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
};
|
||||
|
@ -77,7 +77,7 @@ namespace dbaui
|
||||
|
||||
protected:
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
};
|
||||
|
@ -113,7 +113,7 @@ namespace dbaui
|
||||
AddFormat( SOT_FORMATSTR_ID_SBA_TABID );
|
||||
}
|
||||
|
||||
bool OJoinExchObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool OJoinExchObj::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uInt32 nFormat = SotExchange::GetFormat(rFlavor);
|
||||
if ( SOT_FORMATSTR_ID_SBA_JOIN == nFormat )
|
||||
|
@ -52,7 +52,7 @@ namespace dbaui
|
||||
if ( !m_vTableRow.empty() )
|
||||
AddFormat(SOT_FORMATSTR_ID_SBA_TABED);
|
||||
}
|
||||
bool OTableRowExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool OTableRowExchange::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uLong nFormat = SotExchange::GetFormat(rFlavor);
|
||||
if(nFormat == SOT_FORMATSTR_ID_SBA_TABED)
|
||||
|
@ -723,10 +723,31 @@ void OCommonEmbeddedObject::SwitchDocToStorage_Impl( const uno::Reference< docum
|
||||
m_xRecoveryStorage.clear();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed::XStorage >& xStorage,
|
||||
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& aBaseURL,
|
||||
const OUString& aHierarchName,
|
||||
bool bAttachToTheStorage )
|
||||
{
|
||||
@ -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 )
|
||||
@ -1237,7 +1264,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, false );
|
||||
StoreDocToStorage_Impl(
|
||||
xSubStorage, lArguments, lObjArgs, nTargetStorageFormat, sEntName, false );
|
||||
aGuard.reset();
|
||||
|
||||
if ( bSwitchBackToLoaded )
|
||||
@ -1374,7 +1402,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, false );
|
||||
StoreDocToStorage_Impl(
|
||||
xSubStorage, lArguments, lObjArgs, nTargetStorageFormat, sEntName, false );
|
||||
aGuard.reset();
|
||||
|
||||
if ( bSwitchBackToLoaded )
|
||||
@ -1599,7 +1628,8 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn()
|
||||
}
|
||||
|
||||
aGuard.clear();
|
||||
StoreDocToStorage_Impl( m_xObjectStorage, nStorageFormat, GetBaseURL_Impl(), m_aEntryName, true );
|
||||
uno::Sequence<beans::PropertyValue> aEmpty;
|
||||
StoreDocToStorage_Impl( m_xObjectStorage, aEmpty, aEmpty, nStorageFormat, m_aEntryName, true );
|
||||
aGuard.reset();
|
||||
}
|
||||
|
||||
|
@ -195,9 +195,11 @@ 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,
|
||||
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& aBaseURL,
|
||||
const OUString& aHierarchName,
|
||||
bool bAttachToStorage );
|
||||
|
||||
|
@ -58,7 +58,9 @@ class COMPHELPER_DLLPUBLIC EmbeddedObjectContainer
|
||||
|
||||
public:
|
||||
// add an embedded object to the container storage
|
||||
bool StoreEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString&, 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
|
||||
bool MoveEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, OUString& );
|
||||
|
@ -218,6 +218,8 @@ public:
|
||||
|
||||
using SotObject::GetInterface;
|
||||
|
||||
static OUString CreateShellID( const SfxObjectShell* pShell );
|
||||
|
||||
// Document-Shell Iterator
|
||||
static SfxObjectShell* GetFirst( const TypeId* pType = 0,
|
||||
bool bOnlyVisible = true );
|
||||
|
@ -33,10 +33,12 @@ private:
|
||||
Graphic* m_pGraphic;
|
||||
sal_Int64 m_nAspect;
|
||||
|
||||
OUString maParentShellID;
|
||||
|
||||
protected:
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
|
||||
public:
|
||||
@ -46,6 +48,8 @@ public:
|
||||
sal_Int64 nAspect );
|
||||
virtual ~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,
|
||||
|
@ -42,7 +42,7 @@ namespace svt
|
||||
protected:
|
||||
// TransferableHelper overridables
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& _rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& _rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
|
@ -29,7 +29,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>
|
||||
@ -126,7 +126,7 @@ struct ExecuteDropEvent
|
||||
mbDefault( 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 >
|
||||
@ -177,6 +177,11 @@ private:
|
||||
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
||||
virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
||||
|
||||
// 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, std::exception) SAL_OVERRIDE;
|
||||
|
||||
// XEventListener
|
||||
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
||||
|
||||
@ -235,7 +240,7 @@ protected:
|
||||
protected:
|
||||
|
||||
virtual void AddSupportedFormats() = 0;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) = 0;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) = 0;
|
||||
virtual 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();
|
||||
@ -311,8 +316,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;
|
||||
|
||||
bool GetString( SotFormatStringId nFormat, OUString& rStr );
|
||||
bool GetString( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, OUString& rStr );
|
||||
@ -349,14 +354,14 @@ public:
|
||||
bool GetFileList( SotFormatStringId nFormat, FileList& rFileList );
|
||||
bool GetFileList( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, FileList& rFileList );
|
||||
|
||||
bool GetSequence( SotFormatStringId nFormat, ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq );
|
||||
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 );
|
||||
|
||||
bool GetSotStorageStream( SotFormatStringId nFormat, SotStorageStreamRef& rStreamRef );
|
||||
bool GetSotStorageStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, SotStorageStreamRef& rStreamRef );
|
||||
|
||||
bool GetInputStream( SotFormatStringId nFormat, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream );
|
||||
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 );
|
||||
|
||||
bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf );
|
||||
|
||||
@ -492,7 +497,7 @@ class SVT_DLLPUBLIC TransferDataContainer : public TransferableHelper
|
||||
protected:
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
@ -147,7 +147,7 @@ namespace svx
|
||||
protected:
|
||||
// TransferableHelper overridables
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
|
||||
static sal_uInt32 getDescriptorFormatId();
|
||||
|
||||
@ -225,7 +225,7 @@ namespace svx
|
||||
|
||||
protected:
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
@ -275,7 +275,7 @@ namespace svx
|
||||
|
||||
protected:
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
static sal_uInt32 getDescriptorFormatId();
|
||||
};
|
||||
|
@ -63,7 +63,7 @@ namespace svx
|
||||
protected:
|
||||
// TransferableHelper overridables
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
|
||||
static sal_uInt32 getDescriptorFormatId(bool _bExtractForm);
|
||||
};
|
||||
|
@ -108,8 +108,6 @@ public:
|
||||
|
||||
// for copying complete form structures, not only control models
|
||||
virtual SdrModel* GetMarkedObjModel() const SAL_OVERRIDE;
|
||||
using E3dView::Paste;
|
||||
virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
|
||||
|
||||
virtual bool MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin ) SAL_OVERRIDE;
|
||||
|
||||
|
@ -176,7 +176,7 @@ protected:
|
||||
|
||||
// TransferableHelper
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
|
@ -580,6 +580,9 @@ public:
|
||||
// it should be sufficient to do "virtual Foo* Clone() const { return CloneHelper< Foo >(); }".
|
||||
// Note that this function uses operator= internally.
|
||||
virtual SdrObject* Clone() const;
|
||||
|
||||
virtual SdrObject* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const;
|
||||
|
||||
// implemented mainly for the purposes of Clone()
|
||||
SdrObject& operator=(const SdrObject& rObj);
|
||||
|
||||
|
@ -145,7 +145,10 @@ public:
|
||||
virtual OUString TakeObjNameSingul() const SAL_OVERRIDE;
|
||||
virtual OUString TakeObjNamePlural() const SAL_OVERRIDE;
|
||||
|
||||
SdrOle2Obj* Clone() const SAL_OVERRIDE;
|
||||
virtual SdrOle2Obj* Clone() const SAL_OVERRIDE;
|
||||
virtual SdrOle2Obj* CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const SAL_OVERRIDE;
|
||||
|
||||
SdrOle2Obj& assignFrom( const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID );
|
||||
SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
|
||||
|
||||
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
|
||||
|
@ -103,7 +103,10 @@ public:
|
||||
// View angezeigt wird.
|
||||
// Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und
|
||||
// SDRINSERT_ADDMARK (siehe svdedtv.hxx).
|
||||
virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
|
||||
virtual bool Paste(
|
||||
const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
|
||||
const OUString& rSrcShellID, const OUString& rDestShellID );
|
||||
|
||||
bool Paste(const OUString& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
|
||||
bool Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
|
||||
|
||||
|
@ -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 bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
|
||||
virtual bool Paste(
|
||||
const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
|
||||
const OUString& rSrcShellID, const OUString& rDestShellID ) SAL_OVERRIDE;
|
||||
|
||||
// #83403# Service routine used from local Clone() and from SdrCreateView::EndCreateObj(...)
|
||||
bool ImpCloneAll3DObjectsToDestScene(E3dScene* pSrcScene, E3dScene* pDstScene, Point aOffset);
|
||||
|
@ -69,7 +69,7 @@ namespace svx
|
||||
|
||||
// TransferableHelper overridables
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
|
||||
OXFormsDescriptor m_aDescriptor;
|
||||
|
||||
|
@ -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
|
||||
|
@ -210,6 +210,9 @@ protected:
|
||||
// This method must be overloaded to export the content of <office:body>.
|
||||
virtual void _ExportContent() = 0;
|
||||
|
||||
OUString GetSourceShellID() const;
|
||||
OUString GetDestinationShellID() const;
|
||||
|
||||
void SetExtended( bool bSet=true ) { mbExtended = bSet; }
|
||||
|
||||
// save linked sections? (may be false in global documents)
|
||||
|
@ -2112,6 +2112,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/datatransfer,\
|
||||
XSystemTransferable \
|
||||
XTransferDataAccess \
|
||||
XTransferable \
|
||||
XTransferable2 \
|
||||
XTransferableEx \
|
||||
XTransferableSource \
|
||||
XTransferableSupplier \
|
||||
|
41
offapi/com/sun/star/datatransfer/XTransferable2.idl
Normal file
41
offapi/com/sun/star/datatransfer/XTransferable2.idl
Normal file
@ -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: */
|
||||
|
@ -49,7 +49,7 @@ namespace rptui
|
||||
}
|
||||
}
|
||||
|
||||
bool OGroupExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool OGroupExchange::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uLong nFormat = SotExchange::GetFormat(rFlavor);
|
||||
if(nFormat == OGroupExchange::getReportGroupId() )
|
||||
|
@ -37,7 +37,7 @@ namespace rptui
|
||||
static sal_uInt32 getReportGroupId();
|
||||
protected:
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
};
|
||||
}
|
||||
|
@ -272,7 +272,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() )
|
||||
@ -865,7 +865,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;
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
protected:
|
||||
// TransferableHelper overridables
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
private:
|
||||
TSectionElements m_aCopyElements;
|
||||
};
|
||||
|
@ -52,7 +52,7 @@ void OReportExchange::AddSupportedFormats()
|
||||
AddFormat(getDescriptorFormatId());
|
||||
}
|
||||
|
||||
bool OReportExchange::GetData( const datatransfer::DataFlavor& _rFlavor )
|
||||
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 );
|
||||
@ -76,7 +76,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
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "types.hxx"
|
||||
#include "mtvelements.hxx"
|
||||
#include <formula/types.hxx>
|
||||
#include <svl/zforlist.hxx>
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
@ -232,7 +233,10 @@ public:
|
||||
|
||||
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;
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include "calcconfig.hxx"
|
||||
#include <tools/fract.hxx>
|
||||
#include <tools/gen.hxx>
|
||||
#include <svl/zforlist.hxx>
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
|
@ -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 );
|
||||
|
@ -1040,7 +1040,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;
|
||||
@ -1149,6 +1150,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();
|
||||
}
|
||||
|
||||
|
@ -2157,8 +2157,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 )
|
||||
|
@ -556,7 +556,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;
|
||||
@ -565,7 +566,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,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
|
||||
@ -335,12 +336,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
|
||||
@ -372,19 +369,14 @@ void ScDrawTransferObj::AddSupportedFormats()
|
||||
// AddFormat( SOT_FORMATSTR_ID_SVIM );
|
||||
}
|
||||
|
||||
bool ScDrawTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
|
||||
{
|
||||
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 ) )
|
||||
{
|
||||
@ -396,7 +388,7 @@ bool ScDrawTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavo
|
||||
pModel->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_PURGE );
|
||||
}
|
||||
|
||||
bOK = SetAny( aOleData.GetAny( rFlavor ), rFlavor );
|
||||
bOK = SetAny( aOleData.GetAny(rFlavor, rDestDoc), rFlavor );
|
||||
|
||||
if( pModel )
|
||||
pModel->SetSwapGraphicsMode( nOldSwapMode );
|
||||
@ -697,6 +689,11 @@ void ScDrawTransferObj::SetDragWasInternal()
|
||||
bDragWasInternal = true;
|
||||
}
|
||||
|
||||
OUString ScDrawTransferObj::GetShellID() const
|
||||
{
|
||||
return maShellID;
|
||||
}
|
||||
|
||||
SdrOle2Obj* ScDrawTransferObj::GetSingleObject()
|
||||
{
|
||||
// if single OLE object was copied, get its object
|
||||
@ -715,6 +712,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
|
||||
|
||||
@ -736,7 +753,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)
|
||||
|
||||
|
@ -53,7 +53,8 @@ void ScLinkTransferObj::AddSupportedFormats()
|
||||
}
|
||||
}
|
||||
|
||||
bool ScLinkTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool ScLinkTransferObj::GetData(
|
||||
const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
bool bOK = false;
|
||||
if ( !aLinkURL.isEmpty() )
|
||||
|
@ -389,7 +389,8 @@ ScDrawTransferObj* ScSelectionTransferObj::GetDrawData()
|
||||
return pDrawData;
|
||||
}
|
||||
|
||||
bool ScSelectionTransferObj::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool ScSelectionTransferObj::GetData(
|
||||
const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
|
||||
{
|
||||
bool bOK = false;
|
||||
|
||||
@ -416,7 +417,7 @@ bool ScSelectionTransferObj::GetData( const ::com::sun::star::datatransfer::Data
|
||||
if ( xSource.is() )
|
||||
{
|
||||
TransferableDataHelper aHelper( xSource );
|
||||
uno::Any aAny = aHelper.GetAny( rFlavor );
|
||||
uno::Any aAny = aHelper.GetAny(rFlavor, rDestDoc);
|
||||
bOK = SetAny( aAny, rFlavor );
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ void ScTransferObj::AddSupportedFormats()
|
||||
AddFormat( SOT_FORMATSTR_ID_EDITENGINE );
|
||||
}
|
||||
|
||||
bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
|
||||
bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
|
||||
bool bOK = false;
|
||||
|
@ -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() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
|
||||
const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
@ -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; }
|
||||
|
||||
|
@ -36,7 +36,7 @@ public:
|
||||
void SetLinkURL( const OUString& rURL, const OUString& rText );
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
||||
};
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
ScDrawTransferObj* GetDrawData();
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
virtual ~ScTransferObj();
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
|
||||
const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
|
@ -119,8 +119,8 @@ public:
|
||||
::com::sun::star::datatransfer::XTransferable >& rxTransferable );
|
||||
|
||||
void PasteDraw();
|
||||
void PasteDraw( const Point& rLogicPos, SdrModel* pModel,
|
||||
bool bGroup = false, bool bSameDocClipboard = false );
|
||||
void PasteDraw( const Point& rLogicPos, SdrModel* pModel, bool bGroup,
|
||||
const OUString& rSrcShellID, const OUString& rDestShellID );
|
||||
|
||||
bool PasteOnDrawObjectLinked(
|
||||
const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxTransferable,
|
||||
|
@ -4433,7 +4433,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();
|
||||
@ -4536,8 +4537,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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -447,8 +447,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()
|
||||
@ -584,7 +587,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
|
||||
{
|
||||
|
@ -117,8 +117,10 @@ 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 ) )
|
||||
{
|
||||
@ -209,9 +211,11 @@ 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 );
|
||||
}
|
||||
@ -518,7 +522,7 @@ bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
|
||||
nObjCount += pPage->GetObjCount(); // count group object only once
|
||||
}
|
||||
|
||||
PasteDraw( aPos, pModel.get(), (nObjCount > 1) ); // grouped if more than 1 object
|
||||
PasteDraw(aPos, pModel.get(), (nObjCount > 1), "A", "B"); // grouped if more than 1 object
|
||||
pModel.reset();
|
||||
aDragShellRef->DoClose();
|
||||
bRet = true;
|
||||
@ -528,8 +532,8 @@ 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
|
||||
@ -629,8 +633,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;
|
||||
|
@ -74,8 +74,10 @@ static void lcl_AdjustInsertPos( ScViewData* pData, Point& rPos, Size& rSize )
|
||||
}
|
||||
|
||||
void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
|
||||
bool bGroup, bool bSameDocClipboard )
|
||||
bool bGroup, const OUString& rSrcShellID, const OUString& rDestShellID )
|
||||
{
|
||||
bool bSameDocClipboard = rSrcShellID == rDestShellID;
|
||||
|
||||
MakeDrawLayer();
|
||||
Point aPos( rLogicPos );
|
||||
|
||||
@ -221,7 +223,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
|
||||
if ( !bSameDocClipboard )
|
||||
GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( true );
|
||||
|
||||
pScDrawView->Paste( *pModel, aPos, NULL, nOptions );
|
||||
pScDrawView->Paste(*pModel, aPos, NULL, nOptions, rSrcShellID, rDestShellID);
|
||||
|
||||
if ( !bSameDocClipboard )
|
||||
GetViewData()->GetDocument()->SetPastingDrawFromOtherDoc( false );
|
||||
|
@ -1095,7 +1095,7 @@ 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);
|
||||
|
@ -448,7 +448,7 @@ void SdTransferable::AddSupportedFormats()
|
||||
}
|
||||
}
|
||||
|
||||
bool SdTransferable::GetData( const DataFlavor& rFlavor )
|
||||
bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc )
|
||||
{
|
||||
if (SD_MOD()==NULL)
|
||||
return false;
|
||||
@ -476,7 +476,7 @@ 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 );
|
||||
|
@ -125,7 +125,7 @@ void SdPageObjsTLB::SdPageObjsTransferable::AddSupportedFormats()
|
||||
|
||||
|
||||
|
||||
bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uLong nFormatId = SotExchange::GetFormat( rFlavor );
|
||||
switch (nFormatId)
|
||||
|
@ -95,7 +95,7 @@ private:
|
||||
virtual ~TabControlTransferable();
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
||||
|
||||
};
|
||||
|
@ -195,7 +195,10 @@ public:
|
||||
virtual void onAccessibilityOptionsChanged() SAL_OVERRIDE;
|
||||
|
||||
virtual SdrModel* GetMarkedObjModel() const SAL_OVERRIDE;
|
||||
virtual bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0) SAL_OVERRIDE;
|
||||
virtual bool Paste(
|
||||
const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
|
||||
const OUString& rSrcShellID, const OUString& rDestShellID ) SAL_OVERRIDE;
|
||||
|
||||
using SdrExchangeView::Paste;
|
||||
|
||||
/** returns true if we have an undo manager and there is an open list undo action */
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
SAL_DLLPRIVATE virtual ~SdPageObjsTransferable();
|
||||
|
||||
SAL_DLLPRIVATE virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
SAL_DLLPRIVATE virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
SAL_DLLPRIVATE virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
SAL_DLLPRIVATE virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
||||
|
||||
SAL_DLLPRIVATE virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
||||
|
@ -106,7 +106,7 @@ public:
|
||||
protected:
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual void ObjectReleased() SAL_OVERRIDE;
|
||||
|
||||
|
@ -976,9 +976,11 @@ SdrModel* View::GetMarkedObjModel() const
|
||||
return FmFormView::GetMarkedObjModel();;
|
||||
}
|
||||
|
||||
bool View::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst /* =NULL */, sal_uInt32 nOptions /* =0 */)
|
||||
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
|
||||
|
@ -604,7 +604,7 @@ 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();
|
||||
@ -645,7 +645,7 @@ 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();
|
||||
@ -804,7 +804,7 @@ 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();
|
||||
@ -845,9 +845,15 @@ 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 ) )
|
||||
{
|
||||
@ -881,7 +887,7 @@ 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();
|
||||
@ -1030,8 +1036,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
|
||||
uno::Reference < embed::XEmbeddedObject > xObj;
|
||||
OUString aName;
|
||||
|
||||
if ( aDataHelper.GetInputStream( nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, xStm ) ||
|
||||
aDataHelper.GetInputStream( SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, xStm ) )
|
||||
xStm = aDataHelper.GetInputStream(nFormat ? nFormat : SOT_FORMATSTR_ID_EMBED_SOURCE_OLE, OUString());
|
||||
if (!xStm.is())
|
||||
xStm = aDataHelper.GetInputStream(SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE, OUString());
|
||||
|
||||
if (xStm.is())
|
||||
{
|
||||
xObj = mpDocSh->GetEmbeddedObjectContainer().InsertEmbeddedObject( xStm, aName );
|
||||
}
|
||||
@ -1504,7 +1513,7 @@ bool View::PasteRTFTable( SotStorageStreamRef xStm, SdrPage* pPage, sal_uLong nP
|
||||
pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
|
||||
|
||||
CreateTableFromRTF( *xStm, pModel.get() );
|
||||
bool bRet = Paste( *pModel, maDropPos, pPage, nPasteOptions );
|
||||
bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString());
|
||||
|
||||
xComponent->dispose();
|
||||
xComponent.clear();
|
||||
|
@ -62,7 +62,7 @@ void TabControl::TabControlTransferable::AddSupportedFormats()
|
||||
|
||||
|
||||
|
||||
bool TabControl::TabControlTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& )
|
||||
bool TabControl::TabControlTransferable::GetData( const css::datatransfer::DataFlavor& /*rFlavor*/, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -474,7 +474,24 @@ bool SfxObjectShell::Close()
|
||||
return true;
|
||||
}
|
||||
|
||||
OUString SfxObjectShell::CreateShellID( const SfxObjectShell* pShell )
|
||||
{
|
||||
if (!pShell)
|
||||
return OUString();
|
||||
|
||||
OUString aShellID;
|
||||
|
||||
SfxMedium* pMedium = pShell->GetMedium();
|
||||
if (pMedium)
|
||||
aShellID = pMedium->GetBaseURL();
|
||||
|
||||
if (!aShellID.isEmpty())
|
||||
return aShellID;
|
||||
|
||||
sal_Int64 nShellID = reinterpret_cast<sal_Int64>(pShell);
|
||||
aShellID = "0x" + OUString::number(nShellID, 16);
|
||||
return aShellID;
|
||||
}
|
||||
|
||||
// returns a pointer the first SfxDocument of specified type
|
||||
|
||||
|
@ -1570,8 +1570,10 @@ void SmViewShell::Execute(SfxRequest& rReq)
|
||||
if( aData.GetTransferable().is() &&
|
||||
( aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBEDDED_OBJ ) ||
|
||||
(aData.HasFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR ) &&
|
||||
aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBED_SOURCE ))) &&
|
||||
aData.GetInputStream( nId, xStrm ) && xStrm.is() )
|
||||
aData.HasFormat( nId = SOT_FORMATSTR_ID_EMBED_SOURCE ))))
|
||||
xStrm = aData.GetInputStream(nId, OUString());
|
||||
|
||||
if (xStrm.is())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1243,9 +1243,8 @@ sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox
|
||||
TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
|
||||
if( aData.HasFormat( SOT_FORMATSTR_ID_TREELISTBOX ))
|
||||
{
|
||||
::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
|
||||
if( aData.GetSequence( SOT_FORMATSTR_ID_TREELISTBOX, aSeq ) &&
|
||||
sizeof(SvLBoxDDInfo) == aSeq.getLength() )
|
||||
css::uno::Sequence<sal_Int8> aSeq = aData.GetSequence(SOT_FORMATSTR_ID_TREELISTBOX, OUString());
|
||||
if (sizeof(SvLBoxDDInfo) == aSeq.getLength())
|
||||
{
|
||||
memcpy( &aDDInfo, aSeq.getConstArray(), sizeof(SvLBoxDDInfo) );
|
||||
nRet = rEvt.mnAction;
|
||||
|
@ -293,7 +293,7 @@ bool SvPasteObjectHelper::GetEmbeddedName(const TransferableDataHelper& rData, O
|
||||
|
||||
uno::Any aAny;
|
||||
if( rData.HasFormat( aFlavor ) &&
|
||||
( aAny = rData.GetAny( aFlavor ) ).hasValue() )
|
||||
( aAny = rData.GetAny(aFlavor, OUString()) ).hasValue() )
|
||||
{
|
||||
uno::Sequence< sal_Int8 > anySequence;
|
||||
aAny >>= anySequence;
|
||||
|
@ -65,6 +65,10 @@ SvEmbedTransferHelper::~SvEmbedTransferHelper()
|
||||
}
|
||||
}
|
||||
|
||||
void SvEmbedTransferHelper::SetParentShellID( const OUString& rShellID )
|
||||
{
|
||||
maParentShellID = rShellID;
|
||||
}
|
||||
|
||||
|
||||
void SvEmbedTransferHelper::AddSupportedFormats()
|
||||
@ -76,7 +80,7 @@ void SvEmbedTransferHelper::AddSupportedFormats()
|
||||
|
||||
|
||||
|
||||
bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc )
|
||||
{
|
||||
bool bRet = false;
|
||||
|
||||
@ -109,7 +113,12 @@ bool SvEmbedTransferHelper::GetData( const ::com::sun::star::datatransfer::DataF
|
||||
SvStream* pStream = NULL;
|
||||
bool bDeleteStream = false;
|
||||
uno::Sequence < beans::PropertyValue > aEmpty;
|
||||
xPers->storeToEntry( xStg, aName, aEmpty, aEmpty );
|
||||
uno::Sequence<beans::PropertyValue> aObjArgs(2);
|
||||
aObjArgs[0].Name = "SourceShellID";
|
||||
aObjArgs[0].Value <<= maParentShellID;
|
||||
aObjArgs[1].Name = "DestinationShellID";
|
||||
aObjArgs[1].Value <<= rDestDoc;
|
||||
xPers->storeToEntry(xStg, aName, aEmpty, aObjArgs);
|
||||
if ( xStg->isStreamElement( aName ) )
|
||||
{
|
||||
uno::Reference < io::XStream > xStm = xStg->cloneStreamElement( aName );
|
||||
|
@ -44,7 +44,7 @@ namespace svt
|
||||
}
|
||||
|
||||
|
||||
bool OStringTransferable::GetData( const DataFlavor& _rFlavor )
|
||||
bool OStringTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uInt32 nFormat = SotExchange::GetFormat( _rFlavor );
|
||||
if (SOT_FORMAT_STRING == nFormat)
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
|
||||
#include <com/sun/star/datatransfer/MimeContentTypeFactory.hpp>
|
||||
#include <com/sun/star/datatransfer/XMimeContentType.hpp>
|
||||
#include <com/sun/star/datatransfer/XTransferable2.hpp>
|
||||
#include <com/sun/star/frame/Desktop.hpp>
|
||||
#include <com/sun/star/lang/XInitialization.hpp>
|
||||
|
||||
@ -299,8 +300,14 @@ TransferableHelper::~TransferableHelper()
|
||||
}
|
||||
|
||||
|
||||
Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor )
|
||||
throw (UnsupportedFlavorException, IOException, RuntimeException, std::exception)
|
||||
{
|
||||
return getTransferData2(rFlavor, OUString());
|
||||
}
|
||||
|
||||
Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) throw( UnsupportedFlavorException, IOException, RuntimeException, std::exception )
|
||||
Any SAL_CALL TransferableHelper::getTransferData2( const DataFlavor& rFlavor, const OUString& rDestDoc )
|
||||
throw (UnsupportedFlavorException, IOException, RuntimeException, std::exception)
|
||||
{
|
||||
if( !maAny.hasValue() || !mpFormats->size() || ( maLastFormat != rFlavor.MimeType ) )
|
||||
{
|
||||
@ -322,21 +329,21 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
|
||||
if( SotExchange::GetFormatDataFlavor( FORMAT_STRING, aSubstFlavor ) &&
|
||||
TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor ) )
|
||||
{
|
||||
GetData( aSubstFlavor );
|
||||
GetData(aSubstFlavor, rDestDoc);
|
||||
bDone = maAny.hasValue();
|
||||
}
|
||||
else if(SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_BMP, aSubstFlavor )
|
||||
&& TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor )
|
||||
&& SotExchange::GetFormatDataFlavor(FORMAT_BITMAP, aSubstFlavor))
|
||||
{
|
||||
GetData( aSubstFlavor );
|
||||
GetData(aSubstFlavor, rDestDoc);
|
||||
bDone = true;
|
||||
}
|
||||
else if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_EMF, aSubstFlavor ) &&
|
||||
TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor ) &&
|
||||
SotExchange::GetFormatDataFlavor( FORMAT_GDIMETAFILE, aSubstFlavor ) )
|
||||
{
|
||||
GetData( aSubstFlavor );
|
||||
GetData(aSubstFlavor, rDestDoc);
|
||||
|
||||
if( maAny.hasValue() )
|
||||
{
|
||||
@ -366,7 +373,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
|
||||
TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor ) &&
|
||||
SotExchange::GetFormatDataFlavor( FORMAT_GDIMETAFILE, aSubstFlavor ) )
|
||||
{
|
||||
GetData( aSubstFlavor );
|
||||
GetData(aSubstFlavor, rDestDoc);
|
||||
|
||||
if( maAny.hasValue() )
|
||||
{
|
||||
@ -399,7 +406,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th
|
||||
|
||||
// if any is not yet filled, use standard format
|
||||
if( !maAny.hasValue() )
|
||||
GetData( rFlavor );
|
||||
GetData(rFlavor, rDestDoc);
|
||||
|
||||
#ifdef DEBUG
|
||||
if( maAny.hasValue() && ::com::sun::star::uno::TypeClass_STRING != maAny.getValueType().getTypeClass() )
|
||||
@ -1537,13 +1544,13 @@ Reference< XTransferable > TransferableDataHelper::GetXTransferable() const
|
||||
|
||||
|
||||
|
||||
Any TransferableDataHelper::GetAny( SotFormatStringId nFormat ) const
|
||||
Any TransferableDataHelper::GetAny( SotFormatStringId nFormat, const OUString& rDestDoc ) const
|
||||
{
|
||||
Any aReturn;
|
||||
|
||||
DataFlavor aFlavor;
|
||||
if ( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) )
|
||||
aReturn = GetAny( aFlavor );
|
||||
aReturn = GetAny(aFlavor, rDestDoc);
|
||||
|
||||
return aReturn;
|
||||
}
|
||||
@ -1551,7 +1558,7 @@ Any TransferableDataHelper::GetAny( SotFormatStringId nFormat ) const
|
||||
|
||||
|
||||
|
||||
Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor ) const
|
||||
Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor, const OUString& rDestDoc ) const
|
||||
{
|
||||
::osl::MutexGuard aGuard( mpImpl->maMutex );
|
||||
Any aRet;
|
||||
@ -1562,13 +1569,20 @@ Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor ) const
|
||||
{
|
||||
const SotFormatStringId nRequestFormat = SotExchange::GetFormat( rFlavor );
|
||||
|
||||
Reference<css::datatransfer::XTransferable2> xTransfer2(mxTransfer, UNO_QUERY);
|
||||
|
||||
if( nRequestFormat )
|
||||
{
|
||||
// try to get alien format first
|
||||
for (DataFlavorExVector::const_iterator aIter( mpFormats->begin() ), aEnd( mpFormats->end() ); aIter != aEnd ; ++aIter)
|
||||
{
|
||||
if( ( nRequestFormat == (*aIter).mnSotId ) && !rFlavor.MimeType.equalsIgnoreAsciiCase( (*aIter).MimeType ) )
|
||||
{
|
||||
if (xTransfer2.is())
|
||||
aRet = xTransfer2->getTransferData2(*aIter, rDestDoc);
|
||||
else
|
||||
aRet = mxTransfer->getTransferData(*aIter);
|
||||
}
|
||||
|
||||
if( aRet.hasValue() )
|
||||
break;
|
||||
@ -1576,9 +1590,14 @@ Any TransferableDataHelper::GetAny( const DataFlavor& rFlavor ) const
|
||||
}
|
||||
|
||||
if( !aRet.hasValue() )
|
||||
{
|
||||
if (xTransfer2.is())
|
||||
aRet = xTransfer2->getTransferData2(rFlavor, rDestDoc);
|
||||
else
|
||||
aRet = mxTransfer->getTransferData(rFlavor);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( const ::com::sun::star::uno::Exception& )
|
||||
{
|
||||
}
|
||||
@ -1598,7 +1617,7 @@ bool TransferableDataHelper::GetString( SotFormatStringId nFormat, OUString& rSt
|
||||
|
||||
bool TransferableDataHelper::GetString( const DataFlavor& rFlavor, OUString& rStr )
|
||||
{
|
||||
Any aAny( GetAny( rFlavor ) );
|
||||
Any aAny = GetAny(rFlavor, OUString());
|
||||
bool bRet = false;
|
||||
|
||||
if( aAny.hasValue() )
|
||||
@ -1969,9 +1988,9 @@ bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatransf
|
||||
|
||||
case( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK ):
|
||||
{
|
||||
Sequence< sal_Int8 > aSeq;
|
||||
Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString());
|
||||
|
||||
if( GetSequence( rFlavor, aSeq ) && ( 2048 == aSeq.getLength() ) )
|
||||
if (2048 == aSeq.getLength())
|
||||
{
|
||||
const sal_Char* p1 = reinterpret_cast< const sal_Char* >( aSeq.getConstArray() );
|
||||
const sal_Char* p2 = reinterpret_cast< const sal_Char* >( aSeq.getConstArray() ) + 1024;
|
||||
@ -1985,9 +2004,9 @@ bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatransf
|
||||
#ifdef WNT
|
||||
case SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR:
|
||||
{
|
||||
Sequence< sal_Int8 > aSeq;
|
||||
Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString());
|
||||
|
||||
if( GetSequence( rFlavor, aSeq ) && aSeq.getLength() )
|
||||
if (aSeq.getLength())
|
||||
{
|
||||
FILEGROUPDESCRIPTOR* pFDesc = (FILEGROUPDESCRIPTOR*) aSeq.getConstArray();
|
||||
|
||||
@ -2007,14 +2026,14 @@ bool TransferableDataHelper::GetINetBookmark( const ::com::sun::star::datatransf
|
||||
|
||||
aSeq.realloc( 0 );
|
||||
delete pStream;
|
||||
pStream = NULL;
|
||||
|
||||
if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_FILECONTENT, aFileContentFlavor ) &&
|
||||
GetSequence( aFileContentFlavor, aSeq ) && aSeq.getLength() )
|
||||
if (SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_FILECONTENT, aFileContentFlavor))
|
||||
{
|
||||
aSeq = GetSequence(aFileContentFlavor, OUString());
|
||||
if (aSeq.getLength())
|
||||
pStream = new SvMemoryStream( (sal_Char*) aSeq.getConstArray(), aSeq.getLength(), STREAM_STD_READ );
|
||||
}
|
||||
else
|
||||
pStream = NULL;
|
||||
}
|
||||
|
||||
if( pStream )
|
||||
@ -2119,22 +2138,27 @@ bool TransferableDataHelper::GetFileList(
|
||||
|
||||
|
||||
|
||||
bool TransferableDataHelper::GetSequence( SotFormatStringId nFormat, Sequence< sal_Int8 >& rSeq )
|
||||
Sequence<sal_Int8> TransferableDataHelper::GetSequence( SotFormatStringId nFormat, const OUString& rDestDoc )
|
||||
{
|
||||
DataFlavor aFlavor;
|
||||
return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetSequence( aFlavor, rSeq ) );
|
||||
if (!SotExchange::GetFormatDataFlavor(nFormat, aFlavor))
|
||||
return Sequence<sal_Int8>();
|
||||
|
||||
return GetSequence(aFlavor, rDestDoc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool TransferableDataHelper::GetSequence( const DataFlavor& rFlavor, Sequence< sal_Int8 >& rSeq )
|
||||
Sequence<sal_Int8> TransferableDataHelper::GetSequence( const DataFlavor& rFlavor, const OUString& rDestDoc )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
fprintf( stderr, "TransferableDataHelper requests sequence of data\n" );
|
||||
#endif
|
||||
|
||||
const Any aAny( GetAny( rFlavor ) );
|
||||
return( aAny.hasValue() && ( aAny >>= rSeq ) );
|
||||
const Any aAny = GetAny(rFlavor, rDestDoc);
|
||||
Sequence<sal_Int8> aSeq;
|
||||
if (aAny.hasValue())
|
||||
aAny >>= aSeq;
|
||||
|
||||
return aSeq;
|
||||
}
|
||||
|
||||
|
||||
@ -2149,40 +2173,38 @@ bool TransferableDataHelper::GetSotStorageStream( SotFormatStringId nFormat, Sot
|
||||
|
||||
bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, SotStorageStreamRef& rxStream )
|
||||
{
|
||||
Sequence< sal_Int8 > aSeq;
|
||||
bool bRet = GetSequence( rFlavor, aSeq );
|
||||
Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString());
|
||||
|
||||
if( bRet )
|
||||
if (aSeq.getLength())
|
||||
{
|
||||
rxStream = new SotStorageStream( "" );
|
||||
rxStream->Write( aSeq.getConstArray(), aSeq.getLength() );
|
||||
rxStream->Seek( 0 );
|
||||
}
|
||||
|
||||
return bRet;
|
||||
return aSeq.getLength();
|
||||
}
|
||||
|
||||
bool TransferableDataHelper::GetInputStream( SotFormatStringId nFormat, Reference < XInputStream >& rxStream )
|
||||
Reference<XInputStream> TransferableDataHelper::GetInputStream( SotFormatStringId nFormat, const OUString& rDestDoc )
|
||||
{
|
||||
DataFlavor aFlavor;
|
||||
return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetInputStream( aFlavor, rxStream ) );
|
||||
if (!SotExchange::GetFormatDataFlavor(nFormat, aFlavor))
|
||||
return Reference<XInputStream>();
|
||||
|
||||
return GetInputStream(aFlavor, rDestDoc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, Reference < XInputStream >& rxStream )
|
||||
Reference<XInputStream> TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, const OUString& rDestDoc )
|
||||
{
|
||||
Sequence< sal_Int8 > aSeq;
|
||||
bool bRet = GetSequence( rFlavor, aSeq );
|
||||
Sequence<sal_Int8> aSeq = GetSequence(rFlavor, rDestDoc);
|
||||
|
||||
if( bRet )
|
||||
rxStream = new ::comphelper::SequenceInputStream( aSeq );
|
||||
if (!aSeq.getLength())
|
||||
return Reference<XInputStream>();
|
||||
|
||||
return bRet;
|
||||
Reference<XInputStream> xStream(new comphelper::SequenceInputStream(aSeq));
|
||||
return xStream;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TransferableDataHelper::Rebind( const Reference< XTransferable >& _rxNewContent )
|
||||
{
|
||||
mxTransfer = _rxNewContent;
|
||||
|
@ -415,8 +415,8 @@ void TransferDataContainer::AddSupportedFormats()
|
||||
|
||||
|
||||
|
||||
bool TransferDataContainer::GetData( const
|
||||
::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool TransferDataContainer::GetData(
|
||||
const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
TDataCntnrEntryList::iterator aIter( pImpl->aFmtList.begin() ),
|
||||
aEnd( pImpl->aFmtList.end() );
|
||||
|
@ -441,7 +441,9 @@ SdrModel* E3dView::GetMarkedObjModel() const
|
||||
// When pasting objects have to integrated if a scene is inserted, but
|
||||
// not the scene itself
|
||||
|
||||
bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
|
||||
bool E3dView::Paste(
|
||||
const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
|
||||
const OUString& rSrcShellID, const OUString& rDestShellID )
|
||||
{
|
||||
bool bRetval = false;
|
||||
|
||||
@ -486,7 +488,7 @@ bool E3dView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, s
|
||||
else
|
||||
{
|
||||
// call parent
|
||||
bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions);
|
||||
bRetval = SdrView::Paste(rMod, rPos, pLst, nOptions, rSrcShellID, rDestShellID);
|
||||
}
|
||||
|
||||
return bRetval;
|
||||
|
@ -224,7 +224,7 @@ namespace svx
|
||||
}
|
||||
|
||||
|
||||
bool OColumnTransferable::GetData( const DataFlavor& _rFlavor )
|
||||
bool OColumnTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
|
||||
switch (nFormatId)
|
||||
@ -276,7 +276,7 @@ namespace svx
|
||||
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(), aFlavor);
|
||||
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
|
||||
|
||||
Any aDescriptor = _rData.GetAny(aFlavor);
|
||||
Any aDescriptor = _rData.GetAny(aFlavor, OUString());
|
||||
|
||||
// extract the property value sequence
|
||||
Sequence< PropertyValue > aDescriptorProps;
|
||||
@ -469,7 +469,7 @@ namespace svx
|
||||
}
|
||||
|
||||
|
||||
bool ODataAccessObjectTransferable::GetData( const DataFlavor& rFlavor )
|
||||
bool ODataAccessObjectTransferable::GetData( const DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uIntPtr nFormat = SotExchange::GetFormat(rFlavor);
|
||||
switch (nFormat)
|
||||
@ -524,7 +524,7 @@ namespace svx
|
||||
SotExchange::GetFormatDataFlavor(nKnownFormatId, aFlavor);
|
||||
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
|
||||
|
||||
Any aDescriptor = _rData.GetAny(aFlavor);
|
||||
Any aDescriptor = _rData.GetAny(aFlavor, OUString());
|
||||
|
||||
// extract the property value sequence
|
||||
Sequence< PropertyValue > aDescriptorProps;
|
||||
@ -644,7 +644,7 @@ namespace svx
|
||||
AddFormat(getDescriptorFormatId());
|
||||
}
|
||||
|
||||
bool OMultiColumnTransferable::GetData( const DataFlavor& _rFlavor )
|
||||
bool OMultiColumnTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
|
||||
if (nFormatId == getDescriptorFormatId())
|
||||
@ -682,7 +682,7 @@ namespace svx
|
||||
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(), aFlavor);
|
||||
OSL_ENSURE(bSuccess, "OColumnTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
|
||||
|
||||
_rData.GetAny(aFlavor) >>= aList;
|
||||
_rData.GetAny(aFlavor, OUString()) >>= aList;
|
||||
} // if (_rData.HasFormat(getDescriptorFormatId()))
|
||||
return aList;
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ namespace svx
|
||||
}
|
||||
|
||||
|
||||
bool OComponentTransferable::GetData( const DataFlavor& _rFlavor )
|
||||
bool OComponentTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
|
||||
if ( nFormatId == getDescriptorFormatId(true) || nFormatId == getDescriptorFormatId(false) )
|
||||
@ -131,7 +131,7 @@ namespace svx
|
||||
SotExchange::GetFormatDataFlavor(getDescriptorFormatId(bForm), aFlavor);
|
||||
OSL_ENSURE(bSuccess, "OComponentTransferable::extractColumnDescriptor: invalid data format (no flavor)!");
|
||||
|
||||
Any aDescriptor = _rData.GetAny(aFlavor);
|
||||
Any aDescriptor = _rData.GetAny(aFlavor, OUString());
|
||||
|
||||
// extract the property value sequence
|
||||
Sequence< PropertyValue > aDescriptorProps;
|
||||
|
@ -43,7 +43,7 @@ namespace svx
|
||||
AddFormat( SOT_FORMATSTR_ID_XFORMS );
|
||||
}
|
||||
|
||||
bool OXFormsTransferable::GetData( const DataFlavor& _rFlavor )
|
||||
bool OXFormsTransferable::GetData( const DataFlavor& _rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
const sal_uInt32 nFormatId = SotExchange::GetFormat( _rFlavor );
|
||||
if ( SOT_FORMATSTR_ID_XFORMS == nFormatId )
|
||||
|
@ -115,7 +115,7 @@ namespace svxform
|
||||
}
|
||||
|
||||
|
||||
bool OLocalExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& /*_rFlavor*/ )
|
||||
bool OLocalExchange::GetData( const css::datatransfer::DataFlavor& /*_rFlavor*/, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
return false; // do not have any formats by default
|
||||
}
|
||||
@ -139,7 +139,7 @@ namespace svxform
|
||||
if ( OControlExchange::hasControlPathFormat( aExchangedData.GetDataFlavorExVector() ) )
|
||||
{ // paths to the controls, relative to a root
|
||||
Sequence< Any > aControlPathData;
|
||||
if ( aExchangedData.GetAny( OControlExchange::getControlPathFormatId() ) >>= aControlPathData )
|
||||
if ( aExchangedData.GetAny(OControlExchange::getControlPathFormatId(), OUString()) >>= aControlPathData )
|
||||
{
|
||||
DBG_ASSERT( aControlPathData.getLength() >= 2, "OControlTransferData::OControlTransferData: invalid data for the control path format!" );
|
||||
if ( aControlPathData.getLength() >= 2 )
|
||||
@ -155,7 +155,7 @@ namespace svxform
|
||||
}
|
||||
if ( OControlExchange::hasHiddenControlModelsFormat( aExchangedData.GetDataFlavorExVector() ) )
|
||||
{ // sequence of models of hidden controls
|
||||
aExchangedData.GetAny( OControlExchange::getHiddenControlModelsFormatId() ) >>= m_aHiddenControlModels;
|
||||
aExchangedData.GetAny(OControlExchange::getHiddenControlModelsFormatId(), OUString()) >>= m_aHiddenControlModels;
|
||||
}
|
||||
|
||||
updateFormats( );
|
||||
@ -290,7 +290,7 @@ namespace svxform
|
||||
}
|
||||
|
||||
|
||||
bool OControlExchange::GetData( const DataFlavor& _rFlavor )
|
||||
bool OControlExchange::GetData( const DataFlavor& _rFlavor, const OUString& rDestDoc )
|
||||
{
|
||||
const sal_uInt32 nFormatId = SotExchange::GetFormat( _rFlavor );
|
||||
|
||||
@ -310,7 +310,7 @@ namespace svxform
|
||||
SetAny( makeAny( m_aHiddenControlModels ), _rFlavor );
|
||||
}
|
||||
else
|
||||
return OLocalExchange::GetData( _rFlavor );
|
||||
return OLocalExchange::GetData(_rFlavor, rDestDoc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -379,13 +379,6 @@ SdrModel* FmFormView::GetMarkedObjModel() const
|
||||
return E3dView::GetMarkedObjModel();
|
||||
}
|
||||
|
||||
|
||||
bool FmFormView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
|
||||
{
|
||||
return E3dView::Paste(rMod, rPos, pLst, nOptions);
|
||||
}
|
||||
|
||||
|
||||
void FmFormView::ActivateControls(SdrPageView* pPageView)
|
||||
{
|
||||
if (!pPageView)
|
||||
|
@ -507,7 +507,7 @@ void GalleryTransferable::AddSupportedFormats()
|
||||
}
|
||||
}
|
||||
|
||||
bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor )
|
||||
bool GalleryTransferable::GetData( const datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
|
||||
bool bRet = false;
|
||||
|
@ -82,7 +82,7 @@ namespace svxform
|
||||
|
||||
// TransferableHelper
|
||||
virtual void DragFinished( sal_Int8 nDropAction ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
|
||||
private:
|
||||
void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions, sal_Int32 nDragPointer = DND_POINTER_NONE, sal_Int32 nDragImage = DND_IMAGE_NONE )
|
||||
@ -225,7 +225,7 @@ namespace svxform
|
||||
inline static bool hasHiddenControlModelsFormat( const DataFlavorExVector& _rFormats );
|
||||
|
||||
protected:
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
|
@ -1041,6 +1041,11 @@ SdrObject* SdrObject::Clone() const
|
||||
return CloneHelper< SdrObject >();
|
||||
}
|
||||
|
||||
SdrObject* SdrObject::CloneWithShellIDs( const OUString& /*rSrcShellID*/, const OUString& /*rDestShellID*/ ) const
|
||||
{
|
||||
return Clone();
|
||||
}
|
||||
|
||||
SdrObject& SdrObject::operator=(const SdrObject& rObj)
|
||||
{
|
||||
if( this == &rObj )
|
||||
|
@ -1624,7 +1624,20 @@ SdrOle2Obj* SdrOle2Obj::Clone() const
|
||||
return CloneHelper< SdrOle2Obj >();
|
||||
}
|
||||
|
||||
SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
|
||||
SdrOle2Obj* SdrOle2Obj::CloneWithShellIDs( const OUString& rSrcShellID, const OUString& rDestShellID ) const
|
||||
{
|
||||
SdrOle2Obj* pObj =
|
||||
dynamic_cast<SdrOle2Obj*>(
|
||||
SdrObjFactory::MakeNewObject(GetObjInventor(), GetObjIdentifier(), NULL));
|
||||
|
||||
if (pObj)
|
||||
pObj->assignFrom(*this, rSrcShellID, rDestShellID);
|
||||
|
||||
return pObj;
|
||||
}
|
||||
|
||||
SdrOle2Obj& SdrOle2Obj::assignFrom(
|
||||
const SdrOle2Obj& rObj, const OUString& rSrcShellID, const OUString& rDestShellID )
|
||||
{
|
||||
//TODO/LATER: who takes over control of my old object?!
|
||||
if( &rObj != this )
|
||||
@ -1671,7 +1684,8 @@ SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
|
||||
if ( xObj.is() )
|
||||
{
|
||||
OUString aTmp;
|
||||
xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject( rContainer, xObj, aTmp ), rOle2Obj.GetAspect() );
|
||||
xObjRef.Assign( pDestPers->getEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
|
||||
rContainer, xObj, aTmp, rSrcShellID, rDestShellID), rOle2Obj.GetAspect());
|
||||
m_bTypeAsked = false;
|
||||
mpImpl->aPersistName = aTmp;
|
||||
CheckFileLink_Impl();
|
||||
@ -1684,7 +1698,10 @@ SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
SdrOle2Obj& SdrOle2Obj::operator=(const SdrOle2Obj& rObj)
|
||||
{
|
||||
return assignFrom(rObj, OUString(), OUString());
|
||||
}
|
||||
|
||||
void SdrOle2Obj::ImpSetVisAreaSize()
|
||||
{
|
||||
|
@ -223,7 +223,9 @@ bool SdrExchangeView::Paste(SvStream& rInput, const OUString& rBaseURL, sal_uInt
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions)
|
||||
bool SdrExchangeView::Paste(
|
||||
const SdrModel& rMod, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions,
|
||||
const OUString& rSrcShellID, const OUString& rDestShellID )
|
||||
{
|
||||
const SdrModel* pSrcMod=&rMod;
|
||||
if (pSrcMod==pMod)
|
||||
@ -298,7 +300,7 @@ bool SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList*
|
||||
{
|
||||
const SdrObject* pSrcOb=pSrcPg->GetObj(nOb);
|
||||
|
||||
SdrObject* pNeuObj = pSrcOb->Clone();
|
||||
SdrObject* pNeuObj = pSrcOb->CloneWithShellIDs(rSrcShellID, rDestShellID);
|
||||
|
||||
if (pNeuObj!=NULL)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ private:
|
||||
protected:
|
||||
|
||||
virtual void AddSupportedFormats() SAL_OVERRIDE;
|
||||
virtual bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) SAL_OVERRIDE;
|
||||
virtual bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) SAL_OVERRIDE;
|
||||
|
||||
public:
|
||||
@ -67,7 +67,7 @@ void SvxColorValueSetData::AddSupportedFormats()
|
||||
|
||||
|
||||
|
||||
bool SvxColorValueSetData::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
||||
bool SvxColorValueSetData::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
||||
{
|
||||
bool bRet = false;
|
||||
|
||||
|
@ -1507,7 +1507,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
|
||||
// #i50824#
|
||||
// method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
|
||||
lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel );
|
||||
pView->Paste( *pModel, aPos );
|
||||
pView->Paste(*pModel, aPos, NULL, 0, OUString(), OUString());
|
||||
|
||||
sal_uLong nCnt = pView->GetMarkedObjectList().GetMarkCount();
|
||||
if( nCnt )
|
||||
|
@ -435,7 +435,9 @@ SwCntntNode* SwOLENode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
|
||||
pPersistShell->GetEmbeddedObjectContainer().CopyAndGetEmbeddedObject(
|
||||
pSrc->GetEmbeddedObjectContainer(),
|
||||
pSrc->GetEmbeddedObjectContainer().GetEmbeddedObject( aOLEObj.aName ),
|
||||
aNewName );
|
||||
aNewName,
|
||||
OUString(),
|
||||
OUString());
|
||||
|
||||
SwOLENode* pOLENd = pDoc->GetNodes().MakeOLENode( rIdx, aNewName, GetAspect(),
|
||||
(SwGrfFmtColl*)pDoc->GetDfltGrfFmtColl(),
|
||||
|
@ -435,7 +435,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
|
||||
// TODO/LATER: Copying through the container would copy the replacement image as well
|
||||
comphelper::EmbeddedObjectContainer aCnt;
|
||||
OUString aName = aCnt.CreateUniqueObjectName();
|
||||
if ( aCnt.StoreEmbeddedObject( rSwOLE.GetOleRef(), aName, true ) )
|
||||
if (aCnt.StoreEmbeddedObject(rSwOLE.GetOleRef(), aName, true, OUString(), OUString()))
|
||||
{
|
||||
uno::Reference < embed::XEmbeddedObject > aNew = aCnt.GetEmbeddedObject( aName );
|
||||
rDoc.Insert( rContext.GetRepeatPaM(),
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user