[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - 2 commits - vcl/source

Mark Wielaard mark at klomp.org
Fri May 24 12:49:43 PDT 2013


 vcl/source/gdi/print3.cxx   |    8 +++++++-
 vcl/source/window/split.cxx |   34 +++++++++++++++++-----------------
 2 files changed, 24 insertions(+), 18 deletions(-)

New commits:
commit 8f34685654814a796f63b285b61fbeba2bd62ba3
Author: Mark Wielaard <mark at klomp.org>
Date:   Wed May 22 17:46:20 2013 +0200

    Splitter::ImplInitHorVer(bool) should always initialize all state.
    
    When creating a new Splitter ImplInitHorVer(bool) should always
    init all state independent from the current state because some
    variables might not be initialized yet.
    
     Conditional jump or move depends on uninitialised value(s)
        at 0x8293625: Splitter::ImplInitHorVer(bool) (split.cxx:70)
        by 0x82936DF: Splitter::ImplInit(Window*, long) (split.cxx:100)
        by 0x8293CC3: Splitter::Splitter(Window*, long) (split.cxx:157)
        by 0x2686BC48: ScTabSplitter::ScTabSplitter(Window*, long, ScViewData*) (tabsplit.cxx:28)
        ...
      Uninitialised value was created by a heap allocation
        at 0x4A08361: operator new(unsigned long) (vg_replace_malloc.c:298)
        by 0x2687D8F1: ScTabView::Init() (tabview5.cxx:90)
        by 0x2686C5D3: ScTabView::ScTabView(Window*, ScDocShell&, ScTabViewShell*) (tabview.cxx:261)
        ...
    
    The public method to change the internal state is Splitter::SetHorizontal()
    which does check the current state (and calls Splitter::ImplInitHorVer()
    only when there is a real state change). So the bNew != mbHorzSplit was
    redundant anyway.
    
    Change-Id: If84e8bff4c87d208416de3583202ce88d6982a99
    Reviewed-on: https://gerrit.libreoffice.org/4007
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
    (cherry picked from commit 3fd6c700f85fdf775d64113aa027cc36db57a62a)

diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index 92a637e..13cc486 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -65,28 +65,28 @@ void Splitter::ImplInitSplitterData()
 
 // -----------------------------------------------------------------------
 
+// Should only be called from a ImplInit method for initialization or
+// after checking bNew is different from the current mbHorzSplit value.
+// The public method that does that check is Splitter::SetHorizontal().
 void Splitter::ImplInitHorVer(bool bNew)
 {
-    if(bNew != (bool)mbHorzSplit)
-    {
-        mbHorzSplit = bNew;
+    mbHorzSplit = bNew;
 
-        PointerStyle ePointerStyle;
-        const StyleSettings& rSettings = GetSettings().GetStyleSettings();
-
-        if ( mbHorzSplit )
-        {
-            ePointerStyle = POINTER_HSPLIT;
-            SetSizePixel( Size( rSettings.GetSplitSize(), rSettings.GetScrollBarSize() ) );
-        }
-        else
-        {
-            ePointerStyle = POINTER_VSPLIT;
-            SetSizePixel( Size( rSettings.GetScrollBarSize(), rSettings.GetSplitSize() ) );
-        }
+    PointerStyle ePointerStyle;
+    const StyleSettings& rSettings = GetSettings().GetStyleSettings();
 
-        SetPointer( Pointer( ePointerStyle ) );
+    if ( mbHorzSplit )
+    {
+        ePointerStyle = POINTER_HSPLIT;
+        SetSizePixel( Size( rSettings.GetSplitSize(), rSettings.GetScrollBarSize() ) );
     }
+    else
+    {
+        ePointerStyle = POINTER_VSPLIT;
+        SetSizePixel( Size( rSettings.GetScrollBarSize(), rSettings.GetSplitSize() ) );
+    }
+
+    SetPointer( Pointer( ePointerStyle ) );
 }
 
 // -----------------------------------------------------------------------
commit 09e7888105b7f8ca3894cecee22766ee0939a6c2
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Fri Apr 19 10:41:08 2013 +0000

    Resolves: #i120529# abort print controller job, if no pages will be printed
    
    (cherry picked from commit aad8d0b80c56b956ce674e713d4d09a077e20f68)
    
    Change-Id: I7c341961370ce12de1aeb8f0caed18f2dc496390
    (cherry picked from commit 3bcbc800a5598854be473a7397eac384e0d8a07e)

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 7ea71cc..a3f976b 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -658,7 +658,13 @@ bool Printer::StartJob( const OUString& i_rJobName, boost::shared_ptr<vcl::Print
             {
                 mbJobActive             = sal_True;
                 i_pController->createProgressDialog();
-                int nPages = i_pController->getFilteredPageCount();
+                const int nPages = i_pController->getFilteredPageCount();
+                // abort job, if no pages will be printed.
+                if ( nPages == 0 )
+                {
+                    i_pController->abortJob();
+                    bAborted = true;
+                }
                 for( int nOuterIteration = 0; nOuterIteration < nOuterRepeatCount && ! bAborted; nOuterIteration++ )
                 {
                     for( int nPage = 0; nPage < nPages && ! bAborted; nPage++ )


More information about the Libreoffice-commits mailing list