Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Mon, 2011-01-10 at 14:01 +0100, Maximilian Odendahl wrote:
Hi,

 > max, do you remember the code in the postits that the attached patch
 > affects, can you remember what the problem was that needed fixing ?

no, I don't remember why this is needed, but I don't think this is the 
right patch for two reasons:

- it is a regression from 3.2.1, where no change in the post-it codes 
happened, therefore, a different change must have broken this

- the code in question is inside LayoutPostIts(), and I guess is 
correct. I believe a relayout of the postit notes should not happen in 
the first place if a user simply scrolls, so this code in question would 
never be hit.

Here's the change that triggered this... 

Do you think we should just revert this bit, without it we get the
original scroll behaviour again.

C.
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 72dcebc..132b1ad 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1105,6 +1105,15 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
         pPostItMgr->LayoutPostIts();
     }
 
+    // --> OD 2010-02-11 #i88070#
+    if ( pPostItMgr )
+    {
+        pPostItMgr->Rescale();
+        pPostItMgr->CalcRects();
+        pPostItMgr->LayoutPostIts();
+    }
+    // <--
+
     if ( !bScrolled && pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
         pPostItMgr->CorrectPositions();
 
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 83968df..f3013e8 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -89,6 +89,8 @@
 
 #include "swevent.hxx"
 
+#include <stdio.h>
+
 // distance between Anchor Y and initial note position
 #define POSTIT_INITIAL_ANCHOR_DISTANCE      20
 //distance between two postits
@@ -266,6 +268,9 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
             }
             case SFX_HINT_DOCCHANGED:
             {
+
+                fprintf(stderr, "SFX_HINT_DOCCHANGED\n");
+
                 if ( mpView->GetDocShell() == &rBC )
                 {
                     if ( !mbWaitingForCalcRects && !mvPostItFlds.empty())
@@ -558,6 +563,8 @@ void SwPostItMgr::PreparePageContainer()
 
 void SwPostItMgr::LayoutPostIts()
 {
+    fprintf(stderr, "SwPostItMgr::LayoutPostIts\n");
+
     if ( !mvPostItFlds.empty() && !mbWaitingForCalcRects )
     {
         mbLayouting = true;

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.