[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 4 commits - sc/source sd/source sfx2/source sw/source vcl/unx

Matúš Kukan matus.kukan at collabora.com
Thu May 22 07:40:45 PDT 2014


 sc/source/filter/excel/expop2.cxx           |    3 ---
 sc/source/filter/xml/xmlwrap.cxx            |    2 --
 sd/source/ui/docshell/docshel4.cxx          |   11 -----------
 sfx2/source/doc/objcont.cxx                 |    4 +---
 sfx2/source/doc/objstor.cxx                 |    2 ++
 sfx2/source/doc/objxtor.cxx                 |    2 +-
 sw/source/filter/xml/xmlexp.cxx             |    4 ----
 vcl/unx/generic/dtrans/X11_transferable.cxx |    2 +-
 8 files changed, 5 insertions(+), 25 deletions(-)

New commits:
commit 921ebc39a1cafe5351922edc4e3ca4a465fe2741
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu May 22 16:17:12 2014 +0200

    cp#1000078: Replace "\r\n" with "\n" when pasting from X11 clipboard.
    
    E.g. when pasting from terminal you will get "\r\n".
    
    Writer inserts '\r' character into the document as an
    invisible character. If you save that to .odt and reload, you will
    get ' ' instead. Or when saving to .doc and reload, you will get '\n'.
    
    Change-Id: Id6780bf6d71a8f0a17c1e6ee7a7dcb4d297446dc
    (cherry picked from commit 278baa557d18136a2641c015f7077a5838188766)

diff --git a/vcl/unx/generic/dtrans/X11_transferable.cxx b/vcl/unx/generic/dtrans/X11_transferable.cxx
index bcf54b6..8029405 100644
--- a/vcl/unx/generic/dtrans/X11_transferable.cxx
+++ b/vcl/unx/generic/dtrans/X11_transferable.cxx
@@ -78,7 +78,7 @@ Any SAL_CALL X11Transferable::getTransferData( const DataFlavor& rFlavor )
              OUStringToOString( rFlavor.MimeType, RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
              OUStringToOString( aString, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
 #endif
-        aRet <<= aString;
+        aRet <<= aString.replaceAll("\r\n", "\n");
     }
     else
         aRet <<= aData;
commit b837e9b137bd3cab36a48d7673b5170c83e7fe06
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu May 22 13:50:39 2014 +0200

    Update also revision and editing time when setting 'modified' properties.
    
    Change-Id: Id756ef6dd62ca8df2e62265b9cc930f07d13f2e3
    (cherry picked from commit 6e87f0bb75734e464bb0160dc00ab2fbe1a8fac3)

diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index b3b8347..218efab 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -206,9 +206,7 @@ void SfxObjectShell::UpdateDocInfoForSave()
                 now.GetHour(), now.GetDay(), now.GetMonth(),
                 now.GetYear(), false) );
             xDocProps->setModifiedBy( aUserName );
-            if ( !HasName() || pImp->bIsSaving )
-                // QUESTION: not in case of "real" SaveAs as this is meant to create a new document
-                UpdateTime_Impl( xDocProps );
+            UpdateTime_Impl( xDocProps );
         }
     }
 }
commit 9527a9f688e00263909705f6046d33de0fed1e18
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu May 22 13:42:55 2014 +0200

    Use proper constructor to fill with system time.
    
    Probably 86adb5cacb4fe3e7fb869299447da5876f0da30d did not mean to change
    the behaviour here.
    
    Change-Id: If39c150973c502323b3c785a9738cf65cdd74e5d
    (cherry picked from commit fee87c6fda46923a564cd2574827a7beeffb1a1f)

diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 54b67be..b2cf2f2 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -215,7 +215,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
     ,rDocShell( _rDocShell )
     ,aMacroMode( *this )
     ,pProgress( 0)
-    ,nTime( DateTime::EMPTY )
+    ,nTime( DateTime::SYSTEM )
     ,nVisualDocumentNumber( USHRT_MAX)
     ,nDocumentSignatureState( SIGNATURESTATE_UNKNOWN )
     ,nScriptingSignatureState( SIGNATURESTATE_UNKNOWN )
commit b1a04f9326a7c52944f391364e72049eea6ee629
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu May 22 10:11:38 2014 +0200

    cp#1000077: Set 'modified' document property more consistently.
    
    Update document info at one place, so that it works for other formats
    like .doc, .docx, ... too.
    
    (cherry picked from commit 5c2ab70cc2dfb7cf0c2418433b3aa89d225742a4)
    
    Conflicts:
    	sd/source/ui/docshell/docshel4.cxx
    	sw/source/core/uibase/app/docsh.cxx
    
    Change-Id: If71799b491d2210f0d3bdbdb05f91f26c986a260

diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx
index 1cec3de..a72c6ba 100644
--- a/sc/source/filter/excel/expop2.cxx
+++ b/sc/source/filter/excel/expop2.cxx
@@ -88,9 +88,6 @@ FltError ExportBiff5::Write()
 
     if( pDocShell && xRootStrg.Is() )
     {
-        // #i88642# update doc info (revision etc)
-        pDocShell->UpdateDocInfoForSave();
-
         using namespace ::com::sun::star;
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
                 pDocShell->GetModel(), uno::UNO_QUERY_THROW);
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 2e3210f..d1daf43 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -790,8 +790,6 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
 
     if ( pObjSh && xStorage.is() )
     {
-        pObjSh->UpdateDocInfoForSave();     // update information
-
         uno::Reference<frame::XModel> xModel(pObjSh->GetModel());
         uno::Reference<task::XStatusIndicator> xStatusIndicator(GetStatusIndicator());
         sal_Int32 nProgressRange(1000000);
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 9012869..e40c0f2 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -505,12 +505,7 @@ sal_Bool DrawDocShell::Save()
     sal_Bool bRet = SfxObjectShell::Save();
 
     if( bRet )
-    {
-        // Call UpdateDocInfoForSave() before export
-        UpdateDocInfoForSave();
-
         bRet = SdXMLFilter( *GetMedium(), *this, sal_True, SDXMLMODE_Normal, SotStorage::GetVersion( GetMedium()->GetStorage() ) ).Export();
-    }
 
     return bRet;
 }
@@ -530,11 +525,7 @@ sal_Bool DrawDocShell::SaveAs( SfxMedium& rMedium )
     sal_Bool    bRet = SfxObjectShell::SaveAs( rMedium );
 
     if( bRet )
-    {
-        // Call UpdateDocInfoForSave() before export
-        UpdateDocInfoForSave();
         bRet = SdXMLFilter( rMedium, *this, sal_True, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export();
-    }
 
     if( GetError() == ERRCODE_NONE )
         SetError( nVBWarning, OSL_LOG_PREFIX );
@@ -572,13 +563,11 @@ sal_Bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
                  aTypeName.indexOf( "impress8" ) >= 0 )
         {
             pFilter = new SdXMLFilter( rMedium, *this, sal_True );
-            UpdateDocInfoForSave();
         }
         else if( aTypeName.indexOf( "StarOffice_XML_Impress" ) >= 0 ||
                  aTypeName.indexOf( "StarOffice_XML_Draw" ) >= 0 )
         {
             pFilter = new SdXMLFilter( rMedium, *this, sal_True, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 );
-            UpdateDocInfoForSave();
         }
         else
         {
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index df12f4f..19ca9ef 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1120,6 +1120,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl
     SAL_INFO( "sfx.doc", "PERFORMANCE SfxObjectShell::SaveTo_Impl" );
     SAL_INFO( "sfx.doc", "saving \"" << rMedium.GetName() << "\"" );
 
+    UpdateDocInfoForSave();
+
     AddLog( OUString( OSL_LOG_PREFIX "Begin"  ) );
 
     ModifyBlocker_Impl aMod(this);
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index a971029..94409f9 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -197,10 +197,6 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
         // Update doc stat, so that correct values are exported and
         // the progress works correctly.
         pDoc->UpdateDocStat();
-
-        SfxObjectShell* pObjSh = pDoc->GetDocShell();
-        if( pObjSh )
-            pObjSh->UpdateDocInfoForSave();     // update information
     }
     if( bShowProgress )
     {


More information about the Libreoffice-commits mailing list