Anonymous avatar Anonymous committed 41afdd2

cws tl77: #i111876# clipboard format change

Comments (0)

Files changed (16)

dtrans/source/win32/ftransl/ftransl.cxx

 	m_TranslTable.push_back(FormatEntry("application/x-openoffice-svim;windows_formatname=\"SVIM (StarView ImageMap)\"", "SVIM (StarView ImageMap)", NULL, CF_INVALID, CPPUTYPE_DEFAULT));
 	// SOT_FORMATSTR_ID_XFA
 	m_TranslTable.push_back(FormatEntry("application/x-openoffice-xfa;windows_formatname=\"XFA (XOutDev FillAttr)\"", "XFA (XOutDev FillAttr)", NULL, CF_INVALID, CPPUTYPE_DEFAULT));
-    // SOT_FORMATSTR_ID_EDITENGINE_XML 
-    m_TranslTable.push_back(FormatEntry("application/x-openoffice-editengine;windows_formatname=\"EditEngineFormat\"", "EditEngineFormat", NULL, CF_INVALID, CPPUTYPE_DEFAULT)); 
+    // SOT_FORMATSTR_ID_EDITENGINE 
+    m_TranslTable.push_back(FormatEntry("application/x-openoffice-editengine;windows_formatname=\"ODF (OpenDocument Format)\"", "ODF (OpenDocument Format)", NULL, CF_INVALID, CPPUTYPE_DEFAULT)); 
     // SOT_FORMATSTR_ID_INTERNALLINK_STATE
 	m_TranslTable.push_back(FormatEntry("application/x-openoffice-internallink-state;windows_formatname=\"StatusInfo vom SvxInternalLink\"", "StatusInfo vom SvxInternalLink", NULL, CF_INVALID, CPPUTYPE_DEFAULT)); 
 	// SOT_FORMATSTR_ID_SOLK

editeng/source/editeng/eeobj.cxx

 
 uno::Sequence< datatransfer::DataFlavor > EditDataObject::getTransferDataFlavors(  ) throw(uno::RuntimeException)
 {
-    uno::Sequence< datatransfer::DataFlavor > aDataFlavors(4);
+    uno::Sequence< datatransfer::DataFlavor > aDataFlavors(3);
 
-    // not an actual format but only means to identify the origin of the data (needed for Calc)
-    SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_DATASOURCE_EDITENGINE, aDataFlavors.getArray()[0] );
-
-    SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[1] );
+    SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] );
+    SotExchange::GetFormatDataFlavor( SOT_FORMAT_RTF, aDataFlavors.getArray()[1] );
     SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_EDITENGINE, aDataFlavors.getArray()[2] );
-    SotExchange::GetFormatDataFlavor( SOT_FORMAT_RTF, aDataFlavors.getArray()[3] );
 
 	return aDataFlavors;
 }
 sal_Bool EditDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException)
 {
 	ULONG nT = SotExchange::GetFormat( rFlavor );
-    sal_Bool bSupported = nT == SOT_FORMAT_STRING ||
-            nT == SOT_FORMAT_RTF ||
-            nT == SOT_FORMATSTR_ID_EDITENGINE ||
-            nT == SOT_FORMATSTR_DATASOURCE_EDITENGINE;  // not an actual format but only means to identify the origin of the data (needed for Calc)
-	return bSupported;
+    return SOT_FORMAT_STRING || nT == SOT_FORMAT_RTF || nT == SOT_FORMATSTR_ID_EDITENGINE;
 }

editeng/source/editeng/impedit2.cxx

 
                     // the *current* end of this para is where we want to place the cursor
                     pNode = rEditDoc.SaveGetObject( nLastTextPara );
-                    aNewSelection = EditSelection( EditPaM( pNode, pNode->Len() ) );
+                    DBG_ASSERT( pNode, "pNode missing. Paste will fail." );
+                    if (pNode)
+                        aNewSelection = EditSelection( EditPaM( pNode, pNode->Len() ) );
 
                     // now we can get rid of the two extra paragraph breaks.
                     // Since unlike in EditRTFParser::CallParser here both paragraphs are empty
                     ContentNode* pNode1 = rEditDoc.SaveGetObject( nLastTextPara );
                     ContentNode* pNode2 = rEditDoc.SaveGetObject( nLastTextPara + 1 );
                     ContentNode* pNode3 = rEditDoc.SaveGetObject( nLastTextPara + 2 );
-                    ImpConnectParagraphs( pNode2, pNode3, false );
-                    ImpConnectParagraphs( pNode1, pNode2, false );
+                    DBG_ASSERT( pNode1 && pNode2 && pNode3, 
+                            "node missing. There will be unwanted extra paragraphs" );
+                    if (pNode1 && pNode2 && pNode3)
+                    {
+                        ImpConnectParagraphs( pNode2, pNode3, false );
+                        ImpConnectParagraphs( pNode1, pNode2, false );
+                    }
 
                     SetUpdateMode( bOldUpdateMode );
                 }

sc/source/ui/app/seltrans.cxx

 			AddFormat( SOT_FORMAT_STRING );
 			AddFormat( SOT_FORMAT_RTF );
 			if ( eMode == SC_SELTRANS_CELL )
-                AddFormat( SOT_FORMATSTR_DATASOURCE_EDITENGINE );
+                AddFormat( SOT_FORMATSTR_ID_EDITENGINE );
 			break;
 
 		// different graphic formats as in ScDrawTransferObj::AddSupportedFormats:

sc/source/ui/app/transobj.cxx

 
 	AddFormat( SOT_FORMAT_RTF );
 	if ( aBlock.aStart == aBlock.aEnd )
-        AddFormat( SOT_FORMATSTR_DATASOURCE_EDITENGINE );
+        AddFormat( SOT_FORMATSTR_ID_EDITENGINE );
 }
 
 sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
 		{
 			bOK = SetTransferableObjectDescriptor( aObjDesc, rFlavor );
 		}
-        else if ( nFormat == SOT_FORMAT_RTF && aBlock.aStart == aBlock.aEnd )
+		else if ( ( nFormat == SOT_FORMAT_RTF || nFormat == SOT_FORMATSTR_ID_EDITENGINE ) &&
+						aBlock.aStart == aBlock.aEnd )
 		{
 			//	RTF from a single cell is handled by EditEngine
 

sc/source/ui/drawfunc/drtxtob1.cxx

 
 	pDlg->Insert( SOT_FORMAT_STRING, EMPTY_STRING );
 	pDlg->Insert( SOT_FORMAT_RTF,	 EMPTY_STRING );
+	pDlg->Insert( SOT_FORMATSTR_ID_EDITENGINE,	 EMPTY_STRING );
 
 	TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
 

sc/source/ui/view/cellsh.cxx

 		lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_LINK );
 		lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_STRING );
 		lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_DIF );
+//		lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_EDITENGINE );   -> ToDo: Implement missing functionality (TL)
 		lcl_TestFormat( rFormats, aDataHelper, SOT_FORMAT_RTF );
 		lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_HTML );
 		lcl_TestFormat( rFormats, aDataHelper, SOT_FORMATSTR_ID_HTML_SIMPLE );
 			 rData.HasFormat( SOT_FORMAT_GDIMETAFILE ) ||
 			 rData.HasFormat( SOT_FORMATSTR_ID_SVXB ) ||
 			 rData.HasFormat( FORMAT_PRIVATE ) ||
+//			 rData.HasFormat( SOT_FORMATSTR_ID_EDITENGINE ) ||  -> ToDo: Implement missing functionality (TL)
 			 rData.HasFormat( SOT_FORMAT_RTF ) ||
 			 rData.HasFormat( SOT_FORMATSTR_ID_EMBED_SOURCE ) ||
 			 rData.HasFormat( SOT_FORMATSTR_ID_LINK_SOURCE ) ||

sc/source/ui/view/editsh.cxx

                 {
                     pDlg->Insert( SOT_FORMAT_STRING, EMPTY_STRING );
                     pDlg->Insert( SOT_FORMAT_RTF,    EMPTY_STRING );
+                    pDlg->Insert( SOT_FORMATSTR_ID_EDITENGINE,    EMPTY_STRING );
 
                     TransferableDataHelper aDataHelper(
                         TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );

sc/source/ui/view/viewfun4.cxx

 									::com::sun::star::datatransfer::XTransferable >& rxTransferable )
 {
 	TransferableDataHelper aDataHelper( rxTransferable );
-    if ( aDataHelper.HasFormat( SOT_FORMATSTR_DATASOURCE_EDITENGINE ) )
+    if ( aDataHelper.HasFormat( SOT_FORMATSTR_ID_EDITENGINE ) )
 	{
 		HideAllCursors();
 

sc/source/ui/view/viewfun5.cxx

 	}
 	else if ( ScImportExport::IsFormatSupported( nFormatId ) || nFormatId == SOT_FORMAT_RTF )
 	{
-        if ( nFormatId == SOT_FORMAT_RTF && aDataHelper.HasFormat( SOT_FORMATSTR_DATASOURCE_EDITENGINE ) )
+        if ( nFormatId == SOT_FORMAT_RTF && aDataHelper.HasFormat( SOT_FORMATSTR_ID_EDITENGINE ) )
 		{
 			//	use EditView's PasteSpecial / Drop
 			PasteRTF( nPosX, nPosY, rxTransferable );

sd/source/ui/func/fuinsert.cxx

         pDlg->Insert( FORMAT_STRING, aEmptyString );
         pDlg->Insert( SOT_FORMATSTR_ID_HTML, aEmptyString );
         pDlg->Insert( FORMAT_RTF, aEmptyString );
+        pDlg->Insert( SOT_FORMATSTR_ID_EDITENGINE, aEmptyString );
 
         //TODO/MBA: testing
         nFormatId = pDlg->GetFormat( aDataHelper );

sd/source/ui/view/drviews7.cxx

                 case FORMAT_STRING:
                 case SOT_FORMATSTR_ID_HTML:
                 case FORMAT_RTF:
+                case SOT_FORMATSTR_ID_EDITENGINE:
                     pResult->AddClipbrdFormat(nTestFormat);
                     break;
             }

sd/source/ui/view/sdview2.cxx

                 if( !nRet )
                 {
                     const BOOL  bSBAFormat = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH );
+                    const BOOL  bEditEngine = rTargetHelper.IsDropFormatSupported( SOT_FORMATSTR_ID_EDITENGINE );
                     const BOOL  bString = rTargetHelper.IsDropFormatSupported( FORMAT_STRING );
                     const BOOL  bRTF = rTargetHelper.IsDropFormatSupported( FORMAT_RTF );
                     const BOOL  bFile = rTargetHelper.IsDropFormatSupported( FORMAT_FILE );
 					if( bBookmark && bFile && ( nDropAction & DND_ACTION_MOVE ) && mpViewSh && SlideShow::IsRunning(mpViewSh->GetViewShellBase()) )
 		    			bBookmark = FALSE;
 
-                    if( bDrawing || bGraphic || bMtf || bBitmap || bBookmark || bFile || bFileList || bXFillExchange || bSBAFormat || bString || bRTF )
+                    if( bDrawing || bGraphic || bMtf || bBitmap || bBookmark || bFile || bFileList || bXFillExchange || bSBAFormat || bEditEngine || bString || bRTF )
 					    nRet = nDropAction;
 
                     // For entries from the navigator, change action copy.

sot/inc/sot/formats.hxx

 #define SOT_FORMATSTR_ID_STARBASE_8             ((ULONG)139)
 #define SOT_FORMATSTR_ID_HC_GDIMETAFILE         ((ULONG)140)
 
-// not an actual format in use, but means to hint the provider of the data, here EditEngine (needed for Calc)
-#define SOT_FORMATSTR_DATASOURCE_EDITENGINE     ((ULONG)141)
-
-#define SOT_FORMATSTR_ID_USER_END               SOT_FORMATSTR_DATASOURCE_EDITENGINE
+#define SOT_FORMATSTR_ID_USER_END               SOT_FORMATSTR_ID_HC_GDIMETAFILE
 
 
 #endif // _SOT_FORMATS_HXX

sot/source/base/exchange.cxx

             /*138 SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE*/            { MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII, "Math 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
             /*139 SOT_FORMATSTR_ID_STARBASE_8*/            { MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII, "StarBase 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
             /*140 SOT_FORMAT_GDIMETAFILE*/					{ "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"", "High Contrast GDIMetaFile", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
-            /*141 SOT_FORMATSTR_DATASOURCE_EDITENGINE*/    { "application/x-openoffice-datasource-editengine;windows_formatname=\"DataSourceEditEngine\"", "DataSourceEditEngine", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
             };
 	    return &aInstance[0];
         }

svx/source/svdraw/svdxcgv.cxx

 			FORMAT_BITMAP == nFormat ||
 			FORMAT_RTF == nFormat ||
 			FORMAT_STRING == nFormat ||
-            SOT_FORMATSTR_ID_DRAWING == nFormat );
+            SOT_FORMATSTR_ID_DRAWING == nFormat ||
+            SOT_FORMATSTR_ID_EDITENGINE == nFormat );
 }
 
 void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, UINT32 nOptions)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.