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

Caolán McNamara caolanm at redhat.com
Thu Sep 12 12:54:40 PDT 2013


 sw/source/ui/misc/swruler.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 20d50a8c87c87f33c57397ca2c6f25d49e51f7cd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 12 10:56:37 2013 +0100

    Resolves: rhbz#1006850 crash in SwCommentRuler::GetCommentControlRegion
    
    Change-Id: Ic846da3b22391d724da6f8df94dd771e89d2efb4
    (cherry picked from commit b73dec8a06ef762098e642b2c37e4baad780b11a)
    Reviewed-on: https://gerrit.libreoffice.org/5924
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sw/source/ui/misc/swruler.cxx b/sw/source/ui/misc/swruler.cxx
index a41fc0b..76fb8be 100644
--- a/sw/source/ui/misc/swruler.cxx
+++ b/sw/source/ui/misc/swruler.cxx
@@ -247,6 +247,13 @@ void SwCommentRuler::UpdateCommentHelpText()
 Rectangle SwCommentRuler::GetCommentControlRegion()
 {
     SwPostItMgr *pPostItMgr = mpViewShell->GetPostItMgr();
+
+    //rhbz#1006850 When the SwPostItMgr ctor is called from SwView::SwView it
+    //triggers an update of the uiview, but the result of the ctor hasn't been
+    //set into the mpViewShell yet, so GetPostItMgr is temporarily still NULL
+    if (!pPostItMgr)
+        return Rectangle();
+
     //FIXME When the page width is larger then screen, the ruler is misplaced by one pixel
     long nLeft   = GetWinOffset() + GetPageOffset() + mpSwWin->LogicToPixel(Size(GetPageWidth(), 0)).Width();
     long nTop    = 0 + 4; // Ruler::ImplDraw uses RULER_OFF (value: 3px) as offset, and Ruler::ImplFormat adds one extra pixel


More information about the Libreoffice-commits mailing list