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


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2777

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/77/2777/1

fdo#34800 Comments added to footer are placed at the right top of the page.

I also merged (manually) the changes of the cleanup
commit of Michael Stahl ( commit id 859e94294bdfd8595c88dd7f14da09ead8b32a45 )

Change-Id: Ibcd0373110fde848dccf93ffe9100459c7cc64a5
Reviewed-on: https://gerrit.libreoffice.org/2572
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
---
M sw/source/ui/docvw/PostItMgr.cxx
1 file changed, 27 insertions(+), 1 deletion(-)



diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 3a24565..a573147 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -90,7 +90,33 @@
 bool comp_pos(const SwSidebarItem* a, const SwSidebarItem* b)
 {
     // sort by anchor position
-    return a->GetAnchorPosition() < b->GetAnchorPosition();
+    SwPosition aPosAnchorA = a->GetAnchorPosition();
+    SwPosition aPosAnchorB = b->GetAnchorPosition();
+
+    bool aAnchorAInFooter = false;
+    bool aAnchorBInFooter = false;
+
+    // is the anchor placed in Footnote or the Footer?
+    if( aPosAnchorA.nNode.GetNode().FindFootnoteStartNode() || 
aPosAnchorA.nNode.GetNode().FindFooterStartNode() )
+        aAnchorAInFooter = true;
+    if( aPosAnchorB.nNode.GetNode().FindFootnoteStartNode() || 
aPosAnchorB.nNode.GetNode().FindFooterStartNode() )
+        aAnchorBInFooter = true;
+
+    // fdo#34800
+    // if AnchorA is in footnote, and AnchorB isn't
+    // we do not want to change over the position
+    if( aAnchorAInFooter && !aAnchorBInFooter )
+        return false;
+    // if aAnchorA is not placed in a footnote, and aAnchorB is
+    // force a change over
+    else if( !aAnchorAInFooter && aAnchorBInFooter )
+        return true;
+    // If neither or both are in the footer, compare the positions.
+    // Since footnotes are in Inserts section of nodes array and footers
+    // in Autotext section, all footnotes precede any footers so no need
+    // to check that.
+    else
+        return aPosAnchorA < aPosAnchorB;
 }
 
 SwPostItMgr::SwPostItMgr(SwView* pView)

-- 
To view, visit https://gerrit.libreoffice.org/2777
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcd0373110fde848dccf93ffe9100459c7cc64a5
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Joren De Cuyper <joren.libreoffice@telenet.be>
Gerrit-Reviewer: Fridrich Strba <fridrich@documentfoundation.org>


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.