vcl/win/dtrans/DOTransferable.cxx |    7 ++++++-
 vcl/win/dtrans/ftransl.cxx        |    5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 6335b138ba47a57965e4020576279f7da9d3be8f
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sat Feb 21 13:00:25 2026 +0100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Tue Feb 24 11:27:25 2026 +0100

    Add markdown under paste special for win
    
    Change-Id: I41697f2a4d272889fd57e087689178b96ffd946d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199927
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>
    Reviewed-by: Ujjawal Kumar <[email protected]>
    (cherry picked from commit 77d52596b08149d6c6b1c4b3bcc898c73d379a05)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200147
    Tested-by: Jenkins

diff --git a/vcl/win/dtrans/DOTransferable.cxx 
b/vcl/win/dtrans/DOTransferable.cxx
index 975908998f93..2e63136c97e0 100644
--- a/vcl/win/dtrans/DOTransferable.cxx
+++ b/vcl/win/dtrans/DOTransferable.cxx
@@ -344,7 +344,7 @@ void CDOTransferable::initFlavorListFromFormatList(const 
std::vector<sal_uInt32>
         if (CF_LOCALE == cfFormat)
             continue;
 
-        // if text or oemtext is offered we pretend to have unicode text
+        // if text or oemtext is offered we pretend to have unicode text; any 
text implies markdown
         if (CDataFormatTranslator::isTextFormat(cfFormat))
         {
             if (!m_bUnicodeRegistered)
@@ -354,6 +354,11 @@ void CDOTransferable::initFlavorListFromFormatList(const 
std::vector<sal_uInt32>
 
                 // register unicode text as format
                 addSupportedFlavor(formatEtcToDataFlavor(CF_UNICODETEXT));
+                // register markdown as format
+                css::datatransfer::DataFlavor aFlavor;
+                aFlavor.MimeType = "text/markdown";
+                aFlavor.DataType = cppu::UnoType<OUString>::get();
+                addSupportedFlavor(aFlavor);
             }
         }
         else
diff --git a/vcl/win/dtrans/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx
index a8ece4c28cc8..281e18982133 100644
--- a/vcl/win/dtrans/ftransl.cxx
+++ b/vcl/win/dtrans/ftransl.cxx
@@ -359,6 +359,11 @@ Any SAL_CALL 
CDataFormatTranslatorUNO::getSystemDataTypeFromDataFlavor( const Da
                 findStandardFormatIdForCharset( charset, aAny );
             }
         }
+        else if (fullMediaType.equalsIgnoreAsciiCase("text/markdown"))
+        {
+            // See CDOTransferable::initFlavorListFromFormatList: take the 
text stream
+            aAny <<= static_cast<sal_Int32>(CF_UNICODETEXT);
+        }
         else
         {
             if (refXMimeCntType->hasParameter(Windows_FormatName))

Reply via email to