summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/sdview3.cxx
diff options
context:
space:
mode:
authorVarun Dhall <varun.dhall@studentpartner.com>2017-06-07 21:31:01 +0530
committerMichael Stahl <mstahl@redhat.com>2017-06-08 20:36:50 +0200
commit112a82566453fcf85ce3619965ca6e11fa9d29c5 (patch)
tree1cf7b4775433b3fe10b35c18399f9b8e213aaad5 /sd/source/ui/view/sdview3.cxx
parentb0f0096fbbccc212931501c5c879b65f9b0d7477 (diff)
EditEngine: Added ODF_TEXT_FLAT copy/paste for sd
Change-Id: I23777477d31f30ee18ee8926a8f3170505f74264 Reviewed-on: https://gerrit.libreoffice.org/38535 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd/source/ui/view/sdview3.cxx')
-rw-r--r--sd/source/ui/view/sdview3.cxx31
1 files changed, 30 insertions, 1 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 7720442f6c7b..34a6cc857c01 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -1392,10 +1392,39 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
}
}
- if(!bReturn && !bLink && CHECK_FORMAT_TRANS(SotClipboardFormatId::EDITENGINE))
+ char* ODF_XML_Env = getenv ("ODF_TEXT_FLAT_XML_ENV");
+
+ if(!bReturn && !bLink && CHECK_FORMAT_TRANS(SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT) && ODF_XML_Env != nullptr)
{
::tools::SvRef<SotStorageStream> xStm;
+ if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT, xStm ) )
+ {
+ OutlinerView* pOLV = GetTextEditOutlinerView();
+
+ xStm->Seek( 0 );
+
+ if( pOLV )
+ {
+ ::tools::Rectangle aRect( pOLV->GetOutputArea() );
+ Point aPos( pOLV->GetWindow()->PixelToLogic( maDropPos ) );
+ if( aRect.IsInside( aPos ) || ( !bDrag && IsTextEdit() ) )
+ {
+ // mba: clipboard always must contain absolute URLs (could be from alien source)
+ pOLV->Read( *xStm, EE_FORMAT_XML, mpDocSh->GetHeaderAttributes() );
+ bReturn = true;
+ }
+ }
+
+ if( !bReturn )
+ // mba: clipboard always must contain absolute URLs (could be from alien source)
+ bReturn = SdrView::Paste( *xStm, EE_FORMAT_XML, maDropPos, pPage, nPasteOptions );
+ }
+ }
+
+ if(!bReturn && !bLink && CHECK_FORMAT_TRANS(SotClipboardFormatId::EDITENGINE) )
+ {
+ ::tools::SvRef<SotStorageStream> xStm;
if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::EDITENGINE, xStm ) )
{
OutlinerView* pOLV = GetTextEditOutlinerView();