[Libreoffice-commits] .: 3 commits - basic/source sal/inc sfx2/inc sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 19 09:40:32 PST 2012


 basic/source/runtime/step0.cxx |    2 +-
 sal/inc/rtl/ustrbuf.hxx        |    2 +-
 sfx2/inc/sfx2/sfx.hrc          |    1 +
 sfx2/source/view/viewprn.cxx   |    1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8b9b779e9fc1de7186217b7be75ef02bb66e2da9
Author: Noel Power <noel.power at suse.com>
Date:   Wed Dec 19 17:35:31 2012 +0000

    fix crash for fdo#58306 when appending to OUStringBuffer initialised with ""
    
    don't call rtl_uString_newFromLiteral when literal has zero length as
    that cheats and doesn't assign a buffer. what we really want to do
    is assign a buffer with initial capacity ( but no content )
    
    Change-Id: I9d642c453dee747aca6365abb15408c05f86bb52

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 98f1fc5..b6ddb66 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -183,7 +183,7 @@ public:
         , nCapacity( internal::ConstCharArrayDetector< T, void >::size - 1 + 16 )
     {
         assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
-        rtl_uString_newFromLiteral( &pData, literal, internal::ConstCharArrayDetector< T, void >::size - 1, 16 );
+        ( internal::ConstCharArrayDetector< T >::size - 1 ) ? rtl_uString_newFromLiteral( &pData, literal, internal::ConstCharArrayDetector< T, void >::size - 1, 16 ) : rtl_uString_new_WithLength( &pData, 16 );
 #ifdef RTL_STRING_UNITTEST
         rtl_string_unittest_const_literal = true;
 #endif
commit 551cd207621be5922c528d32a6b349bcd8b10925
Author: Noel Power <noel.power at suse.com>
Date:   Wed Dec 19 15:15:12 2012 +0000

    fix crash for fdo#58306 by avoiding literal assign
    
    OUStringBuffer doesn't handler append ( if it had been previously assigned to "" literal )
    
    Change-Id: Ief4379490a4873fbee4117db5833111943b86334

diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 4128473..5e41425 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -1171,7 +1171,7 @@ void SbiRuntime::StepARGV()
 // is removed afterwards.
 void SbiRuntime::StepINPUT()
 {
-    OUStringBuffer sin = "";
+    OUStringBuffer sin;
     OUString s;
     char ch = 0;
     SbError err;
commit a6636235e6b6f33f77bee31cd06115b7a0fdeff6
Author: Noel Power <noel.power at suse.com>
Date:   Wed Dec 19 13:28:48 2012 +0000

    post OnPrint event ( application & document ) when printing starts
    
    this event used to get posted, somehow it seems it got dropped somewhere along
    the line ( looks like the printer and printer monitor code got reworked )
    
    Change-Id: Ib75ee9e7ecd41614275033d2be2a351785326e24

diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index d92b301..c2103d3 100644
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -50,6 +50,7 @@
 #define SFX_EVENT_SAVEASDOC         (EVENT_SFX_START + 6)
 #define SFX_EVENT_ACTIVATEDOC       (EVENT_SFX_START + 7)
 #define SFX_EVENT_DEACTIVATEDOC     (EVENT_SFX_START + 8)
+#define SFX_EVENT_PRINTDOC          (EVENT_SFX_START + 9)
 
 #define SFX_EVENT_LOADFINISHED      (EVENT_SFX_START + 11)
 
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 7b978d3..4902d90 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -320,6 +320,7 @@ void SfxPrinterController::jobStarted()
             now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
             now.GetDay(), now.GetMonth(), now.GetYear() ) );
 
+        SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( STR_EVENT_PRINTDOC ), mpObjectShell ) );
         // FIXME: how to get all print options incl. AdditionalOptions easily?
         uno::Sequence < beans::PropertyValue > aOpts;
         mpObjectShell->Broadcast( SfxPrintingHint( view::PrintableState_JOB_STARTED, aOpts ) );


More information about the Libreoffice-commits mailing list