[Libreoffice-commits] core.git: 2 commits - comphelper/source embeddedobj/source sw/source

Lennard Wasserthal Wasserthal at nefkom.net
Thu May 15 14:45:10 PDT 2014


 comphelper/source/misc/mimeconfighelper.cxx        |    7 ++++++-
 embeddedobj/source/commonembedding/persistence.cxx |   18 ++++++++++++++++++
 sw/source/core/uibase/dochdl/swdtflvr.cxx          |    8 ++++++--
 3 files changed, 30 insertions(+), 3 deletions(-)

New commits:
commit b7cb2ae5026cfd3bb30f148ed40f244b5c128876
Author: Lennard Wasserthal <Wasserthal at nefkom.net>
Date:   Sat Sep 7 14:00:01 2013 +0200

    fdo#55582 Writer: Dont overwrite from even when selected, from writer.
    
    This patch fixes the writer part, calc part is fixed long ago.
    Problem: it overwrites when you paste from impress or calc.
    This allows to keep the graphic's frame,
    so the text doesn't have to be rearranged.
    (i.e. it is desired, so I didn't change that)
    I was trying to give the user a choice,
    but I didn't succeed in keeping the frame when pasting from writer to writer.
    coming soon!
    
    Change-Id: I07271df9bb501779d06f332bb13edd05f0aefacb
    Signed-off-by: Lennard Wasserthal <Wasserthal at nefkom.net>

diff --git a/sw/source/core/uibase/dochdl/swdtflvr.cxx b/sw/source/core/uibase/dochdl/swdtflvr.cxx
index 447dbfd..62938d5 100644
--- a/sw/source/core/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/core/uibase/dochdl/swdtflvr.cxx
@@ -3203,8 +3203,8 @@ bool SwTransferable::PrivatePaste( SwWrtShell& rShell )
 
     bool bKillPaMs = false;
 
-    //Delete selected content, not at table-selection and table in Clipboard
-    if( rShell.HasSelection() && !( nSelection & nsSelectionType::SEL_TBL_CELLS))
+    //Delete selected content, not at table-selection and table in Clipboard, and dont delete hovering graphics.
+    if( rShell.HasSelection() && !( nSelection & nsSelectionType::SEL_TBL_CELLS) && !( nSelection & nsSelectionType::SEL_DRW))
     {
         bKillPaMs = true;
         rShell.SetRetainSelection( true );
@@ -3221,6 +3221,10 @@ bool SwTransferable::PrivatePaste( SwWrtShell& rShell )
         }
         rShell.SetRetainSelection( false );
     }
+    if ( nSelection & nsSelectionType::SEL_DRW) //unselect hovering graphics
+    {
+       rShell.ResetSelect(NULL,false);
+    }
 
     bool bInWrd = false, bEndWrd = false, bSttWrd = false,
          bSmart = 0 != (TRNSFR_DOCUMENT_WORD & eBufferType);
commit 0b3d0fb2d9256dc6bae6af69ed494487004def75
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu May 15 23:28:55 2014 +0200

    fdo#78159: fix import of OOoXML embedded objects
    
    MimeConfigurationHelper::GetDefaultFilterFromServiceName() checks that
    there is both an import and an export filter, and for OOoXML the export
    has been removed; tweak the check to require only import for OOoXML.
    
    Currently it still works invoke the OOoXML filter, but it is clearly
    better to store the embedded documents only in ODF, so tweak
    OCommonEmbeddedObject::store* methods to do that.
    
    (regression from aeeaccf59abbc485d7786486f1accc1cb4d4dbf7)
    
    Change-Id: Ib71f23fd110cbd4b570517f2dde2c53e3aa6301d

diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index 6f25f00..249f474 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -743,7 +743,12 @@ OUString MimeConfigurationHelper::GetDefaultFilterFromServiceName( const OUStrin
                         sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 );
 
                         // that should be import, export, own filter and not a template filter ( TemplatePath flag )
-                        sal_Int32 nRequired = ( SFX_FILTER_OWN | SFX_FILTER_EXPORT | SFX_FILTER_IMPORT );
+                        sal_Int32 const nRequired = (SFX_FILTER_OWN
+                            // fdo#78159 for OOoXML, there is code to convert
+                            // to ODF in OCommonEmbeddedObject::store*
+                            // so accept it even though there's no export
+                            | (SOFFICE_FILEFORMAT_60 == nVersion ? 0 : SFX_FILTER_EXPORT)
+                            | SFX_FILTER_IMPORT );
                         if ( ( ( nFlags & nRequired ) == nRequired ) && !( nFlags & SFX_FILTER_TEMPLATEPATH ) )
                         {
                             // if there are more than one filter the preffered one should be used
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 2db77f65..4d2ddc8 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -1165,6 +1165,12 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed::
     {
         SAL_WARN( "embeddedobj.common", "Can not retrieve target storage media type!" );
     }
+    if (nTargetStorageFormat == SOFFICE_FILEFORMAT_60)
+    {
+        SAL_INFO("embeddedobj.common", "fdo#78159: Storing OOoXML as ODF");
+        nTargetStorageFormat = SOFFICE_FILEFORMAT_CURRENT;
+        // setting MediaType is done later anyway, no need to do it here
+    }
 
     try
     {
@@ -1294,6 +1300,12 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed::
     {
         SAL_WARN( "embeddedobj.common", "Can not retrieve target storage media type!" );
     }
+    if (nTargetStorageFormat == SOFFICE_FILEFORMAT_60)
+    {
+        SAL_INFO("embeddedobj.common", "fdo#78159: Storing OOoXML as ODF");
+        nTargetStorageFormat = SOFFICE_FILEFORMAT_CURRENT;
+        // setting MediaType is done later anyway, no need to do it here
+    }
 
     try
     {
@@ -1579,6 +1591,12 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn()
         {
             SAL_WARN( "embeddedobj.common", "Can not retrieve storage media type!" );
         }
+        if (nStorageFormat == SOFFICE_FILEFORMAT_60)
+        {
+            SAL_INFO("embeddedobj.common", "fdo#78159: Storing OOoXML as ODF");
+            nStorageFormat = SOFFICE_FILEFORMAT_CURRENT;
+            // setting MediaType is done later anyway, no need to do it here
+        }
 
         aGuard.clear();
         StoreDocToStorage_Impl( m_xObjectStorage, nStorageFormat, GetBaseURL_Impl(), m_aEntryName, true );


More information about the Libreoffice-commits mailing list